revert ad
This commit is contained in:
@ -17,22 +17,25 @@ import './index.less';
|
||||
|
||||
const PREFIX = 'join-group-hint';
|
||||
|
||||
const DEFAULT_GROUP = {
|
||||
name: '播络主播招聘群',
|
||||
serviceUrl: 'https://work.weixin.qq.com/kfid/kfcc60ac7b6420787a8',
|
||||
};
|
||||
|
||||
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)) {
|
||||
if (group && !checkCityCode(cityCode)) {
|
||||
return;
|
||||
}
|
||||
if (group) {
|
||||
openCustomerServiceChat(group.serviceUrl);
|
||||
Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true);
|
||||
setClicked(true);
|
||||
}
|
||||
openCustomerServiceChat(group ? group.serviceUrl : DEFAULT_GROUP.serviceUrl);
|
||||
Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true);
|
||||
setClicked(true);
|
||||
}, [cityCode, group]);
|
||||
if (!group || !validCityCode(cityCode) || clicked) {
|
||||
if (!validCityCode(cityCode) || clicked) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -44,7 +47,9 @@ export function JoinGroupHint() {
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<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>
|
||||
<div className={`${PREFIX}__right`}>
|
||||
|
@ -3,11 +3,7 @@ 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 {
|
||||
@ -19,13 +15,6 @@ interface IProps {
|
||||
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',
|
||||
@ -33,22 +22,11 @@ const GET_CONTACT_TYPE_OPTIONS = [
|
||||
desc: '开通会员每天可查看5个',
|
||||
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);
|
||||
}
|
||||
onConfirm(type);
|
||||
};
|
||||
return (
|
||||
<Popup rounded className={PREFIX} placement="bottom" open={open} onClose={onCancel}>
|
||||
@ -56,11 +34,6 @@ export function PrejobPopup({ open, onCancel, onConfirm }: IProps) {
|
||||
<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}`}>
|
||||
|
@ -14,7 +14,6 @@ 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',
|
||||
// 确定加群
|
||||
|
@ -3,23 +3,20 @@ 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 {
|
||||
requestAllBuyProduct,
|
||||
requestProductBalance,
|
||||
requestProductUseRecord,
|
||||
requestProductBalance,
|
||||
requestUseProduct,
|
||||
requestAllBuyProduct,
|
||||
} from '@/utils/product';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
@ -36,32 +33,13 @@ 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<(skipPreAction?: boolean, skipRecordGet?: boolean) => void | Promise<void>>(() => {});
|
||||
const initRef = useRef(() => {});
|
||||
|
||||
const handleCloseDialog = useCallback(() => {
|
||||
setShowContact(false);
|
||||
onClose();
|
||||
}, [onClose]);
|
||||
|
||||
const handleClosePrejob = useCallback(() => {
|
||||
setShowPrejob(false);
|
||||
onClose();
|
||||
}, []);
|
||||
|
||||
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) {
|
||||
@ -71,8 +49,6 @@ 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);
|
||||
@ -86,9 +62,8 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
}, [data]);
|
||||
|
||||
useEffect(() => {
|
||||
initRef.current = async (skipPreAction?: boolean, skipRecordGet?: boolean) => {
|
||||
initRef.current = async () => {
|
||||
const handleContact = (declarationTypeResult?: ProductInfo['declarationTypeResult']) => {
|
||||
setShowContact(true);
|
||||
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
||||
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
||||
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
||||
@ -102,32 +77,21 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
// setStatus(DialogStatus.JOB_CONTACT_CS);
|
||||
// return;
|
||||
// }
|
||||
if (!skipRecordGet) {
|
||||
const result = await requestProductUseRecord(PRODUCT_CODE, { jobId: data.id });
|
||||
log('requestProductUseRecord result', result);
|
||||
if (result) {
|
||||
handleContact(result.declarationTypeResult);
|
||||
return;
|
||||
}
|
||||
const result = await requestProductUseRecord(PRODUCT_CODE, { jobId: data.id });
|
||||
log('requestProductUseRecord result', result);
|
||||
if (result) {
|
||||
handleContact(result.declarationTypeResult);
|
||||
return;
|
||||
}
|
||||
const [time, isPaidVip] = await requestProductBalance(PRODUCT_CODE);
|
||||
const [time] = await requestProductBalance(PRODUCT_CODE);
|
||||
if (time <= 0) {
|
||||
// const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
||||
setShowContact(true);
|
||||
setStatus(DialogStatus.JOB_UNABLE_UNLOCK);
|
||||
} else if (isPaidVip || skipPreAction) {
|
||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||
setShowPrejob(false);
|
||||
handleContact(productInfo.declarationTypeResult);
|
||||
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
||||
setStatus(allowBuy ? DialogStatus.JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
||||
} else {
|
||||
setShowPrejob(true);
|
||||
setStatus(DialogStatus.PRE_ACTION);
|
||||
|
||||
// const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||
// handleContact(productInfo.declarationTypeResult);
|
||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||
handleContact(productInfo.declarationTypeResult);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
Toast.error('出错了,请重试');
|
||||
handleCloseDialog();
|
||||
} finally {
|
||||
@ -140,44 +104,21 @@ 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 (
|
||||
<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>
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
|
||||
|
||||
import { Button } from '@taroify/core';
|
||||
import classNames from 'classnames';
|
||||
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import Badge from '@/components/badge';
|
||||
import { PREFIX } from '@/components/product-dialog/const';
|
||||
@ -16,7 +16,6 @@ import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
interface IProps {
|
||||
justBuy?: boolean;
|
||||
onConfirm: () => void;
|
||||
}
|
||||
|
||||
@ -30,23 +29,23 @@ interface 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: '每日+5次',
|
||||
price: '60播豆',
|
||||
amt: 6,
|
||||
badge: '限时体验',
|
||||
},
|
||||
{
|
||||
id: ProductSpecId.WeeklyVIP,
|
||||
title: '周会员',
|
||||
content: '7天内免广告',
|
||||
content: '每日+5次',
|
||||
price: '180播豆',
|
||||
amt: 18,
|
||||
badge: '4.2折',
|
||||
badge: ' 超值',
|
||||
},
|
||||
// {
|
||||
// id: ProductSpecId.NewMonthlyVIP,
|
||||
// title: '月会员',
|
||||
// content: '30天内免广告',
|
||||
// price: '300播豆',
|
||||
// amt: 30,
|
||||
// badge: '1.6折',
|
||||
// },
|
||||
];
|
||||
|
||||
const log = logWithPrefix('job-buy');
|
||||
@ -108,26 +107,14 @@ export default function JobBuy(props: IProps) {
|
||||
return (
|
||||
<div className={`${PREFIX}__job-buy`}>
|
||||
<div className={`${PREFIX}__job-buy__header`}>
|
||||
{props.justBuy ? (
|
||||
<div>开通播络会员即可直接查看联系方式</div>
|
||||
) : (
|
||||
<Fragment>
|
||||
<div>今日通告对接次数</div>
|
||||
<div className="highlight">已用完</div>
|
||||
</Fragment>
|
||||
)}
|
||||
<div>今日通告对接次数</div>
|
||||
<div className="highlight">已用完</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__job-buy__describe`}>
|
||||
{props.justBuy ? (
|
||||
<div>每天可查看10个联系方式</div>
|
||||
) : (
|
||||
<Fragment>
|
||||
<div>请</div>
|
||||
<div className="highlight">明日</div>
|
||||
<div>再来</div>
|
||||
<div className="highlight">升级会员</div>
|
||||
</Fragment>
|
||||
)}
|
||||
<div>请</div>
|
||||
<div className="highlight">明日</div>
|
||||
<div>再来 或 </div>
|
||||
<div className="highlight">升级会员</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__job-buy__container`}>
|
||||
{LIST.map(item => (
|
||||
|
@ -24,10 +24,6 @@ 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 {
|
||||
@ -79,7 +75,6 @@ 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 {
|
||||
|
@ -13,6 +13,4 @@ export enum CacheKey {
|
||||
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__',
|
||||
}
|
||||
|
@ -176,7 +176,5 @@ 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 enum GET_CONTACT_TYPE {
|
||||
SHARE = 'share',
|
||||
VIP = 'vip',
|
||||
VIDEO = 'video',
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ const CompanyTabs: TabItemType[] = [
|
||||
{
|
||||
type: PageType.BatchPublish,
|
||||
pagePath: PageUrl.UserBatchPublish,
|
||||
text: '主播群',
|
||||
text: '代招代发',
|
||||
},
|
||||
];
|
||||
|
||||
@ -98,7 +98,6 @@ export const APP_CONFIG: AppConfigType = {
|
||||
PageUrl.Partner,
|
||||
PageUrl.WithdrawRecord,
|
||||
PageUrl.GroupDelegatePublish,
|
||||
PageUrl.PartnerShare,
|
||||
// PageUrl.DevDebug,
|
||||
],
|
||||
window: {
|
||||
|
@ -170,7 +170,6 @@ export default function AnchorPage() {
|
||||
|
||||
const query = getPageQuery();
|
||||
getInviteCodeFromQueryAndUpdate(query);
|
||||
console.log('哈哈哈 useLoad');
|
||||
|
||||
try {
|
||||
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Map, MapProps, Text, Image, Button } from '@tarojs/components';
|
||||
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 CommonDialog from '@/components/common-dialog';
|
||||
@ -183,7 +183,6 @@ 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();
|
||||
|
||||
@ -220,56 +219,6 @@ 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 () => {
|
||||
const query = getPageQuery<Pick<JobDetails, 'id'> & { c: string; share: string }>();
|
||||
|
||||
|
@ -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>
|
||||
);
|
||||
}
|
@ -131,11 +131,3 @@ 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 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 http from '@/http';
|
||||
import { API, DOMAIN } from '@/http/api';
|
||||
import { API } from '@/http/api';
|
||||
import {
|
||||
ProductInfo,
|
||||
GetProductDetailRequest,
|
||||
|
Reference in New Issue
Block a user