feat: AlinPay 充值改为 iframe 内嵌弹窗,不再跳转外链
This commit is contained in:
+56
-7
@@ -236,6 +236,17 @@
|
||||
</view>
|
||||
<view class="mb60"></view>
|
||||
|
||||
<!-- AlinPay 内嵌支付弹窗 -->
|
||||
<view class="alin-overlay" v-if="alinPay.visible" @click.self="closeAlinPay">
|
||||
<view class="alin-pay-box">
|
||||
<view class="alin-pay-header">
|
||||
<text class="alin-pay-title">Thanh toán ngân hàng</text>
|
||||
<view class="epay-qr-close" @click="closeAlinPay">×</view>
|
||||
</view>
|
||||
<iframe v-if="alinPay.url" :src="alinPay.url" class="alin-iframe" frameborder="0" allow="payment"></iframe>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- USDT 内嵌二维码弹窗 -->
|
||||
<u-popup :show="epayQr.visible" mode="center" round="10" :closeOnClickOverlay="false" @close="closeEpayQr">
|
||||
<view class="epay-qr-box">
|
||||
@@ -362,6 +373,10 @@ export default {
|
||||
},
|
||||
_bankPollTimer: null,
|
||||
_bankCountdownTimer: null,
|
||||
alinPay: {
|
||||
visible: false,
|
||||
url: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -510,13 +525,8 @@ export default {
|
||||
.then((res) => {
|
||||
const d = res.Data || {};
|
||||
if (d.status == 1 && d.url) {
|
||||
const o = navigator.userAgent;
|
||||
const isiOS = !!o.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
||||
if (isiOS) {
|
||||
window.location.href = d.url;
|
||||
} else {
|
||||
window.open(d.url, "_blank");
|
||||
}
|
||||
this.alinPay.url = d.url;
|
||||
this.alinPay.visible = true;
|
||||
} else {
|
||||
this.$toast({
|
||||
message: d.message || '充值失败',
|
||||
@@ -643,6 +653,10 @@ export default {
|
||||
},
|
||||
});
|
||||
},
|
||||
closeAlinPay() {
|
||||
this.alinPay.visible = false;
|
||||
this.alinPay.url = "";
|
||||
},
|
||||
closeEpayQr() {
|
||||
this.epayQr.visible = false;
|
||||
this.stopEpayTimers();
|
||||
@@ -956,4 +970,39 @@ export default {
|
||||
margin-top: 14rpx;
|
||||
opacity: 0.85;
|
||||
}
|
||||
.alin-overlay {
|
||||
position: fixed;
|
||||
top: 0; left: 0; right: 0; bottom: 0;
|
||||
z-index: 9999;
|
||||
background: rgba(0,0,0,0.6);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.alin-pay-box {
|
||||
width: 92vw;
|
||||
height: 85vh;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.alin-pay-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px 15px;
|
||||
background: #1a1a2e;
|
||||
}
|
||||
.alin-pay-title {
|
||||
color: #f4c46f;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.alin-iframe {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user