浏览代码

修复扫码支付查看幸运bug

hwb0 3 年之前
父节点
当前提交
2f9d442ff7
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      pages/lucky/index.vue

+ 9 - 1
pages/lucky/index.vue

@@ -46,6 +46,7 @@
 				info: '',
 				payInfo: {},
 				payShow: false,
+				payLookFlag: true,
 				showNull: false,
 			};
 		},
@@ -62,7 +63,7 @@
 			}
 		},
 		onShow() {
-			if (this.serialNo) {
+			if (this.serialNo && this.payLookFlag) {
 				this.getDetail()
 			}
 		},
@@ -142,7 +143,12 @@
 					ticketId: this.info.ticketId,
 					autoCoupon: 1
 				}
+				this.payLookFlag = false
+				uni.showLoading({
+					title: '加载中'
+				});
 				$http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
+					uni.hideLoading();
 					if (res.code == 0) {
 						let info = {
 							...res.data,
@@ -152,6 +158,8 @@
 						this.payInfo = info
 						this.payShow = true
 					}
+				}).catch(() => {
+					uni.hideLoading();
 				})
 			},