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(); + }); + }, }, };