Compare commits
6 Commits
2c48a70b6d
...
trunk
Author | SHA1 | Date | |
---|---|---|---|
260e543fe6 | |||
0cd1a46762 | |||
1ddc8b46c9 | |||
5820fa8d25 | |||
80846d507f | |||
42d1208ee4 |
@ -17,22 +17,25 @@ import './index.less';
|
|||||||
|
|
||||||
const PREFIX = 'join-group-hint';
|
const PREFIX = 'join-group-hint';
|
||||||
|
|
||||||
|
const DEFAULT_GROUP = {
|
||||||
|
name: '播络主播招聘群',
|
||||||
|
serviceUrl: 'https://work.weixin.qq.com/kfid/kfcc60ac7b6420787a8',
|
||||||
|
};
|
||||||
|
|
||||||
export function JoinGroupHint() {
|
export function JoinGroupHint() {
|
||||||
const cityCode = getCurrentCityCode();
|
const cityCode = getCurrentCityCode();
|
||||||
const roleType = getRoleTypeWithDefault();
|
const roleType = getRoleTypeWithDefault();
|
||||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
||||||
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
|
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
if (!checkCityCode(cityCode)) {
|
if (group && !checkCityCode(cityCode)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (group) {
|
openCustomerServiceChat(group ? group.serviceUrl : DEFAULT_GROUP.serviceUrl);
|
||||||
openCustomerServiceChat(group.serviceUrl);
|
Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true);
|
||||||
Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true);
|
setClicked(true);
|
||||||
setClicked(true);
|
|
||||||
}
|
|
||||||
}, [cityCode, group]);
|
}, [cityCode, group]);
|
||||||
if (!group || !validCityCode(cityCode) || clicked) {
|
if (!validCityCode(cityCode) || clicked) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +47,9 @@ export function JoinGroupHint() {
|
|||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
<div className={`${PREFIX}__left`}>
|
<div className={`${PREFIX}__left`}>
|
||||||
<div className={`${PREFIX}__left-title`}>{CITY_CODE_TO_NAME_MAP.get(cityCode)}主播招聘群</div>
|
<div className={`${PREFIX}__left-title`}>
|
||||||
|
{group ? `${CITY_CODE_TO_NAME_MAP.get(cityCode)}主播招聘群` : DEFAULT_GROUP.name}
|
||||||
|
</div>
|
||||||
<div className={`${PREFIX}__left-desc`}>{roleType === RoleType.Anchor ? '高薪工作早知道' : '免费招主播'}</div>
|
<div className={`${PREFIX}__left-desc`}>{roleType === RoleType.Anchor ? '高薪工作早知道' : '免费招主播'}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__right`}>
|
<div className={`${PREFIX}__right`}>
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
&.share {
|
&.material {
|
||||||
background: #feba00;
|
background: #feba00;
|
||||||
> image {
|
> image {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import { Button, Image } from '@tarojs/components';
|
import { Button, Image } from '@tarojs/components';
|
||||||
|
|
||||||
import { Popup } from '@taroify/core';
|
import { Popup, Dialog } from '@taroify/core';
|
||||||
|
import { Fragment, useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageUrl } from '@/constants/app';
|
||||||
import { GET_CONTACT_TYPE } from '@/constants/job';
|
import { GET_CONTACT_TYPE } from '@/constants/job';
|
||||||
import { hasShareToGetContact } from '@/utils/job';
|
|
||||||
import { navigateTo } from '@/utils/route';
|
import { navigateTo } from '@/utils/route';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
open: boolean;
|
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
onConfirm: (type: GET_CONTACT_TYPE) => void;
|
onConfirm: (type: GET_CONTACT_TYPE) => void;
|
||||||
}
|
}
|
||||||
@ -20,11 +20,11 @@ const PREFIX = 'prejob-popup';
|
|||||||
|
|
||||||
const GET_CONTACT_TYPE_OPTIONS = [
|
const GET_CONTACT_TYPE_OPTIONS = [
|
||||||
{
|
{
|
||||||
type: GET_CONTACT_TYPE.SHARE,
|
type: GET_CONTACT_TYPE.MATERIAL,
|
||||||
icon: 'https://publiccdn.neighbourhood.com.cn/img/file.svg',
|
icon: 'https://publiccdn.neighbourhood.com.cn/img/file.svg',
|
||||||
title: '完善资料',
|
title: '创建模卡(免费报单)',
|
||||||
desc: '转发给朋友可享推荐奖励',
|
desc: '免费报单,优先推荐给企业,机会更多',
|
||||||
btnText: '分享',
|
btnText: '创建',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: GET_CONTACT_TYPE.VIP,
|
type: GET_CONTACT_TYPE.VIP,
|
||||||
@ -33,54 +33,57 @@ const GET_CONTACT_TYPE_OPTIONS = [
|
|||||||
desc: '开通会员每天可查看10个',
|
desc: '开通会员每天可查看10个',
|
||||||
btnText: '开通',
|
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) {
|
export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
||||||
|
const [openPopup, setOpenPopup] = useState(true);
|
||||||
|
const [openDialog, setOpenDialog] = useState(false);
|
||||||
const handleClick = (type: GET_CONTACT_TYPE) => () => {
|
const handleClick = (type: GET_CONTACT_TYPE) => () => {
|
||||||
if (type === GET_CONTACT_TYPE.SHARE) {
|
if (type === GET_CONTACT_TYPE.MATERIAL) {
|
||||||
navigateTo(PageUrl.PartnerShare);
|
navigateTo(PageUrl.MaterialUploadVideo);
|
||||||
} else {
|
|
||||||
onConfirm(type);
|
onConfirm(type);
|
||||||
}
|
}
|
||||||
|
if (type === GET_CONTACT_TYPE.VIP) {
|
||||||
|
setOpenPopup(false);
|
||||||
|
setOpenDialog(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
const handleAfterBuy = useCallback(async () => {
|
||||||
|
onConfirm(GET_CONTACT_TYPE.VIP);
|
||||||
|
}, [onConfirm]);
|
||||||
return (
|
return (
|
||||||
<Popup rounded className={PREFIX} placement="bottom" open={open} onClose={onCancel}>
|
<Fragment>
|
||||||
<div className={`${PREFIX}__content`}>
|
<Popup rounded className={PREFIX} placement="bottom" open={openPopup} onClose={onCancel}>
|
||||||
<div className={`${PREFIX}__title`}>以下方式任选其一均可获取联系方式</div>
|
<div className={`${PREFIX}__content`}>
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__title`}>以下方式任选其一均可获取联系方式</div>
|
||||||
{GET_CONTACT_TYPE_OPTIONS.map(option => {
|
<div className={`${PREFIX}__body`}>
|
||||||
// 该方式只能用一次, 以后不再出现在选项中
|
{GET_CONTACT_TYPE_OPTIONS.map(option => {
|
||||||
if (option.type === GET_CONTACT_TYPE.SHARE && !hasShareToGetContact()) {
|
return (
|
||||||
return null;
|
<div className={`${PREFIX}__item`} key={option.type}>
|
||||||
}
|
<div className={`${PREFIX}__item-icon ${option.type}`}>
|
||||||
|
<Image mode="aspectFit" src={option.icon} />
|
||||||
return (
|
</div>
|
||||||
<div className={`${PREFIX}__item`} key={option.type}>
|
<div className={`${PREFIX}__item-main`}>
|
||||||
<div className={`${PREFIX}__item-icon ${option.type}`}>
|
<div className="title">{option.title}</div>
|
||||||
<Image mode="aspectFit" src={option.icon} />
|
<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 className={`${PREFIX}__item-main`}>
|
);
|
||||||
<div className="title">{option.title}</div>
|
})}
|
||||||
<div className="desc">{option.desc}</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div className={`${PREFIX}__item-action`}>
|
|
||||||
<Button className={`${PREFIX}__btn`} onClick={handleClick(option.type)}>
|
|
||||||
{option.btnText}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<SafeBottomPadding />
|
||||||
<SafeBottomPadding />
|
</Popup>
|
||||||
</Popup>
|
<Dialog open={openDialog} onClose={onCancel}>
|
||||||
|
<Dialog.Content>
|
||||||
|
<JobBuy onConfirm={handleAfterBuy} buyOnly />
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
|
</Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ export enum DialogStatus {
|
|||||||
JOB_UNABLE_UNLOCK = 'job_unable_unlock',
|
JOB_UNABLE_UNLOCK = 'job_unable_unlock',
|
||||||
// 通告解锁次数用完,购买界面
|
// 通告解锁次数用完,购买界面
|
||||||
JOB_BUY = 'job_buy',
|
JOB_BUY = 'job_buy',
|
||||||
PREACTION_JOB_BUY = 'preaction_job_buy',
|
|
||||||
// 加群二维码
|
// 加群二维码
|
||||||
GROUP_QR_CODE = 'group_qr_code',
|
GROUP_QR_CODE = 'group_qr_code',
|
||||||
// 确定加群
|
// 确定加群
|
||||||
|
@ -82,7 +82,10 @@ function ProductGroupDialog(props: IProps) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 否则:如果有解锁次数,显示是否确定消费。无解锁次数,显示不无次数 UI
|
// 否则:如果有解锁次数,显示是否确定消费。无解锁次数,显示不无次数 UI
|
||||||
const [time, detail] = await Promise.all([requestProductBalance(PRODUCT_CODE), requestGroupDetail(blGroupId)]);
|
const [[time], detail] = await Promise.all([
|
||||||
|
requestProductBalance(PRODUCT_CODE),
|
||||||
|
requestGroupDetail(blGroupId),
|
||||||
|
]);
|
||||||
setGroupDetail(detail);
|
setGroupDetail(detail);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
setStatus(DialogStatus.GROUP_NEED_BUY_ADD);
|
setStatus(DialogStatus.GROUP_NEED_BUY_ADD);
|
||||||
|
@ -102,7 +102,7 @@ function ProductJobWithGroupDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 否则:如果有解锁次数,显示是否确定消费。无解锁次数,显示不无次数 UI
|
// 否则:如果有解锁次数,显示是否确定消费。无解锁次数,显示不无次数 UI
|
||||||
const time = await requestProductBalance(ProductType.AddGroup);
|
const [time] = await requestProductBalance(ProductType.AddGroup);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
setStatus(DialogStatus.JOB_CONTACT_NEED_BUY_GROUP);
|
setStatus(DialogStatus.JOB_CONTACT_NEED_BUY_GROUP);
|
||||||
} else {
|
} else {
|
||||||
@ -119,7 +119,7 @@ function ProductJobWithGroupDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 自动报单
|
// 自动报单
|
||||||
const time = await requestProductBalance(ProductType.GetJob);
|
const [time] = await requestProductBalance(ProductType.GetJob);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
setStatus(DialogStatus.JOB_UNABLE_UNLOCK);
|
setStatus(DialogStatus.JOB_UNABLE_UNLOCK);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3,24 +3,20 @@ import Taro from '@tarojs/taro';
|
|||||||
import { Dialog } from '@taroify/core';
|
import { Dialog } from '@taroify/core';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
import { PrejobPopup } from '@/components/prejob-popup';
|
|
||||||
import { DialogStatus, PREFIX } from '@/components/product-dialog/const';
|
import { DialogStatus, PREFIX } from '@/components/product-dialog/const';
|
||||||
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
||||||
import ContactCustomerService from '@/components/product-dialog/steps-ui/job-contact-customer';
|
import ContactCustomerService from '@/components/product-dialog/steps-ui/job-contact-customer';
|
||||||
import ContactDirect from '@/components/product-dialog/steps-ui/job-contact-direct';
|
import ContactDirect from '@/components/product-dialog/steps-ui/job-contact-direct';
|
||||||
import UnableUnlockContent from '@/components/product-dialog/steps-ui/job-unable';
|
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 { DeclarationType, ProductType } from '@/constants/product';
|
||||||
import { JobDetails } from '@/types/job';
|
import { JobDetails } from '@/types/job';
|
||||||
import { ProductInfo } from '@/types/product';
|
import { ProductInfo } from '@/types/product';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { getSkipPrejobAction, setSkipPrejobAction } from '@/utils/job';
|
|
||||||
import {
|
import {
|
||||||
requestAllBuyProduct,
|
|
||||||
requestProductBalance,
|
|
||||||
requestProductUseRecord,
|
requestProductUseRecord,
|
||||||
|
requestProductBalance,
|
||||||
requestUseProduct,
|
requestUseProduct,
|
||||||
|
requestAllBuyProduct,
|
||||||
} from '@/utils/product';
|
} from '@/utils/product';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
@ -37,33 +33,15 @@ const log = logWithPrefix('product-job-dialog');
|
|||||||
function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||||
const { data, onClose } = props;
|
const { data, onClose } = props;
|
||||||
const [status, setStatus] = useState<DialogStatus>(DialogStatus.LOADING);
|
const [status, setStatus] = useState<DialogStatus>(DialogStatus.LOADING);
|
||||||
const [showContact, setShowContact] = useState(false);
|
|
||||||
const [showPrejob, setShowPrejob] = useState(false);
|
|
||||||
const [publisherAcctNo, setPublisherAcctNo] = useState<string>('');
|
const [publisherAcctNo, setPublisherAcctNo] = useState<string>('');
|
||||||
const initRef = useRef<(skipPreAction?: boolean, skipRecordGet?: boolean) => void | Promise<void>>(() => {});
|
const initRef = useRef(() => {});
|
||||||
|
|
||||||
const handleCloseDialog = useCallback(() => {
|
const handleCloseDialog = useCallback(() => {
|
||||||
setShowContact(false);
|
|
||||||
onClose();
|
onClose();
|
||||||
}, [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 handleAfterBuy = useCallback(async () => {
|
||||||
const time = await requestProductBalance(PRODUCT_CODE);
|
const [time] = await requestProductBalance(PRODUCT_CODE);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
Toast.error('发生错误请重试');
|
Toast.error('发生错误请重试');
|
||||||
onClose();
|
onClose();
|
||||||
@ -71,8 +49,6 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
}
|
}
|
||||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||||
const declarationTypeResult = productInfo.declarationTypeResult;
|
const declarationTypeResult = productInfo.declarationTypeResult;
|
||||||
setShowContact(true);
|
|
||||||
setShowPrejob(false);
|
|
||||||
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
||||||
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
||||||
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
||||||
@ -86,9 +62,8 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initRef.current = async (skipPreAction?: boolean, skipRecordGet?: boolean) => {
|
initRef.current = async () => {
|
||||||
const handleContact = (declarationTypeResult?: ProductInfo['declarationTypeResult']) => {
|
const handleContact = (declarationTypeResult?: ProductInfo['declarationTypeResult']) => {
|
||||||
setShowContact(true);
|
|
||||||
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
||||||
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
||||||
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
||||||
@ -102,34 +77,19 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
// setStatus(DialogStatus.JOB_CONTACT_CS);
|
// setStatus(DialogStatus.JOB_CONTACT_CS);
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
if (!skipRecordGet) {
|
const result = await requestProductUseRecord(PRODUCT_CODE, { jobId: data.id });
|
||||||
const result = await requestProductUseRecord(PRODUCT_CODE, { jobId: data.id });
|
log('requestProductUseRecord result', result);
|
||||||
log('requestProductUseRecord result', result);
|
if (result) {
|
||||||
if (result) {
|
handleContact(result.declarationTypeResult);
|
||||||
handleContact(result.declarationTypeResult);
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const time = await requestProductBalance(PRODUCT_CODE);
|
const [time] = await requestProductBalance(PRODUCT_CODE);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
||||||
setShowContact(true);
|
|
||||||
setStatus(allowBuy ? DialogStatus.JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
setStatus(allowBuy ? DialogStatus.JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
||||||
}
|
|
||||||
// 创建模卡之后可以直接解锁一次, 分享后解锁一次
|
|
||||||
else if (getSkipPrejobAction() || skipPreAction) {
|
|
||||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
|
||||||
setShowPrejob(false);
|
|
||||||
if (!skipPreAction) {
|
|
||||||
setSkipPrejobAction(false);
|
|
||||||
}
|
|
||||||
handleContact(productInfo.declarationTypeResult);
|
|
||||||
} else {
|
} else {
|
||||||
setShowPrejob(true);
|
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||||
setStatus(DialogStatus.PRE_ACTION);
|
handleContact(productInfo.declarationTypeResult);
|
||||||
|
|
||||||
// const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
|
||||||
// handleContact(productInfo.declarationTypeResult);
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.error('出错了,请重试');
|
Toast.error('出错了,请重试');
|
||||||
@ -144,44 +104,21 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
initRef.current();
|
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) {
|
if (status === DialogStatus.LOADING) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<Dialog className={PREFIX} onClose={onClose} open>
|
||||||
<PrejobPopup open={showPrejob} onCancel={handleClosePrejob} onConfirm={handleConfirmPrejob} />
|
<Dialog.Content>
|
||||||
<Dialog className={PREFIX} onClose={onClose} open={showContact}>
|
{status === DialogStatus.JOB_CONTACT_CS && <ContactCustomerService onAfterConfirm={handleCloseDialog} />}
|
||||||
<Dialog.Content>
|
{status === DialogStatus.JOB_CONTACT_DIRECT && (
|
||||||
{status === DialogStatus.JOB_CONTACT_CS && <ContactCustomerService onAfterConfirm={handleCloseDialog} />}
|
<ContactDirect publisherAcctNo={publisherAcctNo} onAfterConfirm={handleCloseDialog} onReport={handleReport} />
|
||||||
{status === DialogStatus.JOB_CONTACT_DIRECT && (
|
)}
|
||||||
<ContactDirect
|
{status === DialogStatus.JOB_BUY && <JobBuy onConfirm={handleAfterBuy} />}
|
||||||
publisherAcctNo={publisherAcctNo}
|
{status === DialogStatus.JOB_UNABLE_UNLOCK && <UnableUnlockContent onConfirm={handleCloseDialog} />}
|
||||||
onAfterConfirm={handleCloseDialog}
|
</Dialog.Content>
|
||||||
onReport={handleReport}
|
</Dialog>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{(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>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ export function CompanyPublishJobDialog(props: IProps) {
|
|||||||
try {
|
try {
|
||||||
const productCode = ProductType.CompanyPublishJob;
|
const productCode = ProductType.CompanyPublishJob;
|
||||||
Taro.showLoading();
|
Taro.showLoading();
|
||||||
const time = await requestProductBalance(productCode);
|
const [time] = await requestProductBalance(productCode);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
setStatus(DialogStatus.COMPANY_PUBLISH_JOB_BUY);
|
setStatus(DialogStatus.COMPANY_PUBLISH_JOB_BUY);
|
||||||
return;
|
return;
|
||||||
|
@ -70,7 +70,7 @@ export default function GroupBuy(props: IProps) {
|
|||||||
if (status !== OrderStatus.Success) {
|
if (status !== OrderStatus.Success) {
|
||||||
throw new Error('order status error');
|
throw new Error('order status error');
|
||||||
}
|
}
|
||||||
const time = await requestProductBalance(ProductType.AddGroup);
|
const [time] = await requestProductBalance(ProductType.AddGroup);
|
||||||
log('handleBuy new addGroupTime', time);
|
log('handleBuy new addGroupTime', time);
|
||||||
onConfirm(time);
|
onConfirm(time);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
|
|||||||
|
|
||||||
import { Button } from '@taroify/core';
|
import { Button } from '@taroify/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Fragment, useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import Badge from '@/components/badge';
|
import Badge from '@/components/badge';
|
||||||
import { PREFIX } from '@/components/product-dialog/const';
|
import { PREFIX } from '@/components/product-dialog/const';
|
||||||
@ -16,7 +16,7 @@ import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
|
|||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
justBuy?: boolean;
|
buyOnly?: boolean;
|
||||||
onConfirm: () => void;
|
onConfirm: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,29 +24,32 @@ interface Item {
|
|||||||
id: ProductSpecId;
|
id: ProductSpecId;
|
||||||
title: string;
|
title: string;
|
||||||
content: string;
|
content: string;
|
||||||
|
buyOnlyContent?: string;
|
||||||
price: string;
|
price: string;
|
||||||
amt: number;
|
amt: number;
|
||||||
badge?: string;
|
badge?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LIST: Item[] = [
|
const LIST: Item[] = [
|
||||||
{ id: ProductSpecId.DailyVIP, title: '日会员', content: '1天内免广告', price: '60播豆', amt: 6, badge: '限时体验' },
|
{ id: ProductSpecId.WeeklyVIP, title: '非会员', content: '每日2次', price: '免费', amt: 0 },
|
||||||
|
{
|
||||||
|
id: ProductSpecId.DailyVIP,
|
||||||
|
title: '日会员',
|
||||||
|
content: '每日+10次',
|
||||||
|
buyOnlyContent: '每日12次',
|
||||||
|
price: '60播豆',
|
||||||
|
amt: 6,
|
||||||
|
badge: '限时体验',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: ProductSpecId.WeeklyVIP,
|
id: ProductSpecId.WeeklyVIP,
|
||||||
title: '周会员',
|
title: '周会员',
|
||||||
content: '7天内免广告',
|
content: '每日+10次',
|
||||||
|
buyOnlyContent: '每日12次',
|
||||||
price: '180播豆',
|
price: '180播豆',
|
||||||
amt: 18,
|
amt: 18,
|
||||||
badge: '4.2折',
|
badge: ' 超值',
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// id: ProductSpecId.NewMonthlyVIP,
|
|
||||||
// title: '月会员',
|
|
||||||
// content: '30天内免广告',
|
|
||||||
// price: '300播豆',
|
|
||||||
// amt: 30,
|
|
||||||
// badge: '1.6折',
|
|
||||||
// },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const log = logWithPrefix('job-buy');
|
const log = logWithPrefix('job-buy');
|
||||||
@ -63,7 +66,7 @@ const subscribe = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function JobBuy(props: IProps) {
|
export default function JobBuy(props: IProps) {
|
||||||
const { onConfirm } = props;
|
const { onConfirm, buyOnly } = props;
|
||||||
const [selectItem, setSelectItem] = useState(LIST[1]);
|
const [selectItem, setSelectItem] = useState(LIST[1]);
|
||||||
|
|
||||||
const handleClickItem = useCallback((newSelectItem: Item) => setSelectItem(newSelectItem), []);
|
const handleClickItem = useCallback((newSelectItem: Item) => setSelectItem(newSelectItem), []);
|
||||||
@ -107,44 +110,47 @@ export default function JobBuy(props: IProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${PREFIX}__job-buy`}>
|
<div className={`${PREFIX}__job-buy`}>
|
||||||
<div className={`${PREFIX}__job-buy__header`}>
|
{buyOnly ? (
|
||||||
{props.justBuy ? (
|
<div className={`${PREFIX}__job-buy__header`}>开通播络会员即可直接查看联系方式</div>
|
||||||
<div>开通播络会员即可直接查看联系方式</div>
|
) : (
|
||||||
) : (
|
<div className={`${PREFIX}__job-buy__header`}>
|
||||||
<Fragment>
|
<div>今日通告对接次数</div>
|
||||||
<div>今日通告对接次数</div>
|
<div className="highlight">已用完</div>
|
||||||
<div className="highlight">已用完</div>
|
</div>
|
||||||
</Fragment>
|
)}
|
||||||
)}
|
{buyOnly ? (
|
||||||
</div>
|
<div className={`${PREFIX}__job-buy__describe`}>每天可获取12个联系方式</div>
|
||||||
<div className={`${PREFIX}__job-buy__describe`}>
|
) : (
|
||||||
{props.justBuy ? (
|
<div className={`${PREFIX}__job-buy__describe`}>
|
||||||
<div>每天可查看10个联系方式</div>
|
<div>请</div>
|
||||||
) : (
|
<div className="highlight">明日</div>
|
||||||
<Fragment>
|
<div>再来 或 </div>
|
||||||
<div>请</div>
|
<div className="highlight">升级会员</div>
|
||||||
<div className="highlight">明日</div>
|
</div>
|
||||||
<div>再来</div>
|
)}
|
||||||
<div className="highlight">升级会员</div>
|
|
||||||
</Fragment>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className={`${PREFIX}__job-buy__container`}>
|
<div className={`${PREFIX}__job-buy__container`}>
|
||||||
{LIST.map(item => (
|
{LIST.map(item => {
|
||||||
<div
|
if (buyOnly && !item.amt) {
|
||||||
key={item.price}
|
return null;
|
||||||
className={classNames(`${PREFIX}__job-buy__item`, {
|
}
|
||||||
selected: item.amt === selectItem.amt,
|
return (
|
||||||
disabled: item.amt === 0,
|
<div
|
||||||
})}
|
key={item.price}
|
||||||
onClick={item.amt === 0 ? undefined : () => handleClickItem(item)}
|
className={classNames(`${PREFIX}__job-buy__item`, {
|
||||||
>
|
selected: item.amt === selectItem.amt,
|
||||||
<div className={classNames(`${PREFIX}__job-buy__item__title`, { free: item.amt === 0 })}>{item.title}</div>
|
disabled: item.amt === 0,
|
||||||
<div className={`${PREFIX}__job-buy__item__content`}>{item.content}</div>
|
})}
|
||||||
<div className={`${PREFIX}__job-buy__item__price`}>{item.price}</div>
|
onClick={item.amt === 0 ? undefined : () => handleClickItem(item)}
|
||||||
{item.badge && <Badge className={`${PREFIX}__job-buy__item__badge`} text={item.badge} />}
|
>
|
||||||
</div>
|
<div className={classNames(`${PREFIX}__job-buy__item__title`, { free: item.amt === 0 })}>
|
||||||
))}
|
{item.title}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__job-buy__item__content`}>{buyOnly ? item.buyOnlyContent : item.content}</div>
|
||||||
|
<div className={`${PREFIX}__job-buy__item__price`}>{item.price}</div>
|
||||||
|
{item.badge && <Badge className={`${PREFIX}__job-buy__item__badge`} text={item.badge} />}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
<Button className={`${PREFIX}__job-buy__button`} onClick={handleBuy}>
|
<Button className={`${PREFIX}__job-buy__button`} onClick={handleBuy}>
|
||||||
{`支付 ${selectItem.amt} 元`}
|
{`支付 ${selectItem.amt} 元`}
|
||||||
|
@ -24,10 +24,6 @@ export enum EventName {
|
|||||||
SELECT_MY_PUBLISH_JOB = 'select_my_publish_job',
|
SELECT_MY_PUBLISH_JOB = 'select_my_publish_job',
|
||||||
EXIT_CHAT_PAGE = 'exit_chat_page',
|
EXIT_CHAT_PAGE = 'exit_chat_page',
|
||||||
VIEW_MATERIAL_SUCCESS = 'view_material_success',
|
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 {
|
export enum OpenSource {
|
||||||
@ -79,7 +75,6 @@ export enum PageUrl {
|
|||||||
Partner = 'pages/partner/index',
|
Partner = 'pages/partner/index',
|
||||||
WithdrawRecord = 'pages/withdraw-record/index',
|
WithdrawRecord = 'pages/withdraw-record/index',
|
||||||
GroupDelegatePublish = 'pages/group-delegate-publish/index',
|
GroupDelegatePublish = 'pages/group-delegate-publish/index',
|
||||||
PartnerShare = 'pages/partner-share/index',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PluginUrl {
|
export enum PluginUrl {
|
||||||
|
@ -13,7 +13,4 @@ export enum CacheKey {
|
|||||||
AGREEMENT_SIGNED = '__agreement_signed__',
|
AGREEMENT_SIGNED = '__agreement_signed__',
|
||||||
CITY_CODES = '__city_codes__',
|
CITY_CODES = '__city_codes__',
|
||||||
JOIN_GROUP_CARD_CLICKED = '__join_group_card_clicked__',
|
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__',
|
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,6 @@ export const PART_PRICE_OPTIONS = PART_EMPLOY_SALARY_OPTIONS.filter(o => !!o.val
|
|||||||
export const FULL_PRICE_OPTIONS = FULL_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 {
|
export enum GET_CONTACT_TYPE {
|
||||||
SHARE = 'share',
|
|
||||||
VIP = 'vip',
|
VIP = 'vip',
|
||||||
VIDEO = 'video',
|
MATERIAL = 'material',
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ const CompanyTabs: TabItemType[] = [
|
|||||||
{
|
{
|
||||||
type: PageType.BatchPublish,
|
type: PageType.BatchPublish,
|
||||||
pagePath: PageUrl.UserBatchPublish,
|
pagePath: PageUrl.UserBatchPublish,
|
||||||
text: '主播群',
|
text: '代招代发',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -98,7 +98,6 @@ export const APP_CONFIG: AppConfigType = {
|
|||||||
PageUrl.Partner,
|
PageUrl.Partner,
|
||||||
PageUrl.WithdrawRecord,
|
PageUrl.WithdrawRecord,
|
||||||
PageUrl.GroupDelegatePublish,
|
PageUrl.GroupDelegatePublish,
|
||||||
PageUrl.PartnerShare,
|
|
||||||
// PageUrl.DevDebug,
|
// PageUrl.DevDebug,
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
|
@ -26,6 +26,7 @@ export enum RESPONSE_ERROR_CODE {
|
|||||||
INSUFFICIENT_BALANCE = 'INSUFFICIENT_BALANCE', // 聊天或者模卡查看超出限制
|
INSUFFICIENT_BALANCE = 'INSUFFICIENT_BALANCE', // 聊天或者模卡查看超出限制
|
||||||
INSUFFICIENT_FREE_BALANCE = 'INSUFFICIENT_FREE_BALANCE', // 免费查看次数(未购买会员)超限
|
INSUFFICIENT_FREE_BALANCE = 'INSUFFICIENT_FREE_BALANCE', // 免费查看次数(未购买会员)超限
|
||||||
BOSS_VIP_EXPIRED = 'BOSS_VIP_EXPIRED', // 会员过期
|
BOSS_VIP_EXPIRED = 'BOSS_VIP_EXPIRED', // 会员过期
|
||||||
|
CHAT_MSG_SEND_NOT_ALLOW = 'CHAT_MSG_SEND_NOT_ALLOW',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const RESPONSE_ERROR_INFO: { [key in RESPONSE_ERROR_CODE]?: string } = {
|
export const RESPONSE_ERROR_INFO: { [key in RESPONSE_ERROR_CODE]?: string } = {
|
||||||
|
@ -170,7 +170,6 @@ export default function AnchorPage() {
|
|||||||
|
|
||||||
const query = getPageQuery();
|
const query = getPageQuery();
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
console.log('哈哈哈 useLoad');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Map, MapProps, Text, Image, Button } from '@tarojs/components';
|
import { Map, MapProps, Text, Image, Button } from '@tarojs/components';
|
||||||
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { CertificationStatusIcon } from '@/components/certification-status';
|
import { CertificationStatusIcon } from '@/components/certification-status';
|
||||||
import CommonDialog from '@/components/common-dialog';
|
import CommonDialog from '@/components/common-dialog';
|
||||||
@ -9,13 +9,13 @@ import DevDiv from '@/components/dev-div';
|
|||||||
import JobRecommendList from '@/components/job-recommend-list';
|
import JobRecommendList from '@/components/job-recommend-list';
|
||||||
import { JoinGroupHint } from '@/components/join-group-hint';
|
import { JoinGroupHint } from '@/components/join-group-hint';
|
||||||
import LoginButton from '@/components/login-button';
|
import LoginButton from '@/components/login-button';
|
||||||
import MaterialGuide from '@/components/material-guide';
|
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
|
import { PrejobPopup } from '@/components/prejob-popup';
|
||||||
import ProductJobDialog from '@/components/product-dialog/job';
|
import ProductJobDialog from '@/components/product-dialog/job';
|
||||||
import { RoleType, EventName, PageUrl } from '@/constants/app';
|
import { RoleType, EventName, PageUrl } from '@/constants/app';
|
||||||
import { CertificationStatusType } from '@/constants/company';
|
import { CertificationStatusType } from '@/constants/company';
|
||||||
import { CollectEventName, ReportEventId } from '@/constants/event';
|
import { CollectEventName, ReportEventId } from '@/constants/event';
|
||||||
import { EMPLOY_TYPE_TITLE_MAP } from '@/constants/job';
|
import { EMPLOY_TYPE_TITLE_MAP, GET_CONTACT_TYPE } from '@/constants/job';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import useRoleType from '@/hooks/user-role-type';
|
import useRoleType from '@/hooks/user-role-type';
|
||||||
@ -76,9 +76,12 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
reportEvent(ReportEventId.CLICK_JOB_CONTACT);
|
reportEvent(ReportEventId.CLICK_JOB_CONTACT);
|
||||||
try {
|
try {
|
||||||
const needCreateMaterial = await isNeedCreateMaterial();
|
const needCreateMaterial = await isNeedCreateMaterial();
|
||||||
if (needCreateMaterial) {
|
|
||||||
setShowMaterialGuide(true);
|
if (data.sourcePlat !== 'bl') {
|
||||||
return;
|
if (needCreateMaterial) {
|
||||||
|
setShowMaterialGuide(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (data.isAuthed) {
|
if (data.isAuthed) {
|
||||||
const toUserId = data.userId;
|
const toUserId = data.userId;
|
||||||
@ -86,19 +89,27 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
Toast.error('不能与自己聊天');
|
Toast.error('不能与自己聊天');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const profile = await requestProfileDetail();
|
|
||||||
const chat = await postCreateChat(toUserId);
|
const chat = await postCreateChat(toUserId);
|
||||||
const materialMessage: IMaterialMessage = {
|
let materialMessage: null | IMaterialMessage = null;
|
||||||
id: profile.id,
|
if (!needCreateMaterial) {
|
||||||
name: profile.name,
|
const profile = await requestProfileDetail();
|
||||||
age: profile.age,
|
materialMessage = {
|
||||||
height: profile.height,
|
id: profile.id,
|
||||||
weight: profile.weight,
|
name: profile.name,
|
||||||
shoeSize: profile.shoeSize,
|
age: profile.age,
|
||||||
gender: profile.gender,
|
height: profile.height,
|
||||||
workedSecCategoryStr: profile.workedSecCategoryStr,
|
weight: profile.weight,
|
||||||
};
|
shoeSize: profile.shoeSize,
|
||||||
navigateTo(PageUrl.MessageChat, { chatId: chat.chatId, material: materialMessage, jobId: data.id });
|
gender: profile.gender,
|
||||||
|
workedSecCategoryStr: profile.workedSecCategoryStr,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
navigateTo(PageUrl.MessageChat, {
|
||||||
|
chatId: chat.chatId,
|
||||||
|
initText: !materialMessage,
|
||||||
|
material: materialMessage,
|
||||||
|
jobId: data.id,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setDialogVisible(true);
|
setDialogVisible(true);
|
||||||
}
|
}
|
||||||
@ -113,7 +124,15 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
}
|
}
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
const handleDialogHidden = useCallback(() => setDialogVisible(false), []);
|
const handleDialogHidden = useCallback(() => {
|
||||||
|
setDialogVisible(false);
|
||||||
|
}, []);
|
||||||
|
const handleConfirmPrejob = useCallback((type: GET_CONTACT_TYPE) => {
|
||||||
|
setShowMaterialGuide(false);
|
||||||
|
if (GET_CONTACT_TYPE.VIP === type) {
|
||||||
|
setDialogVisible(true);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
@ -126,7 +145,9 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{dialogVisible && <ProductJobDialog data={data} onClose={handleDialogHidden} />}
|
{dialogVisible && <ProductJobDialog data={data} onClose={handleDialogHidden} />}
|
||||||
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
|
{showMaterialGuide && (
|
||||||
|
<PrejobPopup onCancel={() => setShowMaterialGuide(false)} onConfirm={handleConfirmPrejob} />
|
||||||
|
)}
|
||||||
<CommonDialog
|
<CommonDialog
|
||||||
content={errorTips}
|
content={errorTips}
|
||||||
confirm="确定"
|
confirm="确定"
|
||||||
@ -183,7 +204,6 @@ export default function JobDetail() {
|
|||||||
const roleType = useRoleType();
|
const roleType = useRoleType();
|
||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
const [data, setData] = useState<JobDetails | null>(null);
|
const [data, setData] = useState<JobDetails | null>(null);
|
||||||
const videoRef = useRef<Taro.RewardedVideoAd | null>(null);
|
|
||||||
const isOwner = roleType === RoleType.Company && userInfo.userId === data?.userId;
|
const isOwner = roleType === RoleType.Company && userInfo.userId === data?.userId;
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
|
||||||
@ -220,60 +240,12 @@ 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 () => {
|
useLoad(async () => {
|
||||||
switchRoleType(RoleType.Anchor);
|
const query = getPageQuery<Pick<JobDetails, 'id'> & { c: string; share: string }>();
|
||||||
|
|
||||||
const query = getPageQuery<Pick<JobDetails, 'id'> & { c: string }>();
|
if (query?.share === 'true') {
|
||||||
|
switchRoleType(RoleType.Anchor);
|
||||||
|
}
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
const jobId = query?.id;
|
const jobId = query?.id;
|
||||||
if (!jobId) {
|
if (!jobId) {
|
||||||
|
@ -3,8 +3,8 @@ import Taro, { useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
|||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import { AgreementPopup } from '@/components/agreement-popup';
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import { LoginGuide } from '@/components/login-guide';
|
|
||||||
import MaterialGuide from '@/components/material-guide';
|
import MaterialGuide from '@/components/material-guide';
|
||||||
import { EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
import { EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { EmployType, JOB_PAGE_TABS, SortType } from '@/constants/job';
|
import { EmployType, JOB_PAGE_TABS, SortType } from '@/constants/job';
|
||||||
@ -21,8 +21,7 @@ import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
|||||||
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
import { isNeedCreateMaterial } from '@/utils/user';
|
import { getAgreementSigned, setAgreementSigned } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'job';
|
const PREFIX = 'job';
|
||||||
@ -40,9 +39,19 @@ export default function Job() {
|
|||||||
longitude: location.longitude,
|
longitude: location.longitude,
|
||||||
});
|
});
|
||||||
const [showMaterialGuide, setShowMaterialGuide] = useState(false);
|
const [showMaterialGuide, setShowMaterialGuide] = useState(false);
|
||||||
const [showAuthorize, setShowAuthorize] = useState(false);
|
|
||||||
const cityValuesChangedRef = useRef(false);
|
const cityValuesChangedRef = useRef(false);
|
||||||
|
const [openAgreementPopup, setAgreementPopupOpen] = useState(typeof getAgreementSigned() !== 'boolean');
|
||||||
|
|
||||||
|
const getLocation = async () => {
|
||||||
|
if (await isNotNeedAuthorizeLocation()) {
|
||||||
|
log('not need authorize location');
|
||||||
|
requestLocation();
|
||||||
|
} else {
|
||||||
|
log('show authorize location dialog');
|
||||||
|
// setShowAuthorize(true);
|
||||||
|
requestLocation(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
const handleTypeChange = useCallback(value => setTabType(value), []);
|
const handleTypeChange = useCallback(value => setTabType(value), []);
|
||||||
|
|
||||||
const handleClickCity = useCallback(
|
const handleClickCity = useCallback(
|
||||||
@ -76,12 +85,19 @@ export default function Job() {
|
|||||||
setCityCode(code);
|
setCityCode(code);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleAfterBindPhone = useCallback(async () => {
|
const handleCancelAgreementPopup = () => {
|
||||||
if (await isNeedCreateMaterial()) {
|
setAgreementPopupOpen(false);
|
||||||
setShowMaterialGuide(true);
|
setAgreementSigned(false);
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
|
getLocation();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleConfirmAgreementPopup = () => {
|
||||||
|
setAgreementPopupOpen(false);
|
||||||
|
setAgreementSigned(true);
|
||||||
|
|
||||||
|
getLocation();
|
||||||
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
||||||
return () => {
|
return () => {
|
||||||
@ -104,13 +120,8 @@ export default function Job() {
|
|||||||
setSortType(type);
|
setSortType(type);
|
||||||
}
|
}
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
if (await isNotNeedAuthorizeLocation()) {
|
if (!openAgreementPopup) {
|
||||||
log('not need authorize location');
|
getLocation();
|
||||||
requestLocation();
|
|
||||||
} else {
|
|
||||||
log('show authorize location dialog');
|
|
||||||
setShowAuthorize(true);
|
|
||||||
requestLocation(true);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -149,8 +160,12 @@ export default function Job() {
|
|||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
<div>
|
<div>
|
||||||
<LoginGuide disabled={showAuthorize} onAfterBind={handleAfterBindPhone} />
|
|
||||||
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
|
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
|
||||||
|
<AgreementPopup
|
||||||
|
open={openAgreementPopup}
|
||||||
|
onCancel={handleCancelAgreementPopup}
|
||||||
|
onConfirm={handleConfirmAgreementPopup}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</HomePage>
|
</HomePage>
|
||||||
);
|
);
|
||||||
|
@ -15,7 +15,7 @@ import useLocation from '@/hooks/use-location';
|
|||||||
import { MaterialProfile } from '@/types/material';
|
import { MaterialProfile } from '@/types/material';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent } from '@/utils/event';
|
import { collectEvent } from '@/utils/event';
|
||||||
import { isFullTimePriceRequired, isPartTimePriceRequired, setSkipPrejobAction } from '@/utils/job';
|
import { isFullTimePriceRequired, isPartTimePriceRequired } from '@/utils/job';
|
||||||
import { updateProfile, subscribeMaterialMessage } from '@/utils/material';
|
import { updateProfile, subscribeMaterialMessage } from '@/utils/material';
|
||||||
import { navigateBack } from '@/utils/route';
|
import { navigateBack } from '@/utils/route';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
@ -110,7 +110,6 @@ export default function MaterialCreateProfile() {
|
|||||||
// 发起订阅不能在异步任务中,保证是第一个
|
// 发起订阅不能在异步任务中,保证是第一个
|
||||||
await Promise.all([subscribeMaterialMessage(), updateProfile(data)]);
|
await Promise.all([subscribeMaterialMessage(), updateProfile(data)]);
|
||||||
}
|
}
|
||||||
setSkipPrejobAction();
|
|
||||||
Taro.eventCenter.trigger(EventName.CREATE_PROFILE);
|
Taro.eventCenter.trigger(EventName.CREATE_PROFILE);
|
||||||
nextType ? setGroupType(nextType) : navigateBack(2);
|
nextType ? setGroupType(nextType) : navigateBack(2);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -72,6 +72,7 @@ interface ILoadProps {
|
|||||||
chatId: string;
|
chatId: string;
|
||||||
jobId?: string;
|
jobId?: string;
|
||||||
job?: string;
|
job?: string;
|
||||||
|
initText?: boolean;
|
||||||
material?: string;
|
material?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,6 +91,7 @@ export default function MessageChat() {
|
|||||||
const [input, setInput] = useState('');
|
const [input, setInput] = useState('');
|
||||||
const [showMore, setShowMore] = useState(false);
|
const [showMore, setShowMore] = useState(false);
|
||||||
const [chat, setChat] = useState<IChatInfo | null>(null);
|
const [chat, setChat] = useState<IChatInfo | null>(null);
|
||||||
|
const [initText, setInitText] = useState('');
|
||||||
const [reject, setReject] = useState<boolean>(false);
|
const [reject, setReject] = useState<boolean>(false);
|
||||||
const [receiver, setReceiver] = useState<IChatUser | null>(null);
|
const [receiver, setReceiver] = useState<IChatUser | null>(null);
|
||||||
const [messages, setMessages] = useState<IChatMessage[]>([]);
|
const [messages, setMessages] = useState<IChatMessage[]>([]);
|
||||||
@ -100,7 +102,7 @@ export default function MessageChat() {
|
|||||||
const [material, setMaterial] = useState<IMaterialMessage>();
|
const [material, setMaterial] = useState<IMaterialMessage>();
|
||||||
const [scrollItemId, setScrollItemId] = useState<string>();
|
const [scrollItemId, setScrollItemId] = useState<string>();
|
||||||
const scrollToLowerRef = useRef(false);
|
const scrollToLowerRef = useRef(false);
|
||||||
const autoSendRef = useRef({ sendJob: false, sendMaterial: false });
|
const autoSendRef = useRef({ sendJob: false, sendMaterial: false, sendText: false });
|
||||||
const loadMoreRef = useRef(async (chatId: string, currentMessages: IChatMessage[], forceScroll?: boolean) => {
|
const loadMoreRef = useRef(async (chatId: string, currentMessages: IChatMessage[], forceScroll?: boolean) => {
|
||||||
try {
|
try {
|
||||||
const lastMsgId = last(currentMessages)?.msgId;
|
const lastMsgId = last(currentMessages)?.msgId;
|
||||||
@ -167,6 +169,9 @@ export default function MessageChat() {
|
|||||||
) {
|
) {
|
||||||
tips = '今日申请交换联系方式次数已用完,当前每日限制为5次';
|
tips = '今日申请交换联系方式次数已用完,当前每日限制为5次';
|
||||||
duration = 3000;
|
duration = 3000;
|
||||||
|
} else if (errorCode === RESPONSE_ERROR_CODE.CHAT_MSG_SEND_NOT_ALLOW) {
|
||||||
|
tips = '账号已在另一台设备上切换身份,本条消息未发送成功,请在本设备重新切换身份后,再发送消息';
|
||||||
|
duration = 5000;
|
||||||
}
|
}
|
||||||
tips.length > 7 ? Toast.info(tips, duration) : Toast.error(tips, duration);
|
tips.length > 7 ? Toast.info(tips, duration) : Toast.error(tips, duration);
|
||||||
}
|
}
|
||||||
@ -275,7 +280,11 @@ export default function MessageChat() {
|
|||||||
}
|
}
|
||||||
job && handleSendJobMessage();
|
job && handleSendJobMessage();
|
||||||
material && handleSendMaterialMessage();
|
material && handleSendMaterialMessage();
|
||||||
}, [chat, job, material, handleSendJobMessage, handleSendMaterialMessage]);
|
if (initText && !autoSendRef.current.sendText) {
|
||||||
|
autoSendRef.current.sendText = true;
|
||||||
|
handleSendMessage({ type: MessageType.Text, content: '你好,想了解下这个岗位' });
|
||||||
|
}
|
||||||
|
}, [chat, job, material, handleSendJobMessage, handleSendMaterialMessage, initText, handleSendMessage]);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
const query = getPageQuery<ILoadProps>();
|
const query = getPageQuery<ILoadProps>();
|
||||||
@ -306,6 +315,9 @@ export default function MessageChat() {
|
|||||||
setScrollItemId(getScrollItemId(last(chatDetail.messages)?.msgId));
|
setScrollItemId(getScrollItemId(last(chatDetail.messages)?.msgId));
|
||||||
parseJob && setJob(parseJob);
|
parseJob && setJob(parseJob);
|
||||||
parseMaterial && setMaterial(parseMaterial);
|
parseMaterial && setMaterial(parseMaterial);
|
||||||
|
if (!parseMaterial && query.initText && watchType === ChatWatchType.AnchorReject) {
|
||||||
|
setInitText('你好,想了解下这个岗位');
|
||||||
|
}
|
||||||
Taro.setNavigationBarTitle({ title: toUserInfo.nickName });
|
Taro.setNavigationBarTitle({ title: toUserInfo.nickName });
|
||||||
setReceiver(toUserInfo);
|
setReceiver(toUserInfo);
|
||||||
setReject(!watchStatus);
|
setReject(!watchStatus);
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
export default definePageConfig({
|
|
||||||
navigationBarTitleText: '分享',
|
|
||||||
});
|
|
@ -1,57 +0,0 @@
|
|||||||
@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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
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>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,88 +1,94 @@
|
|||||||
import { Image } from '@tarojs/components';
|
import { Image } from '@tarojs/components';
|
||||||
import { useLoad } from '@tarojs/taro';
|
import { useLoad } from '@tarojs/taro';
|
||||||
|
|
||||||
import { useState } from 'react';
|
// import { useEffect, useState } from 'react';
|
||||||
|
// import { AgreementPopup } from '@/components/agreement-popup';
|
||||||
import { AgreementPopup } from '@/components/agreement-popup';
|
// import Slogan from '@/components/slogan';
|
||||||
import Slogan from '@/components/slogan';
|
// import { PageUrl, RoleType } from '@/constants/app';
|
||||||
import { PageUrl, RoleType } from '@/constants/app';
|
// import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST } from '@/hooks/use-config';
|
||||||
import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST } from '@/hooks/use-config';
|
// import store from '@/store';
|
||||||
import store from '@/store';
|
// import { changeHomePage } from '@/store/actions';
|
||||||
import { changeHomePage } from '@/store/actions';
|
import { RoleType } from '@/constants/app';
|
||||||
import { getRoleType, switchDefaultTab, switchRoleType } from '@/utils/app';
|
import { getRoleType, switchDefaultTab, switchRoleType } from '@/utils/app';
|
||||||
import { switchTab } from '@/utils/route';
|
// import { switchTab } from '@/utils/route';
|
||||||
import { getAgreementSigned, setAgreementSigned } from '@/utils/user';
|
// import { getAgreementSigned, setAgreementSigned } from '@/utils/user';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'page-start';
|
const PREFIX = 'page-start';
|
||||||
|
|
||||||
export default function Start() {
|
export default function Start() {
|
||||||
const [open, setOpen] = useState(typeof getAgreementSigned() !== 'boolean');
|
// const [open, setOpen] = useState(typeof getAgreementSigned() !== 'boolean');
|
||||||
const mode = getRoleType();
|
const mode = getRoleType();
|
||||||
useLoad(() => {
|
useLoad(() => {
|
||||||
switchDefaultTab();
|
if (!mode) {
|
||||||
|
switchRoleType(RoleType.Anchor).then(() => {
|
||||||
|
switchDefaultTab();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
switchDefaultTab();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const handleAnchor = async () => {
|
// const handleAnchor = async () => {
|
||||||
await switchRoleType(RoleType.Anchor);
|
// await switchRoleType(RoleType.Anchor);
|
||||||
store.dispatch(changeHomePage(ANCHOR_TAB_LIST[0].type));
|
// store.dispatch(changeHomePage(ANCHOR_TAB_LIST[0].type));
|
||||||
await switchTab(ANCHOR_TAB_LIST[0].pagePath as PageUrl);
|
// await switchTab(ANCHOR_TAB_LIST[0].pagePath as PageUrl);
|
||||||
};
|
// };
|
||||||
|
|
||||||
const handleCompany = async () => {
|
// const handleCompany = async () => {
|
||||||
await switchRoleType(RoleType.Company);
|
// await switchRoleType(RoleType.Company);
|
||||||
store.dispatch(changeHomePage(COMPANY_TAB_LIST[0].type));
|
// store.dispatch(changeHomePage(COMPANY_TAB_LIST[0].type));
|
||||||
await switchTab(COMPANY_TAB_LIST[0].pagePath as PageUrl);
|
// await switchTab(COMPANY_TAB_LIST[0].pagePath as PageUrl);
|
||||||
};
|
// };
|
||||||
|
|
||||||
const handleCancel = () => {
|
// const handleCancel = () => {
|
||||||
setOpen(false);
|
// setOpen(false);
|
||||||
setAgreementSigned(false);
|
// setAgreementSigned(false);
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
const handleConfirm = () => {
|
// const handleConfirm = () => {
|
||||||
setOpen(false);
|
// setOpen(false);
|
||||||
setAgreementSigned(true);
|
// setAgreementSigned(true);
|
||||||
};
|
// };
|
||||||
return (
|
return (
|
||||||
<div className={`${PREFIX} ${mode ? '' : 'color-bg'}`}>
|
<div className={`${PREFIX}`}>
|
||||||
{mode && (
|
{/*{mode && (*/}
|
||||||
<div className={`${PREFIX}__app`}>
|
<div className={`${PREFIX}__app`}>
|
||||||
<Image className={`${PREFIX}__icon`} mode="aspectFit" src={require('@/statics/svg/slogan.svg')} />
|
<Image className={`${PREFIX}__icon`} mode="aspectFit" src={require('@/statics/svg/slogan.svg')} />
|
||||||
<div className={`${PREFIX}__text`}>每天推荐海量高薪通告 </div>
|
<div className={`${PREFIX}__text`}>每天推荐海量高薪通告 </div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
{/*)}*/}
|
||||||
{!mode && (
|
{!mode && (
|
||||||
<>
|
<>
|
||||||
<div className={`${PREFIX}__role-app`}>
|
{/*<div className={`${PREFIX}__role-app`}>*/}
|
||||||
<div className={`${PREFIX}__greet`}>Hi,很高兴见到你</div>
|
{/* <div className={`${PREFIX}__greet`}>Hi,很高兴见到你</div>*/}
|
||||||
<div className={`${PREFIX}__title`}>请选择您的身份</div>
|
{/* <div className={`${PREFIX}__title`}>请选择您的身份</div>*/}
|
||||||
<div className={`${PREFIX}__card`} onClick={handleAnchor}>
|
{/* <div className={`${PREFIX}__card`} onClick={handleAnchor}>*/}
|
||||||
<Image
|
{/* <Image*/}
|
||||||
className={`${PREFIX}__avatar anchor`}
|
{/* className={`${PREFIX}__avatar anchor`}*/}
|
||||||
src="https://publiccdn.neighbourhood.com.cn/img/avatar_f.png"
|
{/* src="https://publiccdn.neighbourhood.com.cn/img/avatar_f.png"*/}
|
||||||
mode="aspectFill"
|
{/* mode="aspectFill"*/}
|
||||||
/>
|
{/* />*/}
|
||||||
<div className={`${PREFIX}__content`}>
|
{/* <div className={`${PREFIX}__content`}>*/}
|
||||||
<div className="title">我是主播</div>
|
{/* <div className="title">我是主播</div>*/}
|
||||||
<div className="desc">我要找工作</div>
|
{/* <div className="desc">我要找工作</div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<Image src={require('@/statics/svg/arrow-right.svg')} mode="aspectFill" className={`${PREFIX}__arrow`} />
|
{/* <Image src={require('@/statics/svg/arrow-right.svg')} mode="aspectFill" className={`${PREFIX}__arrow`} />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div className={`${PREFIX}__card`} onClick={handleCompany}>
|
{/* <div className={`${PREFIX}__card`} onClick={handleCompany}>*/}
|
||||||
<Image
|
{/* <Image*/}
|
||||||
className={`${PREFIX}__avatar company`}
|
{/* className={`${PREFIX}__avatar company`}*/}
|
||||||
src="https://publiccdn.neighbourhood.com.cn/img/avatar_m.png"
|
{/* src="https://publiccdn.neighbourhood.com.cn/img/avatar_m.png"*/}
|
||||||
mode="aspectFill"
|
{/* mode="aspectFill"*/}
|
||||||
/>
|
{/* />*/}
|
||||||
<div className={`${PREFIX}__content`}>
|
{/* <div className={`${PREFIX}__content`}>*/}
|
||||||
<div className="title">我是企业</div>
|
{/* <div className="title">我是企业</div>*/}
|
||||||
<div className="desc">我要招主播</div>
|
{/* <div className="desc">我要招主播</div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<Image src={require('@/statics/svg/arrow-right.svg')} mode="aspectFill" className={`${PREFIX}__arrow`} />
|
{/* <Image src={require('@/statics/svg/arrow-right.svg')} mode="aspectFill" className={`${PREFIX}__arrow`} />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/*</div>*/}
|
||||||
<Slogan />
|
{/*<Slogan />*/}
|
||||||
<AgreementPopup open={open} onCancel={handleCancel} onConfirm={handleConfirm} />
|
{/*<AgreementPopup open={open} onCancel={handleCancel} onConfirm={handleConfirm} />*/}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,9 +21,9 @@
|
|||||||
padding-top: var(--tabs-wrap-height);
|
padding-top: var(--tabs-wrap-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
.taroify-tabs__nav .taroify-tabs__tab:nth-child(2) .taroify-badge-wrapper {
|
//.taroify-tabs__nav .taroify-tabs__tab:nth-child(2) .taroify-badge-wrapper {
|
||||||
left: 18px;
|
// left: 18px;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__star {
|
&__star {
|
||||||
|
@ -106,7 +106,7 @@ export default function BizService() {
|
|||||||
title={
|
title={
|
||||||
<>
|
<>
|
||||||
主播群
|
主播群
|
||||||
<Image src={require('@/statics/svg/star.svg')} className={`${PREFIX}__star`} />
|
{/*<Image src={require('@/statics/svg/star.svg')} className={`${PREFIX}__star`} />*/}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
@ -49,6 +49,7 @@ export type JobDetails = JobInfo &
|
|||||||
declarationType: DeclarationType; // 报单类型
|
declarationType: DeclarationType; // 报单类型
|
||||||
userId: string; // 发布人的 userId
|
userId: string; // 发布人的 userId
|
||||||
verifyFailReason?: string; // 审核不通过的原因
|
verifyFailReason?: string; // 审核不通过的原因
|
||||||
|
sourcePlat?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface JobManageInfo {
|
export interface JobManageInfo {
|
||||||
|
@ -13,6 +13,7 @@ export interface ProductInfo {
|
|||||||
balance: number;
|
balance: number;
|
||||||
created: number;
|
created: number;
|
||||||
updated: number;
|
updated: number;
|
||||||
|
isPaidVip?: boolean;
|
||||||
// 报单类型信息,只有 use 接口返回值才有
|
// 报单类型信息,只有 use 接口返回值才有
|
||||||
declarationTypeResult?: DeclarationTypeResult;
|
declarationTypeResult?: DeclarationTypeResult;
|
||||||
}
|
}
|
||||||
|
@ -131,19 +131,3 @@ export function postPublishJob(jobId: string) {
|
|||||||
export function postCloseJob(jobId: string) {
|
export function postCloseJob(jobId: string) {
|
||||||
return http.post(API.CLOSE_JOB, { data: { jobId }, contentType: 'application/x-www-form-urlencoded' });
|
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);
|
|
||||||
}
|
|
||||||
|
@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
|
|||||||
|
|
||||||
import { ProductType, QrCodeType } from '@/constants/product';
|
import { ProductType, QrCodeType } from '@/constants/product';
|
||||||
import http from '@/http';
|
import http from '@/http';
|
||||||
import { API, DOMAIN } from '@/http/api';
|
import { API } from '@/http/api';
|
||||||
import {
|
import {
|
||||||
ProductInfo,
|
ProductInfo,
|
||||||
GetProductDetailRequest,
|
GetProductDetailRequest,
|
||||||
@ -54,13 +54,13 @@ export async function requestUseProduct(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取某个产品的剩余解锁次数
|
// 获取某个产品的剩余解锁次数
|
||||||
export async function requestProductBalance(productCode: ProductType) {
|
export async function requestProductBalance(productCode: ProductType): Promise<[number, boolean | undefined]> {
|
||||||
const data: GetProductDetailRequest = { productCode, userId: getUserId() };
|
const data: GetProductDetailRequest = { productCode, userId: getUserId() };
|
||||||
const { balance } = await http.post<ProductInfo>(API.GET_PRODUCT_DETAIL, {
|
const { balance, isPaidVip } = await http.post<ProductInfo>(API.GET_PRODUCT_DETAIL, {
|
||||||
data,
|
data,
|
||||||
contentType: 'application/x-www-form-urlencoded',
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
});
|
});
|
||||||
return balance;
|
return [balance, isPaidVip];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否可以购买某一个产品
|
// 是否可以购买某一个产品
|
||||||
|
Reference in New Issue
Block a user