🐛 fix: 修复bug

This commit is contained in:
wangsongsole 2023-11-22 14:09:12 +08:00
parent 741579b3ae
commit 47c38dc09b
3 changed files with 48 additions and 17 deletions

View File

@ -213,6 +213,19 @@ body {
.but { .but {
margin-bottom: 0.3rem; margin-bottom: 0.3rem;
background: linear-gradient(#fff9df, #ffc078, #ffe69e);
border-radius: 1rem;
height: 0.42rem;
border: 0;
outline: 0;
color: #be6822;
font-size: 0.16rem;
font-weight: 600;
border: 0.02rem solid #fed2b9;
}
.dis {
filter: opacity(0.9);
} }
.f-title { .f-title {

View File

@ -46,11 +46,13 @@
</p> </p>
</div> </div>
<div class="form"> <div class="form">
<template v-if="goodsInfo.available==1">
<input type="text" placeholder="请输入真实姓名" class="f-input" v-model="form.receive_name" maxlength="6"> <input type="text" placeholder="请输入真实姓名" class="f-input" v-model="form.receive_name" maxlength="6">
<input type="text" placeholder="请输入支付宝账号" class="f-input" v-model="form.receive_account"> <input type="text" placeholder="请输入支付宝账号" class="f-input" v-model="form.receive_account">
<p class="f-prompt">您可在支付宝的个人信息中查看【支付宝账号】</p> <p class="f-prompt">您可在支付宝的个人信息中查看【支付宝账号】</p>
<img src='https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/zfb-red-but.png' class="but" <button class="but" @click="receive">立即领取</button>
@click="receive" alt='' /> </template>
<button class="but dis" v-else>已领取</button>
</div> </div>
<div class="instruction-box"> <div class="instruction-box">
<div class="instruction-header"></div> <div class="instruction-header"></div>
@ -129,11 +131,6 @@
mounted () { mounted () {
document.title = localStorage.getItem('title'); document.title = localStorage.getItem('title');
/* 初始弹窗 */
if (![1, 9].includes(this.goodsInfo.available)) {
this.tip(product_status(this.goodsInfo.available, this.goodsInfo), 2);
}
}, },
methods: { methods: {
@ -158,13 +155,23 @@
req.axiosPost("/key/usage", data) req.axiosPost("/key/usage", data)
.then(({ code, data, message }) => { .then(({ code, data, message }) => {
if (code == 200) { if (code == 200) {
this.loading = false;
this.judgeEnvironment(data.order_number); this.judgeEnvironment(data.order_number);
} else {
if (code == 403) {
if (this.backAble) {
this.tip(message, 2, '关闭');
setTimeout(() => {
window.location.href = localStorage.getItem('entryLink');
}, 3000);
} else {
this.tip(message, 2, '关闭');
}
} else { } else {
this.loading = false; this.loading = false;
this.tip(message, 2, '关闭'); this.tip(message, 2, '关闭');
} }
}); }
}).catch((err) => { this.loading = false; });;
}, },
@ -172,8 +179,12 @@
req.axiosPost('/alipay/cash/receive/account', { ...this.form, order_number }) req.axiosPost('/alipay/cash/receive/account', { ...this.form, order_number })
.then(({ code, data, message }) => { .then(({ code, data, message }) => {
if (code == 200) { if (code == 200) {
this.loading = false;
this.goodsInfo.available = 9;
sessionStorage.setItem('goodsInfo', JSON.stringify(this.goodsInfo));
this.tip(message, 1, '关闭'); this.tip(message, 1, '关闭');
} else { } else {
this.loading = false;
if (code == 403) { if (code == 403) {
if (this.backAble) { if (this.backAble) {
this.tip(message, 2, '关闭'); this.tip(message, 2, '关闭');
@ -187,6 +198,8 @@
this.tip(message, 2, '关闭'); this.tip(message, 2, '关闭');
} }
} }
}).catch(() => {
this.loading = false;
}); });
}, },

View File

@ -166,7 +166,6 @@
/* 创建订单 */ /* 创建订单 */
req.axiosPost("/key/usage", data) req.axiosPost("/key/usage", data)
.then(({ code, data, message }) => { .then(({ code, data, message }) => {
this.loading = false;
if (code == 200) { if (code == 200) {
this.verificationYsf(data); this.verificationYsf(data);
} else { } else {
@ -187,13 +186,19 @@
req.axiosPost("/voucher/grant", params) req.axiosPost("/voucher/grant", params)
.then(({ code, message }) => { .then(({ code, message }) => {
if (code === 200) { if (code === 200) {
this.goods.available = 9; this.loading = false;
this.goodsInfo.available = 9;
sessionStorage.setItem('goodsInfo', JSON.stringify(this.goodsInfo));
this.tip('领取成功,请前往【支付宝】-【卡包】中查看', 1); this.tip('领取成功,请前往【支付宝】-【卡包】中查看', 1);
} else { } else {
this.loading = false;
this.axiosErrorFun(code, message, 2); this.axiosErrorFun(code, message, 2);
} }
}) })
.catch((err) => { }); .catch((err) => {
this.loading = false;
});
}, },
/* 返回 */ /* 返回 */