|
|
@ -1,28 +1,30 @@ |
|
|
|
<template> |
|
|
|
<view class="main"> |
|
|
|
<!-- nav --> |
|
|
|
<navigation>{{ i18n.Withdrawal }}<view slot="right" class="right" @click="goto('withdrawalRecord')">{{ |
|
|
|
<navigation>{{ i18n.Withdrawal }} |
|
|
|
<view slot="right" class="right" @click="goto('withdrawalRecord')">{{ |
|
|
|
i18n.Record |
|
|
|
}} |
|
|
|
</view> |
|
|
|
</navigation> |
|
|
|
<!-- headBtn --> |
|
|
|
<view class="head"> |
|
|
|
<view class="headItem" @click="pageState = 'digitalCurrency'" |
|
|
|
:class="{ select: pageState === 'digitalCurrency' }"> |
|
|
|
<view class="headItem" @click="pageState = 'crypto',getWithConfig()" |
|
|
|
:class="{ select: pageState === 'crypto' }"> |
|
|
|
{{ i18n.DigitalCurrency }} |
|
|
|
</view> |
|
|
|
<view class="headItem" @click="pageState = 'onLine'" :class="{ select: pageState === 'onLine' }"> |
|
|
|
<view class="headItem" @click="pageState = 'online',getWithConfig()" |
|
|
|
:class="{ select: pageState === 'online' }"> |
|
|
|
{{ i18n.OnLine }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="DCContent" v-if="pageState === 'digitalCurrency'"> |
|
|
|
<view class="DCContent" v-if="pageState === 'crypto'"> |
|
|
|
<!-- coin选择框 --> |
|
|
|
<view class="input-item"> |
|
|
|
<u-input class="input" v-model="coin" color="#fff" fontSize="32rpx" border="none" |
|
|
|
<u-input class="input" v-model="coinInfo.coinCode" color="#fff" fontSize="32rpx" border="none" |
|
|
|
:placeholder="i18n.PleaseChooseCoin"> |
|
|
|
</u-input> |
|
|
|
<view class="selectCoinBtn" @click="USDTPopupShow = true">USDT |
|
|
|
<view class="selectCoinBtn" @click="USDTPopupShow = true">{{coinInfo.coinCode}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
@ -37,21 +39,31 @@ |
|
|
|
<!-- 分割线 --> |
|
|
|
<u-divider text="" lineColor="#B9C1D9"></u-divider> |
|
|
|
<!-- 可用数量 --> |
|
|
|
<key-value-row :keyName="i18n.Quantity" :value="`${i18n.Available} ${AvailableValue} ${currentCoin}`" |
|
|
|
<key-value-row :keyName="i18n.Quantity" |
|
|
|
:value="`${i18n.Available} ${parseInt(selectCoinInfo.useCapital,16)} ${selectCoinInfo.enname}`" |
|
|
|
rightColor="#A1A0A8"></key-value-row> |
|
|
|
<!-- 数量输入框 --> |
|
|
|
<view class="input-item"> |
|
|
|
<u-input class="input" v-model="coin" color="#fff" fontSize="32rpx" border="none" |
|
|
|
<u-input class="input" v-model="coinInfo.tranAmt" color="#fff" fontSize="32rpx" border="none" |
|
|
|
:placeholder="i18n.EnterTheQuantity"> |
|
|
|
</u-input> |
|
|
|
<view class="all">{{ i18n.ALL }}</view> |
|
|
|
<view class="all" @click="coinInfo.tranAmt=parseInt(selectCoinInfo.useCapital,16)">{{ i18n.ALL }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 最低体现金额 --> |
|
|
|
<key-value-row :keyName="i18n.MinimumWithdrawAmount" size="24rpx" |
|
|
|
:value="`${AvailableValue} ${currentCoin}`" rightColor="#A1A0A8"></key-value-row> |
|
|
|
:value="selectCoinInfo.withdrawMinAmount+selectCoinInfo.enname" rightColor="#A1A0A8"> |
|
|
|
</key-value-row> |
|
|
|
<!-- 手续费 --> |
|
|
|
<key-value-row :keyName="i18n.HandlingFee" size="24rpx" :value="`${AvailableValue} ${currentCoin}`" |
|
|
|
rightColor="#A1A0A8"></key-value-row> |
|
|
|
<key-value-row :keyName="i18n.HandlingFee" size="24rpx" |
|
|
|
:value="selectCoinInfo.withdrawFeeAmount+selectCoinInfo.enname" rightColor="#A1A0A8"> |
|
|
|
</key-value-row> |
|
|
|
<view class="title">{{ i18n.PaymentPassword }}</view> |
|
|
|
<view class="input-item"> |
|
|
|
<u-input class="input" type="password" v-model="coinInfo.payPassword" color="#fff" fontSize="32rpx" |
|
|
|
border="none" :placeholder="i18n.enterPaymentPassword" style="width: 590rpx;"> |
|
|
|
</u-input> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="message-item first"> |
|
|
|
{{ i18n.message1 }} |
|
|
@ -62,7 +74,8 @@ |
|
|
|
<view class="message-item last"> |
|
|
|
{{ i18n.message3 }} |
|
|
|
</view> |
|
|
|
<u-button class="withdrawBtn" color="#00E8A2" throttleTime="500">{{ i18n.withdraw }} |
|
|
|
<u-button class="withdrawBtn" color="#00E8A2" throttleTime="500" @click="withdraw('virtual')" |
|
|
|
:disabled="virtualWithdraw">{{ i18n.withdraw }} |
|
|
|
</u-button> |
|
|
|
|
|
|
|
<!-- USDT按钮通知弹出层 --> |
|
|
@ -70,18 +83,20 @@ |
|
|
|
@open="USDTPopupShow = true" bgColor="#211F32"> |
|
|
|
<view class="content"> |
|
|
|
<view class="close" @click="USDTPopupShow = false"></view> |
|
|
|
<scroll-view scroll-y="true" style="height: 432rpx;" scroll-with-animation="true" @touchmove.stop.prevent=""> |
|
|
|
<scroll-view scroll-y="true" style="height: 432rpx;" scroll-with-animation="true" |
|
|
|
@touchmove.stop.prevent=""> |
|
|
|
<radio-group class="radioGroup" @change="USDTRadioChange" v-model="USDTRadioValue"> |
|
|
|
<label class="checkBox" v-for="(item, index) in 10" :key="index"> |
|
|
|
<label class="checkBox" v-for="(item, index) in withdrawInfo.coins" :key="index" |
|
|
|
@click="radioChange(item)"> |
|
|
|
<view class="icon"> |
|
|
|
<u-icon name="../../static/maskets/logo.png" size="64rpx" width="64rpx"></u-icon> |
|
|
|
<u-icon :name="baseURL+'/coins/'+item.code+'.png'" size="52rpx" width="52rpx"> |
|
|
|
</u-icon> |
|
|
|
</view> |
|
|
|
<view class="iconName"> |
|
|
|
<view class="top">USDT</view> |
|
|
|
<view class="bottom">BTC</view> |
|
|
|
<view class="top">{{item.enname}}</view> |
|
|
|
<view class="bottom">{{item.useCapital}}{{" "}}{{item.code}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<radio color="#00E8A2" shape="square"></radio> |
|
|
|
<radio color="#00E8A2" shape="square" :checked="coinInfo.coinCode==item.enname"></radio> |
|
|
|
</label> |
|
|
|
|
|
|
|
</radio-group> |
|
|
@ -94,7 +109,7 @@ |
|
|
|
</u-popup> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="OLContent" v-if="pageState === 'onLine'"> |
|
|
|
<view class="OLContent" v-if="pageState === 'online'"> |
|
|
|
<view class="bankCard" v-if="!ifNextStep"> |
|
|
|
<view class="header"> |
|
|
|
<view class="bankTitle">{{ i18n.BankCardWithdrawal }}</view> |
|
|
@ -104,10 +119,10 @@ |
|
|
|
<view class="addBankCardBtn" v-if="!hasBankCard" @click="goto('addBankCard')">{{ i18n.AddBankCard }} |
|
|
|
</view> |
|
|
|
<view class="bankCardInfo" v-if="hasBankCard"> |
|
|
|
<view class="username">ZHOU JIELUN</view> |
|
|
|
<view class="BankCardCode">4349 9545 9893 9854 027</view> |
|
|
|
<key-value-row :keyName="'Bank of Melbourne'" size="24rpx" :value="'CODE98Y'" rightColor="#F2FE8D" |
|
|
|
leftColor="#fff"> |
|
|
|
<view class="username">{{withdrawInfo.bankCard.acctName}}</view> |
|
|
|
<view class="BankCardCode">{{withdrawInfo.bankCard.acctId}}</view> |
|
|
|
<key-value-row :keyName="withdrawInfo.bankCard.bankName" size="24rpx" |
|
|
|
:value="withdrawInfo.bankCard.bankCode" rightColor="#F2FE8D" leftColor="#fff"> |
|
|
|
</key-value-row> |
|
|
|
|
|
|
|
</view> |
|
|
@ -119,18 +134,19 @@ |
|
|
|
<view class="inputBody"> |
|
|
|
<view class="title">{{ i18n.WithdrawableAmount }}</view> |
|
|
|
<view class="withdrawableAmount-item"> |
|
|
|
<view class="withdrawableAmount">₹ {{ withdrawableAmount }} </view> |
|
|
|
<view class="withdrawableAmount">{{ withdrawInfo.useCapital}} {{coinTypeInfo.system_coin_code}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="title">{{ i18n.Amount }}</view> |
|
|
|
<view class="input-item"> |
|
|
|
<u-input class="input" v-model="amount" color="#fff" fontSize="32rpx" border="none" |
|
|
|
<u-input class="input" v-model="coinInfo.tranAmt" color="#fff" fontSize="32rpx" border="none" |
|
|
|
:placeholder="i18n.enterAmount"> |
|
|
|
</u-input> |
|
|
|
</view> |
|
|
|
<view class="title">{{ i18n.PaymentPassword }}</view> |
|
|
|
<view class="input-item"> |
|
|
|
<u-input class="input" type="password" v-model="paymentPassword" color="#fff" fontSize="32rpx" |
|
|
|
border="none" :placeholder="i18n.enterPaymentPassword"> |
|
|
|
<u-input class="input" type="password" v-model="coinInfo.payPassword" color="#fff" |
|
|
|
fontSize="32rpx" border="none" :placeholder="i18n.enterPaymentPassword"> |
|
|
|
</u-input> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -146,14 +162,30 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import uniCopy from '@/utils/uni-copy' |
|
|
|
import KeyValueRow from '../../components/KeyValueRow/KeyValueRow.vue'; |
|
|
|
export default { |
|
|
|
components: { KeyValueRow }, |
|
|
|
import uniCopy from '@/utils/uni-copy' |
|
|
|
import api from '@/utils/api' |
|
|
|
import constant from '@/utils/constant.js'; |
|
|
|
import KeyValueRow from '../../components/KeyValueRow/KeyValueRow.vue'; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
KeyValueRow |
|
|
|
}, |
|
|
|
name: "withdrawal", |
|
|
|
data() { |
|
|
|
return { |
|
|
|
pageState: 'digitalCurrency', |
|
|
|
// 选择的币种信息 |
|
|
|
selectCoinInfo: {}, |
|
|
|
coinInfo: { |
|
|
|
tranAmt: null, |
|
|
|
coinCode: null, |
|
|
|
type: 'crypto', |
|
|
|
addressId: null, |
|
|
|
payPassword: null, |
|
|
|
}, |
|
|
|
// 提现配置信息 |
|
|
|
withdrawInfo: {}, |
|
|
|
baseURL: '', |
|
|
|
pageState: 'crypto', |
|
|
|
coinAddress: '', |
|
|
|
AvailableValue: 3399, |
|
|
|
currentCoin: 'USDT', |
|
|
@ -168,13 +200,29 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// 获取币种 |
|
|
|
coinTypeInfo() { |
|
|
|
return uni.getStorageSync('coinTypeInfo') |
|
|
|
}, |
|
|
|
// 检验虚拟币提现是否可以点击 |
|
|
|
virtualWithdraw() { |
|
|
|
if (this.coinInfo.tranAmt && this.coinInfo.coinCode && this.coinInfo.type && this.coinInfo.addressId && |
|
|
|
this.coinInfo.payPassword) { |
|
|
|
return false; |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
}, |
|
|
|
i18n() { |
|
|
|
return this.$t("withdrawal"); |
|
|
|
}, |
|
|
|
btnIsCanClick() { // 按钮是否可以点击 |
|
|
|
if (this.hasBankCard && !this.ifNextStep) { // 在第一步,有银行卡可以点击 |
|
|
|
return false; |
|
|
|
} if (this.amount && this.paymentPassword && this.ifNextStep) { // 在第二步,有值才可以点 |
|
|
|
} |
|
|
|
if (this.coinInfo.tranAmt && this.coinInfo.coinCode && this.coinInfo.type && this.coinInfo.addressId && |
|
|
|
this.coinInfo.payPassword) { |
|
|
|
// 在第二步,有值才可以点 |
|
|
|
return false; |
|
|
|
} else { |
|
|
|
return true |
|
|
@ -182,17 +230,82 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.baseURL = constant.BASE_URL |
|
|
|
// 监听事件 |
|
|
|
uni.$on('coinAddressChang', (data) => { |
|
|
|
this.coinAddress = data.coinAddress |
|
|
|
this.coinInfo.addressId = data.coinid |
|
|
|
}) |
|
|
|
this.getWithConfig(); |
|
|
|
}, |
|
|
|
onUnload() { |
|
|
|
// 移除监听事件 |
|
|
|
uni.$off('coinAddressChang'); |
|
|
|
}, |
|
|
|
onShow() { }, |
|
|
|
onShow() { |
|
|
|
this.getWithConfig(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 提现 |
|
|
|
withdraw(e) { |
|
|
|
let info; |
|
|
|
if (e == 'virtual') { |
|
|
|
info={ |
|
|
|
type: this.coinInfo.type, |
|
|
|
tranAmt: this.coinInfo.tranAmt, |
|
|
|
addressId: this.coinInfo.addressId, |
|
|
|
coinCode: this.coinInfo.coinCode2, |
|
|
|
payPassword: this.coinInfo.payPassword |
|
|
|
} |
|
|
|
}else{ |
|
|
|
info={ |
|
|
|
type: this.coinInfo.type, |
|
|
|
tranAmt: this.coinInfo.tranAmt, |
|
|
|
addressId: this.coinInfo.addressId, |
|
|
|
payPassword: this.coinInfo.payPassword |
|
|
|
} |
|
|
|
} |
|
|
|
api.withdraw(info).then(res => { |
|
|
|
console.log(res) |
|
|
|
uni.$u.toast(this.$t("login").Withdrawalsucceeded) |
|
|
|
setTimeout(() => { |
|
|
|
this.coinInfo = { |
|
|
|
tranAmt: null, |
|
|
|
coinCode: null, |
|
|
|
addressId: null, |
|
|
|
payPassword: null, |
|
|
|
} |
|
|
|
this.getWithConfig() |
|
|
|
}, 600) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取币种 |
|
|
|
radioChange(e) { |
|
|
|
this.selectCoinInfo = e |
|
|
|
this.coinInfo.coinCode = e.enname |
|
|
|
this.coinInfo.coinCode2 = e.code |
|
|
|
}, |
|
|
|
// 获取提现配置 |
|
|
|
getWithConfig() { |
|
|
|
api.withdrawConfig({ |
|
|
|
type: this.pageState |
|
|
|
}).then(res => { |
|
|
|
if (res) { |
|
|
|
// 虚拟币提现 |
|
|
|
if (this.pageState == 'crypto') { |
|
|
|
// 进来默认选中第一个币 |
|
|
|
this.withdrawInfo = res |
|
|
|
this.coinInfo.coinCode = this.withdrawInfo.coins[0].enname |
|
|
|
this.selectCoinInfo = this.withdrawInfo.coins[0] |
|
|
|
this.coinInfo.coinCode2 = this.withdrawInfo.coins[0].code |
|
|
|
} else { |
|
|
|
// 法币 |
|
|
|
this.withdrawInfo = res |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
goto(page) { |
|
|
|
// console.log(page); |
|
|
|
let url = ''; |
|
|
@ -247,17 +360,19 @@ export default { |
|
|
|
btnClick() { |
|
|
|
if (!this.ifNextStep) { // 第一步是切换到提现菜单 |
|
|
|
this.ifNextStep = true |
|
|
|
}else{ // 提现逻辑 |
|
|
|
|
|
|
|
this.coinInfo.type=this.pageState |
|
|
|
this.coinInfo.addressId = this.withdrawInfo.bankCard.id |
|
|
|
} else { // 提现逻辑 |
|
|
|
this.withdraw() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.main { |
|
|
|
.main { |
|
|
|
|
|
|
|
.right { |
|
|
|
position: absolute; |
|
|
@ -317,10 +432,9 @@ export default { |
|
|
|
|
|
|
|
.selectCoinBtn { |
|
|
|
position: absolute; |
|
|
|
width: 170rpx; |
|
|
|
height: 54rpx; |
|
|
|
top: 36rpx; |
|
|
|
right: 32rpx; |
|
|
|
right: 80rpx; |
|
|
|
line-height: 56rpx; |
|
|
|
font-size: 36rpx; |
|
|
|
padding: 0; |
|
|
@ -336,7 +450,7 @@ export default { |
|
|
|
width: 32rpx; |
|
|
|
height: 32rpx; |
|
|
|
top: 12rpx; |
|
|
|
right: 10rpx; |
|
|
|
right: -40rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -684,5 +798,5 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|