Fix:5397 【商城小程序】商品链接,连续快速点击“送给朋友”,重复弹出多个送礼页面

This commit is contained in:
linxi
2026-07-14 14:06:41 +08:00
parent b4c1ea20ac
commit 6d963a5bc0
3 changed files with 56 additions and 13 deletions
+15 -1
View File
@@ -655,7 +655,8 @@ export default {
pageKeyId: '',
couponListLimit2ToShow: [],
qualifications: [],
couponId: null
couponId: null,
submitActionLock: false
}
},
computed: mapGetters(['isLogin', 'location', 'userInfo']),
@@ -821,6 +822,7 @@ export default {
}
},
onShow() {
this.submitActionLock = false
this.getMapData()
getGiftCardSendBackground().then(res => {
if (res.status === 200) {
@@ -1500,6 +1502,10 @@ export default {
q.drawActivityId = Number(this.activityId || 0)
break
}
if (that.submitActionLock) {
return
}
that.submitActionLock = true
postCartAdd(q).then(function (res) {
that.isOpen = false
that.attr.cartAttr = false
@@ -1516,6 +1522,9 @@ export default {
path: "/pages/order/OrderSubmission/index",
query: orderQuery
})
setTimeout(() => {
that.submitActionLock = false
}, 1500)
return
}
if(news === 2) {
@@ -1532,8 +1541,12 @@ export default {
// + '&couponId=' + coupId
url: giftUrl
})
setTimeout(() => {
that.submitActionLock = false
}, 1500)
}
if(news === 0) {
that.submitActionLock = false
uni.showToast({
title: "添加购物车成功",
icon: "success",
@@ -1546,6 +1559,7 @@ export default {
}
}).catch(error => {
that.isOpen = false;
that.submitActionLock = false
uni.showToast({
title: error.msg,
icon: "none",