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