|
@@ -269,6 +269,8 @@ import { compare } from '@/utils/location.js';
|
|
|
import uni from '@/utils/uniHooks';
|
|
|
import { initWxJsSdkConfig } from '@/utils/login';
|
|
|
import { isInWeixinH5, getPlatform } from '@/utils/index';
|
|
|
+import { Dialog } from 'vant';
|
|
|
+import { json } from 'body-parser';
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -534,18 +536,18 @@ export default {
|
|
|
this.refreshTime = countDownTime;
|
|
|
}
|
|
|
}
|
|
|
- return;
|
|
|
+ // return;
|
|
|
|
|
|
// 优惠减免(首停、会员、消费)
|
|
|
this.checkedTotal = uni.getStorageSync('checkedTotal');
|
|
|
this.discountTotal = uni.getStorageSync('discountTotal');
|
|
|
|
|
|
// 电子券减免(停车券)
|
|
|
- this.couponInfo = uni.getStorageSync('couponInfo');
|
|
|
- this.checkedCouponCount = uni.getStorageSync('checkedCouponList').length;
|
|
|
+ this.couponInfo = JSON.parse(uni.getStorageSync('couponInfo'));
|
|
|
+ this.checkedCouponCount = JSON.parse(uni.getStorageSync('checkedCouponList')).length;
|
|
|
|
|
|
// 纸质优惠券
|
|
|
- this.paperCouponInfo = uni.getStorageSync('paperCouponInfo');
|
|
|
+ this.paperCouponInfo = JSON.parse(uni.getStorageSync('paperCouponInfo'));
|
|
|
}
|
|
|
},
|
|
|
onHide() {
|
|
@@ -1873,6 +1875,7 @@ export default {
|
|
|
window.subscribe('wxPayOver', (options) => {
|
|
|
console.log('微信支付结束之后的返回参数', options);
|
|
|
if (options?.wxPayOver === 'fail') {
|
|
|
+ console.log('支付失败');
|
|
|
this.failedParkOrder();
|
|
|
} else {
|
|
|
this.$router.replace({
|
|
@@ -1924,14 +1927,23 @@ export default {
|
|
|
|
|
|
// 支付失败弹框 重新创建订单
|
|
|
reCreateParkOrder() {
|
|
|
- uni.showModal({
|
|
|
- showCancel: false,
|
|
|
+ console.log('支付失败弹框 重新创建订单');
|
|
|
+ Dialog.alert({
|
|
|
title: '提示',
|
|
|
- content: '支付失败',
|
|
|
- complete: (r) => {
|
|
|
- this.createParkOrder();
|
|
|
- },
|
|
|
+ message: '支付失败',
|
|
|
+ confirmButtonColor: '#333',
|
|
|
+ }).then(() => {
|
|
|
+ // on confirm
|
|
|
+ this.createParkOrder();
|
|
|
});
|
|
|
+ // uni.showModal({
|
|
|
+ // showCancel: false,
|
|
|
+ // title: '提示',
|
|
|
+ // content: '支付失败',
|
|
|
+ // complete: (r) => {
|
|
|
+ // this.createParkOrder();
|
|
|
+ // },
|
|
|
+ // });
|
|
|
},
|
|
|
|
|
|
// 支付失败后返还优惠券
|
|
@@ -1939,17 +1951,22 @@ export default {
|
|
|
const param = {
|
|
|
orderno: this.parkInfo.orderno,
|
|
|
};
|
|
|
+ console.log(1943, '支付失败后返还优惠券');
|
|
|
this.$md(param);
|
|
|
- this.$request({
|
|
|
- path: this.$baseURL + 'api/1.0/park/failedParkOrder',
|
|
|
- data: param,
|
|
|
- method: 'POST',
|
|
|
- header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
- })
|
|
|
+ console.log(1946, this.$baseURL + 'api/1.0/park/failedParkOrder');
|
|
|
+ uni
|
|
|
+ .request({
|
|
|
+ url: this.$baseURL + 'api/1.0/park/failedParkOrder',
|
|
|
+ data: param,
|
|
|
+ method: 'POST',
|
|
|
+ header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
+ })
|
|
|
.then((res) => {
|
|
|
+ console.log(1954, 'reCreateParkOrder then');
|
|
|
this.reCreateParkOrder();
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
+ console.log(1958, 'reCreateParkOrder catch');
|
|
|
this.reCreateParkOrder();
|
|
|
});
|
|
|
},
|