Browse Source

支付调整

lsx 2 years ago
parent
commit
2cf1d58d85
2 changed files with 20 additions and 37 deletions
  1. 1 28
      src/packageGoods/order/payOrder.vue
  2. 19 9
      src/pages/index/payExternal.vue

+ 1 - 28
src/packageGoods/order/payOrder.vue

@@ -28,7 +28,7 @@
 			<u-button class="btn1" @click="openPay(1)" text="前往第三方支付" shape="circle"></u-button>
 		</view>
 		<view class="btn" v-else>
-			<u-button class="btn1" @click="toPurchase" text="我已支付,前往订单列表查看" shape="circle"></u-button>
+			<u-button class="btn1" @click="toOrder" text="前往订单列表页查看" shape="circle"></u-button>
 			<u-button class="btn2" @click="openPay(2)" text="还未支付,前往第三方支付" shape="circle"></u-button>
 		</view>
 	</view>
@@ -87,33 +87,6 @@
 					url: `/packageGoods/order/index`
 				})
 			},
-			toPurchase() {
-				let _this = this
-				uni.showLoading({
-					title: '加载中'
-				});
-				$http.post('/api/v1/mp/user/ticket/query', {
-					orderId: this.orderId,
-				}).then(res => {
-					uni.hideLoading();
-					if (res.code == 0) {
-						uni.showToast({
-							title: '支付成功',
-							icon: 'success',
-							duration: 2000
-						})
-						setTimeout(() => {
-							uni.redirectTo({
-								url: `/packageGoods/order/index`
-							})
-						}, 500)
-					}else {
-						uni.$u.toast(res.msg);
-					}
-				}).catch(() => {
-					uni.hideLoading();
-				})
-			},
 			
 		}
 	}

+ 19 - 9
src/pages/index/payExternal.vue

@@ -87,17 +87,27 @@
 					orderId: this.orderId,
 				}).then(res => {
 					uni.hideLoading();
+					console.log(res);
 					if (res.code == 0) {
-						uni.showToast({
-							title: '支付成功',
-							icon: 'success',
-							duration: 2000
-						})
-						setTimeout(() => {
-							uni.redirectTo({
-								url: `/packagePrize/purchase/index?boxId=${ res.data.boxId }&orderId=${ this.orderId }&isTry=0`
+						if(res.data.status != 3) {
+							uni.showToast({
+								title: '支付成功',
+								icon: 'success',
+								duration: 2000
 							})
-						}, 500)
+							setTimeout(() => {
+								uni.redirectTo({
+									url: `/packagePrize/purchase/index?boxId=${ res.data.boxId }&orderId=${ this.orderId }&isTry=0`
+								})
+							}, 500)
+						}else {
+							uni.$u.toast('盲票已开奖');
+							setTimeout(() => {
+								uni.switchTab({
+									url: `/pages/index/index`
+								})
+							}, 500)
+						}
 					}else {
 						uni.$u.toast(res.msg);
 					}