feat:
This commit is contained in:
@ -1,14 +1,15 @@
|
||||
import { Button, Image } from '@tarojs/components';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
import { Popup, Dialog } from '@taroify/core';
|
||||
import { Dialog, Popup } 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 { PageUrl } from '@/constants/app';
|
||||
import { CacheKey } from '@/constants/cache-key';
|
||||
import { GET_CONTACT_TYPE } from '@/constants/job';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
|
||||
import { switchTab, navigateTo } from '@/utils/route';
|
||||
import './index.less';
|
||||
|
||||
interface IProps {
|
||||
@ -33,11 +34,19 @@ const GET_CONTACT_TYPE_OPTIONS = [
|
||||
desc: '开通会员每天免费查看',
|
||||
btnText: '开通',
|
||||
},
|
||||
{
|
||||
type: GET_CONTACT_TYPE.GROUP,
|
||||
icon: 'https://publiccdn.neighbourhood.com.cn/img/group-avatar.png',
|
||||
title: '进群领会员(免费报单)',
|
||||
desc: '群内定期发放会员,免费报单',
|
||||
btnText: '进群',
|
||||
},
|
||||
];
|
||||
|
||||
export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
||||
const [openPopup, setOpenPopup] = useState(true);
|
||||
const [openDialog, setOpenDialog] = useState(false);
|
||||
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_POPUP_CLICKED));
|
||||
const handleClick = (type: GET_CONTACT_TYPE) => () => {
|
||||
if (type === GET_CONTACT_TYPE.MATERIAL) {
|
||||
navigateTo(PageUrl.MaterialUploadVideo);
|
||||
@ -47,6 +56,12 @@ export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
||||
setOpenPopup(false);
|
||||
setOpenDialog(true);
|
||||
}
|
||||
if (type === GET_CONTACT_TYPE.GROUP) {
|
||||
Taro.setStorageSync(CacheKey.JOIN_GROUP_POPUP_CLICKED, true);
|
||||
setClicked(true);
|
||||
switchTab(PageUrl.GroupV2);
|
||||
onConfirm(type);
|
||||
}
|
||||
};
|
||||
const handleAfterBuy = useCallback(async () => {
|
||||
onConfirm(GET_CONTACT_TYPE.VIP);
|
||||
@ -58,6 +73,9 @@ export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
||||
<div className={`${PREFIX}__title`}>以下方式任选其一均可获取联系方式</div>
|
||||
<div className={`${PREFIX}__body`}>
|
||||
{GET_CONTACT_TYPE_OPTIONS.map(option => {
|
||||
if (clicked && option.type === GET_CONTACT_TYPE.GROUP) {
|
||||
return;
|
||||
}
|
||||
return (
|
||||
<div className={`${PREFIX}__item`} key={option.type}>
|
||||
<div className={`${PREFIX}__item-icon ${option.type}`}>
|
||||
|
||||
Reference in New Issue
Block a user