Browse Source

bug 修复

lilei 4 years ago
parent
commit
d6c8c367ec
2 changed files with 11 additions and 4 deletions
  1. 2 2
      App.vue
  2. 9 2
      pages/getOrder/getOrder.vue

+ 2 - 2
App.vue

@@ -1,6 +1,6 @@
 <script>
-	const uat_URL = 'https://carwash.test.zyucgj.com/cw-wechat/' // 预发布
-	// const uat_URL = 'http://192.168.16.103:8103/cw-wechat/' // 本地
+	// const uat_URL = 'https://carwash.test.zyucgj.com/cw-wechat/' // 预发布
+	const uat_URL = 'http://192.168.16.103:8103/cw-wechat/' // 本地
 	const pro_URL = 'https://carwash.zyucgj.com/cw-wecaht/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url

+ 9 - 2
pages/getOrder/getOrder.vue

@@ -82,7 +82,7 @@
 				<text>合计:</text>
 				<text class="amount">¥{{finalAmount}}</text>
 				<view class="">
-					<button @click="handleSubmit" type="warn">去付款</button>
+					<button :disabled="disabledPay" @click="handleSubmit" type="warn">去付款</button>
 				</view>
 			</view>
 		</view>
@@ -110,6 +110,7 @@
 		data() {
 			return {
 				status: 'loadmore',
+				disabledPay: false,
 				userPhone: '',
 				stepIndex: 0, // 当前步奏下标
 				serverIndex: 0, // 选择服务下标
@@ -329,6 +330,7 @@
 				if (this.checkedCoupon) {
 					params.couponReceivesList = [{id:this.checkedCoupon.id}]
 				}
+				this.disabledPay = true
 				saveOrder(params).then(res => {
 					if (res.status == 200) {
 						let data = res.data
@@ -337,8 +339,9 @@
 						this.$u.vuex('vuex_itemCode',data.itemCode)
 						this.$u.vuex('vuex_orderNo',data.orderNo)
 					} else {
-						this.toashMsg(res.message)
 						uni.hideLoading()
+						this.toashMsg(res.message)
+						this.disabledPay = false
 						setTimeout(()=>{
 							// 刷新服务项
 							this.getServerList()
@@ -374,11 +377,13 @@
 								fail: function(err) {
 									console.log('fail:' + JSON.stringify(err));
 									_this.payFail(err)
+									_this.disabledPay = false
 								}
 							});
 						}
 					} else {
 						this.toashMsg(res.message)
+						this.disabledPay = false
 					}
 				})
 			},
@@ -393,6 +398,8 @@
 				uni.redirectTo({
 					url: `/pages/work/index/index`
 				})
+				
+				this.disabledPay = false
 			},
 			// 付款失败或取消
 			payFail(err){