Browse Source

钱包工具类

master
vee 4 years ago
parent
commit
66ceeec207
  1. 2
      pages/menu/collection/index.vue
  2. 6
      utils/WalletUtil.js

2
pages/menu/collection/index.vue

@ -21,7 +21,7 @@
</view>
</view>
</view>
<image src="../../../../tongyonh/chevron_right_24px.png" mode="aspectFit" class="letImg"></image>
<image src="../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="letImg"></image>
</view>

6
utils/WalletUtil.js

@ -205,6 +205,7 @@ let WalletUtil = {
wallet.balance=balance;
wallet.balancePrice=(balance*rr).toFixed(2);
wallet.coinList[0].balance=balance
wallet.coinList[0].balancePrice=wallet.balancePrice
uni.setStorageSync('wallet', wallet);
})
break;
@ -213,6 +214,7 @@ let WalletUtil = {
wallet.balance=balance;
wallet.balancePrice=(balance*rr).toFixed(2);
wallet.coinList[0].balance=balance
wallet.coinList[0].balancePrice=wallet.balancePrice
for(let i=1;i<wallet.coinList.length;i++){
EthUtil.getTokenBalance(wallet.address,wallet.coinList[i].contractAddress,function(b){
wallet.coinList[i].balance=b;
@ -228,8 +230,10 @@ let WalletUtil = {
TronUtil.getTronBalance(wallet.address).then((res) => {
wallet.balance=res;
wallet.balancePrice=(res*rr).toFixed(2);
wallet.coinList[0].balance=res
TronUtil.getContract('TWgEuYRuXgwfDbcfzZsteu5w5dq1nFR35w',wallet.coinList,function(list){
wallet.coinList[0].balancePrice=wallet.balancePrice
TronUtil.getContract(wallet.address,wallet.coinList,function(list){
wallet.coinList=list;
wallet.coinList[1].balancePrice=(wallet.coinList[1].balance*usdt).toFixed(2);
console.log(wallet.coinList)

Loading…
Cancel
Save