feat: 越南充值页加 USDT (TRC20) 通道切换

- recharge.vue: 银行卡 / USDT 两个 tab,共用 amount 输入
- api.js: 新增 epayDeposit 调 /epay_online_order

USDT 请求体多传 pay_type='usdt',下单响应同 AlinPay 走 Data.url 跳转
This commit is contained in:
li
2026-04-15 23:19:16 +08:00
parent b67b11c181
commit 91fa85f4ef
2 changed files with 88 additions and 4 deletions
+84 -4
View File
@@ -184,11 +184,23 @@
@confirm="confirmPicker"
></u-picker>
</template>
<!-- 越南 AlinPay 在线充值 -->
<!-- 越南在线充值银行卡 (AlinPay) / USDT (Epay) 双通道 -->
<template v-if="userInfo.pay_channel == 'ALIN_VN'">
<view class="pay-tabs">
<view
class="pay-tab"
:class="{ active: payChannel === 'alin' }"
@click="payChannel = 'alin'"
>Thẻ ngân hàng</view>
<view
class="pay-tab"
:class="{ active: payChannel === 'epay' }"
@click="payChannel = 'epay'"
>USDT (TRC20)</view>
</view>
<view class="picker-view">
<u-input
placeholder="Tối thiểu 1,000,000"
:placeholder="payChannel === 'epay' ? 'Số tiền nạp' : 'Tối thiểu 1,000,000'"
color="#93979b"
v-model="amount"
type="number"
@@ -207,12 +219,12 @@
class="button"
color="#e5b932"
:text="$lang.submit"
@click="submitAlin"
@click="payChannel === 'epay' ? submitEpay() : submitAlin()"
></u-button>
</view>
<view class="list">
<view class="tip">
{{ $lang.rechargeTip }}
{{ payChannel === 'epay' ? 'Thanh toán USDT qua mạng TRC20' : $lang.rechargeTip }}
</view>
</view>
</template>
@@ -240,6 +252,8 @@ export default {
amount: "",
currency: { name: "", key: "" },
coin_type: { name: "", key: "" },
// 越南地区在线支付通道:'alin'(银行卡) | 'epay'(USDT)
payChannel: "alin",
};
},
computed: {
@@ -409,11 +423,77 @@ export default {
this.$toastHide();
});
},
submitEpay() {
if (!this.amount || this.amount <= 0) {
this.$toast({ message: 'Vui lòng nhập số tiền', duration: 2000 });
return;
}
if (this.amount < 1000000) {
this.$toast({ message: 'Số tiền tối thiểu là 1,000,000', duration: 2000 });
return;
}
const params = {
user_id: this.userInfo.id,
price: this.amount,
client: 3,
username: this.userInfo.username,
pay_type: 'usdt',
};
this.$toast({
type: "loading",
message: `${this.$lang.submit}...`,
duration: 200000,
});
this.$api
.epayDeposit(params)
.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");
}
} else {
this.$toast({ message: d.message || 'Nạp thất bại', duration: 2000 });
}
})
.catch((err) => {
console.log(err);
})
.finally(() => {
this.$toastHide();
});
},
},
};
</script>
<style lang="scss" scoped>
.pay-tabs {
display: flex;
padding: 20rpx 30rpx 0;
gap: 15rpx;
}
.pay-tab {
flex: 1;
text-align: center;
padding: 18rpx 0;
color: #93979b;
background: rgba(255, 255, 255, 0.04);
border: 1rpx solid #2a3448;
border-radius: 8rpx;
font-size: 26rpx;
transition: all 0.2s;
&.active {
background: linear-gradient(to right, #e5b932, #c5971e);
color: #0b1520;
font-weight: bold;
border-color: #e5b932;
}
}
.recharge {
background: #0b1520;
width: 100%;
+4
View File
@@ -57,6 +57,10 @@ let api = {
alinDeposit: async (params) => {
return await ajax.post("/alin_online_order", params);
},
// 彩虹易支付充值(USDT TRC20 / 支付宝 / 微信 等,默认 usdt)
epayDeposit: async (params) => {
return await ajax.post("/epay_online_order", params);
},
// 越南银行卡提现
applyWithdrawBank: async (params) => {
return await ajax.post("/apply_withdraw_bank", params);