Compare commits
2 Commits
de2f380cd9
...
e8cf28b6e9
Author | SHA1 | Date | |
---|---|---|---|
e8cf28b6e9 | |||
de7f0e14fe |
41
src/components/join-group-hint/index.less
Normal file
41
src/components/join-group-hint/index.less
Normal file
@ -0,0 +1,41 @@
|
||||
@import '@/styles/common.less';
|
||||
@import '@/styles/variables.less';
|
||||
|
||||
.join-group-hint {
|
||||
.flex-row();
|
||||
background: #FFFFFF;
|
||||
border-radius: 16px;
|
||||
padding: 32px 24px;
|
||||
margin-top: 24px;
|
||||
margin-bottom: 24px;
|
||||
|
||||
&__icon {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
&__left {
|
||||
flex: 1;
|
||||
padding-left: 8px;
|
||||
&-title {
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
line-height: 40px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
&-desc {
|
||||
font-weight: 400;
|
||||
font-size: 28px;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
&__right {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
&__button {
|
||||
.button(@width: 186px, @height: 64px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 32px, @highlight: 0);
|
||||
}
|
||||
}
|
58
src/components/join-group-hint/index.tsx
Normal file
58
src/components/join-group-hint/index.tsx
Normal file
@ -0,0 +1,58 @@
|
||||
import { Button, Image } from '@tarojs/components';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
import { Plus } from '@taroify/icons';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { RoleType } from '@/constants/app';
|
||||
import { CacheKey } from '@/constants/cache-key';
|
||||
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||
import { GROUPS } from '@/constants/group';
|
||||
import { getRoleTypeWithDefault } from '@/utils/app';
|
||||
import { openCustomerServiceChat } from '@/utils/common';
|
||||
import { getCurrentCityCode } from '@/utils/location';
|
||||
import { checkCityCode, validCityCode } from '@/utils/user';
|
||||
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'join-group-hint';
|
||||
|
||||
export function JoinGroupHint() {
|
||||
const cityCode = getCurrentCityCode();
|
||||
const roleType = getRoleTypeWithDefault();
|
||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
||||
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
|
||||
const handleClick = useCallback(() => {
|
||||
if (!checkCityCode(cityCode)) {
|
||||
return;
|
||||
}
|
||||
if (group) {
|
||||
openCustomerServiceChat(group.serviceUrl);
|
||||
Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true);
|
||||
setClicked(true);
|
||||
}
|
||||
}, [cityCode, group]);
|
||||
if (!group || !validCityCode(cityCode) || clicked) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={PREFIX}>
|
||||
<Image
|
||||
className={`${PREFIX}__icon`}
|
||||
src="https://publiccdn.neighbourhood.com.cn/img/group-avatar.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<div className={`${PREFIX}__left`}>
|
||||
<div className={`${PREFIX}__left-title`}>{CITY_CODE_TO_NAME_MAP.get(cityCode)}主播招聘群</div>
|
||||
<div className={`${PREFIX}__left-desc`}>{roleType === RoleType.Anchor ? '高薪工作早知道' : '免费招主播'}</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__right`}>
|
||||
<Button className={`${PREFIX}__button`} onClick={handleClick}>
|
||||
<Plus />
|
||||
加入该群
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
82
src/components/prejob-popup/index.less
Normal file
82
src/components/prejob-popup/index.less
Normal file
@ -0,0 +1,82 @@
|
||||
@import '@/styles/common.less';
|
||||
@import '@/styles/variables.less';
|
||||
|
||||
.prejob-popup {
|
||||
&__content {
|
||||
padding: 40px 32px;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
line-height: 48px;
|
||||
margin-bottom: 31px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__body {
|
||||
}
|
||||
|
||||
&__item {
|
||||
.flex-row();
|
||||
margin-bottom: 40px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&.share {
|
||||
background: #feba00;
|
||||
> image {
|
||||
width: 40px;
|
||||
height: 46px;
|
||||
}
|
||||
}
|
||||
&.vip {
|
||||
background: #b094ff;
|
||||
> image {
|
||||
width: 48px;
|
||||
height: 42px;
|
||||
}
|
||||
}
|
||||
&.video {
|
||||
background: #34a853;
|
||||
> image {
|
||||
width: 46px;
|
||||
height: 44px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-main {
|
||||
padding: 0 24px;
|
||||
flex: 1;
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: 28px;
|
||||
line-height: 40px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.desc {
|
||||
font-size: 24px;
|
||||
line-height: 36px;
|
||||
color: @blColorG1;
|
||||
}
|
||||
}
|
||||
&-action {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
&__btn {
|
||||
.button(@width: 136px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 43px, @highlight: 0);
|
||||
background: #f2f2f2;
|
||||
}
|
||||
}
|
86
src/components/prejob-popup/index.tsx
Normal file
86
src/components/prejob-popup/index.tsx
Normal file
@ -0,0 +1,86 @@
|
||||
import { Button, Image } from '@tarojs/components';
|
||||
|
||||
import { Popup } from '@taroify/core';
|
||||
|
||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||
import { PageUrl } from '@/constants/app';
|
||||
import { GET_CONTACT_TYPE } from '@/constants/job';
|
||||
import { hasShareToGetContact } from '@/utils/job';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
|
||||
import './index.less';
|
||||
|
||||
interface IProps {
|
||||
open: boolean;
|
||||
onCancel: () => void;
|
||||
onConfirm: (type: GET_CONTACT_TYPE) => void;
|
||||
}
|
||||
|
||||
const PREFIX = 'prejob-popup';
|
||||
|
||||
const GET_CONTACT_TYPE_OPTIONS = [
|
||||
{
|
||||
type: GET_CONTACT_TYPE.SHARE,
|
||||
icon: 'https://publiccdn.neighbourhood.com.cn/img/file.svg',
|
||||
title: '完善资料',
|
||||
desc: '转发给朋友可享推荐奖励',
|
||||
btnText: '分享',
|
||||
},
|
||||
{
|
||||
type: GET_CONTACT_TYPE.VIP,
|
||||
icon: 'https://publiccdn.neighbourhood.com.cn/img/diamond.svg',
|
||||
title: '播络会员',
|
||||
desc: '开通会员每天可查看10个',
|
||||
btnText: '开通',
|
||||
},
|
||||
{
|
||||
type: GET_CONTACT_TYPE.VIDEO,
|
||||
icon: 'https://publiccdn.neighbourhood.com.cn/img/video.svg',
|
||||
title: '观看视频',
|
||||
desc: '观看6-30s广告即可免费查看',
|
||||
btnText: '观看',
|
||||
},
|
||||
];
|
||||
|
||||
export function PrejobPopup({ open, onCancel, onConfirm }: IProps) {
|
||||
const handleClick = (type: GET_CONTACT_TYPE) => () => {
|
||||
if (type === GET_CONTACT_TYPE.SHARE) {
|
||||
navigateTo(PageUrl.PartnerShare);
|
||||
} else {
|
||||
onConfirm(type);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Popup rounded className={PREFIX} placement="bottom" open={open} onClose={onCancel}>
|
||||
<div className={`${PREFIX}__content`}>
|
||||
<div className={`${PREFIX}__title`}>以下方式任选其一均可获取联系方式</div>
|
||||
<div className={`${PREFIX}__body`}>
|
||||
{GET_CONTACT_TYPE_OPTIONS.map(option => {
|
||||
// 该方式只能用一次, 以后不再出现在选项中
|
||||
if (option.type === GET_CONTACT_TYPE.SHARE && !hasShareToGetContact()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={`${PREFIX}__item`} key={option.type}>
|
||||
<div className={`${PREFIX}__item-icon ${option.type}`}>
|
||||
<Image mode="aspectFit" src={option.icon} />
|
||||
</div>
|
||||
<div className={`${PREFIX}__item-main`}>
|
||||
<div className="title">{option.title}</div>
|
||||
<div className="desc">{option.desc}</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__item-action`}>
|
||||
<Button className={`${PREFIX}__btn`} onClick={handleClick(option.type)}>
|
||||
{option.btnText}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
<SafeBottomPadding />
|
||||
</Popup>
|
||||
);
|
||||
}
|
@ -3,6 +3,7 @@ export const PREFIX = 'product-dialog';
|
||||
export enum DialogStatus {
|
||||
// 加载中
|
||||
LOADING = 'loading',
|
||||
PRE_ACTION = 'pre_action',
|
||||
// 直接联系通告主
|
||||
JOB_CONTACT_DIRECT = 'job_contact_direct',
|
||||
// 联系客服去联系通告主 -> 订阅通知
|
||||
@ -13,6 +14,7 @@ export enum DialogStatus {
|
||||
JOB_UNABLE_UNLOCK = 'job_unable_unlock',
|
||||
// 通告解锁次数用完,购买界面
|
||||
JOB_BUY = 'job_buy',
|
||||
PREACTION_JOB_BUY = 'preaction_job_buy',
|
||||
// 加群二维码
|
||||
GROUP_QR_CODE = 'group_qr_code',
|
||||
// 确定加群
|
||||
|
@ -133,6 +133,7 @@
|
||||
&__header {
|
||||
.flex-row();
|
||||
.header-font();
|
||||
font-size: 32px;
|
||||
|
||||
.highlight {
|
||||
color: @blHighlightColor;
|
||||
@ -143,7 +144,8 @@
|
||||
&__describe {
|
||||
.flex-row();
|
||||
.describe-font();
|
||||
margin-top: 24px;
|
||||
margin-top: 18px;
|
||||
line-height: 40px;
|
||||
|
||||
.highlight {
|
||||
color: @blHighlightColor;
|
||||
@ -158,13 +160,13 @@
|
||||
|
||||
&__item {
|
||||
position: relative;
|
||||
width: 170px;
|
||||
width: 182px;
|
||||
height: 192px;
|
||||
.flex-column();
|
||||
justify-content: center;
|
||||
border: 2px solid @blHighlightColor;
|
||||
border-radius: 8px;
|
||||
margin-right: 24px;
|
||||
margin-right: 15px;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
@ -660,4 +662,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,20 +3,24 @@ import Taro from '@tarojs/taro';
|
||||
import { Dialog } from '@taroify/core';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { PrejobPopup } from '@/components/prejob-popup';
|
||||
import { DialogStatus, PREFIX } from '@/components/product-dialog/const';
|
||||
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
||||
import ContactCustomerService from '@/components/product-dialog/steps-ui/job-contact-customer';
|
||||
import ContactDirect from '@/components/product-dialog/steps-ui/job-contact-direct';
|
||||
import UnableUnlockContent from '@/components/product-dialog/steps-ui/job-unable';
|
||||
import { EventName } from '@/constants/app';
|
||||
import { GET_CONTACT_TYPE } from '@/constants/job';
|
||||
import { DeclarationType, ProductType } from '@/constants/product';
|
||||
import { JobDetails } from '@/types/job';
|
||||
import { ProductInfo } from '@/types/product';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
import { getSkipPrejobAction, setSkipPrejobAction } from '@/utils/job';
|
||||
import {
|
||||
requestProductUseRecord,
|
||||
requestProductBalance,
|
||||
requestUseProduct,
|
||||
requestAllBuyProduct,
|
||||
requestProductBalance,
|
||||
requestProductUseRecord,
|
||||
requestUseProduct,
|
||||
} from '@/utils/product';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
@ -33,13 +37,31 @@ const log = logWithPrefix('product-job-dialog');
|
||||
function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
const { data, onClose } = props;
|
||||
const [status, setStatus] = useState<DialogStatus>(DialogStatus.LOADING);
|
||||
const [showContact, setShowContact] = useState(false);
|
||||
const [showPrejob, setShowPrejob] = useState(false);
|
||||
const [publisherAcctNo, setPublisherAcctNo] = useState<string>('');
|
||||
const initRef = useRef(() => {});
|
||||
const initRef = useRef<(skipPreAction?: boolean, skipRecordGet?: boolean) => void | Promise<void>>(() => {});
|
||||
|
||||
const handleCloseDialog = useCallback(() => {
|
||||
setShowContact(false);
|
||||
onClose();
|
||||
}, [onClose]);
|
||||
|
||||
const handleClosePrejob = useCallback(() => {
|
||||
setShowPrejob(false);
|
||||
}, []);
|
||||
|
||||
const handleConfirmPrejob = useCallback(async (type: GET_CONTACT_TYPE) => {
|
||||
if (type === GET_CONTACT_TYPE.VIP) {
|
||||
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
||||
setShowContact(true);
|
||||
setShowPrejob(false);
|
||||
setStatus(allowBuy ? DialogStatus.PREACTION_JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
||||
} else if (type === GET_CONTACT_TYPE.VIDEO) {
|
||||
Taro.eventCenter.trigger(EventName.SHOW_VIDEO_REWARD);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const handleAfterBuy = useCallback(async () => {
|
||||
const time = await requestProductBalance(PRODUCT_CODE);
|
||||
if (time <= 0) {
|
||||
@ -49,6 +71,8 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
}
|
||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||
const declarationTypeResult = productInfo.declarationTypeResult;
|
||||
setShowContact(true);
|
||||
setShowPrejob(false);
|
||||
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
||||
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
||||
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
||||
@ -62,8 +86,9 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
}, [data]);
|
||||
|
||||
useEffect(() => {
|
||||
initRef.current = async () => {
|
||||
initRef.current = async (skipPreAction?: boolean, skipRecordGet?: boolean) => {
|
||||
const handleContact = (declarationTypeResult?: ProductInfo['declarationTypeResult']) => {
|
||||
setShowContact(true);
|
||||
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
||||
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
||||
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
||||
@ -77,19 +102,34 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
// setStatus(DialogStatus.JOB_CONTACT_CS);
|
||||
// return;
|
||||
// }
|
||||
const result = await requestProductUseRecord(PRODUCT_CODE, { jobId: data.id });
|
||||
log('requestProductUseRecord result', result);
|
||||
if (result) {
|
||||
handleContact(result.declarationTypeResult);
|
||||
return;
|
||||
if (!skipRecordGet) {
|
||||
const result = await requestProductUseRecord(PRODUCT_CODE, { jobId: data.id });
|
||||
log('requestProductUseRecord result', result);
|
||||
if (result) {
|
||||
handleContact(result.declarationTypeResult);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const time = await requestProductBalance(PRODUCT_CODE);
|
||||
if (time <= 0) {
|
||||
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
||||
setShowContact(true);
|
||||
setStatus(allowBuy ? DialogStatus.JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
||||
} else {
|
||||
}
|
||||
// 创建模卡之后可以直接解锁一次, 分享后解锁一次
|
||||
else if (getSkipPrejobAction() || skipPreAction) {
|
||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||
setShowPrejob(false);
|
||||
if (!skipPreAction) {
|
||||
setSkipPrejobAction(false);
|
||||
}
|
||||
handleContact(productInfo.declarationTypeResult);
|
||||
} else {
|
||||
setShowPrejob(true);
|
||||
setStatus(DialogStatus.PRE_ACTION);
|
||||
|
||||
// const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||
// handleContact(productInfo.declarationTypeResult);
|
||||
}
|
||||
} catch (e) {
|
||||
Toast.error('出错了,请重试');
|
||||
@ -104,21 +144,44 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
initRef.current();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
Taro.eventCenter.once(EventName.PRE_ACTION_SHARE_SUCCESS, () => {
|
||||
initRef.current(true, true);
|
||||
});
|
||||
Taro.eventCenter.on(EventName.PRE_ACTION_VIDEO_SUCCESS, () => {
|
||||
initRef.current(true, true);
|
||||
});
|
||||
|
||||
return () => {
|
||||
Taro.eventCenter.off(EventName.PRE_ACTION_SHARE_SUCCESS);
|
||||
Taro.eventCenter.off(EventName.PRE_ACTION_VIDEO_SUCCESS);
|
||||
};
|
||||
}, []);
|
||||
|
||||
if (status === DialogStatus.LOADING) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog className={PREFIX} onClose={onClose} open>
|
||||
<Dialog.Content>
|
||||
{status === DialogStatus.JOB_CONTACT_CS && <ContactCustomerService onAfterConfirm={handleCloseDialog} />}
|
||||
{status === DialogStatus.JOB_CONTACT_DIRECT && (
|
||||
<ContactDirect publisherAcctNo={publisherAcctNo} onAfterConfirm={handleCloseDialog} onReport={handleReport} />
|
||||
)}
|
||||
{status === DialogStatus.JOB_BUY && <JobBuy onConfirm={handleAfterBuy} />}
|
||||
{status === DialogStatus.JOB_UNABLE_UNLOCK && <UnableUnlockContent onConfirm={handleCloseDialog} />}
|
||||
</Dialog.Content>
|
||||
</Dialog>
|
||||
<div>
|
||||
<PrejobPopup open={showPrejob} onCancel={handleClosePrejob} onConfirm={handleConfirmPrejob} />
|
||||
<Dialog className={PREFIX} onClose={onClose} open={showContact}>
|
||||
<Dialog.Content>
|
||||
{status === DialogStatus.JOB_CONTACT_CS && <ContactCustomerService onAfterConfirm={handleCloseDialog} />}
|
||||
{status === DialogStatus.JOB_CONTACT_DIRECT && (
|
||||
<ContactDirect
|
||||
publisherAcctNo={publisherAcctNo}
|
||||
onAfterConfirm={handleCloseDialog}
|
||||
onReport={handleReport}
|
||||
/>
|
||||
)}
|
||||
{(status === DialogStatus.JOB_BUY || status === DialogStatus.PREACTION_JOB_BUY) && (
|
||||
<JobBuy onConfirm={handleAfterBuy} justBuy={status === DialogStatus.PREACTION_JOB_BUY} />
|
||||
)}
|
||||
{status === DialogStatus.JOB_UNABLE_UNLOCK && <UnableUnlockContent onConfirm={handleCloseDialog} />}
|
||||
</Dialog.Content>
|
||||
</Dialog>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
|
||||
|
||||
import { Button } from '@taroify/core';
|
||||
import classNames from 'classnames';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import Badge from '@/components/badge';
|
||||
import { PREFIX } from '@/components/product-dialog/const';
|
||||
@ -16,6 +16,7 @@ import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
interface IProps {
|
||||
justBuy?: boolean;
|
||||
onConfirm: () => void;
|
||||
}
|
||||
|
||||
@ -29,22 +30,22 @@ interface Item {
|
||||
}
|
||||
|
||||
const LIST: Item[] = [
|
||||
{ id: ProductSpecId.WeeklyVIP, title: '非会员', content: '每日2次', price: '免费', amt: 0 },
|
||||
{ id: ProductSpecId.WeeklyVIP, title: '日会员', content: '1天内免广告', price: '60播豆', amt: 6, badge: '限时体验' },
|
||||
{
|
||||
id: ProductSpecId.WeeklyVIP,
|
||||
title: '周会员',
|
||||
content: '每日5次',
|
||||
price: '60播豆',
|
||||
amt: 6,
|
||||
badge: '限时体验',
|
||||
content: '7天内免广告',
|
||||
price: '180播豆',
|
||||
amt: 18,
|
||||
badge: '4.2折',
|
||||
},
|
||||
{
|
||||
id: ProductSpecId.NewMonthlyVIP,
|
||||
title: '月会员',
|
||||
content: '每日5次',
|
||||
price: '180播豆',
|
||||
amt: 18,
|
||||
badge: ' 超值',
|
||||
content: '30天内免广告',
|
||||
price: '300播豆',
|
||||
amt: 30,
|
||||
badge: '1.6折',
|
||||
},
|
||||
];
|
||||
|
||||
@ -75,6 +76,7 @@ export default function JobBuy(props: IProps) {
|
||||
type: OrderType.VIP,
|
||||
amt: getOrderPrice(selectItem.amt),
|
||||
productCode: ProductType.VIP,
|
||||
// todo: 日会员的 productSpectId 是什么?
|
||||
productSpecId: selectItem.id,
|
||||
});
|
||||
log('handleBuy payInfo', payOrderNo, createPayInfo);
|
||||
@ -107,14 +109,26 @@ export default function JobBuy(props: IProps) {
|
||||
return (
|
||||
<div className={`${PREFIX}__job-buy`}>
|
||||
<div className={`${PREFIX}__job-buy__header`}>
|
||||
<div>今日通告对接次数</div>
|
||||
<div className="highlight">已用完</div>
|
||||
{props.justBuy ? (
|
||||
<div>开通播络会员即可直接查看联系方式</div>
|
||||
) : (
|
||||
<Fragment>
|
||||
<div>今日通告对接次数</div>
|
||||
<div className="highlight">已用完</div>
|
||||
</Fragment>
|
||||
)}
|
||||
</div>
|
||||
<div className={`${PREFIX}__job-buy__describe`}>
|
||||
<div>请</div>
|
||||
<div className="highlight">明日</div>
|
||||
<div>再来 或 </div>
|
||||
<div className="highlight">升级会员</div>
|
||||
{props.justBuy ? (
|
||||
<div>每天可查看10个联系方式</div>
|
||||
) : (
|
||||
<Fragment>
|
||||
<div>请</div>
|
||||
<div className="highlight">明日</div>
|
||||
<div>再来 或 </div>
|
||||
<div className="highlight">升级会员</div>
|
||||
</Fragment>
|
||||
)}
|
||||
</div>
|
||||
<div className={`${PREFIX}__job-buy__container`}>
|
||||
{LIST.map(item => (
|
||||
|
@ -40,18 +40,18 @@ const SERVICE_ILLUSTRATE = `服务方式:帮您把招聘需求发到众多同
|
||||
内容要求:仅限带货主播招聘需求,其他不发
|
||||
主播联系:内容中留招聘方联系方式,主播直接联系`;
|
||||
const cityValues: CityValue[] = [
|
||||
{ cityCode: '440100', cityName: '广州', count: 300 }, // 800
|
||||
{ cityCode: '440100', cityName: '广州', count: 800 },
|
||||
{ cityCode: '440300', cityName: '深圳', count: 100 },
|
||||
{ cityCode: '330100', cityName: '杭州', count: 300 }, // 750
|
||||
{ cityCode: '110100', cityName: '北京', count: 100 }, // 150
|
||||
{ cityCode: '330100', cityName: '杭州', count: 750 },
|
||||
{ cityCode: '110100', cityName: '北京', count: 150 },
|
||||
{ cityCode: '510100', cityName: '成都', count: 100 },
|
||||
// { cityCode: '500100', cityName: '重庆', count: 50 },
|
||||
{ cityCode: '500100', cityName: '重庆', count: 50 },
|
||||
{ cityCode: '430100', cityName: '长沙', count: 50 },
|
||||
{ cityCode: '350200', cityName: '厦门', count: 50 },
|
||||
{ cityCode: '310100', cityName: '上海', count: 100 }, // 150
|
||||
{ cityCode: '420100', cityName: '武汉', count: 50 }, // 80
|
||||
{ cityCode: '610100', cityName: '西安', count: 50 }, // 60
|
||||
{ cityCode: '410100', cityName: '郑州', count: 100 }, // 150
|
||||
{ cityCode: '310100', cityName: '上海', count: 150 },
|
||||
{ cityCode: '420100', cityName: '武汉', count: 80 },
|
||||
{ cityCode: '610100', cityName: '西安', count: 60 },
|
||||
{ cityCode: '410100', cityName: '郑州', count: 150 },
|
||||
].sort((a, b) => b.count - a.count);
|
||||
const MIN_GROUP_SIZE = 20;
|
||||
const GROUP_OPTIONS = [
|
||||
@ -62,7 +62,7 @@ const GROUP_OPTIONS = [
|
||||
{ value: 100, productSpecId: ProductSpecId.GroupBatchPublish100, label: '100', price: 68 },
|
||||
{ value: 150, productSpecId: ProductSpecId.GroupBatchPublish150, label: '150', price: 98 },
|
||||
{ value: 300, productSpecId: ProductSpecId.GroupBatchPublish300, label: '300', price: 128 },
|
||||
{ value: 500, productSpecId: ProductSpecId.GroupBatchPublish500, label: '500', price: 188 }, // 168
|
||||
{ value: 500, productSpecId: ProductSpecId.GroupBatchPublish500, label: '500', price: 168 },
|
||||
{ value: 750, productSpecId: ProductSpecId.GroupBatchPublish750, label: '750', price: 188 },
|
||||
{ value: 800, productSpecId: ProductSpecId.GroupBatchPublish800, label: '800', price: 198 },
|
||||
{ value: 1000, productSpecId: ProductSpecId.GroupBatchPublish1000, label: '1000', price: 288 },
|
||||
@ -146,7 +146,7 @@ export default function UserBatchPublish() {
|
||||
useEffect(() => {
|
||||
try {
|
||||
const cOptions: CityOption[] = cityValues.map(value => ({ value, label: value.cityName }));
|
||||
const initCity = cOptions[0].value;
|
||||
const initCity = (cOptions.find(o => o.label === '重庆') || cOptions[0]).value;
|
||||
|
||||
setLoading(false);
|
||||
setCity(initCity);
|
||||
|
@ -24,6 +24,10 @@ export enum EventName {
|
||||
SELECT_MY_PUBLISH_JOB = 'select_my_publish_job',
|
||||
EXIT_CHAT_PAGE = 'exit_chat_page',
|
||||
VIEW_MATERIAL_SUCCESS = 'view_material_success',
|
||||
PRE_ACTION_SHARE_SUCCESS = 'pre_action_share_success',
|
||||
PRE_ACTION_VIDEO_SUCCESS = 'pre_action_video_success',
|
||||
PRE_ACTION_VIDEO_ERROR = 'pre_action_video_error',
|
||||
SHOW_VIDEO_REWARD = 'show_video_reward',
|
||||
}
|
||||
|
||||
export enum OpenSource {
|
||||
@ -75,6 +79,7 @@ export enum PageUrl {
|
||||
Partner = 'pages/partner/index',
|
||||
WithdrawRecord = 'pages/withdraw-record/index',
|
||||
GroupDelegatePublish = 'pages/group-delegate-publish/index',
|
||||
PartnerShare = 'pages/partner-share/index',
|
||||
}
|
||||
|
||||
export enum PluginUrl {
|
||||
|
@ -12,4 +12,8 @@ export enum CacheKey {
|
||||
INVITE_CODE = '__invite_code__',
|
||||
AGREEMENT_SIGNED = '__agreement_signed__',
|
||||
CITY_CODES = '__city_codes__',
|
||||
JOIN_GROUP_CARD_CLICKED = '__join_group_card_clicked__',
|
||||
SHARE_TO_GET_JOB_CONTACT = '__share_to_get_job_contract__',
|
||||
SHARE_TO_GET_ANCHOR_CONTACT = '__share_to_get_anchor_contract__',
|
||||
SKIP_PREACTION = '__skip_preaction__',
|
||||
}
|
||||
|
@ -174,3 +174,9 @@ export const FULL_EMPLOY_SALARY_OPTIONS = [
|
||||
export const PART_PRICE_OPTIONS = PART_EMPLOY_SALARY_OPTIONS.filter(o => !!o.value);
|
||||
|
||||
export const FULL_PRICE_OPTIONS = FULL_EMPLOY_SALARY_OPTIONS.filter(o => !!o.value);
|
||||
|
||||
export enum GET_CONTACT_TYPE {
|
||||
SHARE = 'share',
|
||||
VIP = 'vip',
|
||||
VIDEO = 'video',
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ export enum ProductSpecId {
|
||||
AddGroup2 = 'ADDGROUP_2',
|
||||
AddGroup3 = 'ADDGROUP_3',
|
||||
BossVip = 'BOSSVIP',
|
||||
DaylyVIP = 'VIP_D',
|
||||
WeeklyVIP = 'VIP_W',
|
||||
MonthlyVIP = 'VIP_M', // 30 每天十次
|
||||
NewMonthlyVIP = 'VIP_M_NEW', // 18 每天五次
|
||||
|
@ -44,7 +44,7 @@
|
||||
font-size: 28px;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
background: #0000005c;
|
||||
background: #6D3DF5B2;
|
||||
border-radius: 48px;
|
||||
}
|
||||
|
||||
@ -232,4 +232,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.join-group-hint {
|
||||
margin: 24px;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import { navigateTo } from '@/utils/route';
|
||||
|
||||
import './index.less';
|
||||
import onChangeEventDetail = SwiperProps.onChangeEventDetail;
|
||||
import { JoinGroupHint } from '@/components/join-group-hint';
|
||||
|
||||
interface IProps {
|
||||
editable: boolean;
|
||||
@ -207,6 +208,7 @@ export default function ProfileViewFragment(props: IProps) {
|
||||
>{`${coverIndex + 1}/${profile.materialVideoInfoList.length}`}</div>
|
||||
</div>
|
||||
</div>
|
||||
{!editable && <JoinGroupHint />}
|
||||
<div className={`${PREFIX}__body`}>
|
||||
<div className={`${PREFIX}__basic-info`}>
|
||||
<div className={`${PREFIX}__basic-info__name-container`}>
|
||||
@ -228,7 +230,9 @@ export default function ProfileViewFragment(props: IProps) {
|
||||
{index ? (
|
||||
<div className={`${PREFIX}__info-group__header__title`}>{data.title}</div>
|
||||
) : (
|
||||
<DevDiv className={`${PREFIX}__info-group__header__title`} OnDev={onDev}>{data.title}</DevDiv>
|
||||
<DevDiv className={`${PREFIX}__info-group__header__title`} OnDev={onDev}>
|
||||
{data.title}
|
||||
</DevDiv>
|
||||
)}
|
||||
{editable && (
|
||||
<div className={`${PREFIX}__info-group__header__edit`} onClick={() => handleEditGroupItem(data.type)}>
|
||||
|
@ -98,6 +98,7 @@ export const APP_CONFIG: AppConfigType = {
|
||||
PageUrl.Partner,
|
||||
PageUrl.WithdrawRecord,
|
||||
PageUrl.GroupDelegatePublish,
|
||||
PageUrl.PartnerShare,
|
||||
// PageUrl.DevDebug,
|
||||
],
|
||||
window: {
|
||||
|
@ -1,12 +1,13 @@
|
||||
import { Map, MapProps, Text, Image, Button } from '@tarojs/components';
|
||||
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { CertificationStatusIcon } from '@/components/certification-status';
|
||||
import CommonDialog from '@/components/common-dialog';
|
||||
import DevDiv from '@/components/dev-div';
|
||||
import JobRecommendList from '@/components/job-recommend-list';
|
||||
import { JoinGroupHint } from '@/components/join-group-hint';
|
||||
import LoginButton from '@/components/login-button';
|
||||
import MaterialGuide from '@/components/material-guide';
|
||||
import PageLoading from '@/components/page-loading';
|
||||
@ -182,6 +183,7 @@ export default function JobDetail() {
|
||||
const roleType = useRoleType();
|
||||
const userInfo = useUserInfo();
|
||||
const [data, setData] = useState<JobDetails | null>(null);
|
||||
const videoRef = useRef<Taro.RewardedVideoAd | null>(null);
|
||||
const isOwner = roleType === RoleType.Company && userInfo.userId === data?.userId;
|
||||
const inviteCode = useInviteCode();
|
||||
|
||||
@ -218,6 +220,56 @@ export default function JobDetail() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const handleLoad = () => {
|
||||
log('视频奖励加载成功');
|
||||
};
|
||||
const handleError = err => {
|
||||
Taro.eventCenter.trigger(EventName.PRE_ACTION_VIDEO_ERROR);
|
||||
log('视频奖励加载失败', err);
|
||||
};
|
||||
const handleClose = res => {
|
||||
if (res.isEnded) {
|
||||
Taro.eventCenter.trigger(EventName.PRE_ACTION_VIDEO_SUCCESS);
|
||||
} else {
|
||||
Toast.info('请完整观看广告以获得奖励');
|
||||
}
|
||||
};
|
||||
const handleShowVideo = async () => {
|
||||
if (videoRef.current) {
|
||||
try {
|
||||
await videoRef.current.show();
|
||||
} catch (error) {
|
||||
Taro.eventCenter.trigger(EventName.PRE_ACTION_VIDEO_ERROR);
|
||||
Toast.info('广告奖励加载失败,请重试');
|
||||
log('激励视频显示失败');
|
||||
}
|
||||
} else {
|
||||
Taro.eventCenter.trigger(EventName.PRE_ACTION_VIDEO_ERROR);
|
||||
Toast.info('广告奖励加载失败,请重试');
|
||||
log('激励视频加载&显示失败');
|
||||
}
|
||||
};
|
||||
videoRef.current = Taro.createRewardedVideoAd({
|
||||
adUnitId: 'adunit-ca879f574edfeb33',
|
||||
});
|
||||
videoRef.current.onLoad(handleLoad);
|
||||
videoRef.current.onClose(handleClose);
|
||||
videoRef.current.onError(handleError);
|
||||
|
||||
videoRef.current.load();
|
||||
Taro.eventCenter.on(EventName.SHOW_VIDEO_REWARD, handleShowVideo);
|
||||
|
||||
return () => {
|
||||
if (videoRef.current) {
|
||||
videoRef.current.offLoad(handleLoad);
|
||||
videoRef.current.offError(handleError);
|
||||
videoRef.current.offClose(handleClose);
|
||||
}
|
||||
Taro.eventCenter.off(EventName.SHOW_VIDEO_REWARD);
|
||||
};
|
||||
}, []);
|
||||
|
||||
useLoad(async () => {
|
||||
switchRoleType(RoleType.Anchor);
|
||||
|
||||
@ -282,6 +334,8 @@ export default function JobDetail() {
|
||||
{data.companyName && <div className={`${PREFIX}__company`}>{`公司:${data.companyName}`}</div>}
|
||||
</div>
|
||||
|
||||
{!isOwner && <JoinGroupHint />}
|
||||
|
||||
<div className={`${PREFIX}__content`}>
|
||||
<div className={`${PREFIX}__content-title`}>职位描述</div>
|
||||
<div className={`${PREFIX}__tags`}>
|
||||
|
@ -15,7 +15,7 @@ import useLocation from '@/hooks/use-location';
|
||||
import { MaterialProfile } from '@/types/material';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
import { collectEvent } from '@/utils/event';
|
||||
import { isFullTimePriceRequired, isPartTimePriceRequired } from '@/utils/job';
|
||||
import { isFullTimePriceRequired, isPartTimePriceRequired, setSkipPrejobAction } from '@/utils/job';
|
||||
import { updateProfile, subscribeMaterialMessage } from '@/utils/material';
|
||||
import { navigateBack } from '@/utils/route';
|
||||
import Toast from '@/utils/toast';
|
||||
@ -110,6 +110,7 @@ export default function MaterialCreateProfile() {
|
||||
// 发起订阅不能在异步任务中,保证是第一个
|
||||
await Promise.all([subscribeMaterialMessage(), updateProfile(data)]);
|
||||
}
|
||||
setSkipPrejobAction();
|
||||
Taro.eventCenter.trigger(EventName.CREATE_PROFILE);
|
||||
nextType ? setGroupType(nextType) : navigateBack(2);
|
||||
} catch (e) {
|
||||
|
3
src/pages/partner-share/index.config.ts
Normal file
3
src/pages/partner-share/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '分享',
|
||||
});
|
57
src/pages/partner-share/index.less
Normal file
57
src/pages/partner-share/index.less
Normal file
@ -0,0 +1,57 @@
|
||||
@import '@/styles/common.less';
|
||||
@import '@/styles/variables.less';
|
||||
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.partner-share {
|
||||
padding-top: 175px;
|
||||
&__money {
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
&__header {
|
||||
.flex-column();
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
font-size: 48px;
|
||||
line-height: 48px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
&__body {
|
||||
padding-top: 86px;
|
||||
.flex-column();
|
||||
}
|
||||
|
||||
&__item {
|
||||
.flex-row();
|
||||
margin-top: 72px;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
line-height: 48px;
|
||||
width: 640px;
|
||||
|
||||
color: #000000;
|
||||
.highlight {
|
||||
color: @blHighlightColor;
|
||||
font-weight: 400;
|
||||
padding-left: 8px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
&__no {
|
||||
width: 74px;
|
||||
height: 46px;
|
||||
margin-right: 21px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
&__btn {
|
||||
.button(@width: 360px; @height: 72px;);
|
||||
margin-top: 150px;
|
||||
}
|
||||
}
|
61
src/pages/partner-share/index.tsx
Normal file
61
src/pages/partner-share/index.tsx
Normal file
@ -0,0 +1,61 @@
|
||||
import { Button, Image } from '@tarojs/components';
|
||||
import Taro, { useDidShow, useShareAppMessage } from '@tarojs/taro';
|
||||
|
||||
import { EventName } from '@/constants/app';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import { hasShareToGetContact, setShareToGetContact } from '@/utils/job';
|
||||
import { navigateBack } from '@/utils/route';
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'partner-share';
|
||||
|
||||
export default function Partner() {
|
||||
const inviteCode = useInviteCode();
|
||||
useDidShow(() => {
|
||||
if (!hasShareToGetContact()) {
|
||||
Taro.eventCenter.trigger(EventName.PRE_ACTION_SHARE_SUCCESS);
|
||||
navigateBack(-1);
|
||||
}
|
||||
});
|
||||
useShareAppMessage(() => {
|
||||
setShareToGetContact();
|
||||
console.log('Partner inviteCode', inviteCode);
|
||||
return getCommonShareMessage({ useCapture: false, inviteCode });
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={PREFIX}>
|
||||
<div className={`${PREFIX}__header`}>
|
||||
<Image
|
||||
src="https://publiccdn.neighbourhood.com.cn/img/money.png"
|
||||
mode="aspectFit"
|
||||
className={`${PREFIX}__money`}
|
||||
/>
|
||||
<div>分享可获3重收益</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__body`}>
|
||||
<div className={`${PREFIX}__item`}>
|
||||
<Image src="https://publiccdn.neighbourhood.com.cn/img/01.svg" mode="aspectFit" className={`${PREFIX}__no`} />
|
||||
<div>
|
||||
直接获得被邀请人支付金额<div className="highlight">20%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__item`}>
|
||||
<Image src="https://publiccdn.neighbourhood.com.cn/img/02.svg" mode="aspectFit" className={`${PREFIX}__no`} />
|
||||
<div>邀请的主播被企业开聊,即可获得分润</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__item`}>
|
||||
<Image src="https://publiccdn.neighbourhood.com.cn/img/03.svg" mode="aspectFit" className={`${PREFIX}__no`} />
|
||||
<div>
|
||||
获得被邀请人再邀请他人收益的<div className="highlight">5%</div>
|
||||
</div>
|
||||
</div>
|
||||
<Button className={`${PREFIX}__btn`} openType="share">
|
||||
立即分享
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
@ -8,20 +8,20 @@ import { API } from '@/http/api';
|
||||
import store from '@/store';
|
||||
import { selectLocation } from '@/store/selector';
|
||||
import {
|
||||
JobDetails,
|
||||
CreateJobInfo,
|
||||
GetJobManagesRequest,
|
||||
GetJobManagesResponse,
|
||||
GetJobsDetailsRequest,
|
||||
GetJobsRequest,
|
||||
GetJobsResponse,
|
||||
JobInfo,
|
||||
GetMyRecommendJobRequest,
|
||||
GetUserJobRequest,
|
||||
GetUserJobResponse,
|
||||
MyDeclaredJobInfo,
|
||||
MyBrowsedJobInfo,
|
||||
GetMyRecommendJobRequest,
|
||||
GetJobManagesRequest,
|
||||
GetJobManagesResponse,
|
||||
CreateJobInfo,
|
||||
JobDetails,
|
||||
JobInfo,
|
||||
JobManageInfo,
|
||||
MyBrowsedJobInfo,
|
||||
MyDeclaredJobInfo,
|
||||
} from '@/types/job';
|
||||
import { collectEvent } from '@/utils/event';
|
||||
import { getCityValues } from '@/utils/location';
|
||||
@ -131,3 +131,19 @@ export function postPublishJob(jobId: string) {
|
||||
export function postCloseJob(jobId: string) {
|
||||
return http.post(API.CLOSE_JOB, { data: { jobId }, contentType: 'application/x-www-form-urlencoded' });
|
||||
}
|
||||
|
||||
export function setSkipPrejobAction(skip = true) {
|
||||
Taro.setStorageSync(CacheKey.SKIP_PREACTION, skip);
|
||||
}
|
||||
|
||||
export function getSkipPrejobAction() {
|
||||
return !!Taro.getStorageSync(CacheKey.SKIP_PREACTION);
|
||||
}
|
||||
|
||||
export function setShareToGetContact(job = true) {
|
||||
Taro.setStorageSync(job ? CacheKey.SHARE_TO_GET_JOB_CONTACT : CacheKey.SHARE_TO_GET_ANCHOR_CONTACT, true);
|
||||
}
|
||||
|
||||
export function hasShareToGetContact(job = true) {
|
||||
return !Taro.getStorageSync(job ? CacheKey.SHARE_TO_GET_JOB_CONTACT : CacheKey.SHARE_TO_GET_ANCHOR_CONTACT);
|
||||
}
|
||||
|
@ -156,14 +156,18 @@ export const getCityCodes = (): string[] => {
|
||||
return !cachedValue || !Array.isArray(cachedValue) ? [] : cachedValue;
|
||||
};
|
||||
export const setCityCodes = (cityCode: string[]) => Taro.setStorageSync(CacheKey.CITY_CODES, cityCode);
|
||||
export const checkCityCode = (cityCode: string): boolean => {
|
||||
export const validCityCode = (cityCode: string) => {
|
||||
const cachedCityCodes = getCityCodes();
|
||||
const isNewCityCode = cachedCityCodes.indexOf(cityCode) === -1;
|
||||
if (cachedCityCodes.length === 2 && isNewCityCode) {
|
||||
return !(cachedCityCodes.length === 2 && isNewCityCode);
|
||||
};
|
||||
export const checkCityCode = (cityCode: string): boolean => {
|
||||
if (!validCityCode(cityCode)) {
|
||||
Toast.info('最多只能进入2个城市');
|
||||
return false;
|
||||
}
|
||||
if (isNewCityCode) {
|
||||
const cachedCityCodes = getCityCodes();
|
||||
if (cachedCityCodes.indexOf(cityCode) === -1) {
|
||||
setCityCodes([...cachedCityCodes, cityCode]);
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user