Browse Source

修改

master
vee 4 years ago
parent
commit
722d4064f4
  1. 12
      pages.json
  2. 7
      pages/menu/collection/index.vue
  3. 366
      pages/menu/sendToken/transfer2/index.vue
  4. 2
      pages/menu/token/btc/index.css
  5. 7
      pages/menu/token/btc/index.vue
  6. 10
      pages/menu/token/btc/index2.vue
  7. 12
      pages/menu/wallet/index.css
  8. 166
      pages/menu/wallet/index.vue
  9. 8
      utils/TronUtil.js
  10. 2
      utils/WalletUtil.js

12
pages.json

@ -30,7 +30,8 @@
{ {
"path": "pages/menu/token/btc/index", "path": "pages/menu/token/btc/index",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom",
"enablePullDownRefresh": true
} }
}, },
@ -66,7 +67,8 @@
{ {
"path": "pages/menu/collection/index", "path": "pages/menu/collection/index",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom",
"enablePullDownRefresh": true
} }
}, },
@ -289,7 +291,8 @@
{ {
"path": "pages/menu/token/btc/index2", "path": "pages/menu/token/btc/index2",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom",
"enablePullDownRefresh": true
} }
}, },
@ -300,7 +303,8 @@
{ {
"path": "pages/menu/wallet/index", "path": "pages/menu/wallet/index",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom",
"enablePullDownRefresh": true
} }
}, },
{ {

7
pages/menu/collection/index.vue

@ -95,6 +95,13 @@
this.getCollection(); this.getCollection();
},
onPullDownRefresh() {
console.log('refresh');
this.getCollection();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 500);
}, },
methods: { methods: {
showMsg(item,index){ showMsg(item,index){

366
pages/menu/sendToken/transfer2/index.vue

@ -8,89 +8,94 @@
@click="chooseImage()"></image> @click="chooseImage()"></image>
</navigation> </navigation>
<view class="main"> <view class="main">
<view class="item"> <view class="item">
<view class="title"> <view class="title">
Collection address Collection address
</view> </view>
<view class="inputcon"> <view class="inputcon">
<input type="text" value="" :placeholder="addValue" placeholder-style="color:#D0D0D2" class="input" v-model="toAddress"/> <input type="text" value="" :placeholder="addValue" placeholder-style="color:#D0D0D2" class="input"
<image src="../../../../static/tongyonh/lu.png" mode="aspectFit" class="img" @click="goAddress"></image> v-model="toAddress" />
</view> <image src="../../../../static/tongyonh/lu.png" mode="aspectFit" class="img" @click="goAddress">
</view> </image>
<view class="item"> </view>
<view class="title flex">
<text>Amount of Money</text>
<text class="all" @click="toAll">ALL</text>
</view>
<view class="inputcon2">
<view class="input_con">
<input type="text" value="" placeholder="0" placeholder-style="color:#D0D0D2" class="input2" v-model="toValue"/>
<!-- <input type="text" value="" placeholder="Remark" placeholder-style="color:#D0D0D2" class="input1"/> -->
</view> </view>
</view> <view class="item">
</view> <view class="title flex">
<!-- <view class="item minitem flex"> <text>Amount of Money</text>
<text class="all" @click="toAll">ALL</text>
</view>
<view class="inputcon2">
<view class="input_con">
<input type="text" value="" placeholder="0" placeholder-style="color:#D0D0D2" class="input2"
v-model="toValue" />
<!-- <input type="text" value="" placeholder="Remark" placeholder-style="color:#D0D0D2" class="input1"/> -->
</view>
</view>
</view>
<!-- <view class="item minitem flex">
<text>Miner's fee</text> <text>Miner's fee</text>
<view class="imgcon"> <view class="imgcon">
<image src="../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="rimg"></image> <image src="../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="rimg"></image>
</view> </view>
</view> --> </view> -->
<view class="btn" @click="next"> <view class="btn" @click="next">
Next step Next step
</view> </view>
</view>
<view class="bottom_con" v-if="show">
<view class="title_con">
Payment details
</view> </view>
<view class="money_con">
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img" @click="show=false"></image> <view class="bottom_con" v-if="show">
<view class="money"> <view class="title_con">
<text class="tex1">{{toValue}}</text> Payment details
<text class="tex2">{{info.coinList[0].name2}}</text>
</view> </view>
<view class="info_con"> <view class="money_con">
<view class="item"> <image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img" @click="show=false">
<text class="text1">Payment information</text> </image>
<text class="text2">{{info.coinList[0].name2}} transfer</text> <view class="money">
<text class="tex1">{{toValue}}</text>
<text class="tex2">{{info.coinList[0].name2}}</text>
</view> </view>
<view class="item"> <view class="info_con">
<text class="text1">Collection address</text> <view class="item">
<text class="text2">{{toAddress}}</text> <text class="text1">Payment information</text>
<text class="text2">{{info.coinList[0].name2}} transfer</text>
</view>
<view class="item">
<text class="text1">Collection address</text>
<text class="text2">{{toAddress}}</text>
</view>
<view class="item">
<text class="text1">Payment address</text>
<text class="text2">{{info.address}}</text>
</view>
</view> </view>
<view class="item">
<text class="text1">Payment address</text>
<text class="text2">{{info.address}}</text>
</view>
</view>
</view>
<view class="btn" @click="toNext">
Next step
</view>
</view> </view>
<view class="btn" @click="toNext">
Next step
</view>
</view>
<view class="bottom_con" v-if="show2"> <view class="bottom_con" v-if="show2">
<view class="title_con"> <view class="title_con">
Password Password
</view> </view>
<view class="money_con money_con2"> <view class="money_con money_con2">
<image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" class="img2" @click="back"></image> <image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" class="img2" @click="back"></image>
<u-input placeholder="Wallet password" v-model="value" :type="type" :border="border" :password-icon="passwordIcon" @input="btnco()" /> <u-input placeholder="Wallet password" v-model="value" :type="type" :border="border"
</view> :password-icon="passwordIcon" @input="btnco()" />
<view class="btn2" :class="btntype?'btncolor':'btncolor2'" @click="confirm()"> </view>
Next step <view class="btn2" :class="btntype?'btncolor':'btncolor2'" @click="confirm()">
Next step
</view>
</view> </view>
</view>
<u-mask :show="show" z-index="10"></u-mask> <u-mask :show="show" z-index="10"></u-mask>
<u-mask :show="show2" z-index="10"></u-mask> <u-mask :show="show2" z-index="10"></u-mask>
</view> </view>
@ -103,135 +108,160 @@
export default { export default {
data() { data() {
return { return {
btntype:false, btntype: false,
addValue:'', addValue: '',
info:{}, info: {},
toAddress:'', toAddress: '',
toValue:null, toValue: null,
show:false, show: false,
show2:false, show2: false,
value: '', value: '',
type: 'password', type: 'password',
passwordIcon: true, passwordIcon: true,
border: true, border: true,
} }
}, },
methods: { methods: {
toNext(){ toNext() {
this.show=false; this.show = false;
this.show2=true; this.show2 = true;
}, },
back(){ back() {
this.show2=false; this.show2 = false;
this.show=true this.show = true
}, },
btnco(){ btnco() {
if(this.value.length==0){ if (this.value.length == 0) {
this.btntype=false; this.btntype = false;
return; return;
} }
this.btntype=true; this.btntype = true;
}, },
toAll(){ toAll() {
this.toValue=this.info.balance this.toValue = this.info.balance
}, },
succ(a,b){ succ(a, b) {
console.log(a,4545) console.log(a, 4545)
console.log(b,45646) console.log(b, 45646)
},
next(){
if(this.toAddress==''){
uni.showToast({
title: 'Transfer receiving address cannot be blank',
icon: 'none',
duration: 1500
})
return
}
if(this.toValue==null){
uni.showToast({
title: 'Please enter the transfer amount',
icon: 'none',
duration: 1500
})
return
}
if(this.toValue<=0){
uni.showToast({
title: 'The transfer amount cannot be less than or equal to zero',
icon: 'none',
duration: 1500
})
return
}
this.show=true;
}, },
confirm(){ next() {
if(this.value!=this.info.password){ if (this.toAddress == '') {
uni.showToast({ uni.showToast({
title: 'Password error', title: 'Transfer receiving address cannot be blank',
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
return return
} }
if(this.info.coinList[0].xname=='Ethereum'){ if (this.toValue == null) {
this.$EthUtil.transaction(this.info.address,this.toAddress,this.toValue,this.info.privateKey).then((res) => { uni.showToast({
console.log(res,'钱包') title: 'Please enter the transfer amount',
this.show2=false; icon: 'none',
uni.reLaunch({ duration: 1500
url:'../transfer2/index'
}) })
}).catch(err => { return
console.log(err)
})
} }
if(this.info.coinList[0].xname=='TRON'){ if (this.toValue <= 0) {
this.$TronUtil.sendTransaction(this.info.address,this.info.privateKey,this.toAddress,this.toValue,).then((res) => {
uni.showToast({ uni.showToast({
title: 'Successfully', title: 'The transfer amount cannot be less than or equal to zero',
icon: 'success', icon: 'none',
duration: 1500 duration: 1500
}) })
this.show2=false; return
uni.reLaunch({ }
url:'../transfer2/index' this.show = true;
},
confirm() {
if (this.value != this.info.password) {
uni.showToast({
title: 'Password error',
icon: 'none',
duration: 1500
})
return
}
if (this.info.coinList[0].xname == 'Ethereum') {
this.$EthUtil.transaction(this.info.address, this.toAddress, this.toValue, this.info.privateKey).then((
res) => {
console.log(res, '钱包')
this.show2 = false;
uni.reLaunch({
url: '../transfer2/index'
})
}).catch(err => {
console.log(err)
}) })
}).catch(err => {
uni.showToast({ }
title: err, if (this.info.coinList[0].xname == 'TRON') {
icon: 'none', if (!this.contractAddress) {
duration: 1500 this.$TronUtil.sendTransaction(this.info.address, this.info.privateKey, this.toAddress, this.toValue, )
}) .then((res) => {
}) uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 2000
})
this.show2 = false;
uni.reLaunch({
url: '/pages/menu/wallet/index'
})
}).catch(err => {
uni.showToast({
title: err,
icon: 'none',
duration: 2000
})
})
}else{
this.$TronUtil.sendRawTransaction(this.info.address, this.info.privateKey, this.toAddress, this.toValue,'',this.contractAddress )
.then((res) => {
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 2000
})
this.show2 = false;
uni.reLaunch({
url: '/pages/menu/wallet/index'
})
}).catch(err => {
console.log(err)
uni.showToast({
title: err,
icon: 'none',
duration: 2000
})
})
}
} }
}, },
goAddress(){ goAddress() {
uni.navigateTo({ uni.navigateTo({
url:'../address/index' url: '../address/index'
}) })
}, },
// //
chooseImage() { chooseImage() {
var _this = this var _this = this
uni.chooseImage({ uni.chooseImage({
count: 1, //9 count: 1, //9
sizeType: ['original', 'compressed'], // sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], // sourceType: ['album', 'camera'], //
success: function(res) { success: function(res) {
_this.imgShow = res.tempFilePaths[0] _this.imgShow = res.tempFilePaths[0]
} }
}); });
// ass() // ass()
}, },
}, },
onLoad(option) { onLoad(option) {
const item = JSON.parse(option.item); this.contractAddress = option.contractAddress;
this.info=item; this.info = uni.getStorageSync('wallet');
this.addValue=this.info.coinList[0].xname+' Address' this.addValue = this.info.coinList[0].xname + ' Address'
} }
}; };
</script> </script>

2
pages/menu/token/btc/index.css

@ -5,7 +5,7 @@
right: 30rpx; right: 30rpx;
} }
.big_title{ .big_title{
font-size: 48rpx; font-size: 36rpx;
} }
.main .money_con{ .main .money_con{

7
pages/menu/token/btc/index.vue

@ -232,6 +232,13 @@
console.log(this.infoWallet,1111) console.log(this.infoWallet,1111)
this.getWalletInfo() this.getWalletInfo()
}, },
onPullDownRefresh() {
console.log('refresh');
this.getWalletInfo();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 500);
},
onReachBottom() { onReachBottom() {
this.pageSize += 5; this.pageSize += 5;
this.getWalletInfo() this.getWalletInfo()

10
pages/menu/token/btc/index2.vue

@ -144,7 +144,7 @@
goSend() { goSend() {
let itemm = JSON.stringify(this.infoWallet) let itemm = JSON.stringify(this.infoWallet)
uni.navigateTo({ uni.navigateTo({
url: '/pages/menu/sendToken/transfer2/index?item=' + itemm url: '/pages/menu/sendToken/transfer2/index?contractAddress=' + this.contractAddress
}) })
}, },
goReceive() { goReceive() {
@ -222,8 +222,16 @@
this.xname=this.infoWallet.coinList[index].xname this.xname=this.infoWallet.coinList[index].xname
this.balance=this.infoWallet.coinList[index].balance this.balance=this.infoWallet.coinList[index].balance
this.xbalance=this.infoWallet.coinList[index].balancePrice this.xbalance=this.infoWallet.coinList[index].balancePrice
this.contractAddress=this.infoWallet.coinList[index].contractAddress
this.getWalletInfo() this.getWalletInfo()
}, },
onPullDownRefresh() {
console.log('refresh');
this.getWalletInfo();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 500);
},
onReachBottom() { onReachBottom() {
this.pageSize += 5; this.pageSize += 5;
this.getWalletInfo() this.getWalletInfo()

12
pages/menu/wallet/index.css

@ -12,7 +12,7 @@
right: 30rpx; right: 30rpx;
} }
.big_title{ .big_title{
font-size: 48rpx; font-size: 36rpx;
} }
.main{ .main{
padding: 0 26rpx; padding: 0 26rpx;
@ -64,7 +64,7 @@
margin-top:40rpx; margin-top:40rpx;
} }
.textcon3{ .textcon3{
color: #D6CAF7; color: #FFFFFF;
font-size: 28rpx; font-size: 28rpx;
margin-top:40rpx; margin-top:40rpx;
} }
@ -109,20 +109,20 @@
margin-right: 20rpx; margin-right: 20rpx;
} }
.bot_con .item .left .textcon .text1{ .bot_con .item .left .textcon .text1{
font-size: 36rpx; font-size: 30rpx;
} }
.bot_con .item .left .textcon .text2{ .bot_con .item .left .textcon .text2{
font-size: 28rpx; font-size: 24rpx;
color: #B0BBD5; color: #B0BBD5;
} }
.bot_con .item .rig{ .bot_con .item .rig{
text-align: right; text-align: right;
} }
.bot_con .item .rig .text1{ .bot_con .item .rig .text1{
font-size: 36rpx; font-size: 32rpx;
} }
.bot_con .item .rig .text2{ .bot_con .item .rig .text2{
font-size: 28rpx; font-size: 24rpx;
color: #B0BBD5; color: #B0BBD5;
} }
.opc{ .opc{

166
pages/menu/wallet/index.vue

@ -10,14 +10,20 @@
</text> </text>
</navigation> </navigation>
<view class="main"> <view class="main">
<view :class="{'money_con': userObj.coinList[0].xname=='Ethereum', 'money_con2': userObj.coinList[0].xname=='Bitcoin', 'money_con3': userObj.coinList[0].xname=='TRON'}"> <view
<image src="../../../static/tongyonh/ethereum.png" mode="aspectFit" class="imgicon" v-if="userObj.coinList[0].xname=='Ethereum'"></image> :class="{'money_con': userObj.coinList[0].xname=='Ethereum', 'money_con2': userObj.coinList[0].xname=='Bitcoin', 'money_con3': userObj.coinList[0].xname=='TRON'}">
<image src="../../../static/tongyonh/Frame28.png" mode="aspectFit" class="imgicon" v-if="userObj.coinList[0].xname=='Bitcoin'"></image> <image src="../../../static/tongyonh/ethereum.png" mode="aspectFit" class="imgicon"
<image src="../../../static/tongyonh/tronicon.png" mode="aspectFit" class="imgicon" v-if="userObj.coinList[0].xname=='TRON'"></image> v-if="userObj.coinList[0].xname=='Ethereum'"></image>
<image src="../../../static/tongyonh/Frame28.png" mode="aspectFit" class="imgicon"
v-if="userObj.coinList[0].xname=='Bitcoin'"></image>
<image src="../../../static/tongyonh/tronicon.png" mode="aspectFit" class="imgicon"
v-if="userObj.coinList[0].xname=='TRON'"></image>
<view class="textcon1 flex"> <view class="textcon1 flex">
<text class="text">{{this.userObj.name}}</text> <text class="text">{{this.userObj.name}}</text>
<image src="../../../static/tongyonh/visibility_24px.png" mode="aspectFit" class="img1" @click="showMoney()" v-if="showMoney1"></image> <image src="../../../static/tongyonh/visibility_24px.png" mode="aspectFit" class="img1"
<image src="../../../static/tongyonh/eyeno.png" mode="aspectFit" class="img1" @click="showMoney22()" v-if="showMoney2"></image> @click="showMoney()" v-if="showMoney1"></image>
<image src="../../../static/tongyonh/eyeno.png" mode="aspectFit" class="img1" @click="showMoney22()"
v-if="showMoney2"></image>
</view> </view>
<view class="textcon2" v-if="showMoney1"> <view class="textcon2" v-if="showMoney1">
$ {{!userObj.balancePrice?0.00:userObj.balancePrice}} $ {{!userObj.balancePrice?0.00:userObj.balancePrice}}
@ -35,34 +41,36 @@
<view class="title"> <view class="title">
Assets Assets
</view> </view>
<image src="../../../static/tongyonh/IconGroup.png" mode="aspectFit" class="jiaimg" v-if="userObj.coinList[0].xname!='Bitcoin'&&userObj.coinList[0].xname!='TRON'" @click="goOther"></image> <image src="../../../static/tongyonh/IconGroup.png" mode="aspectFit" class="jiaimg"
v-if="userObj.coinList[0].xname!='Bitcoin'&&userObj.coinList[0].xname!='TRON'" @click="goOther">
</image>
</view> </view>
<view class="scroll"> <view class="scroll">
<view class="item flexx" @click="goTrans(item,index)" v-for="item,index in this.userObj.coinList"> <view class="item flexx" @click="goTrans(item,index)" v-for="item,index in this.userObj.coinList">
<view class="left flex"> <view class="left flex">
<image :src="item.icon" mode="aspectFit" class="img1"></image> <image :src="item.icon" mode="aspectFit" class="img1"></image>
<view class="textcon"> <view class="textcon">
<view class="text1">
{{item.name}}
</view>
<view class="text2">
{{item.xname}}
</view>
</view>
</view>
<view class="rig">
<view class="text1"> <view class="text1">
{{item.name}} {{item.balance}}
</view> </view>
<view class="text2"> <view class="text2" v-if="item.balancePrice">
{{item.xname}} $ {{item.balancePrice}}
</view>
<view class="text2" v-if="!item.balancePrice">
$ 0.00
</view> </view>
</view>
</view>
<view class="rig">
<view class="text1">
{{item.balance}}
</view>
<view class="text2" v-if="item.balancePrice">
$ {{item.balancePrice}}
</view>
<view class="text2" v-if="!item.balancePrice">
$ 0.00
</view> </view>
</view> </view>
</view> </view>
</view>
@ -83,80 +91,90 @@
return { return {
eth: '', eth: '',
trc: 'Hello', trc: 'Hello',
walletInfo:{}, walletInfo: {},
userObj:{}, userObj: {},
userObj2:{}, userObj2: {},
showMoney1:true, showMoney1: true,
showMoney2:false, showMoney2: false,
btcBalance:0, btcBalance: 0,
} }
}, },
onLoad() { onLoad() {
this.setStorage(); this.setStorage();
this.$walletUtil.updateBalance();
if(uni.getStorageSync('wallet')){ if (uni.getStorageSync('wallet')) {
this.userObj=uni.getStorageSync('wallet'); this.userObj = uni.getStorageSync('wallet');
this.userObj2=uni.getStorageSync('wallet'); this.userObj2 = uni.getStorageSync('wallet');
this.updateData(); this.updateData();
this.userObj.address = this.userObj.address.substring(0, 6)+'...'+this.userObj.address.substring(25,this.userObj.address.length); this.userObj.address = this.userObj.address.substring(0, 6) + '...' + this.userObj.address.substring(25,
this.userObj.address.length);
} }
}, },
onPullDownRefresh() {
console.log('refresh');
this.$walletUtil.updateBalance();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 500);
},
methods: { methods: {
updateData(){ updateData() {
let thar=this; let thar = this;
setTimeout( setTimeout(
function(){ function() {
thar.userObj=uni.getStorageSync('wallet'); thar.userObj = uni.getStorageSync('wallet');
thar.userObj2=uni.getStorageSync('wallet'); thar.userObj2 = uni.getStorageSync('wallet');
thar.userObj.address = thar.userObj.ellipsisAddress; thar.userObj.address = thar.userObj.ellipsisAddress;
thar.updateData(); thar.updateData();
},200); }, 200);
},
goOther(){
console.log(this.userObj2,8888)
let item = JSON.stringify(this.userObj2)
uni.navigateTo({
url:'otherCoin/index?type='+item
})
},
showMoney(){
this.showMoney1=false
this.showMoney2=true
}, },
showMoney22(){ goOther() {
this.showMoney1=true console.log(this.userObj2, 8888)
this.showMoney2=false let item = JSON.stringify(this.userObj2)
uni.navigateTo({
url: 'otherCoin/index?type=' + item
})
},
showMoney() {
this.showMoney1 = false
this.showMoney2 = true
},
showMoney22() {
this.showMoney1 = true
this.showMoney2 = false
}, },
setStorage() { setStorage() {
this.walletInfo = uni.getStorageSync('walletInfo'); this.walletInfo = uni.getStorageSync('walletInfo');
this.userObj=this.walletInfo.BTC[0] this.userObj = this.walletInfo.BTC[0]
this.userObj.address = this.userObj.address.substring(0, 6)+'...'+this.userObj.address.substring(25,this.userObj.address.length); this.userObj.address = this.userObj.address.substring(0, 6) + '...' + this.userObj.address.substring(25,
this.userObj.address.length);
console.log(this.walletInfo.BTC[0]) console.log(this.walletInfo.BTC[0])
}, },
goTrans(itemm,index) { goTrans(itemm, index) {
console.log(index,444) console.log(index, 444)
let item = JSON.stringify(this.userObj2) let item = JSON.stringify(this.userObj2)
console.log(item,454545) console.log(item, 454545)
if(index==0){ if (index == 0) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/menu/token/btc/index?item='+item url: '/pages/menu/token/btc/index?item=' + item
}) })
}else{ } else {
// //
uni.setStorageSync('otherCoin',index) uni.setStorageSync('otherCoin', index)
uni.navigateTo({ uni.navigateTo({
url:'/pages/menu/token/btc/index2' url: '/pages/menu/token/btc/index2'
}) })
} }
}, },
// //
chooseImage() { chooseImage() {
@ -177,7 +195,7 @@
url: './cwallet/index' url: './cwallet/index'
}) })
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>

