feat: get is vip

This commit is contained in:
chashaobao
2025-07-07 22:08:51 +08:00
parent 2c48a70b6d
commit 42d1208ee4
7 changed files with 16 additions and 11 deletions

View File

@ -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 {