|
@@ -146,6 +146,7 @@
|
|
|
}
|
|
|
}],
|
|
|
title: "",
|
|
|
+ appId: '',
|
|
|
// #ifdef MP-ALIPAY
|
|
|
rightBtns: [{
|
|
|
text: "删除",
|
|
@@ -215,6 +216,7 @@
|
|
|
let res = await uni.$http.post('/order/payment/weChat', {
|
|
|
openid: this.userInfo.openid,
|
|
|
orderId: this.order.orderId,
|
|
|
+ appId: this.appId
|
|
|
})
|
|
|
if (res.data.code == 200) {
|
|
|
res.data.data.package = res.data.data.packageStr
|
|
@@ -270,21 +272,19 @@
|
|
|
// #endif
|
|
|
},
|
|
|
async ystPayment() {
|
|
|
- const {miniProgram: {appId}} = uni.getAccountInfoSync();
|
|
|
- // console.log("小程序信息", appId);
|
|
|
-
|
|
|
+ let platform
|
|
|
// #ifdef MP-WEIXIN
|
|
|
- const platform = "WECHAT"
|
|
|
+ platform = "WECHAT"
|
|
|
// #endif
|
|
|
|
|
|
// #ifdef MP-ALIPAY
|
|
|
- const platform = "ALIPAY"
|
|
|
+ platform = "ALIPAY"
|
|
|
// #endif
|
|
|
|
|
|
const {data: submitRes} = await uni.$http.post('/order/payment/ystPay', {
|
|
|
openid: this.userInfo.openid,
|
|
|
orderId: this.order.orderId,
|
|
|
- appId: appId
|
|
|
+ appId: this.appId
|
|
|
})
|
|
|
|
|
|
console.log("订单提交结果", submitRes)
|
|
@@ -336,7 +336,7 @@
|
|
|
const {data: paymentRes} = await uni.$http.post('/order/payment/queryYstPay', {
|
|
|
openid: this.userInfo.openid,
|
|
|
orderId: this.order.orderId,
|
|
|
- appId: appId,
|
|
|
+ appId: this.appId,
|
|
|
platform: platform
|
|
|
})
|
|
|
console.log("订单支付结果", paymentRes)
|
|
@@ -369,7 +369,8 @@
|
|
|
// 申请获取预付号
|
|
|
let alipayRes = await uni.$http.post('/order/payment/alipayNormal', {
|
|
|
openid: this.userInfo.openid,
|
|
|
- orderId: this.order.orderId
|
|
|
+ orderId: this.order.orderId,
|
|
|
+ appId: this.appId
|
|
|
})
|
|
|
// console.log("获取预付号",alipayRes.data)
|
|
|
if (!alipayRes.data.success) {
|
|
@@ -447,7 +448,8 @@
|
|
|
// 申请获取签名字符串
|
|
|
let alipayRes = await uni.$http.post('/order/payment/alipayAuthPay', {
|
|
|
openid: this.userInfo.openid,
|
|
|
- orderId: this.order.orderId
|
|
|
+ orderId: this.order.orderId,
|
|
|
+ appId: this.appId
|
|
|
})
|
|
|
console.log("签名字符串", alipayRes.data)
|
|
|
|
|
@@ -509,7 +511,8 @@
|
|
|
// 顾客授权后,查询授权状态,只有AUTHORIZED(已授权状态:授权成功,可以进行转支付或解冻操作)才算成功
|
|
|
const { data: tradeStatus } = await uni.$http.post('/order/payment/queryAlipayAuthPay', {
|
|
|
openid: this.userInfo.openid,
|
|
|
- orderId: this.order.orderId
|
|
|
+ orderId: this.order.orderId,
|
|
|
+ appId: this.appId
|
|
|
})
|
|
|
// console.log("tradeStatus", tradeStatus);
|
|
|
if (tradeStatus.success && tradeStatus.data === "AUTHORIZED") {
|
|
@@ -525,6 +528,8 @@
|
|
|
// #endif
|
|
|
},
|
|
|
async onLoad() {
|
|
|
+ const {miniProgram: {appId}} = uni.getAccountInfoSync();
|
|
|
+ this.appId = appId
|
|
|
const res = await uni.$http.post(`/hotel/roomType`, {
|
|
|
hotelId: this.currentHotel.hotelId,
|
|
|
roomType: this.order.roomType
|