|
@@ -190,10 +190,11 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
|
- :class="{
|
|
|
- flewx_index3: true,
|
|
|
- 'btn-disabled': payBtnDisabled,
|
|
|
- }"
|
|
|
+ :class="[
|
|
|
+ 'flewx_index3',
|
|
|
+ payBtnDisabled && 'btn-disabled',
|
|
|
+ btnLoading && 'btn-disabled',
|
|
|
+ ]"
|
|
|
@click="toPay"
|
|
|
>
|
|
|
支付
|
|
@@ -318,6 +319,8 @@ export default {
|
|
|
integralMaxMoney: 0, // 深圳前海停车积分上限
|
|
|
// 是否重载
|
|
|
// isReload: '1',
|
|
|
+ Toastloading: null,
|
|
|
+ btnLoading: false,
|
|
|
};
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
@@ -325,7 +328,6 @@ export default {
|
|
|
if (/index|home/.test(to.name)) {
|
|
|
// 不在缓存列表中,从cachedViews缓存列表中移除
|
|
|
this.$store.commit('cachedViews/DEL_CACHED_VIEW', from);
|
|
|
-
|
|
|
}
|
|
|
next();
|
|
|
},
|
|
@@ -1530,9 +1532,12 @@ export default {
|
|
|
// ) {
|
|
|
// return;
|
|
|
// }
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
+ this.Toastloading = Toast.loading({
|
|
|
+ message: '加载中',
|
|
|
+ duration: 0,
|
|
|
+ forbidClick: true,
|
|
|
});
|
|
|
+ this.btnLoading = true;
|
|
|
let bonus = this.duration * this.integral;
|
|
|
// 深圳特殊处理(单位:金额)
|
|
|
if (this.parkMallCode === 5) {
|
|
@@ -1788,12 +1793,14 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
window.subscribe('wxPayOver', (options) => {
|
|
|
+ this.Toastloading.clear();
|
|
|
// console.log('微信支付结束之后的返回参数', options);
|
|
|
// TODO: 在 qa 新发版前,只提示支付成功的信息
|
|
|
if (options?.wxPayOver === 'fail') {
|
|
|
// console.log('支付失败');
|
|
|
this.failedParkOrder();
|
|
|
} else {
|
|
|
+ this.btnLoading = false;
|
|
|
this.$router.replace({
|
|
|
path: '/parkingFeeSuccess?carno=' + this.parkInfo.carno,
|
|
|
});
|
|
@@ -1849,7 +1856,7 @@ export default {
|
|
|
message: '支付失败',
|
|
|
confirmButtonColor: '#333',
|
|
|
}).then(() => {
|
|
|
- // on confirm
|
|
|
+ this.btnLoading = false;
|
|
|
this.createParkOrder();
|
|
|
});
|
|
|
// uni.showModal({
|
|
@@ -1864,12 +1871,11 @@ export default {
|
|
|
|
|
|
// 支付失败后返还优惠券
|
|
|
failedParkOrder() {
|
|
|
+ this.Toastloading.clear();
|
|
|
const param = {
|
|
|
orderno: this.parkInfo.orderno,
|
|
|
};
|
|
|
- // console.log(1943, '支付失败后返还优惠券');
|
|
|
this.$md(param);
|
|
|
- // console.log(1946, this.$baseURL + 'api/1.0/park/failedParkOrder');
|
|
|
uni
|
|
|
.request({
|
|
|
url: this.$baseURL + 'api/1.0/park/failedParkOrder',
|
|
@@ -1878,11 +1884,9 @@ export default {
|
|
|
header: JSON.parse(uni.getStorageSync('handleUser')),
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- // console.log(1954, 'reCreateParkOrder then');
|
|
|
this.reCreateParkOrder();
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- // console.log(1958, 'reCreateParkOrder catch');
|
|
|
this.reCreateParkOrder();
|
|
|
});
|
|
|
},
|