| | |
| | | } |
| | | }, |
| | | async getData() { |
| | | await Axios.getBlock({ |
| | | coin: this.coin |
| | | }).then((res) => { |
| | | if (res.code == "0") { |
| | | this.chainList = res.data.page.elements; |
| | | // this.address = res.data.page.elements[0].address; |
| | | this.blockchain_name = res.data.page.elements[0].blockchain_name; |
| | | let trc20=res.data.page.elements[3].address |
| | | let erc20=res.data.page.elements[0].address |
| | | let btc=res.data.page.elements[1].address |
| | | let eth=res.data.page.elements[2].address |
| | | if(this.symbol=='usdt'){ |
| | | this.chainList=[{ |
| | | address:trc20, |
| | | blockchain_name:'TRC20' |
| | | },{ |
| | | address:erc20, |
| | | blockchain_name:'ERC20' |
| | | }] |
| | | this.address = this.chainList[0].address; |
| | | this.blockchain_name = this.chainList[0].blockchain_name; |
| | | }else if (this.symbol=='btc'){ |
| | | // console.log(btc); |
| | | // debugger |
| | | this.chainList=[{ |
| | | address:btc, |
| | | blockchain_name:'BTC' |
| | | }] |
| | | this.address = this.chainList[0].address; |
| | | this.blockchain_name = this.chainList[0].blockchain_name; |
| | | }else if (this.symbol=='eth'){ |
| | | this.chainList=[{ |
| | | address:eth, |
| | | blockchain_name:"ETH" |
| | | }] |
| | | this.address = this.chainList[0].address; |
| | | this.blockchain_name = this.chainList[0].blockchain_name; |
| | | } |
| | | this.getQRCode(); |
| | | } |
| | | }); |
| | | // Axios.exchange({}).then((res) => { |
| | | // if (res.data&&res.data.filter(item => { |
| | | // return item.userid == this.userInfo.usercode |
| | | // }).length >0) { |
| | | // Axios.user_wallet({}).then((res) => { |
| | | // let trc20=res.data["wallet_address_USDT(trc20)"].contract_address |
| | | // let erc20=res.data["wallet_address_USDT(erc20)"].contract_address |
| | | // let btc=res.data["wallet_address_BTC"].contract_address |
| | | // let eth=res.data["wallet_address_ETH"].contract_address |
| | | // if(this.coin=='usdt'){ |
| | | // this.chainList=[{ |
| | | // address:trc20, |
| | | // blockchain_name:'TRC20' |
| | | // },{ |
| | | // address:erc20, |
| | | // blockchain_name:'ERC20' |
| | | // }] |
| | | // }else if (this.coin=='btc'){ |
| | | // this.chainList=[{ |
| | | // address:btc, |
| | | // blockchain_name:'BTC' |
| | | // }] |
| | | // }else if (this.coin=='eth'){ |
| | | // this.chainList=[{ |
| | | // address:eth, |
| | | // blockchain_name:"ETH" |
| | | // }] |
| | | // } |
| | | // this.address = this.chainList[0].address; |
| | | // this.blockchain_name = this.chainList[0].blockchain_name; |
| | | // this.getQRCode(); |
| | | // }) |
| | | // } else { |
| | | // Axios.getBlock({ |
| | | // coin: this.coin |
| | | // }).then((res) => { |
| | | // if (res.code == "0") { |
| | | // this.chainList = res.data; |
| | | // this.address = res.data[0].address; |
| | | // this.blockchain_name = res.data[0].blockchain_name; |
| | | // this.getQRCode(); |
| | | // } |
| | | // }); |
| | | // } |
| | | // }) |
| | | // await Axios.getBlock({ |
| | | // coin: this.coin |
| | | // }).then((res) => { |
| | | // if (res.code == "0") { |
| | | // this.chainList = res.data.page.elements; |
| | | // // this.address = res.data.page.elements[0].address; |
| | | // this.blockchain_name = res.data.page.elements[0].blockchain_name; |
| | | // let trc20=res.data.page.elements[3].address |
| | | // let erc20=res.data.page.elements[0].address |
| | | // let btc=res.data.page.elements[1].address |
| | | // let eth=res.data.page.elements[2].address |
| | | // if(this.symbol=='usdt'){ |
| | | // this.chainList=[{ |
| | | // address:trc20, |
| | | // blockchain_name:'TRC20' |
| | | // },{ |
| | | // address:erc20, |
| | | // blockchain_name:'ERC20' |
| | | // }] |
| | | // this.address = this.chainList[0].address; |
| | | // this.blockchain_name = this.chainList[0].blockchain_name; |
| | | // }else if (this.symbol=='btc'){ |
| | | // // console.log(btc); |
| | | // // debugger |
| | | // this.chainList=[{ |
| | | // address:btc, |
| | | // blockchain_name:'BTC' |
| | | // }] |
| | | // this.address = this.chainList[0].address; |
| | | // this.blockchain_name = this.chainList[0].blockchain_name; |
| | | // }else if (this.symbol=='eth'){ |
| | | // this.chainList=[{ |
| | | // address:eth, |
| | | // blockchain_name:"ETH" |
| | | // }] |
| | | // this.address = this.chainList[0].address; |
| | | // this.blockchain_name = this.chainList[0].blockchain_name; |
| | | // } |
| | | // this.getQRCode(); |
| | | // } |
| | | // }); |
| | | await Axios.exchange({}).then((res) => { |
| | | if (res.data&&res.data.filter(item => { |
| | | return item.userid == this.userInfo.usercode |
| | | }).length >0) { |
| | | Axios.user_wallet({}).then((res) => { |
| | | let trc20=res.data["wallet_address_USDT(trc20)"].contract_address |
| | | let erc20=res.data["wallet_address_USDT(erc20)"].contract_address |
| | | let btc=res.data["wallet_address_BTC"].contract_address |
| | | let eth=res.data["wallet_address_ETH"].contract_address |
| | | if(this.coin=='usdt'){ |
| | | this.chainList=[{ |
| | | address:trc20, |
| | | blockchain_name:'TRC20' |
| | | },{ |
| | | address:erc20, |
| | | blockchain_name:'ERC20' |
| | | }] |
| | | }else if (this.coin=='btc'){ |
| | | this.chainList=[{ |
| | | address:btc, |
| | | blockchain_name:'BTC' |
| | | }] |
| | | }else if (this.coin=='eth'){ |
| | | this.chainList=[{ |
| | | address:eth, |
| | | blockchain_name:"ETH" |
| | | }] |
| | | } |
| | | this.address = this.chainList[0].address; |
| | | this.blockchain_name = this.chainList[0].blockchain_name; |
| | | this.getQRCode(); |
| | | }) |
| | | } else { |
| | | Axios.getBlock({ |
| | | coin: this.coin |
| | | }).then((res) => { |
| | | if (res.code == "0") { |
| | | this.chainList = res.data.page.elements; |
| | | // this.address = res.data.page.elements[0].address; |
| | | this.blockchain_name = res.data.page.elements[0].blockchain_name; |
| | | let trc20=res.data.page.elements[3].address |
| | | let erc20=res.data.page.elements[0].address |
| | | let btc=res.data.page.elements[1].address |
| | | let eth=res.data.page.elements[2].address |
| | | if(this.symbol=='usdt'){ |
| | | this.chainList=[{ |
| | | address:trc20, |
| | | blockchain_name:'TRC20' |
| | | },{ |
| | | address:erc20, |
| | | blockchain_name:'ERC20' |
| | | }] |
| | | this.address = this.chainList[0].address; |
| | | this.blockchain_name = this.chainList[0].blockchain_name; |
| | | }else if (this.symbol=='btc'){ |
| | | // console.log(btc); |
| | | // debugger |
| | | this.chainList=[{ |
| | | address:btc, |
| | | blockchain_name:'BTC' |
| | | }] |
| | | this.address = this.chainList[0].address; |
| | | this.blockchain_name = this.chainList[0].blockchain_name; |
| | | }else if (this.symbol=='eth'){ |
| | | this.chainList=[{ |
| | | address:eth, |
| | | blockchain_name:"ETH" |
| | | }] |
| | | this.address = this.chainList[0].address; |
| | | this.blockchain_name = this.chainList[0].blockchain_name; |
| | | } |
| | | this.getQRCode(); |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | changeBlockchain(index) { |
| | | this.blockchainIndex = index; |