feat
This commit is contained in:
@ -14,6 +14,7 @@ import './index.less';
|
||||
|
||||
interface IProps {
|
||||
onCancel: () => void;
|
||||
isCreateResume?: boolean;
|
||||
onConfirm: (type: GET_CONTACT_TYPE) => void;
|
||||
}
|
||||
|
||||
@ -43,7 +44,7 @@ const GET_CONTACT_TYPE_OPTIONS = [
|
||||
},
|
||||
];
|
||||
|
||||
export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
||||
export function PrejobPopup({ onCancel, isCreateResume, onConfirm }: IProps) {
|
||||
const [openPopup, setOpenPopup] = useState(true);
|
||||
const [openDialog, setOpenDialog] = useState(false);
|
||||
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_POPUP_CLICKED));
|
||||
@ -99,7 +100,7 @@ export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
||||
</Popup>
|
||||
<Dialog open={openDialog} onClose={onCancel}>
|
||||
<Dialog.Content>
|
||||
<JobBuy onConfirm={handleAfterBuy} />
|
||||
<JobBuy onConfirm={handleAfterBuy} isCreateResume={isCreateResume} />
|
||||
</Dialog.Content>
|
||||
</Dialog>
|
||||
</Fragment>
|
||||
|
||||
@ -45,9 +45,11 @@ function ProductContactDialog(props: Omit<IProps, 'visible'>) {
|
||||
initRef.current = async () => {
|
||||
const handleContact = (declarationTypeResult?: ProductInfo['declarationTypeResult']) => {
|
||||
if (declarationTypeResult?.type === DeclarationType.Direct && declarationTypeResult.publisherAcctNo) {
|
||||
console.log('set JOB_CONTACT_DIRECT', declarationTypeResult.publisherAcctNo)
|
||||
setStatus(DialogStatus.JOB_CONTACT_DIRECT);
|
||||
setPublisherAcctNo(declarationTypeResult.publisherAcctNo);
|
||||
} else {
|
||||
console.log('set JOB_CONTACT_CS')
|
||||
setStatus(DialogStatus.JOB_CONTACT_CS);
|
||||
}
|
||||
};
|
||||
@ -67,8 +69,8 @@ function ProductContactDialog(props: Omit<IProps, 'visible'>) {
|
||||
return;
|
||||
}
|
||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||
console.log('开始报单', productInfo);
|
||||
Taro.eventCenter.trigger(EventName.READ_CONTACT);
|
||||
console.log('开始报单', productInfo);
|
||||
handleContact(productInfo ? productInfo.declarationTypeResult : undefined);
|
||||
} catch (e) {
|
||||
Toast.error('出错了,请重试');
|
||||
|
||||
@ -26,6 +26,7 @@ import Toast from '@/utils/toast';
|
||||
|
||||
interface IProps {
|
||||
onConfirm: () => void;
|
||||
isCreateResume?: boolean;
|
||||
}
|
||||
|
||||
// interface Item {
|
||||
@ -74,7 +75,7 @@ const subscribe = async () => {
|
||||
};
|
||||
|
||||
export default function JobBuy(props: IProps) {
|
||||
const { onConfirm } = props;
|
||||
const { onConfirm, isCreateResume } = props;
|
||||
const [productList, setProductList] = useState<ProductSpecResult[]>([]);
|
||||
const [selectItem, setSelectItem] = useState<ProductSpecResult | undefined>();
|
||||
|
||||
@ -139,13 +140,15 @@ export default function JobBuy(props: IProps) {
|
||||
<div>免费查看次数已用完</div>
|
||||
<div className="highlight">请升级会员</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__job-buy__describe`}>
|
||||
<div>完善模卡</div>
|
||||
<div> 赠10次查看 </div>
|
||||
<div className="highlight" onClick={handleResume}>
|
||||
去完善
|
||||
{!isCreateResume && (
|
||||
<div className={`${PREFIX}__job-buy__describe`}>
|
||||
<div>完善模卡</div>
|
||||
<div> 赠5次查看 </div>
|
||||
<div className="highlight" onClick={handleResume}>
|
||||
去完善
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className={`${PREFIX}__job-buy__container`}>
|
||||
{productList.map(item => {
|
||||
return (
|
||||
|
||||
@ -237,12 +237,16 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
||||
/>
|
||||
)}
|
||||
{showMaterialGuide && (
|
||||
<PrejobPopup onCancel={() => setShowMaterialGuide(false)} onConfirm={handleConfirmPrejob} />
|
||||
<PrejobPopup
|
||||
isCreateResume={productInfo?.isCreateResume}
|
||||
onCancel={() => setShowMaterialGuide(false)}
|
||||
onConfirm={handleConfirmPrejob}
|
||||
/>
|
||||
)}
|
||||
{showBuyDialog && (
|
||||
<Dialog open onClose={handleCancel}>
|
||||
<Dialog.Content>
|
||||
<JobBuy onConfirm={handleAfterBuy} />
|
||||
<JobBuy onConfirm={handleAfterBuy} isCreateResume={productInfo?.isCreateResume} />
|
||||
</Dialog.Content>
|
||||
</Dialog>
|
||||
)}
|
||||
|
||||
@ -15,12 +15,10 @@ export const isDesktop = (() => {
|
||||
return info.platform === 'windows' || info.platform === 'mac';
|
||||
})();
|
||||
|
||||
export const logWithPrefix = isDev()
|
||||
? (prefix: string) =>
|
||||
(...args: BL.Anything[]) =>
|
||||
console.log(`[${prefix}]`, ...args)
|
||||
: (_prefix: string) =>
|
||||
(..._args: BL.Anything[]) => {};
|
||||
export const logWithPrefix =
|
||||
(prefix: string) =>
|
||||
(...args: BL.Anything[]) =>
|
||||
console.log(`[${prefix}]`, ...args);
|
||||
|
||||
export const safeJsonParse = <T = BL.Anything>(str: string, defaultValue: BL.Anything = {}): T => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user