|
@@ -276,7 +276,7 @@
|
|
},
|
|
},
|
|
async aliPaymentNormal() {
|
|
async aliPaymentNormal() {
|
|
// 申请获取预付号
|
|
// 申请获取预付号
|
|
- let alipayRes = await uni.$http.post('/hotelOrder/alipayPrepay', {
|
|
|
|
|
|
+ let alipayRes = await uni.$http.post('/order/payment/alipayNormal', {
|
|
openid: this.userInfo.openid,
|
|
openid: this.userInfo.openid,
|
|
orderId: this.order.orderId
|
|
orderId: this.order.orderId
|
|
})
|
|
})
|
|
@@ -322,7 +322,7 @@
|
|
|
|
|
|
if (tradeRes.resultCode === "6001") {
|
|
if (tradeRes.resultCode === "6001") {
|
|
console.log("支付未完成。");
|
|
console.log("支付未完成。");
|
|
- uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
|
|
|
|
|
|
+ uni.$http.post(`/order/cancelPayment/${this.order.id}`)
|
|
}
|
|
}
|
|
|
|
|
|
if (tradeRes.resultCode === "6002") {
|
|
if (tradeRes.resultCode === "6002") {
|
|
@@ -331,13 +331,13 @@
|
|
title: "网络连接出错",
|
|
title: "网络连接出错",
|
|
content: "网络连接出错,请检查网络连接后重试。",
|
|
content: "网络连接出错,请检查网络连接后重试。",
|
|
});
|
|
});
|
|
- uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
|
|
|
|
|
|
+ uni.$http.post(`/order/cancelPayment/${this.order.id}`)
|
|
}
|
|
}
|
|
|
|
|
|
// 顾客支付后,查询支付状态
|
|
// 顾客支付后,查询支付状态
|
|
if (["9000", "6004", "8000"].includes(tradeRes.resultCode)) {
|
|
if (["9000", "6004", "8000"].includes(tradeRes.resultCode)) {
|
|
// 顾客支付订单后,查询支付宝侧的订单支付状态,只有TRADE_SUCCESS才为支付成功
|
|
// 顾客支付订单后,查询支付宝侧的订单支付状态,只有TRADE_SUCCESS才为支付成功
|
|
- let tradeStatus = await uni.$http.post('/hotelOrder/queryAlipayTradeStatus', {
|
|
|
|
|
|
+ let tradeStatus = await uni.$http.post('/order/payment/queryAlipayNormal', {
|
|
tradeNo: tradeNo,
|
|
tradeNo: tradeNo,
|
|
hotelId: this.currentHotel.hotelId
|
|
hotelId: this.currentHotel.hotelId
|
|
})
|
|
})
|
|
@@ -348,15 +348,15 @@
|
|
url: '/subpkg_checkin/checkin/checkin'
|
|
url: '/subpkg_checkin/checkin/checkin'
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
|
|
|
|
|
|
+ uni.$http.post(`/order/cancelPayment/${this.order.id}`)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async aliPaymentFreeze() {
|
|
async aliPaymentFreeze() {
|
|
// 申请获取签名字符串
|
|
// 申请获取签名字符串
|
|
- let alipayRes = await uni.$http.post('/hotelOrder/alipayFreezeFund', {
|
|
|
|
- orderId: this.order.orderId,
|
|
|
|
- hotelId: this.currentHotel.hotelId
|
|
|
|
|
|
+ let alipayRes = await uni.$http.post('/order/payment/alipayAuthPay', {
|
|
|
|
+ openid: this.userInfo.openid,
|
|
|
|
+ orderId: this.order.orderId
|
|
})
|
|
})
|
|
console.log("签名字符串", alipayRes.data)
|
|
console.log("签名字符串", alipayRes.data)
|
|
|
|
|
|
@@ -401,7 +401,7 @@
|
|
|
|
|
|
if (tradeRes.resultCode === "6001") {
|
|
if (tradeRes.resultCode === "6001") {
|
|
console.log("支付未完成。");
|
|
console.log("支付未完成。");
|
|
- uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
|
|
|
|
|
|
+ uni.$http.post(`/order/cancelPayment/${this.order.id}`)
|
|
}
|
|
}
|
|
|
|
|
|
if (tradeRes.resultCode === "6002") {
|
|
if (tradeRes.resultCode === "6002") {
|
|
@@ -410,31 +410,31 @@
|
|
title: "网络连接出错",
|
|
title: "网络连接出错",
|
|
content: "网络连接出错,请检查网络连接后重试。",
|
|
content: "网络连接出错,请检查网络连接后重试。",
|
|
});
|
|
});
|
|
- uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
|
|
|
|
|
|
+ uni.$http.post(`/order/cancelPayment/${this.order.id}`)
|
|
}
|
|
}
|
|
|
|
|
|
// 顾客授权后,查询授权状态
|
|
// 顾客授权后,查询授权状态
|
|
if (["9000", "6004", "8000"].includes(tradeRes.resultCode)) {
|
|
if (["9000", "6004", "8000"].includes(tradeRes.resultCode)) {
|
|
// 顾客授权后,查询授权状态,只有AUTHORIZED(已授权状态:授权成功,可以进行转支付或解冻操作)才算成功
|
|
// 顾客授权后,查询授权状态,只有AUTHORIZED(已授权状态:授权成功,可以进行转支付或解冻操作)才算成功
|
|
- let tradeStatus = await uni.$http.post('/hotelOrder/queryFreezeStatus', {
|
|
|
|
- orderId: this.order.orderId,
|
|
|
|
- hotelId: this.currentHotel.hotelId
|
|
|
|
|
|
+ const { data: tradeStatus } = await uni.$http.post('/order/payment/queryAlipayAuthPay', {
|
|
|
|
+ openid: this.userInfo.openid,
|
|
|
|
+ orderId: this.order.orderId
|
|
})
|
|
})
|
|
// console.log("tradeStatus", tradeStatus);
|
|
// console.log("tradeStatus", tradeStatus);
|
|
- if (tradeStatus.data.success && tradeStatus.data.data === "AUTHORIZED") {
|
|
|
|
|
|
+ if (tradeStatus.success && tradeStatus.data === "AUTHORIZED") {
|
|
uni.$showMsg("支付成功")
|
|
uni.$showMsg("支付成功")
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/subpkg_checkin/checkin/checkin'
|
|
url: '/subpkg_checkin/checkin/checkin'
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- uni.$http.post(`/hotelOrder/cancelPayment/${this.order.id}`)
|
|
|
|
|
|
+ uni.$http.post(`/order/cancelPayment/${this.order.id}`)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// #endif
|
|
// #endif
|
|
},
|
|
},
|
|
async onLoad() {
|
|
async onLoad() {
|
|
- let res = await uni.$http.post(`/hotel/roomType`, {
|
|
|
|
|
|
+ const res = await uni.$http.post(`/hotel/roomType`, {
|
|
hotelId: this.currentHotel.hotelId,
|
|
hotelId: this.currentHotel.hotelId,
|
|
roomType: this.order.roomType
|
|
roomType: this.order.roomType
|
|
})
|
|
})
|