| | |
| | | return account && account.substr(0, 5) + '********' + account.substr(account.length - 5) |
| | | }, |
| | | amountAvailable() { |
| | | console.log(this.form.symbol) |
| | | console.log(this.wallets) |
| | | // console.log("ddddddddddddddddddd", this.form.iconImg1, this.wallets) |
| | | let res |
| | | let dataInfo = this.wallets.find(item => item.symbol_data.toUpperCase() === this.form.symbol.toUpperCase()) |
| | | let dataInfo = this.wallets.find(item => item.symbol_data.toUpperCase() == this.form.iconImg1.toUpperCase()) |
| | | |
| | | if (dataInfo) { |
| | | res = dataInfo.usable |
| | | } else { |
| | | res = 0 |
| | | } |
| | | |
| | | return res |
| | | }, |
| | | }, |
| | |
| | | form: { // 闪兑 |
| | | symbol: 'USDC', |
| | | symbol_to: 'USDT', |
| | | name: '', |
| | | volume: '', |
| | | rate: 0, |
| | | iconImg2: '', |
| | |
| | | data.extends.map(item => { |
| | | this.actions.push({ |
| | | symbol: item.symbol, |
| | | name: item.symbol, |
| | | name: item.name, |
| | | symbol_data: item.symbol, |
| | | usable: item.usable, |
| | | usdt: item.usdt, |
| | |
| | | }) |
| | | this.wallets = data.extends |
| | | console.log("this.actions",this.actions[0].symbol_data); |
| | | this.form.symbol = this.actions[0].symbol_data |
| | | this.form.symbol_to = this.actions[1].symbol_data |
| | | this.form.symbol = this.strToArr(this.actions[0].name, '/')[0] |
| | | this.form.symbol_to = this.strToArr(this.actions[1].name, '/')[0] |
| | | this.form.iconImg1 = this.actions[0].symbol_data |
| | | this.form.iconImg2 = this.actions[1].symbol_data |
| | | this.form.symbol_ex = this.actions[0].symbol |
| | |
| | | }, |
| | | onSelect(type, evt) { // 选择 |
| | | if (evt.type == 0) { |
| | | this.form['symbol'] = evt.item.symbol_data |
| | | this.form['symbol'] = this.strToArr(evt.item.name, '/')[0] |
| | | this.form['iconImg1'] = evt.item.symbol_data |
| | | this.form['symbol_ex'] = evt.item.symbol |
| | | } else { |
| | | this.form['symbol_to'] = evt.item.symbol_data |
| | | this.form['symbol_to'] = this.strToArr(evt.item.name, '/')[0] |
| | | this.form['iconImg2'] = evt.item.symbol_data |
| | | this.form['symbol_to_ex'] = evt.item.symbol |
| | | } |
| | |
| | | clearInterval() { // 清除定时器 |
| | | clearInterval(this.interval) |
| | | this.interval = null |
| | | } |
| | | }, |
| | | strToArr(str, separator = ',') { |
| | | if (typeof str !== 'string') return []; |
| | | return str.split(separator); |
| | | }, |
| | | }, |
| | | beforeUnmount() { |
| | | // console.log('beforeDestroy') |