From 18a4d03c3a8a6b2f6119191b70fa243e5fa44ff4 Mon Sep 17 00:00:00 2001 From: li Date: Sun, 22 Mar 2026 12:55:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=B9=E6=8E=A5=E8=B6=8A=E5=8D=97Ali?= =?UTF-8?q?nPay=E6=94=AF=E4=BB=98=EF=BC=88=E5=85=85=E5=80=BC+=E6=8F=90?= =?UTF-8?q?=E7=8E=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - recharge.vue: 新增ALIN_VN充值模板,最低1,000,000 VND - withdraw.vue: 新增银行卡提现模板,银行列表API加载,最低1,000,000 VND - api.js: 新增alinDeposit/applyWithdrawBank/getBankListVn接口 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- pages/recharge.vue | 85 +++++++++++ pages/withdraw.vue | 346 +++++++++++++++++++++++++++++++++++---------- request/api.js | 12 ++ 3 files changed, 371 insertions(+), 72 deletions(-) diff --git a/pages/recharge.vue b/pages/recharge.vue index 2457318..9e0a32d 100644 --- a/pages/recharge.vue +++ b/pages/recharge.vue @@ -184,6 +184,38 @@ @confirm="confirmPicker" > + + @@ -324,6 +356,59 @@ export default { }); } }, + // 越南 AlinPay 充值 + submitAlin() { + 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, + }; + this.$toast({ + type: "loading", + message: `${this.$lang.submit}...`, + duration: 200000, + }); + this.$api + .alinDeposit(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 || '充值失败', + duration: 2000, + }); + } + }) + .catch((err) => { + console.log(err); + }) + .finally(() => { + this.$toastHide(); + }); + }, }, }; diff --git a/pages/withdraw.vue b/pages/withdraw.vue index 4f1894b..3aa58b5 100644 --- a/pages/withdraw.vue +++ b/pages/withdraw.vue @@ -18,77 +18,161 @@ >{{ $lang.balance }}:{{ userInfo.money }} - - - - - - - - - {{ $lang.walletAddress }} - - - - {{ $lang.amount }} - - - - {{ $lang.rechargeWithdrawNetwork }} - TRC20 - - - - - - {{ $lang.withdrawTip }} - {{ $lang.commission }}:1 USDT - + + + + @@ -104,6 +188,14 @@ export default { type: "USDT", show: false, columns: [["USDT"]], + // 越南银行卡提现 + bankName: "", + bankCode: "", + accountName: "", + accountNumber: "", + showBankPicker: false, + bankColumns: [[]], + bankList: [], }; }, computed: { @@ -112,7 +204,12 @@ export default { $lang: (state) => state.app.lang[state.app.language], }), }, - onLoad() {}, + onLoad() { + // 越南渠道加载银行列表 + if (this.userInfo && this.userInfo.pay_channel === 'ALIN_VN') { + this.loadBankList(); + } + }, methods: { confirm(chose) { this.type = chose.value[0]; @@ -169,6 +266,111 @@ export default { }); } }, + // 加载越南银行列表 + loadBankList() { + this.$api + .getBankListVn({ user_id: this.userInfo.id }) + .then((res) => { + if (res.Data && res.Data.data) { + this.bankList = res.Data.data; + this.bankColumns = [res.Data.data.map((item) => item.name)]; + } + }) + .catch((err) => { + console.log(err); + }); + }, + // 选择银行 + confirmBank(chose) { + this.bankName = chose.value[0]; + this.bankCode = chose.value[0]; + this.showBankPicker = false; + }, + // 越南银行卡提现 + applyWithdrawBank() { + if (!this.bankName) { + this.$toast({ + message: this.$lang.bankName || '请选择银行', + duration: 2000, + }); + return; + } + if (!this.accountName) { + this.$toast({ + message: this.$lang.enterAccountName || '请输入账户姓名', + duration: 2000, + }); + return; + } + if (!this.accountNumber) { + this.$toast({ + message: this.$lang.enterAccountNumber || '请输入银行卡号', + duration: 2000, + }); + return; + } + if (!this.money || this.money <= 0) { + this.$toast({ + message: this.$lang.amountCannotBe0, + duration: 2000, + }); + return; + } + if (Number(this.money) < 1000000) { + this.$toast({ + message: 'Số tiền rút tối thiểu là 1,000,000 VND', + duration: 2000, + }); + return; + } + if (Number(this.money) > Number(this.userInfo.money)) { + this.$toast({ + message: this.$lang.insufficientBalance || 'Số dư không đủ', + duration: 2000, + }); + return; + } + const params = { + user_id: this.userInfo.id, + account_name: this.accountName, + account_number: this.accountNumber, + bank_code: this.bankCode, + bank_name: this.bankName, + amount: this.money, + }; + this.$toast({ + type: "loading", + message: this.$lang.submittingApplication || '提交中...', + duration: 200000, + }); + this.$api + .applyWithdrawBank(params) + .then((res) => { + if (res.Success) { + this.$toast({ + type: "success", + message: res.Msg, + duration: 2000, + }); + this.bankName = ""; + this.bankCode = ""; + this.accountName = ""; + this.accountNumber = ""; + this.money = ""; + } else { + this.$toast({ + message: res.Msg, + duration: 2000, + }); + } + }) + .catch((err) => { + console.log(err); + }) + .finally(() => { + this.$toastHide(); + }); + }, }, }; diff --git a/request/api.js b/request/api.js index a2b4be5..0ec89ff 100644 --- a/request/api.js +++ b/request/api.js @@ -53,6 +53,18 @@ let api = { ybfDeposit: async (params) => { return await ajax.post("/deposit", params); }, + // 越南AlinPay充值 + alinDeposit: async (params) => { + return await ajax.post("/alin_online_order", params); + }, + // 越南银行卡提现 + applyWithdrawBank: async (params) => { + return await ajax.post("/apply_withdraw_bank", params); + }, + // 获取越南银行列表 + getBankListVn: async (params) => { + return await ajax.post("/get_bank_list_vn", params); + }, // 获取用户信息 getUserInfo: async (params) => { return await ajax.post("/get_user_info", params);