|
@@ -13,7 +13,8 @@
|
|
<view class="pay-content">
|
|
<view class="pay-content">
|
|
<view class="pay-list">
|
|
<view class="pay-list">
|
|
<radio-group @change="payRadioChange">
|
|
<radio-group @change="payRadioChange">
|
|
- <view class="pay-list-item">
|
|
|
|
|
|
+ <!-- #ifdef H5 || MP-WEIXIN -->
|
|
|
|
+ <view class="pay-list-item" v-if="wxEnv">
|
|
<view class="pay-list-item-image">
|
|
<view class="pay-list-item-image">
|
|
<image class="image" src="/static/img/wechat-icon-new.png" mode="aspectFit" />
|
|
<image class="image" src="/static/img/wechat-icon-new.png" mode="aspectFit" />
|
|
<view>微信支付</view>
|
|
<view>微信支付</view>
|
|
@@ -22,6 +23,7 @@
|
|
<radio color="#2DCF8C" value="weixin" :checked="'weixin' === radioCurrent" />
|
|
<radio color="#2DCF8C" value="weixin" :checked="'weixin' === radioCurrent" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <!-- #endif -->
|
|
<template v-if="alipayEnv">
|
|
<template v-if="alipayEnv">
|
|
<view class="pay-list-item">
|
|
<view class="pay-list-item">
|
|
<view class="pay-list-item-image">
|
|
<view class="pay-list-item-image">
|
|
@@ -75,7 +77,7 @@
|
|
>
|
|
>
|
|
</view>
|
|
</view>
|
|
<view class="pay-btn">
|
|
<view class="pay-btn">
|
|
- <u-button type="primary" shape="circle" :disabled="!radioCurrent" @click="immediatePayment">立即支付</u-button>
|
|
|
|
|
|
+ <u-button type="primary" shape="circle" :disabled="!radioCurrent" @tap="$u.debounce(immediatePayment, 1500, true)">立即支付</u-button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</u-modal>
|
|
</u-modal>
|
|
@@ -258,10 +260,14 @@ export default {
|
|
* @returns {any}
|
|
* @returns {any}
|
|
*/
|
|
*/
|
|
openPopup(details, numType = 'single', orderType = 'road') {
|
|
openPopup(details, numType = 'single', orderType = 'road') {
|
|
|
|
+ // 获取环境信息
|
|
this.wxEnv = getEnvIsWx();
|
|
this.wxEnv = getEnvIsWx();
|
|
this.alipayEnv = getEnvIsAlipay();
|
|
this.alipayEnv = getEnvIsAlipay();
|
|
|
|
+ // 打开弹出层
|
|
this.payWayPop = true;
|
|
this.payWayPop = true;
|
|
|
|
+ // 计算订单金额
|
|
this.orderMoney = details.payAmount.toFixed(2);
|
|
this.orderMoney = details.payAmount.toFixed(2);
|
|
|
|
+ // 如果是单个停车订单,且是路边停车,且不是月卡支付,则显示优惠券
|
|
if (numType === 'single' && orderType === 'parking' && !this.isMonthPay) {
|
|
if (numType === 'single' && orderType === 'parking' && !this.isMonthPay) {
|
|
this.isShowCoupon = true;
|
|
this.isShowCoupon = true;
|
|
this.isCancelCoupon = true;
|
|
this.isCancelCoupon = true;
|
|
@@ -405,7 +411,6 @@ export default {
|
|
this.cancelCoupon(messageMap[r.code]);
|
|
this.cancelCoupon(messageMap[r.code]);
|
|
} else {
|
|
} else {
|
|
this.showToast(messageMap[r.code], 'info');
|
|
this.showToast(messageMap[r.code], 'info');
|
|
- location.reload();
|
|
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 2: // 支付失败
|
|
case 2: // 支付失败
|
|
@@ -416,8 +421,7 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.showToast('无需支付', 'info');
|
|
this.showToast('无需支付', 'info');
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- uni.hideLoading();
|
|
|
|
- location.reload();
|
|
|
|
|
|
+ this.jumpUrl ? (location.href = `${this.jumpUrl}`) : location.reload();
|
|
}, 1000);
|
|
}, 1000);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -616,7 +620,7 @@ export default {
|
|
switch (Number(r.code)) {
|
|
switch (Number(r.code)) {
|
|
case 0: // 成功
|
|
case 0: // 成功
|
|
//#ifdef H5
|
|
//#ifdef H5
|
|
- location.reload();
|
|
|
|
|
|
+ this.jumpUrl ? (location.href = `${this.jumpUrl}&polyOrderId=${data.polyOrderId}`) : location.reload();
|
|
//#endif
|
|
//#endif
|
|
break;
|
|
break;
|
|
case 1: // 取消
|
|
case 1: // 取消
|
|
@@ -624,7 +628,6 @@ export default {
|
|
this.cancelCoupon(messageMap[r.code]);
|
|
this.cancelCoupon(messageMap[r.code]);
|
|
} else {
|
|
} else {
|
|
this.showToast(messageMap[r.code], 'info');
|
|
this.showToast(messageMap[r.code], 'info');
|
|
- location.reload();
|
|
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 2: // 支付失败
|
|
case 2: // 支付失败
|
|
@@ -644,7 +647,7 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.showToast('无需支付', 'info');
|
|
this.showToast('无需支付', 'info');
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- location.href = this.jumpUrl;
|
|
|
|
|
|
+ this.jumpUrl ? (location.href = `${this.jumpUrl}&polyOrderId=${data.polyOrderId}`) : location.reload();
|
|
}, 1000);
|
|
}, 1000);
|
|
}
|
|
}
|
|
}
|
|
}
|