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"
>
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $lang.rechargeTip }}
+
+
+
@@ -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
-
+
+
+
+
+
+
+
+
+
+
+ {{ $lang.walletAddress }}
+
+
+
+ {{ $lang.amount }}
+
+
+
+ {{ $lang.rechargeWithdrawNetwork }}
+ TRC20
+
+
+
+
+
+ {{ $lang.withdrawTip }}
+ {{ $lang.commission }}:1 USDT
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $lang.accountName || '账户姓名' }}
+
+
+
+ {{ $lang.accountNumber || '银行卡号' }}
+
+
+
+ {{ $lang.amount }}
+
+
+
+
+
+
+ {{ $lang.withdrawTip }}
+
+
@@ -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);