feat: 对接越南AlinPay支付(充值+提现)
- 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 <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -184,6 +184,38 @@
|
||||
@confirm="confirmPicker"
|
||||
></u-picker>
|
||||
</template>
|
||||
<!-- 越南 AlinPay 在线充值 -->
|
||||
<template v-if="userInfo.pay_channel == 'ALIN_VN'">
|
||||
<view class="picker-view">
|
||||
<u-input
|
||||
placeholder="Tối thiểu 1,000,000"
|
||||
color="#93979b"
|
||||
v-model="amount"
|
||||
type="number"
|
||||
border="none"
|
||||
>
|
||||
<u--text
|
||||
:text="$lang.rechargeAmount || '充值金额'"
|
||||
slot="prefix"
|
||||
margin="0 3px 0 0"
|
||||
type="tips"
|
||||
></u--text>
|
||||
</u-input>
|
||||
</view>
|
||||
<view class="list mb60">
|
||||
<u-button
|
||||
class="button"
|
||||
color="#e5b932"
|
||||
:text="$lang.submit"
|
||||
@click="submitAlin"
|
||||
></u-button>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="tip">
|
||||
{{ $lang.rechargeTip }}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="mb60"></view>
|
||||
</view>
|
||||
@@ -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();
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user