zhangbs 2 năm trước cách đây
mục cha
commit
901e8b7d52

+ 6 - 1
pagesHome/group/order.vue

@@ -112,7 +112,8 @@
 				// 收货地址
 				addressList: [],
 				// 备注
-				remarks: ''
+				remarks: '',
+				disabled: false
 			};
 		},
 		onLoad: function(e) {
@@ -185,6 +186,8 @@
 			async toSubmit() {
 				const that = this;
 				let system = that.system;
+				if (that.disabled) return;
+				that.$set(that, `disabled`, true);
 				if (that.address) {
 					let obj = {
 						address: that.address,
@@ -217,6 +220,7 @@
 										})
 									},
 									fail: function(err) {
+										that.$set(that, `disabled`, false);
 										uni.showToast({
 											title: `支付失败`,
 											icon: 'none'
@@ -228,6 +232,7 @@
 									}
 								})
 							} else {
+								that.$set(that, `disabled`, false);
 								uni.showToast({
 									title: p2.errmsg,
 									icon: 'none'

+ 5 - 0
pagesHome/order/order.vue

@@ -242,6 +242,7 @@
 				change: false,
 				// 显示加购商品
 				plus_total: 3,
+				disabled: false
 			};
 		},
 		onLoad: function(e) {
@@ -463,6 +464,8 @@
 			async toSubmit() {
 				const that = this;
 				let system = that.system;
+				if (that.disabled) return;
+				that.$set(that, `disabled`, true);
 				if (that.address) {
 					let obj = {
 						address: that.address,
@@ -508,6 +511,7 @@
 												})
 											}
 										} else {
+											that.$set(that, `disabled`, false);
 											uni.showToast({
 												title: p3.errmsg,
 												icon: 'none'
@@ -515,6 +519,7 @@
 										}
 									},
 									fail: function(err) {
+										that.$set(that, `disabled`, false);
 										uni.showToast({
 											title: `支付失败`,
 											icon: 'none'

+ 6 - 1
pagesMy/dough/index.vue

@@ -59,7 +59,7 @@
 													@tap.stop="toView(item,'order')">详细信息</button>
 												<button v-if="item.status=='0'||item.status=='1'" size="mini"
 													@tap.stop="toCancel(item)">取消订单</button>
-												<button v-if="item.status=='0'" size="mini"
+												<button v-if="item.status=='0'" size="mini" :disabled="disabled"
 													@tap.stop="toPay(item)">支付</button>
 												<button v-if="item.status=='2'||item.status=='3'||item.status=='2-'"
 													size="mini" @tap.stop="toLogi(item,'order')">查看物流</button>
@@ -252,6 +252,8 @@
 				},
 				// 状态名称
 				status_name: '',
+				// 禁用
+				disabled: false
 			};
 		},
 		onShow: async function() {
@@ -467,6 +469,7 @@
 			async toPay(e) {
 				const that = this;
 				let system = that.system;
+				that.$set(that, `disabled`, true)
 				if (system.uniPlatform == "mp-weixin") {
 					uni.showLoading({
 						title: '加载中'
@@ -486,6 +489,7 @@
 								})
 							},
 							fail: function(err) {
+								that.$set(that, `disabled`, false)
 								uni.showToast({
 									title: `支付失败`,
 									icon: 'none'
@@ -498,6 +502,7 @@
 							}
 						})
 					} else {
+						that.$set(that, `disabled`, false)
 						uni.showToast({
 							title: p2.errmsg || '错误信息',
 							icon: 'none'

+ 5 - 1
pagesMy/order/all.vue

@@ -127,7 +127,7 @@
 											<view class="btn">
 												<button v-if="item.status=='0'||item.status=='1'" size="mini"
 													@tap.stop="toCancel(item)">取消订单</button>
-												<button v-if="item.status=='0'" size="mini"
+												<button v-if="item.status=='0'" size="mini" :disabled="disabled"
 													@tap.stop="toPay(item,'group_order')">支付</button>
 												<button v-if="item.status=='2'||item.status=='3'||item.status=='2-'"
 													size="mini" @tap.stop="toLogi(item,'group_order')">查看物流</button>
@@ -209,6 +209,7 @@
 				},
 				// 状态名称
 				status_name: '',
+				disabled: false
 			};
 		},
 		onShow: async function() {
@@ -454,6 +455,7 @@
 			async toPay(e, type) {
 				const that = this;
 				let system = that.system;
+				that.$set(that, `disabled`, true)
 				if (system.uniPlatform == "mp-weixin") {
 					uni.showLoading({
 						title: '加载中'
@@ -472,12 +474,14 @@
 							"provider": "wxpay",
 							...p2.data,
 							success: function(res) {
+								that.$set(that, `disabled`, true)
 								uni.showToast({
 									title: '支付成功',
 									icon: 'none'
 								})
 							},
 							fail: function(err) {
+								that.$set(that, `disabled`, true)
 								uni.showToast({
 									title: `支付失败`,
 									icon: 'none'

+ 4 - 2
pagesMy/order/index.vue

@@ -106,7 +106,7 @@
 									<view class="btn">
 										<button v-if="item.status=='0'" size="mini"
 											@tap.stop="toCancel(item)">取消订单</button>
-										<button v-if="item.status=='0'" size="mini" @tap.stop="toPay(item)">支付</button>
+										<button v-if="item.status=='0'" :disabled="disabled" size="mini" @tap.stop="toPay(item)">支付</button>
 										<button v-if="item.status=='1'&&item.is_afterSale!=true" size="mini"
 											@tap.stop="toCancels(item)">取消订单</button>
 										<button v-if="item.status=='2'||item.status=='3'||item.status=='2-'" size="mini"
@@ -161,7 +161,8 @@
 				is_bottom: false,
 				scrollTop: 0,
 				// 字典表
-				statusList: []
+				statusList: [],
+				disabled:false
 			};
 		},
 		onLoad: function(e) {
@@ -348,6 +349,7 @@
 								})
 							},
 							fail: function(err) {
+								that.$set(that, `disabled`, false)
 								uni.showToast({
 									title: `支付失败`,
 									icon: 'none'