Browse Source

修改

master
vee 4 years ago
parent
commit
24ed52444d
  1. 4
      pages/menu/wallet/index.vue
  2. 16604
      unpackage/dist/dev/app-plus/app-service.js
  3. 7704
      unpackage/dist/dev/app-plus/app-view.js
  4. 0
      unpackage/dist/dev/app-plus/static/img/copy_24px_outlined.e8932d3c.svg
  5. 0
      unpackage/dist/dev/app-plus/static/img/more_vert_24px_outlined.427f4df0.svg
  6. 8
      utils/WalletUtil.js
  7. 2
      utils/axios.js

4
pages/menu/wallet/index.vue

@ -122,9 +122,9 @@
let thar = this; let thar = this;
setTimeout( setTimeout(
function() { function() {
console.log(uni.getStorageSync('wallet'),'钱包');
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.address.substring(0, 6) + '...' + thar.userObj.address thar.userObj.address = thar.userObj.address.substring(0, 6) + '...' + thar.userObj.address
.substring(25, .substring(25,
thar.userObj.address.length); thar.userObj.address.length);
@ -132,7 +132,7 @@
if (!thar.isStop) { if (!thar.isStop) {
thar.updateData() thar.updateData()
} }
}, 2000); }, 5000);
}, },
goOther() { goOther() {

16604
unpackage/dist/dev/app-plus/app-service.js

File diff suppressed because one or more lines are too long

7704
unpackage/dist/dev/app-plus/app-view.js

File diff suppressed because one or more lines are too long

0
unpackage/dist/dev/app-plus/static/img/copy_24px_outlined.8dca7e38.svg → unpackage/dist/dev/app-plus/static/img/copy_24px_outlined.e8932d3c.svg

Before

Width:  |  Height:  |  Size: 629 B

After

Width:  |  Height:  |  Size: 629 B

0
unpackage/dist/dev/app-plus/static/img/more_vert_24px_outlined.266aaa48.svg → unpackage/dist/dev/app-plus/static/img/more_vert_24px_outlined.427f4df0.svg

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 526 B

8
utils/WalletUtil.js

@ -187,12 +187,13 @@ let WalletUtil = {
return walletList; return walletList;
}, },
selectWallet: function(type, address) { selectWallet: function(type, address) {
console.log('选择钱包')
uni.setStorageSync('walleti', address); uni.setStorageSync('walleti', address);
let walletInfo = uni.getStorageSync('walletInfo'); let walletInfo = uni.getStorageSync('walletInfo');
let walletList = walletInfo[type]; let walletList = walletInfo[type];
console.log() console.log()
for (var k = 0, length = walletList.length; k < length; k++) { for (var k = 0, length = walletList.length; k < length; k++) {
if (walletList[k].address === address) { if (walletList[k].address == address) {
walletList[k].ellipsisAddress = address.substring(0, 6) + '...' + address.substring(25, walletList[k].ellipsisAddress = address.substring(0, 6) + '...' + address.substring(25,
address.length) address.length)
uni.setStorageSync('wallet', walletList[k]); uni.setStorageSync('wallet', walletList[k]);
@ -204,6 +205,7 @@ let WalletUtil = {
}, },
updateBalance:function() { updateBalance:function() {
const wallet = uni.getStorageSync('wallet'); const wallet = uni.getStorageSync('wallet');
console.log(wallet,'更新余额')
const walletInfo = uni.getStorageSync('walletInfo'); const walletInfo = uni.getStorageSync('walletInfo');
for (var k = 0, length = walletInfo[wallet.type].length; k < length; k++) { for (var k = 0, length = walletInfo[wallet.type].length; k < length; k++) {
if (walletInfo[wallet.type][k].address === wallet.address) { if (walletInfo[wallet.type][k].address === wallet.address) {
@ -217,6 +219,7 @@ let WalletUtil = {
that.getPrice('USDT',function(usdt){ that.getPrice('USDT',function(usdt){
switch (wallet.type) { switch (wallet.type) {
case 'BTC': case 'BTC':
console.log("进来BTC")
BtcUtil.getBalance(wallet.address,function(balance){ BtcUtil.getBalance(wallet.address,function(balance){
wallet.balance=balance; wallet.balance=balance;
wallet.balancePrice=(balance*rr).toFixed(2); wallet.balancePrice=(balance*rr).toFixed(2);
@ -226,6 +229,7 @@ let WalletUtil = {
}) })
break; break;
case 'ETH': case 'ETH':
console.log("进来ETH")
EthUtil.getBalance(wallet.address,function(balance){ EthUtil.getBalance(wallet.address,function(balance){
wallet.balance=balance; wallet.balance=balance;
wallet.balancePrice=(balance*rr).toFixed(2); wallet.balancePrice=(balance*rr).toFixed(2);
@ -243,7 +247,7 @@ let WalletUtil = {
break; break;
case 'TRX': case 'TRX':
console.log("进来TRX")
TronUtil.getTronBalance(wallet.address).then((res) => { TronUtil.getTronBalance(wallet.address).then((res) => {
wallet.balance=res; wallet.balance=res;
wallet.balancePrice=(res*rr).toFixed(2); wallet.balancePrice=(res*rr).toFixed(2);

2
utils/axios.js

@ -78,7 +78,7 @@ axios.defaults.adapter = function(config) { //自己定义个适配器,用来
var buildURL = require('axios/lib/helpers/buildURL'); var buildURL = require('axios/lib/helpers/buildURL');
uni.request({ uni.request({
method: config.method.toUpperCase(), method: config.method.toUpperCase(),
url: config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer), url: (config.baseURL?config.baseURL+'/':'') + buildURL(config.url, config.params, config.paramsSerializer),
header: config.headers, header: config.headers,
data: config.data, data: config.data,
dataType: config.dataType, dataType: config.dataType,

Loading…
Cancel
Save