8
utils/TronUtil.js

@ -41,6 +41,7 @@ let tron = {
}, },
// 发起TRC/USDT交易 // 发起TRC/USDT交易
sendRawTransaction: async function(fromAddress, privateKey, toAddress, amount, remark, contract) { sendRawTransaction: async function(fromAddress, privateKey, toAddress, amount, remark, contract) {
console.log(fromAddress, privateKey, toAddress, amount, remark, contract)
const parameter = [{ const parameter = [{
type: 'address', type: 'address',
value: toAddress value: toAddress
@ -83,6 +84,9 @@ let tron = {
'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息 'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
}, },
success: (res) => { success: (res) => {
var newList=[];
newList.push(list[0])
newList.push(list[1])
for(let i=1;i<res.data.data.length;i++){ for(let i=1;i<res.data.data.length;i++){
if(res.data.data[i].tokenAbbr==='USDT'){ if(res.data.data[i].tokenAbbr==='USDT'){
list[1].balance=(Number(res.data.data[i].balance)/ Math.pow(10, res.data.data[i].tokenDecimal)); list[1].balance=(Number(res.data.data[i].balance)/ Math.pow(10, res.data.data[i].tokenDecimal));
@ -101,14 +105,14 @@ let tron = {
}else{ }else{
coin.contractAddress=res.data.data[i].owner_address coin.contractAddress=res.data.data[i].owner_address
} }
list.push(coin) newList.push(coin)
} }
} }
console.log(list,12313) console.log(list,12313)
success(list); success(newList);
// coinList: [{ // coinList: [{
// name: "ETH", // name: "ETH",
// xname: 'Ethereum', // xname: 'Ethereum',

2
utils/WalletUtil.js

@ -197,7 +197,7 @@ let WalletUtil = {
} }
} }
this.updateBalance(); //this.updateBalance();
}, },
updateBalance:function() { updateBalance:function() {

Loading…
Cancel
Save