From 91fa85f4ef5922ee08fa719d7af7d50b8cc980a1 Mon Sep 17 00:00:00 2001 From: li Date: Wed, 15 Apr 2026 23:19:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B6=8A=E5=8D=97=E5=85=85=E5=80=BC?= =?UTF-8?q?=E9=A1=B5=E5=8A=A0=20USDT=20(TRC20)=20=E9=80=9A=E9=81=93?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - recharge.vue: 银行卡 / USDT 两个 tab,共用 amount 输入 - api.js: 新增 epayDeposit 调 /epay_online_order USDT 请求体多传 pay_type='usdt',下单响应同 AlinPay 走 Data.url 跳转 --- pages/recharge.vue | 88 +++++++++++++++++++++++++++++++++++++++++++--- request/api.js | 4 +++ 2 files changed, 88 insertions(+), 4 deletions(-) diff --git a/pages/recharge.vue b/pages/recharge.vue index 9e0a32d..8309e9d 100644 --- a/pages/recharge.vue +++ b/pages/recharge.vue @@ -184,11 +184,23 @@ @confirm="confirmPicker" > - + @@ -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(); + }); + }, }, };