puyao 2 hónapja
szülő
commit
c070685b5d

+ 6 - 5
pages/shopping/confirmOrder.vue

@@ -237,6 +237,7 @@
 				this.computed()
 			},
 			confirm(item){
+				console.log(123111)
 				let data = {type:this.type,cartIds:this.cartIds};
 				confirm(data).then(
 					res => {
@@ -275,11 +276,11 @@
 									icon:'none',
 									title: res.msg,
 								});
-								setTimeout(function(){
-									uni.navigateBack({
-										delta:1
-									})
-								},500);
+								// setTimeout(function(){
+								// 	uni.navigateBack({
+								// 		delta:1
+								// 	})
+								// },500);
 								return;
 							}
 							else{

+ 16 - 4
pages/shopping/confirmPackageOrder.vue

@@ -90,7 +90,7 @@
 						<text class="num" v-if="totalMoney!=null">{{totalMoney.toFixed(2)}}</text>
 					</view>
 				</view>
-				<view class="btn" @click="submitOrder">提交订单</view>
+				<view :class="isSubmitting?'btnsel btn':'btn '" @click="submitOrder" :disabled="isSubmitting" > {{ isSubmitting ? '提交中...' : '提交订单' }}</view>
 			</view>
 		</view>
 		<popupBottom ref="popup" :visible.sync="couponVisible" title=" " bgColor="#f5f5f5"  radius="30"    maxHeight="60%">
@@ -159,7 +159,8 @@
 					addressId:null,
 					mark:null,
 				},
-				postMoney:''
+				postMoney:'',
+				isSubmitting: false // 控制按钮禁用状态
 			}
 		},
 		onLoad(option) {
@@ -168,7 +169,7 @@
 			uni.$on('updateAddress', (e) => {
 				this.address=e;
 				this.form.addressId=e.id;
-				that.form.address=e.province+e.city+e.district+e.detail
+				this.form.address=e.province+e.city+e.district+e.detail
 			})
 			this.confirmPackageOrder();
 			this.getWeixinTemps();
@@ -266,7 +267,14 @@
 					});
 					return;
 				}
-				
+				if (this.isSubmitting) return; // 防止重复点击
+				 this.isSubmitting = true; // 禁用按钮
+				 if(this.isSubmitting){
+				 	uni.showToast({
+				 		icon:'none',
+				 		title: '不能重复点击',
+				 	});
+				 }
 				uni.requestSubscribeMessage({
 					tmplIds: this.temps,
 					success(res) {
@@ -637,6 +645,10 @@
 				background: #2BC7B9;
 				border-radius: 44upx;
 			}
+			.btnsel{
+				color: #5f5f5f;
+				background: #ebebeb;
+			}
 		}
 	}