feat: get is vip
This commit is contained in:
@ -63,7 +63,7 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
}, []);
|
||||
|
||||
const handleAfterBuy = useCallback(async () => {
|
||||
const time = await requestProductBalance(PRODUCT_CODE);
|
||||
const [time] = await requestProductBalance(PRODUCT_CODE);
|
||||
if (time <= 0) {
|
||||
Toast.error('发生错误请重试');
|
||||
onClose();
|
||||
@ -110,14 +110,14 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const time = await requestProductBalance(PRODUCT_CODE);
|
||||
const [time, isPaidVip] = await requestProductBalance(PRODUCT_CODE);
|
||||
if (time <= 0) {
|
||||
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
||||
setShowContact(true);
|
||||
setStatus(allowBuy ? DialogStatus.JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
||||
}
|
||||
// 创建模卡之后可以直接解锁一次, 分享后解锁一次
|
||||
else if (getSkipPrejobAction() || skipPreAction) {
|
||||
else if (isPaidVip || getSkipPrejobAction() || skipPreAction) {
|
||||
const productInfo = await requestUseProduct(PRODUCT_CODE, { jobId: data.id });
|
||||
setShowPrejob(false);
|
||||
if (!skipPreAction) {
|
||||
@ -132,6 +132,7 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
||||
// handleContact(productInfo.declarationTypeResult);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
Toast.error('出错了,请重试');
|
||||
handleCloseDialog();
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user