fix: 修复领取方式

This commit is contained in:
zhangds 2024-04-09 22:01:37 +08:00
parent 2f910c83e0
commit 9cfd48a405
6 changed files with 107 additions and 66 deletions

View File

@ -488,26 +488,23 @@
}).then(res => {
if (res.code == 200) {
this.goods = res.data
// 支付宝组合商品
if (this.goods.group_info.channel == 3 || this.goods.group_info.channel == 1 && this.goods.group_info.receive_mode == 2) {
// send_status 1发放中2全部成功 3全部失败4部分失败 5未领取
this.popMsg = res.data.send_status === 2 || res.data.send_status === 3 || res.data.send_status === 4 ? true : false;
// 部分失败
if (res.data.send_status === 4) {
let all_product_length = res.data.product.length;
let is_err_length = res.data.product.filter(item => item.voucher.status === 5).length;
self.isOKLength = all_product_length - is_err_length;
self.isErrLength = is_err_length;
}
// send_status 1发放中2全部成功 3全部失败4部分失败 5未领取
this.popMsg = res.data.send_status === 2 || res.data.send_status === 3 || res.data.send_status === 4 ? true : false;
// 发放中 轮循
if (res.data.send_status === 1) {
setTimeout(() => {
self.groupProductVoucherDetail();
self.cont++;
}, 5000)
}
// 部分失败
if (res.data.send_status === 4) {
let all_product_length = res.data.product.length;
let is_err_length = res.data.product.filter(item => item.voucher.status === 5).length;
self.isOKLength = all_product_length - is_err_length;
self.isErrLength = is_err_length;
}
// 发放中 轮循
if (res.data.send_status === 1) {
setTimeout(() => {
self.groupProductVoucherDetail();
}, 5000)
}
} else {
@ -574,7 +571,6 @@
.then((res) => {
if (res.code == 200) {
this.message = '领取成功';
this.getProductDetail();
} else {

View File

@ -386,7 +386,6 @@
code_batch_id: this.code_batch_id
}).then(res => {
if (res.code === 200) {
alert(JSON.stringify(res.data.product))
// send_status 1发放中2全部成功 3全部失败4部分失败 5未领取
// status 1待领取2发放中3待使用4已使用5领取失败
@ -489,29 +488,25 @@
code_batch_id: this.code_batch_id
}).then(res => {
if (res.code == 200) {
alert(res.data.send_status)
this.goods = res.data
// 支付宝组合商品
if (this.goods.group_info.channel == 3 || this.goods.group_info.channel == 1 && this.goods.group_info.receive_mode == 2) {
// send_status 1发放中2全部成功 3全部失败4部分失败 5未领取
this.popMsg = res.data.send_status === 2 || res.data.send_status === 3 || res.data.send_status === 4 ? true : false;
// send_status 1发放中2全部成功 3全部失败4部分失败 5未领取
this.popMsg = res.data.send_status === 2 || res.data.send_status === 3 || res.data.send_status === 4 ? true : false;
// 部分失败
if (res.data.send_status === 4) {
let all_product_length = res.data.product.length;
let is_err_length = res.data.product.filter(item => item.voucher.status === 5).length;
self.isOKLength = all_product_length - is_err_length;
self.isErrLength = is_err_length;
}
// 发放中 轮循
if (res.data.send_status === 1) {
setTimeout(() => {
self.groupProductVoucherDetail();
}, 5000)
}
// 部分失败
if (res.data.send_status === 4) {
let all_product_length = res.data.product.length;
let is_err_length = res.data.product.filter(item => item.voucher.status === 5).length;
self.isOKLength = all_product_length - is_err_length;
self.isErrLength = is_err_length;
}
// 发放中 轮循
if (res.data.send_status === 1) {
setTimeout(() => {
self.groupProductVoucherDetail();
}, 5000)
}
// 代码暂时这样
if (res.data.group_info.channel == 1 && res.data.group_info.receive_mode == 1) {
@ -599,7 +594,6 @@
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
}
this.message = '领取成功';
this.getProductDetail();
} else {

View File

@ -6,7 +6,7 @@
<meta name="viewport"
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>组合立减金</title>
<link rel="stylesheet" href="../combining.css?v=123">
<link rel="stylesheet" href="../combining.css?v=234">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage2_0.css" />
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=20210302151401"
type="text/javascript" charset="utf-8"></script>
@ -102,7 +102,6 @@
v-model="form.receive_account">
</template>
<!-- 普通状态 -->
<button type="button" class="but"
:style="{marginTop:goods.group_info.channel==2||goods.group_info.channel==1&&goods.group_info.receive_mode==1&&'0.12rem'}"
alt="" @click="submit" :disabled="loading"
@ -318,6 +317,7 @@
},
methods: {
// 错误弹出框关闭
knowFn() {
this.popboxshow = false;
@ -489,12 +489,23 @@
}).then(res => {
if (res.code == 200) {
this.goods = res.data
// 支付宝组合商品
// send_status 1发放中2全部成功 3全部失败4部分失败 5未领取
this.popMsg = res.data.send_status === 2 || res.data.send_status === 3 || res.data.send_status === 4 ? true : false;
// 部分失败
if (res.data.send_status === 4) {
let all_product_length = res.data.product.length;
let is_err_length = res.data.product.filter(item => item.voucher.status === 5).length;
self.isOKLength = all_product_length - is_err_length;
self.isErrLength = is_err_length;
}
// 发放中 轮循
if (res.data.send_status === 1) {
setTimeout(() => {
self.getProductDetail();
}, 3000)
self.groupProductVoucherDetail();
}, 5000)
}
// 代码暂时这样
if (res.data.group_info.channel == 1 && res.data.group_info.receive_mode == 1) {
@ -583,7 +594,6 @@
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
}
// this.message = '领取成功';
this.getProductDetail();
} else {

View File

@ -6,7 +6,7 @@
<meta name="viewport"
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>组合立减金</title>
<link rel="stylesheet" href="../combining.css?v=123">
<link rel="stylesheet" href="../combining.css?v=234">
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage2_0.css" />
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=20210302151401"
type="text/javascript" charset="utf-8"></script>
@ -102,7 +102,6 @@
v-model="form.receive_account">
</template>
<!-- 普通状态 -->
<button type="button" class="but"
:style="{marginTop:goods.group_info.channel==2||goods.group_info.channel==1&&goods.group_info.receive_mode==1&&'0.12rem'}"
alt="" @click="submit" :disabled="loading"
@ -318,6 +317,7 @@
},
methods: {
// 错误弹出框关闭
knowFn() {
this.popboxshow = false;
@ -489,14 +489,24 @@
}).then(res => {
if (res.code == 200) {
this.goods = res.data
// 支付宝组合商品
// send_status 1发放中2全部成功 3全部失败4部分失败 5未领取
this.popMsg = res.data.send_status === 2 || res.data.send_status === 3 || res.data.send_status === 4 ? true : false;
if (res.data.send_status === 1) {
setTimeout(() => {
self.getProductDetail();
}, 3000)
// 部分失败
if (res.data.send_status === 4) {
let all_product_length = res.data.product.length;
let is_err_length = res.data.product.filter(item => item.voucher.status === 5).length;
self.isOKLength = all_product_length - is_err_length;
self.isErrLength = is_err_length;
}
// 发放中 轮循
if (res.data.send_status === 1) {
setTimeout(() => {
self.groupProductVoucherDetail();
}, 5000)
}
// 代码暂时这样
if (res.data.group_info.channel == 1 && res.data.group_info.receive_mode == 1) {
@ -554,7 +564,6 @@
} else {
/* 小程序 */
window.location.replace(res.data.redirect_url);
this.getProductDetail();
}
}
} else {
@ -585,7 +594,6 @@
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
}
// this.message = '领取成功';
this.getProductDetail();
} else {

View File

@ -488,11 +488,26 @@
}).then(res => {
if (res.code == 200) {
this.goods = res.data
// send_status 1发放中2全部成功 3全部失败4部分失败 5未领取
this.popMsg = res.data.send_status === 2 || res.data.send_status === 3 || res.data.send_status === 4 ? true : false;
if (res.data.send_status === 1) {
self.groupProductVoucherDetail();
// 部分失败
if (res.data.send_status === 4) {
let all_product_length = res.data.product.length;
let is_err_length = res.data.product.filter(item => item.voucher.status === 5).length;
self.isOKLength = all_product_length - is_err_length;
self.isErrLength = is_err_length;
}
// 发放中 轮循
if (res.data.send_status === 1) {
setTimeout(() => {
self.groupProductVoucherDetail();
self.cont++;
}, 5000)
}
} else {
this.openErrorDialog(res.message)
}
@ -535,6 +550,7 @@
} else {
/* 小程序 */
window.location.replace(res.data.redirect_url);
this.getProductDetail();
}
}
} else {
@ -546,7 +562,6 @@
/* 公众号领取 */
publicCollection() {
let self = this;
let params = {
token: this.token,
code_batch_id: this.code_batch_id,
@ -556,8 +571,9 @@
req.axiosPost("/voucher/groupVoucherGrant", params)
.then((res) => {
if (res.code == 200) {
// this.message = '领取成功';
self.groupProductVoucherDetail();
this.getProductDetail();
} else {
this.axiosErrorFun(res.code, res.message);
}
@ -611,7 +627,7 @@
req.axiosPost("/key/couponGroupUsage", data)
.then(({ code, message }) => {
if (code == 200) {
self.getProductDetail();
this.getProductDetail();
} else {
this.axiosErrorFun(code, message);
}
@ -625,7 +641,7 @@
req.axiosPost("/voucher/groupVoucherRetry", data)
.then(({ code, message }) => {
if (code == 200) {
self.getProductDetail();
this.getProductDetail();
} else {
this.axiosErrorFun(code, message);
}

View File

@ -488,11 +488,26 @@
}).then(res => {
if (res.code == 200) {
this.goods = res.data
// send_status 1发放中2全部成功 3全部失败4部分失败 5未领取
this.popMsg = res.data.send_status === 2 || res.data.send_status === 3 || res.data.send_status === 4 ? true : false;
if (res.data.send_status === 1) {
self.groupProductVoucherDetail();
// 部分失败
if (res.data.send_status === 4) {
let all_product_length = res.data.product.length;
let is_err_length = res.data.product.filter(item => item.voucher.status === 5).length;
self.isOKLength = all_product_length - is_err_length;
self.isErrLength = is_err_length;
}
// 发放中 轮循
if (res.data.send_status === 1) {
setTimeout(() => {
self.groupProductVoucherDetail();
self.cont++;
}, 5000)
}
} else {
this.openErrorDialog(res.message)
}
@ -535,6 +550,7 @@
} else {
/* 小程序 */
window.location.replace(res.data.redirect_url);
this.getProductDetail();
}
}
} else {
@ -546,7 +562,6 @@
/* 公众号领取 */
publicCollection() {
let self = this;
let params = {
token: this.token,
code_batch_id: this.code_batch_id,
@ -556,8 +571,10 @@
req.axiosPost("/voucher/groupVoucherGrant", params)
.then((res) => {
if (res.code == 200) {
// this.message = '领取成功';
self.groupProductVoucherDetail();
this.getProductDetail();
} else {
this.axiosErrorFun(res.code, res.message);
}
@ -611,7 +628,7 @@
req.axiosPost("/key/couponGroupUsage", data)
.then(({ code, message }) => {
if (code == 200) {
self.getProductDetail();
this.getProductDetail();
} else {
this.axiosErrorFun(code, message);
}
@ -625,7 +642,7 @@
req.axiosPost("/voucher/groupVoucherRetry", data)
.then(({ code, message }) => {
if (code == 200) {
self.getProductDetail();
this.getProductDetail();
} else {
this.axiosErrorFun(code, message);
}