From 6d963a5bc02974b09c2b702516ad95e010ad1408 Mon Sep 17 00:00:00 2001 From: linxi <957440651@qq.com> Date: Tue, 14 Jul 2026 14:06:41 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A5397=20=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E5=95=86=E5=93=81=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=EF=BC=8C=E8=BF=9E=E7=BB=AD=E5=BF=AB=E9=80=9F=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E2=80=9C=E9=80=81=E7=BB=99=E6=9C=8B=E5=8F=8B=E2=80=9D?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E5=A4=8D=E5=BC=B9=E5=87=BA=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E9=80=81=E7=A4=BC=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aiChat/mixins/chatMixinsV2.js | 15 +++++++++++ pages/order/OrderSubmission/index.vue | 38 ++++++++++++++++++--------- pages/shop/GoodsCon/index.vue | 16 ++++++++++- 3 files changed, 56 insertions(+), 13 deletions(-) diff --git a/aiChat/mixins/chatMixinsV2.js b/aiChat/mixins/chatMixinsV2.js index 224950a..a854680 100644 --- a/aiChat/mixins/chatMixinsV2.js +++ b/aiChat/mixins/chatMixinsV2.js @@ -51,6 +51,7 @@ export const chatMixinsV2 = { audioPlayId: '', showGiftBtn: false, buyLoading: false, + buyActionLock: false, exceptionConfig: { model_exception: '您提的问题未能理解,云灵思想跑偏啦,重新整理一下问题或者重新提问,让云灵再试试!', voice_exception: '' @@ -533,6 +534,10 @@ export const chatMixinsV2 = { this.productItemBuyNowOrGiftBuy(item, 2) }, productItemBuyNowOrGiftBuy(item, BuyNowOrGiftBuyType) { + if (this.buyActionLock) { + return + } + this.buyActionLock = true this.audioStopHandle() this.cart_num = 1 this.m_id = item.id @@ -540,6 +545,7 @@ export const chatMixinsV2 = { const { data } = res this.storeInfo = {...data.storeInfo} if(data.storeInfo.stock === 0) { + this.buyActionLock = false uni.showToast({ title: "产品库存不足,请选择其他商品", icon: "none", @@ -577,6 +583,14 @@ export const chatMixinsV2 = { return } this.attr.cartAttr = !this.isOpen ? true : false + this.buyActionLock = false + }).catch(error => { + this.buyActionLock = false + uni.showToast({ + title: error.msg || '操作失败,请稍后重试', + icon: "none", + duration: 3000 + }) }) }, buyNowOrGiftBuyReq(type) { @@ -617,6 +631,7 @@ export const chatMixinsV2 = { }) }).finally(() => { _this.buyLoading = false + _this.buyActionLock = false }) }, closeAttrWindow() { diff --git a/pages/order/OrderSubmission/index.vue b/pages/order/OrderSubmission/index.vue index 040d3cd..47422d0 100644 --- a/pages/order/OrderSubmission/index.vue +++ b/pages/order/OrderSubmission/index.vue @@ -398,7 +398,8 @@ export default { pageKeyId: Object.freeze('orderConfirm'), total: 0, couponTitle: '', - hasCoupon: false + hasCoupon: false, + pageQuery: {} } }, computed: mapGetters(["userInfo", "storeItems"]), @@ -417,17 +418,18 @@ export default { }, onLoad(opts) { const that = this - if (that.$yroute.query.pinkid !== undefined) { - that.pinkId = that.$yroute.query.pinkid + that.pageQuery = Object.assign({}, that.resolvePageQuery(), opts || {}) + if (that.pageQuery.pinkid !== undefined) { + that.pinkId = that.pageQuery.pinkid } - if (that.$yroute.query.id !== undefined) { - that.cartid = that.$yroute.query.id + if (that.pageQuery.id !== undefined) { + that.cartid = that.pageQuery.id console.log(that.cartid) } - if (that.$yroute.query.lotteryRecordId !== undefined) { - that.lotteryRecordId = that.$yroute.query.lotteryRecordId + if (that.pageQuery.lotteryRecordId !== undefined) { + that.lotteryRecordId = that.pageQuery.lotteryRecordId } - that.hasCoupon = opts.couponId !== '' + that.hasCoupon = !!(opts && opts.couponId !== '') that.getCartInfo() }, onShow() { @@ -452,14 +454,26 @@ export default { }, methods: { isNullOrEmpty, + resolvePageQuery() { + if (this.$yroute && this.$yroute.query) { + return this.$yroute.query + } + if (this.$route && this.$route.query) { + return this.$route.query + } + if (this._route && this._route.query) { + return this._route.query + } + return {} + }, isLotteryOrder() { const cartInfo = Array.isArray(this.orderGroupInfo && this.orderGroupInfo.cartInfo) ? this.orderGroupInfo.cartInfo : [] return Boolean( this.lotteryRecordId || - this.$yroute.query.from === 'countyLottery' || - Number(this.$yroute.query.drawActivityId || 0) > 0 || + this.pageQuery.from === 'countyLottery' || + Number(this.pageQuery.drawActivityId || 0) > 0 || cartInfo.some(item => Number( item.drawActivityId || (item.productInfo && item.productInfo.drawActivityId) || @@ -567,8 +581,8 @@ export default { } _this.systemStore = data.systemStore || {} _this.storeSelfMention = data.storeSelfMention - if(_this.$yroute.query.address !== undefined ) { - _this.addressInfo = JSON.parse(_this.$yroute.query.address) || {} + if(_this.pageQuery.address !== undefined ) { + _this.addressInfo = JSON.parse(_this.pageQuery.address) || {} _this.computedPrice() } else { // _this.addressInfo = uni.getStorageSync('sourceAddress') || data.addressInfo || {} diff --git a/pages/shop/GoodsCon/index.vue b/pages/shop/GoodsCon/index.vue index e0e4a95..5474dee 100644 --- a/pages/shop/GoodsCon/index.vue +++ b/pages/shop/GoodsCon/index.vue @@ -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",