Parcourir la source

Merge remote-tracking branch 'origin/dev' into dev

LiChengjin il y a 3 mois
Parent
commit
67072a8d7e
1 fichiers modifiés avec 39 ajouts et 7 suppressions
  1. 39 7
      subpkg_checkin/confirmOrder/confirmOrder.vue

+ 39 - 7
subpkg_checkin/confirmOrder/confirmOrder.vue

@@ -273,9 +273,17 @@
 				if (!alipayRes.data.success) {
 					console.log("获取预付号失败");
 					uni.showModal({
-						title: "网络连接出错。",
-						content: "网络连接出错,请检查网络连接后重试。",
-					});
+						content: '房间已被占用,请重新选房',
+						showCancel: false,
+						success: (res) => {
+							if (res.confirm) {
+								uni.navigateTo({
+									url: '/subpkg_checkin/selectRoom/selectRoom?roomType=' +
+										this.order.roomType
+								})
+							}
+						}
+					})
 					return
 				}
 
@@ -286,12 +294,18 @@
 				})
 				// console.log("tradeRes 交易支付结果",tradeRes.resultCode);
 
+				if (tradeRes.resultCode === "6001") {
+					console.log("支付未完成。");
+					uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
+				}
+
 				if (tradeRes.resultCode === "6002") {
 					// 网络连接出错
 					uni.showModal({
 						title: "网络连接出错",
 						content: "网络连接出错,请检查网络连接后重试。",
 					});
+					uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
 				}
 
 				// 顾客支付后,查询支付状态
@@ -307,6 +321,8 @@
 						uni.navigateTo({
 							url: '/subpkg_checkin/checkin/checkin'
 						})
+					} else {
+						uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
 					}
 				}
 			},
@@ -319,11 +335,19 @@
 				console.log("签名字符串", alipayRes.data)
 
 				if (!alipayRes.data.success) {
-					console.log("获取签名字符串");
+					console.log("获取签名字符串失败");
 					uni.showModal({
-						title: "网络连接出错。",
-						content: "网络连接出错,请检查网络连接后重试。",
-					});
+						content: '房间已被占用,请重新选房',
+						showCancel: false,
+						success: (res) => {
+							if (res.confirm) {
+								uni.navigateTo({
+									url: '/subpkg_checkin/selectRoom/selectRoom?roomType=' +
+										this.order.roomType
+								})
+							}
+						}
+					})
 					return
 				}
 
@@ -334,12 +358,18 @@
 				})
 				// console.log("tradeRes 授权结果",tradeRes.resultCode);
 
+				if (tradeRes.resultCode === "6001") {
+					console.log("支付未完成。");
+					uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
+				}
+
 				if (tradeRes.resultCode === "6002") {
 					// 网络连接出错
 					uni.showModal({
 						title: "网络连接出错",
 						content: "网络连接出错,请检查网络连接后重试。",
 					});
+					uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
 				}
 
 				// 顾客授权后,查询授权状态
@@ -355,6 +385,8 @@
 						uni.navigateTo({
 							url: '/subpkg_checkin/checkin/checkin'
 						})
+					} else {
+						uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
 					}
 				}
 			}