Browse Source

代码

master
Dread 4 years ago
parent
commit
621978dadf
  1. 51
      pages/menu/wallet/cwallet/index.vue
  2. 316
      unpackage/dist/dev/app-plus/app-service.js
  3. 184
      unpackage/dist/dev/app-plus/app-view.js
  4. 17
      utils/WalletUtil.js

51
pages/menu/wallet/cwallet/index.vue

@ -40,7 +40,7 @@
</view> </view>
</view> </view>
<view class="item flexx pur" @click="gou(item,index)" v-for="item,index in walletInfoETH" v-if="type=='eth' || typeBoll==false"> <!-- <view class="item flexx pur" @click="gou(item,index)" v-for="item,index in walletInfoETH" v-if="type=='eth' || typeBoll==false">
<view class="left flex"> <view class="left flex">
<image src="../../../../static/tongyonh/ETH_icon.png" mode="aspectFit" class="img1"></image> <image src="../../../../static/tongyonh/ETH_icon.png" mode="aspectFit" class="img1"></image>
<view class="textcon"> <view class="textcon">
@ -59,10 +59,10 @@
{{item.balance}} {{item.balance}}
</view> </view>
</view> </view> -->
<view class="item flexx red" @click="gou(item,index)" v-for="item,index in walletInfoTRX" v-if="type=='trx' || typeBoll==false"> <!-- <view class="item flexx red" @click="gou(item,index)" v-for="item,index in walletInfoTRX" v-if="type=='trx' || typeBoll==false">
<view class="left flex"> <view class="left flex">
<image src="../../../../static/tongyonh/tron_icon.png" mode="aspectFit" class="img1"></image> <image src="../../../../static/tongyonh/tron_icon.png" mode="aspectFit" class="img1"></image>
<view class="textcon"> <view class="textcon">
@ -78,7 +78,7 @@
<view class="rig"> <view class="rig">
{{item.balance}} {{item.balance}}
</view> </view>
</view> </view> -->
@ -168,30 +168,26 @@
this.typeBoll=true; this.typeBoll=true;
} }
}, },
getStorage(){
this.walletInfo2 = uni.getStorageSync('walletInfo');
console.log(this.walletInfo2,232323)
this.walletInfoBTC2=this.walletInfo2.BTC;
this.walletInfoETH2=this.walletInfo2.ETH;
this.walletInfoTRX2=this.walletInfo2.TRON;
},
setStorage() { setStorage() {
this.walletInfo = uni.getStorageSync('walletInfo'); console.log(this.$walletUtil.getWalletList())
this.walletInfoBTC=this.walletInfo.BTC; this.walletInfo=this.$walletUtil.getWalletList()
// this.walletInfo = uni.getStorageSync('walletInfo');
// this.walletInfoBTC=this.walletInfo.BTC;
this.num=this.walletInfoBTC[0].privateKey // this.num=this.walletInfoBTC[0].privateKey
for(var i=0;i<this.walletInfoBTC.length;i++){ // for(var i=0;i<this.walletInfoBTC.length;i++){
this.walletInfoBTC[i].address = this.walletInfoBTC[i].address.substring(0, 6)+'...'+this.walletInfoBTC[i].address.substring(25,this.walletInfoBTC[i].address.length); // this.walletInfoBTC[i].address = this.walletInfoBTC[i].address.substring(0, 6)+'...'+this.walletInfoBTC[i].address.substring(25,this.walletInfoBTC[i].address.length);
} // }
this.walletInfoETH=this.walletInfo.ETH; // this.walletInfoETH=this.walletInfo.ETH;
for(var i=0;i<this.walletInfoETH.length;i++){ // for(var i=0;i<this.walletInfoETH.length;i++){
this.walletInfoETH[i].address = this.walletInfoETH[i].address.substring(0, 6)+'...'+this.walletInfoETH[i].address.substring(25,this.walletInfoETH[i].address.length); // this.walletInfoETH[i].address = this.walletInfoETH[i].address.substring(0, 6)+'...'+this.walletInfoETH[i].address.substring(25,this.walletInfoETH[i].address.length);
} // }
this.walletInfoTRX=this.walletInfo.TRON; // this.walletInfoTRX=this.walletInfo.TRON;
for(var i=0;i<this.walletInfoTRX.length;i++){ // for(var i=0;i<this.walletInfoTRX.length;i++){
this.walletInfoTRX[i].address = this.walletInfoTRX[i].address.substring(0, 6)+'...'+this.walletInfoTRX[i].address.substring(25,this.walletInfoTRX[i].address.length); // this.walletInfoTRX[i].address = this.walletInfoTRX[i].address.substring(0, 6)+'...'+this.walletInfoTRX[i].address.substring(25,this.walletInfoTRX[i].address.length);
} // }
console.log(this.walletInfo,111111) // console.log(this.walletInfo,111111)
}, },
goManager(itemm){ goManager(itemm){
console.log(itemm) console.log(itemm)
@ -205,10 +201,7 @@
}, },
onLoad() { onLoad() {
this.getStorage()
this.setStorage() this.setStorage()
if(uni.getStorageSync('walleti')!=''){ if(uni.getStorageSync('walleti')!=''){
this.num=uni.getStorageSync('walleti') this.num=uni.getStorageSync('walleti')
} }

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

File diff suppressed because one or more lines are too long

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

@ -8804,190 +8804,6 @@ var render = function() {
1 1
) )
: _vm._e() : _vm._e()
}),
_vm._l(_vm._$g(21, "f"), function(item, index, $21, $31) {
return _vm._$g("21-" + $31, "i")
? _c(
"v-uni-view",
{
key: item,
staticClass: _vm._$g("21-" + $31, "sc"),
attrs: { _i: "21-" + $31 },
on: {
click: function($event) {
return _vm.$handleViewEvent($event)
}
}
},
[
_c(
"v-uni-view",
{
staticClass: _vm._$g("22-" + $31, "sc"),
attrs: { _i: "22-" + $31 }
},
[
_c("v-uni-image", {
staticClass: _vm._$g("23-" + $31, "sc"),
attrs: {
src: _vm._$g("23-" + $31, "a-src"),
mode: "aspectFit",
_i: "23-" + $31
}
}),
_c(
"v-uni-view",
{
staticClass: _vm._$g("24-" + $31, "sc"),
attrs: { _i: "24-" + $31 }
},
[
_c(
"v-uni-view",
{
staticClass: _vm._$g("25-" + $31, "sc"),
attrs: { _i: "25-" + $31 }
},
[_vm._v(_vm._$g("25-" + $31, "t0-0"))]
),
_c(
"v-uni-view",
{
staticClass: _vm._$g("26-" + $31, "sc"),
attrs: { _i: "26-" + $31 }
},
[_vm._v(_vm._$g("26-" + $31, "t0-0"))]
)
],
1
)
],
1
),
_vm._$g("27-" + $31, "i")
? _c(
"v-uni-view",
{
staticClass: _vm._$g("27-" + $31, "sc"),
attrs: { _i: "27-" + $31 }
},
[
_c("v-uni-image", {
staticClass: _vm._$g("28-" + $31, "sc"),
attrs: {
src: _vm._$g("28-" + $31, "a-src"),
mode: "aspectFit",
_i: "28-" + $31
}
})
],
1
)
: _vm._e(),
_c(
"v-uni-view",
{
staticClass: _vm._$g("29-" + $31, "sc"),
attrs: { _i: "29-" + $31 }
},
[_vm._v(_vm._$g("29-" + $31, "t0-0"))]
)
],
1
)
: _vm._e()
}),
_vm._l(_vm._$g(30, "f"), function(item, index, $22, $32) {
return _vm._$g("30-" + $32, "i")
? _c(
"v-uni-view",
{
key: item,
staticClass: _vm._$g("30-" + $32, "sc"),
attrs: { _i: "30-" + $32 },
on: {
click: function($event) {
return _vm.$handleViewEvent($event)
}
}
},
[
_c(
"v-uni-view",
{
staticClass: _vm._$g("31-" + $32, "sc"),
attrs: { _i: "31-" + $32 }
},
[
_c("v-uni-image", {
staticClass: _vm._$g("32-" + $32, "sc"),
attrs: {
src: _vm._$g("32-" + $32, "a-src"),
mode: "aspectFit",
_i: "32-" + $32
}
}),
_c(
"v-uni-view",
{
staticClass: _vm._$g("33-" + $32, "sc"),
attrs: { _i: "33-" + $32 }
},
[
_c(
"v-uni-view",
{
staticClass: _vm._$g("34-" + $32, "sc"),
attrs: { _i: "34-" + $32 }
},
[_vm._v(_vm._$g("34-" + $32, "t0-0"))]
),
_c(
"v-uni-view",
{
staticClass: _vm._$g("35-" + $32, "sc"),
attrs: { _i: "35-" + $32 }
},
[_vm._v(_vm._$g("35-" + $32, "t0-0"))]
)
],
1
)
],
1
),
_vm._$g("36-" + $32, "i")
? _c(
"v-uni-view",
{
staticClass: _vm._$g("36-" + $32, "sc"),
attrs: { _i: "36-" + $32 }
},
[
_c("v-uni-image", {
staticClass: _vm._$g("37-" + $32, "sc"),
attrs: {
src: _vm._$g("37-" + $32, "a-src"),
mode: "aspectFit",
_i: "37-" + $32
}
})
],
1
)
: _vm._e(),
_c(
"v-uni-view",
{
staticClass: _vm._$g("38-" + $32, "sc"),
attrs: { _i: "38-" + $32 }
},
[_vm._v(_vm._$g("38-" + $32, "t0-0"))]
)
],
1
)
: _vm._e()
}) })
], ],
2 2

17
utils/WalletUtil.js

@ -131,5 +131,22 @@ let WalletUtil = {
uni.setStorageSync('walletInfo', walletInfo); uni.setStorageSync('walletInfo', walletInfo);
uni.setStorageSync('wallet', wallet); uni.setStorageSync('wallet', wallet);
} }
,
getWalletList: function(type) {
let walletInfo = uni.getStorageSync('walletInfo');
let walletList=[];
if(type){
walletList=walletInfo[type]
}else{
for(let obj in walletInfo){
for (var k = 0, length = walletInfo[obj].length; k < length; k++) {
let address=walletInfo[obj][k].address;
walletInfo[obj][k].ellipsisAddress=address.substring(0, 6)+'...'+address.substring(25, address.length);
walletList.push(walletInfo[obj][k]);
}
}
}
return walletList;
}
} }
export default WalletUtil export default WalletUtil

Loading…
Cancel
Save