<template>
|
<div>
|
<van-nav-bar
|
:placeholder="true"
|
:safe-area-inset-top="true"
|
:title="$t('提款')"
|
left-arrow
|
@click-left="onClickLeft"
|
>
|
<template #right>
|
<van-icon
|
@click="$router.push('/cashlist')"
|
name="orders-o"
|
size="20"
|
/>
|
</template>
|
</van-nav-bar>
|
<main>
|
<div class="main-title">{{ $t("請選擇提款账户") }}</div>
|
<van-cell
|
is-link
|
:title="rechargeAccountData.name || $t('請選擇')"
|
@click="rechargeAccountShow = true"
|
/>
|
<van-action-sheet
|
v-model="rechargeAccountShow"
|
:actions="rechargeAccountActions"
|
:cancel-text="$t('hj106')"
|
close-on-click-action
|
@select="rechargeAccountSelect"
|
/>
|
|
<div class="main-title">{{ $t("支持得提款渠道") }}</div>
|
<van-cell
|
is-link
|
:title="rechargeSelect.name || $t('請選擇')"
|
@click="show = true"
|
/>
|
<van-action-sheet
|
v-model="show"
|
:actions="actions"
|
:cancel-text="$t('hj106')"
|
close-on-click-action
|
@select="select"
|
/>
|
<div v-if="rechargeSelect.key !== undefined">
|
<div class="main-title">{{ $t("請選擇銀行卡") }}</div>
|
<van-cell is-link :title="bankCard.bankNo || $t('請選擇')" />
|
</div>
|
<div class="main-title">{{ $t("請選擇充值金額") }}</div>
|
<div class="white-input">
|
<input type="number" :value="value" @input="inputValue" />
|
<span class="myr" @click="value = availableBalanceUSD">{{
|
$t("最大")
|
}}</span>
|
</div>
|
<div>
|
<div class="dz-title" v-if="rechargeAccountData.key !== undefined">
|
<div>{{ $t("可用餘額") }}</div>
|
<div class="balance-text">
|
{{ availableBalanceUSD }} {{ symbolCode }}
|
<!-- {{ symbolCode }} -->
|
</div>
|
</div>
|
</div>
|
<van-button
|
class="but"
|
type="primary"
|
style="margin-top: 1.04rem; margin-bottom: 1.04rem"
|
@click="setOutMoney"
|
>{{ $t("提款") }}</van-button
|
>
|
</main>
|
</div>
|
</template>
|
|
<script>
|
import { ActionSheet, Notify } from "vant";
|
import ClipboardJS from "clipboard";
|
import { getBankCard, getMoney, outMoney } from "../../axios/api";
|
|
export default {
|
components: { ActionSheet, [Notify.Component.name]: Notify.Component },
|
data() {
|
return {
|
value: 0,
|
|
paymentSelectData: "IN",
|
|
show: false,
|
|
// 提款聚到
|
rechargeSelect: {},
|
actions: [{ name: this.$t("hj215"), key: "YHK" }],
|
paymentShow: false,
|
|
rechargeAccountShow: false,
|
// 请选择提款账户
|
rechargeAccountData: {},
|
rechargeAccountActions: [
|
{
|
name: this.$t("IN"),
|
key: "IN",
|
},
|
// {
|
// name: this.$t("MAS"),
|
// key: "MAS",
|
// },
|
// {
|
// name: this.$t("HK"),
|
// key: "HK",
|
// },
|
],
|
|
bankCard: {},
|
availableBalanceUSD: "0.0000",
|
getMoneyList: [],
|
assetsType: "",
|
symbolCode: "",
|
};
|
},
|
mounted() {
|
this.getykh();
|
this.getMoneys();
|
},
|
methods: {
|
async setOutMoney() {
|
const res = await outMoney({
|
amt: this.value,
|
assetsType: this.accectType,
|
});
|
if (res.status === 0) {
|
Notify({ type: "success", message: this.$t("hj182") });
|
setTimeout(() => {
|
this.$router.push("/cashlist");
|
}, 500);
|
} else {
|
Notify(res.msg);
|
}
|
// Notify("请上传文件");
|
},
|
inputValue(e) {
|
this.value = e.target.value;
|
},
|
async getykh() {
|
const res = await getBankCard();
|
if (res.status === 0) {
|
this.bankCard = res.data;
|
}
|
},
|
async getMoneys() {
|
const res = await getMoney();
|
if (res.status === 0) {
|
this.getMoneyList = res.data;
|
res.data.map((item) => {
|
if (item.accectType === this.rechargeAccountData.key) {
|
this.availableBalanceUSD = item.availableBalance;
|
this.symbolCode = item.symbolCode;
|
this.accectType = item.accectType;
|
}
|
});
|
}
|
},
|
afterRead(file) {
|
// 此时可以自行将文件上传至服务器
|
console.log(file);
|
},
|
copyText(e, data) {
|
var clipboard = new ClipboardJS(".copy-button", {
|
text: () => data,
|
});
|
|
clipboard.on("success", () => {
|
// alert("已复制到剪贴板");
|
clipboard.destroy();
|
});
|
|
clipboard.onClick(e);
|
},
|
onClickLeft() {
|
this.$router.push("/user");
|
},
|
select(e) {
|
this.rechargeSelect = e;
|
console.log(e);
|
},
|
rechargeAccountSelect(e) {
|
this.rechargeAccountData = e;
|
(this.getMoneyList || []).map((item) => {
|
if (item.accectType === this.rechargeAccountData.key) {
|
this.availableBalanceUSD = item.availableBalance;
|
this.symbolCode = item.symbolCode;
|
this.accectType = item.accectType;
|
}
|
});
|
},
|
paymentSelect(e) {
|
this.paymentSelectData = e.name;
|
console.log(e);
|
},
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.but {
|
width: 100%;
|
color: #ffffff;
|
background-color: #1989fa;
|
border-radius: 8px;
|
height: 66px;
|
font-size: 22px;
|
}
|
.bottom-text {
|
width: 100%;
|
background-color: #fff;
|
padding: 0.26667rem 0.37333rem;
|
box-sizing: border-box;
|
margin-top: 0.26667rem;
|
// margin-bottom: 80px;
|
.balance {
|
display: flex;
|
justify-content: space-between;
|
color: #181818;
|
font-family: PingFang SC;
|
font-size: 0.32rem;
|
font-style: normal;
|
font-weight: 500;
|
box-sizing: border-box;
|
.balance-text {
|
color: #181818;
|
font-family: PingFang SC;
|
font-size: 0.32rem;
|
font-style: normal;
|
font-weight: 500;
|
line-height: 0.37333rem;
|
margin-bottom: 0.37333rem;
|
}
|
}
|
.division {
|
width: 100%;
|
height: 0.02667rem;
|
flex-shrink: 0;
|
background-color: #e5e8ed;
|
margin: 0.37333rem 0;
|
}
|
.upload-text {
|
color: #181818;
|
font-family: PingFang SC;
|
font-size: 0.32rem;
|
font-style: normal;
|
font-weight: 500;
|
}
|
}
|
/deep/ .van-nav-bar__content {
|
height: 65px;
|
}
|
/deep/ .van-nav-bar__title {
|
font-family: "DINPro";
|
width: 100%;
|
height: 1.17333rem;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.48rem;
|
color: #14181f;
|
}
|
/deep/ .van-cell {
|
list-style: none;
|
width: 100%;
|
margin-top: 0.26667rem;
|
background: #fff;
|
border-radius: 0.10667rem;
|
list-style: none;
|
border: none;
|
font-family: Arial, sans-serif;
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.37333rem;
|
line-height: 0.53333rem;
|
padding: 0.32rem 0.4rem;
|
box-sizing: border-box;
|
margin-top: 0.26667rem;
|
box-shadow: 0 0.16rem 0.32rem #eaeaea99;
|
}
|
main {
|
padding: 0 0.4rem 0.53333rem;
|
box-sizing: border-box;
|
}
|
.main-title {
|
font-style: normal;
|
font-weight: 400;
|
font-size: 0.37333rem;
|
color: #8c9fad;
|
margin-top: 0.53333rem;
|
}
|
|
.white-input {
|
width: 100%;
|
background: #fff;
|
border-radius: 0.10667rem;
|
list-style: none;
|
border: none;
|
font-family: Arial, sans-serif;
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.37333rem;
|
line-height: 0.53333rem;
|
padding: 0.32rem 0.4rem;
|
-webkit-box-sizing: border-box;
|
box-sizing: border-box;
|
margin-top: 0.26667rem;
|
-webkit-box-shadow: 0 0.16rem 0.32rem #eaeaea99;
|
box-shadow: 0 0.16rem 0.32rem #eaeaea99;
|
display: flex;
|
justify-content: space-between;
|
}
|
.fuzhi {
|
font-size: 28px;
|
cursor: pointer;
|
}
|
.myr {
|
color: rgb(5, 106, 239);
|
cursor: pointer;
|
}
|
.dz-title {
|
display: flex;
|
justify-content: space-between;
|
font-style: normal;
|
font-weight: 400;
|
font-size: 0.37333rem;
|
color: #8c9fad;
|
margin-top: 0.31333rem;
|
padding: 0 0.13333rem;
|
box-sizing: border-box;
|
.balance-text {
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.37333rem;
|
color: #4f5257;
|
}
|
}
|
</style>
|