vee 4 years ago
parent
commit
f692e03a96
  1. 241
      pages/menu/backUp/transPaw/index.vue
  2. 142
      pages/menu/wallet/cwallet/index.vue
  3. 2
      pages/menu/wallet/index.vue
  4. 131
      pages/menu/wallet/mwallet/index.vue
  5. 43
      pages/menu/wallet/mwallet/manage/index.vue
  6. 4
      pages/menu/wallet/otherCoin/index.css
  7. 82
      pages/menu/wallet/otherCoin/index.vue
  8. BIN
      static/tongyonh/img500.png
  9. 894
      unpackage/dist/dev/app-plus/app-service.js
  10. 430
      unpackage/dist/dev/app-plus/app-view.js
  11. BIN
      unpackage/dist/dev/app-plus/static/tongyonh/img500.png
  12. 13
      utils/WalletUtil.js

241
pages/menu/backUp/transPaw/index.vue

@ -64,8 +64,7 @@
// //
setWalletInfo(e) { setWalletInfo(e) {
this.word = uni.getStorageSync('word'); this.word = uni.getStorageSync('word');
this.$walletUtil.initialWallet(this.word, e) this.$walletUtil.initialWallet(this.word,this.password )
console.log(123123)
}, },
// //
@ -74,225 +73,43 @@
this.info = false; this.info = false;
} }
}, },
//
//
finish2(e) { finish2(e) {
if (this.password != e) { if (this.password != e) {
this.info = true; this.info = true;
return; return;
} else { } else {
var a = uni.getStorageSync('createWalletName') //
var mnemonic = uni.getStorageSync('word'); if(uni.getStorageSync('walletInfo')){
this.$walletUtil.mnemonicEstablishWallet(a,mnemonic,e) var a = uni.getStorageSync('createWalletName')
uni.showToast({ var mnemonic = uni.getStorageSync('word');
title: 'Set successfully', this.$walletUtil.mnemonicEstablishWallet(a,mnemonic,e)
icon: 'success', uni.showToast({
duration: 1500, title: 'Set successfully',
}) icon: 'success',
setTimeout(() => { duration: 1500,
uni.navigateTo({
url: '../../wallet/index'
}) })
}, 1500) setTimeout(() => {
uni.navigateTo({
url: '../../wallet/index'
})
}, 1500)
}else{
this.setWalletInfo();
uni.showToast({
title: 'Set successfully',
icon: 'success',
duration: 1500,
})
setTimeout(() => {
uni.navigateTo({
url: '../../wallet/index'
})
}, 1500)
}
this.info = false; this.info = false;
} }
// if (a == 'BTC' && a != '' && a != undefined) {
// this.walletInfo = uni.getStorageSync('walletInfo');
// console.log(mnemonic, 7777777777)
// let btc = this.$Token.generateBtc(mnemonic);
// btc.mnemonic = mnemonic;
// btc.password = e;
// this.$api.getBtcBalance().then((res) => {
// var b = res.data.data[0]
// for (var k in b) {
// this.btcBalance = b[k]
// }
// })
// btc.coinList = [{
// name: "BTC",
// name2: "BTC",
// xname: 'Bitcoin',
// icon: require('@/static/tongyonh/bye.png'),
// balance: this.btcBalance
// }];
// btc.balance = this.btcBalance
// console.log(this.$store.state.btci, 555566565)
// this.$store.commit('addBtci', 1)
// uni.setStorageSync('wallet', btc)
// uni.setStorageSync('walleti', btc.privateKey)
// this.walletInfo.BTC[this.$store.state.btci] = btc;
// //
// console.log(this.$store.state.btci, 555566565)
// console.log(this.walletInfo, 44444)
// uni.setStorageSync('walletInfo', this.walletInfo);
// if (this.password != e) {
// this.info = true;
// return;
// } else {
// uni.showToast({
// title: 'successfully',
// icon: 'success',
// duration: 1500,
// })
// setTimeout(() => {
// uni.navigateTo({
// url: '../../wallet/index'
// })
// }, 1500)
// this.info = false;
// }
// return;
// }
// if (a == 'ETH' && a != '' && a != undefined) {
// this.walletInfo = uni.getStorageSync('walletInfo');
// var mnemonic = uni.getStorageSync('word');
// let eth = this.$Token.generateEth(mnemonic);
// eth.mnemonic = mnemonic;
// eth.password = e;
// this.$EthUtil.getBalance(eth.address,function(res){
// eth.balance = res
// this.ethBbalance = res;
// console.log(res,'eth')
// });
// eth.coinList = [
// {
// name: "ETH",
// name2: "ETH",
// xname: 'Ethereum',
// icon: require('@/static/tongyonh/Frame3299.png'),
// balance: this.ethBbalance
// },
// {
// name:"USDT",
// name2:"ERC20-USDT",
// xname:'Tether USD',
// contractAddress:'0xdac17f958d2ee523a2206206994597c13d831ec7',
// icon:require('@/static/tongyonh/img500.png')
// }
// ];
// this.$store.commit('addEthi', 1)
// uni.setStorageSync('walleti', eth.privateKey)
// this.walletInfo.ETH[this.$store.state.ethi] = eth;
// //
// console.log(this.$store.state.ethi, 555566565)
// console.log(this.walletInfo, 44444)
// setTimeout(()=>{
// uni.setStorageSync('walletInfo', this.walletInfo);
// // 便
// var e=uni.getStorageSync(ethi)
// e+=1
// uni.setStorageSync('ethi', e);
// uni.setStorageSync('itype', true);
// },1000)
// setTimeout(()=>{
// uni.setStorageSync('wallet', eth)
// },1000)
// if (this.password != e) {
// this.info = true;
// return;
// } else {
// uni.showToast({
// title: 'successfully',
// icon: 'success',
// duration: 1500,
// })
// setTimeout(() => {
// uni.navigateTo({
// url: '../../wallet/index'
// })
// }, 1500)
// this.info = false;
// }
// return;
// }
// if (a == 'TRX' && a != '' && a != undefined) {
// console.log(123123)
// this.walletInfo = uni.getStorageSync('walletInfo');
// var mnemonic = uni.getStorageSync('word');
// let tron = this.$Token.generateTron(mnemonic);
// tron.mnemonic = mnemonic;
// tron.password = e;
// this.$TronUtil.getTronBalance(tron.address).then((res) => {
// tron.balance = res
// this.trxBbalance = res
// console.log(res,'tron')
// }).catch(err => {
// console.log(err)
// })
// tron.coinList = [
// {
// name: "TRX",
// name2: "TRX",
// xname: 'TRON',
// icon: require('@/static/tongyonh/tron1.png'),
// balance: this.trxBbalance
// },
// {
// name:"USDT",
// name2:"TRC20-USDT",
// xname:'Tether USD',
// contractAddress:'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
// icon:require('@/static/tongyonh/tether_usd.png')
// }
// ];
// console.log(this.$store.state.troni, 555566565)
// //
// this.$store.commit('addTroni', 1)
// setTimeout(()=>{
// uni.setStorageSync('wallet', tron)
// },1000)
// uni.setStorageSync('walleti', tron.privateKey)
// this.walletInfo.TRON[this.$store.state.troni] = tron;
// setTimeout(()=>{
// uni.setStorageSync('walletInfo', this.walletInfo);
// },1000)
// if (this.password != e) {
// this.info = true;
// return;
// } else {
// uni.showToast({
// title: 'Set successfully',
// icon: 'success',
// duration: 1500,
// })
// setTimeout(() => {
// uni.navigateTo({
// url: '../../wallet/index'
// })
// }, 1500)
// this.info = false;
// }
// return;
// }
}, },
// //
finish(e) { finish(e) {

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

@ -8,10 +8,10 @@
</navigation> </navigation>
<view class="main flexx"> <view class="main flexx">
<view class="imgcon"> <view class="imgcon">
<image @click="getHeight('one')" ref="one" src="../../../../static/tongyonh/filter-left.png" mode="aspectFit" class="letConimg"></image> <image @click="getHeight('one'),setStorage()" ref="one" src="../../../../static/tongyonh/filter-left.png" mode="aspectFit" class="letConimg"></image>
<image @click="getHeight('btc')" ref="btc" src="../../../../static/tongyonh/bye.png" mode="aspectFit" class="letConimg"></image> <image @click="getHeight('btc'),setStorage('BTC')" ref="btc" src="../../../../static/tongyonh/bye.png" mode="aspectFit" class="letConimg"></image>
<image @click="getHeight('eth')" ref="eth" src="../../../../static/tongyonh/Frame3299.png" mode="aspectFit" class="letConimg"></image> <image @click="getHeight('eth'),setStorage('ETH')" ref="eth" src="../../../../static/tongyonh/Frame3299.png" mode="aspectFit" class="letConimg"></image>
<image @click="getHeight('trx')" ref="trx" src="../../../../static/tongyonh/tron1.png" mode="aspectFit" class="letConimg"></image> <image @click="getHeight('trx'),setStorage('TRX')" ref="trx" src="../../../../static/tongyonh/tron1.png" mode="aspectFit" class="letConimg"></image>
</view> </view>
@ -20,19 +20,21 @@
<view class="tiao" ref="tiao" :class="{'ethh': type=='eth','btch': type=='btc','trxh': type=='trx'}"> <view class="tiao" ref="tiao" :class="{'ethh': type=='eth','btch': type=='btc','trxh': type=='trx'}">
<!-- --> <!-- -->
</view> </view>
<view class="item flexx" @click="gou(item,index)" v-for="item,index in walletInfoBTC" v-if="type=='btc' || typeBoll==false"> <view class="item flexx" @click="gou(item)" v-for="item,index in walletInfo" :class="{'pur': item.type=='ETH','red': item.type=='TRX'}">
<view class="left flex"> <view class="left flex">
<image src="../../../../static/tongyonh/btc_icon.png" mode="aspectFit" class="img1"></image> <image src="../../../../static/tongyonh/btc_icon.png" mode="aspectFit" class="img1" v-if="item.type=='BTC'"></image>
<image src="../../../../static/tongyonh/ETH_icon.png" mode="aspectFit" class="img1" v-if="item.type=='ETH'"></image>
<image src="../../../../static/tongyonh/tron_icon.png" mode="aspectFit" class="img1" v-if="item.type=='TRX'"></image>
<view class="textcon"> <view class="textcon">
<view class="text1"> <view class="text1">
{{item.coinList[0].name}} {{item.name}}
</view> </view>
<view class="text2"> <view class="text2">
{{item.address}} {{item.ellipsisAddress}}
</view> </view>
</view> </view>
</view> </view>
<view class="gou" v-if="num==item.privateKey"> <view class="gou" v-if="num==item.address">
<image src="../../../../static/tongyonh/Shape.png" mode="aspectFit" class="img"></image> <image src="../../../../static/tongyonh/Shape.png" mode="aspectFit" class="img"></image>
</view> </view>
<view class="rig"> <view class="rig">
@ -40,45 +42,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="left flex">
<image src="../../../../static/tongyonh/ETH_icon.png" mode="aspectFit" class="img1"></image>
<view class="textcon">
<view class="text1">
{{item.coinList[0].name}}
</view>
<view class="text2">
{{item.address}}
</view>
</view>
</view>
<view class="gou" v-if="num==item.privateKey">
<image src="../../../../static/tongyonh/Shape.png" mode="aspectFit" class="img"></image>
</view>
<view class="rig">
{{item.balance}}
</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="left flex">
<image src="../../../../static/tongyonh/tron_icon.png" mode="aspectFit" class="img1"></image>
<view class="textcon">
<view class="text1">
{{item.coinList[0].name}}
</view>
<view class="text2">
{{item.address}}
</view>
</view>
</view>
<view class="gou" v-if="num==item.privateKey"> <image src="../../../../static/tongyonh/Shape.png" mode="aspectFit" class="img"></image> </view>
<view class="rig">
{{item.balance}}
</view>
</view> -->
@ -99,57 +63,25 @@
return { return {
type:'', type:'',
typeBoll:false, typeBoll:false,
walletInfoBTC:[],
walletInfoBTC2:[],
walletInfoETH:[],
walletInfoETH2:[],
walletInfoTRX:[],
walletInfoTRX2:[],
walletInfo:{}, walletInfo:{},
walletInfo2:{}, walletInfo2:{},
num:'', num:'',
} }
}, },
methods: { methods: {
gou(index,i){ gou(item){
console.log(i,777) var address=item.address;
this.num=index.privateKey var type=item.type;
uni.setStorageSync('walleti',this.num) this.$walletUtil.selectWallet(type,address)
console.log(index) uni.reLaunch({
if(index.coinList[0].xname=='Bitcoin'){ url:'../index'
console.log(this.walletInfoBTC2[i]) })
uni.setStorageSync('wallet',this.walletInfoBTC2[i])
setTimeout(()=>{
uni.reLaunch({
url:'../index'
})
},5)
}
if(index.coinList[0].xname=='Ethereum'){
console.log(this.walletInfoETH2[i],777777777)
uni.setStorageSync('wallet',this.walletInfoETH2[i])
setTimeout(()=>{
uni.setStorageSync('ethiSe', i);
uni.setStorageSync('itype', false);
uni.reLaunch({
url:'../index'
})
},5)
}
if(index.coinList[0].xname=="TRON"){
uni.setStorageSync('wallet',this.walletInfoTRX2[i])
setTimeout(()=>{
uni.reLaunch({
url:'../index'
})
},5)
}
}, },
goMwallet(){ goMwallet(){
uni.navigateTo({ url:'../mwallet/index' }) }, uni.navigateTo({ url:'../mwallet/index' }) },
getHeight(type){ getHeight(type){
console.log(111)
if(type=='one'){ if(type=='one'){
this.type='none' this.type='none'
this.typeBoll=false; this.typeBoll=false;
@ -169,25 +101,15 @@
} }
}, },
setStorage() { setStorage(type) {
console.log(this.$walletUtil.getWalletList()) if(type){
this.walletInfo=this.$walletUtil.getWalletList() this.walletInfo=this.$walletUtil.getWalletList(type)
// this.walletInfo = uni.getStorageSync('walletInfo'); console.log(this.walletInfo)
// this.walletInfoBTC=this.walletInfo.BTC; }else{
this.walletInfo=this.$walletUtil.getWalletList()
// this.num=this.walletInfoBTC[0].privateKey console.log(this.walletInfo)
// 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.walletInfoETH=this.walletInfo.ETH;
// 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.walletInfoTRX=this.walletInfo.TRON;
// 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);
// }
// console.log(this.walletInfo,111111)
}, },
goManager(itemm){ goManager(itemm){
console.log(itemm) console.log(itemm)
@ -202,8 +124,12 @@
}, },
onLoad() { onLoad() {
this.setStorage() this.setStorage()
if(uni.getStorageSync('walleti')!=''){ if(uni.getStorageSync('walleti')){
//
this.num=uni.getStorageSync('walleti') this.num=uni.getStorageSync('walleti')
}else{
//
this.num=this.walletInfo[0].address
} }
} }

2
pages/menu/wallet/index.vue

@ -15,7 +15,7 @@
<image src="../../../static/tongyonh/Frame28.png" mode="aspectFit" class="imgicon" v-if="userObj.coinList[0].xname=='Bitcoin'"></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> <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.coinList[0].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" @click="showMoney()" v-if="showMoney1"></image>
<image src="../../../static/tongyonh/eyeno.png" mode="aspectFit" class="img1" @click="showMoney22()" v-if="showMoney2"></image> <image src="../../../static/tongyonh/eyeno.png" mode="aspectFit" class="img1" @click="showMoney22()" v-if="showMoney2"></image>
</view> </view>

131
pages/menu/wallet/mwallet/index.vue

@ -8,10 +8,10 @@
</navigation> </navigation>
<view class="main flexx"> <view class="main flexx">
<view class="imgcon"> <view class="imgcon">
<image @click="getHeight('one')" ref="one" src="../../../../static/tongyonh/filter-left.png" mode="aspectFit" class="letConimg"></image> <image @click="getHeight('one'),setStorage()" ref="one" src="../../../../static/tongyonh/filter-left.png" mode="aspectFit" class="letConimg"></image>
<image @click="getHeight('btc')" ref="btc" src="../../../../static/tongyonh/bye.png" mode="aspectFit" class="letConimg"></image> <image @click="getHeight('btc'),setStorage('BTC')" ref="btc" src="../../../../static/tongyonh/bye.png" mode="aspectFit" class="letConimg"></image>
<image @click="getHeight('eth')" ref="eth" src="../../../../static/tongyonh/Frame3299.png" mode="aspectFit" class="letConimg"></image> <image @click="getHeight('eth'),setStorage('ETH')" ref="eth" src="../../../../static/tongyonh/Frame3299.png" mode="aspectFit" class="letConimg"></image>
<image @click="getHeight('trx')" ref="trx" src="../../../../static/tongyonh/tron1.png" mode="aspectFit" class="letConimg"></image> <image @click="getHeight('trx'),setStorage('TRX')" ref="trx" src="../../../../static/tongyonh/tron1.png" mode="aspectFit" class="letConimg"></image>
</view> </view>
@ -20,61 +20,34 @@
<view class="tiao" ref="tiao" :class="{'ethh': type=='eth','btch': type=='btc','trxh': type=='trx'}"> <view class="tiao" ref="tiao" :class="{'ethh': type=='eth','btch': type=='btc','trxh': type=='trx'}">
<!-- --> <!-- -->
</view> </view>
<view class="item flexx" v-for="item,index in walletInfoBTC" v-if="type=='btc' || typeBoll==false">
<view class="left flex"> <view class="item flexx" v-for="item,index in walletInfo" :class="{'pur': item.type=='ETH','red': item.type=='TRX'}">
<image src="../../../../static/tongyonh/btc_icon.png" mode="aspectFit" class="img1"></image> <view class="left flex">
<view class="textcon"> <image src="../../../../static/tongyonh/btc_icon.png" mode="aspectFit" class="img1" v-if="item.type=='BTC'"></image>
<view class="text1"> <image src="../../../../static/tongyonh/ETH_icon.png" mode="aspectFit" class="img1" v-if="item.type=='ETH'"></image>
{{item.coinList[0].name}} <image src="../../../../static/tongyonh/tron_icon.png" mode="aspectFit" class="img1" v-if="item.type=='TRX'"></image>
</view> <view class="textcon">
<view class="text2"> <view class="text1">
{{item.address}} {{item.name}}
</view> </view>
</view> <view class="text2">
</view> {{item.ellipsisAddress}}
<view class="rig"> </view>
<image src="../../../../static/tongyonh/ellipsis.png" mode="aspectFit" class="img1" @click="goManager(item,index)"></image> </view>
{{item.balance}} </view>
</view>
</view> <view class="rig">
<image src="../../../../static/tongyonh/ellipsis.png" mode="aspectFit" class="img1" @click="goManager(item,index)"></image>
<view class="item flexx pur" v-for="item,index in walletInfoETH" v-if="type=='eth' || typeBoll==false"> {{item.balance}}
<view class="left flex"> </view>
<image src="../../../../static/tongyonh/ETH_icon.png" mode="aspectFit" class="img1"></image>
<view class="textcon">
<view class="text1">
{{item.coinList[0].name}}
</view>
<view class="text2">
{{item.address}}
</view>
</view>
</view>
<view class="rig">
<image src="../../../../static/tongyonh/ellipsis.png" mode="aspectFit" class="img1" @click="goManager(item,index)"></image>
{{item.balance}}
</view> </view>
</view>
<view class="item flexx red" v-for="item,index in walletInfoTRX" v-if="type=='trx' || typeBoll==false">
<view class="left flex">
<image src="../../../../static/tongyonh/tron_icon.png" mode="aspectFit" class="img1"></image>
<view class="textcon">
<view class="text1">
{{item.coinList[0].name}}
</view>
<view class="text2">
{{item.address}}
</view>
</view>
</view>
<view class="rig">
<image src="../../../../static/tongyonh/ellipsis.png" mode="aspectFit" class="img1" @click="goManager(item,index)"></image>
{{item.balance}}
</view>
</view>
@ -94,22 +67,18 @@
return { return {
type:'', type:'',
typeBoll:false, typeBoll:false,
walletInfoBTC:[],
walletInfoETH:[],
walletInfoTRX:[],
walletInfo:{}, walletInfo:{},
walletInfo2:{}, walletInfo2:{},
} }
}, },
methods: { methods: {
goMwallett(){ goMwallett(){
console.log(1111)
uni.navigateTo({ uni.navigateTo({
url:'../add/index' url:'../add/index'
}) })
}, },
getHeight(type){ getHeight(type){
console.log(111)
if(type=='one'){ if(type=='one'){
this.type='none' this.type='none'
this.typeBoll=false; this.typeBoll=false;
@ -132,44 +101,16 @@
} }
}, },
setStorage() { setStorage(type) {
// this.walletInfo.walletPassword = this.$store.state.noBackupWalletInfo.walletPassword this.walletInfo=this.$walletUtil.getWalletList()
this.walletInfo = uni.getStorageSync('walletInfo');
this.walletInfo2 = uni.getStorageSync('walletInfo');
this.walletInfoBTC=this.walletInfo.BTC;
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.walletInfoETH=this.walletInfo.ETH;
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.walletInfoTRX=this.walletInfo.TRON;
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);
}
console.log(this.walletInfo,111111)
}, },
goManager(itemm,index){ goManager(itemm){
uni.setStorageSync('nameIndex',index) // uni.setStorageSync('nameIndex',index)
if(itemm.coinList[0].xname=='Bitcoin'){ let item = JSON.stringify(itemm)
let item = JSON.stringify(this.walletInfo2.BTC[index])
uni.navigateTo({ uni.navigateTo({
url:'../../../menu/wallet/mwallet/manage/index?item='+item url:'../../../menu/wallet/mwallet/manage/index?item='+item
}) })
}
if(itemm.coinList[0].xname=='Ethereum'){
let item = JSON.stringify(this.walletInfo2.ETH[index])
uni.navigateTo({
url:'../../../menu/wallet/mwallet/manage/index?item='+item
})
}
if(itemm.coinList[0].xname=='TRON'){
let item = JSON.stringify(this.walletInfo2.TRON[index])
uni.navigateTo({
url:'../../../menu/wallet/mwallet/manage/index?item='+item
})
}
}, },

43
pages/menu/wallet/mwallet/manage/index.vue

@ -102,11 +102,8 @@
duration: 1500 duration: 1500
}) })
} }
this.walletInfo=uni.getStorageSync('walletInfo'); console.log(this.userObj,2222)
console.log(this.userObj.coinList[0].xname) this.$walletUtil.updateWalletName(this.userObj.type,this.userObj.address,this.value)
if(this.userObj.coinList[0].xname=='Bitcoin'){
this.walletInfo.BTC[this.nameIndex].coinList[0].name=this.value;
uni.setStorageSync('walletInfo',this.walletInfo)
uni.showToast({ uni.showToast({
title: 'Successfully', title: 'Successfully',
icon: 'success', icon: 'success',
@ -118,38 +115,6 @@
url:'../../mwallet/index' url:'../../mwallet/index'
}) })
},1500) },1500)
}
if(this.userObj.coinList[0].xname=='Ethereum'){
this.walletInfo.ETH[this.nameIndex].coinList[0].name=this.value;
uni.setStorageSync('walletInfo',this.walletInfo)
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 1500
})
this.showAddress=false;
setTimeout(()=>{
uni.reLaunch({
url:'../../mwallet/index'
})
},1500)
}
if(this.userObj.coinList[0].xname=='TRON'){
this.walletInfo.TRON[this.nameIndex].coinList[0].name=this.value;
uni.setStorageSync('walletInfo',this.walletInfo)
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 1500
})
this.showAddress=false;
setTimeout(()=>{
uni.reLaunch({
url:'../../mwallet/index'
})
},1500)
}
}, },
goTrans(){ goTrans(){
@ -170,10 +135,10 @@
}, },
}, },
onLoad: function(option) { onLoad: function(option) {
this.nameIndex=uni.getStorageSync('nameIndex') // this.nameIndex=uni.getStorageSync('nameIndex')
const item = JSON.parse(option.item); const item = JSON.parse(option.item);
console.log(item)
this.userObj = item this.userObj = item
//
if(!this.userObj.mnemonic){ if(!this.userObj.mnemonic){
this.itemMnemonic=false; this.itemMnemonic=false;
} }

4
pages/menu/wallet/otherCoin/index.css

@ -7,6 +7,10 @@
page { page {
height: 100%; height: 100%;
} }
.main_con{
max-height: 1000rpx;
overflow-y: scroll;
}
.main{ .main{
padding: 0 24rpx; padding: 0 24rpx;
margin-top: 30rpx; margin-top: 30rpx;

82
pages/menu/wallet/otherCoin/index.vue

@ -60,12 +60,12 @@
onLoad(option) { onLoad(option) {
const item = JSON.parse(option.type); const item = JSON.parse(option.type);
console.log(item,12132)
if(uni.getStorageSync('imgindex').length>0){ if(uni.getStorageSync('imgindex').length>0){
this.imgindex=uni.getStorageSync('imgindex') this.imgindex=uni.getStorageSync('imgindex')
} }
this.coinAddress=item.address this.coinAddress=item.address
this.coinType=item.coinList[0].name2 this.coinType=item.type
console.log(this.coinAddress,this.coinType,444)
this.walletInfo=uni.getStorageSync('walletInfo') this.walletInfo=uni.getStorageSync('walletInfo')
this.getCoin(); this.getCoin();
}, },
@ -103,59 +103,34 @@
if(this.coinType=='ETH'){ if(this.coinType=='ETH'){
if(uni.getStorageSync('itype')){ var walleti=uni.getStorageSync('walleti')
// eth var walletInfo=uni.getStorageSync('walletInfo')
console.log(this.coinAddress console.log(walleti)
,item.contractAddress)
setTimeout(()=>{
this.$EthUtil.getTokenBalance(this.coinAddress
,item.contractAddress,function(balance){
console.log(balance,123132)
this.tmoney=balance
});
},1000)
var a=uni.getStorageSync('ethi') for(var i=0;i<walletInfo[this.coinType].length;i++){
var b={ console.log(walletInfo[this.coinType].address,111)
name:item.chainName, console.log(walleti,2211)
name2:item.contractName, if(walletInfo[this.coinType][i].address==walleti){
xname:item.chainName, console.log(1111)
icon:item.contractIconUrlAbs, var that=this
contractAddress:item.contractAddress, this.$EthUtil.getTokenBalance(this.coinAddress
balance:this.tmoney, ,item.contractAddress,function(balance){
}; console.log(balance,123132)
this.walletInfo.ETH[a].coinList.push(b) that.tmoney=balance
uni.setStorageSync('walletInfo',this.walletInfo) });
console.log(111) var b={
name:item.chainName,
name2:item.contractName,
xname:item.chainName,
icon:item.contractIconUrlAbs,
contractAddress:item.contractAddress,
balance:this.tmoney,
};
walletInfo[this.coinType][i].coinList.push(b)
}
} }
if(uni.getStorageSync('itype')==false){ uni.setStorageSync('walletInfo',walletInfo)
var a=uni.getStorageSync('ethiSe')
setTimeout(()=>{
this.$EthUtil.getTokenBalance(this.coinAddress
,item.contractAddress,function(balance){
console.log(balance,123132)
this.tmoney=balance
});
},1000)
var b={
name:item.chainName,
name2:item.contractName,
xname:item.chainName,
icon:item.contractIconUrlAbs,
contractAddress:item.contractAddress,
balance:this.tmoney,
};
this.walletInfo.ETH[a].coinList.push(b)
uni.setStorageSync('wallet',this.walletInfo.ETH[a])
console.log(this.walletInfo,111)
uni.setStorageSync('walletInfo',this.walletInfo)
console.log(222)
}
} }
@ -164,7 +139,6 @@
}, },
// //
getCoin(){ getCoin(){
console.log(this.coinType,444)
uni.request({ uni.request({
url: 'http://wallet-api.weirui0755.com/api/contract/getContractInfoList?chainName='+this.coinType, // url: 'http://wallet-api.weirui0755.com/api/contract/getContractInfoList?chainName='+this.coinType, //
header: { header: {

BIN
static/tongyonh/img500.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

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

File diff suppressed because one or more lines are too long

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

@ -8164,7 +8164,7 @@ if(false) {}
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 13); var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 13);
exports = ___CSS_LOADER_API_IMPORT___(false); exports = ___CSS_LOADER_API_IMPORT___(false);
// Module // Module
exports.push([module.i, ".maintoP{\r\n\tmargin-top: 100rpx;\n}\n.aaa{\r\n\tdisplay: block;\n}\nbody {\r\n\theight: 100%;\n}\n.main{\r\n\tpadding: 0 24rpx;\r\n\tmargin-top: 30rpx;\r\n\tbackground: #fff;\n}\n.title{\r\n\theight: 160rpx;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tfont-size: 32rpx;\r\n\tborder-bottom: 2rpx solid #F6F8FD;\n}\n.flex{\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tjustify-content: space-between;\n}\n.flex2{\r\n\tdisplay: flex;\n}\n.main_con .item .left .img{\r\n\twidth: 80rpx;\r\n\theight: 80rpx;\n}\n.main_con .item{\r\n\theight: 160rpx;\r\n\tborder-bottom: 2rpx solid #F6F8FD;\r\n\tborder-radius: 24rpx;\n}\n.main_con .item .img{\r\n\twidth: 48rpx;\r\n\theight: 48rpx;\n}\n.main_con .textcon{\r\n\tmargin-left: 20rpx;\n}\n.main_con .textcon .text1{\r\n\tfont-size: 30rpx;\n}\n.main_con .textcon .text2{\r\n\tfont-size: 24rpx;\r\n\tcolor: #999;\r\n\tword-break: break-word;\n}\n.back{\r\n\t\twidth: 16rpx;\r\n\t\theight: 24rpx;\r\n\t\tposition: absolute;\r\n\t\tleft:36rpx;\r\n\t top: 50%;\r\n\t\t-webkit-transform: translateY(-50%);\r\n\t\t transform: translateY(-50%);\n}\n.opci{\r\n\t\topacity: 0.5;\n}\n.topview{\r\n\tbackground-color: #FAFAFA;\r\n\twidth: 100%;\r\n\t\tborder-radius: 32rpx;\r\n\t\tposition: relative;\n}\n.topinput{\r\n\twidth: 100%;\r\n\theight: 70rpx;\r\n padding-left: 100rpx;\n}\n.searchimg{\r\n\twidth: 48rpx;\r\n\theight: 48rpx;\r\n\tposition: absolute;\r\n\tleft: 30rpx;\r\n\ttop: 50%;\r\n\t-webkit-transform: translateY(-50%);\r\n\t transform: translateY(-50%);\n}\n.info_con{\r\n\twidth: 702rpx;\r\n\theight: 120rpx;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tposition: fixed;\r\n\tbottom: -150rpx;\r\n\tz-index: 999;\r\n\tborder-radius: 26rpx;\r\n\tleft: 50%;\r\n\tpadding: 0 48rpx;\r\n\t-webkit-transform: translateX(-50%);\r\n\t transform: translateX(-50%);\r\n\tcolor: #fff;\r\n\ttransition: .8s all;\n}\n.goTop{\r\n\tposition: fixed;\r\n\tbottom: 60rpx !important;\n}\n.green{\r\n\tbackground-color: #6AD6A8;\n}\n.info_con .text{\n}\n.info_con .text2{\r\n\tfont-size: 700;\r\n\tfont-size: 32rpx;\n}\n.goTop{\r\n\tposition: fixed;\r\n\tbottom: 60rpx !important;\n}\n.copyImg{\r\n\twidth: 48rpx;\r\n\theight: 48rpx;\r\n\tmargin-right: 10rpx;\n}\r\n", ""]); exports.push([module.i, ".maintoP{\r\n\tmargin-top: 100rpx;\n}\n.aaa{\r\n\tdisplay: block;\n}\nbody {\r\n\theight: 100%;\n}\n.main_con{\r\n\t\tmax-height: 1000rpx;\r\n\t\toverflow-y: scroll;\n}\n.main{\r\n\tpadding: 0 24rpx;\r\n\tmargin-top: 30rpx;\r\n\tbackground: #fff;\n}\n.title{\r\n\theight: 160rpx;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tfont-size: 32rpx;\r\n\tborder-bottom: 2rpx solid #F6F8FD;\n}\n.flex{\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tjustify-content: space-between;\n}\n.flex2{\r\n\tdisplay: flex;\n}\n.main_con .item .left .img{\r\n\twidth: 80rpx;\r\n\theight: 80rpx;\n}\n.main_con .item{\r\n\theight: 160rpx;\r\n\tborder-bottom: 2rpx solid #F6F8FD;\r\n\tborder-radius: 24rpx;\n}\n.main_con .item .img{\r\n\twidth: 48rpx;\r\n\theight: 48rpx;\n}\n.main_con .textcon{\r\n\tmargin-left: 20rpx;\n}\n.main_con .textcon .text1{\r\n\tfont-size: 30rpx;\n}\n.main_con .textcon .text2{\r\n\tfont-size: 24rpx;\r\n\tcolor: #999;\r\n\tword-break: break-word;\n}\n.back{\r\n\t\twidth: 16rpx;\r\n\t\theight: 24rpx;\r\n\t\tposition: absolute;\r\n\t\tleft:36rpx;\r\n\t top: 50%;\r\n\t\t-webkit-transform: translateY(-50%);\r\n\t\t transform: translateY(-50%);\n}\n.opci{\r\n\t\topacity: 0.5;\n}\n.topview{\r\n\tbackground-color: #FAFAFA;\r\n\twidth: 100%;\r\n\t\tborder-radius: 32rpx;\r\n\t\tposition: relative;\n}\n.topinput{\r\n\twidth: 100%;\r\n\theight: 70rpx;\r\n padding-left: 100rpx;\n}\n.searchimg{\r\n\twidth: 48rpx;\r\n\theight: 48rpx;\r\n\tposition: absolute;\r\n\tleft: 30rpx;\r\n\ttop: 50%;\r\n\t-webkit-transform: translateY(-50%);\r\n\t transform: translateY(-50%);\n}\n.info_con{\r\n\twidth: 702rpx;\r\n\theight: 120rpx;\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n\tposition: fixed;\r\n\tbottom: -150rpx;\r\n\tz-index: 999;\r\n\tborder-radius: 26rpx;\r\n\tleft: 50%;\r\n\tpadding: 0 48rpx;\r\n\t-webkit-transform: translateX(-50%);\r\n\t transform: translateX(-50%);\r\n\tcolor: #fff;\r\n\ttransition: .8s all;\n}\n.goTop{\r\n\tposition: fixed;\r\n\tbottom: 60rpx !important;\n}\n.green{\r\n\tbackground-color: #6AD6A8;\n}\n.info_con .text{\n}\n.info_con .text2{\r\n\tfont-size: 700;\r\n\tfont-size: 32rpx;\n}\n.goTop{\r\n\tposition: fixed;\r\n\tbottom: 60rpx !important;\n}\n.copyImg{\r\n\twidth: 48rpx;\r\n\theight: 48rpx;\r\n\tmargin-right: 10rpx;\n}\r\n", ""]);
// Exports // Exports
module.exports = exports; module.exports = exports;
@ -8714,96 +8714,117 @@ var render = function() {
attrs: { _i: 11 } attrs: { _i: 11 }
}), }),
_vm._l(_vm._$g(12, "f"), function(item, index, $20, $30) { _vm._l(_vm._$g(12, "f"), function(item, index, $20, $30) {
return _vm._$g("12-" + $30, "i") return _c(
? _c( "v-uni-view",
{
key: item,
staticClass: _vm._$g("12-" + $30, "sc"),
class: _vm._$g("12-" + $30, "c"),
attrs: { _i: "12-" + $30 },
on: {
click: function($event) {
return _vm.$handleViewEvent($event)
}
}
},
[
_c(
"v-uni-view", "v-uni-view",
{ {
key: item, staticClass: _vm._$g("13-" + $30, "sc"),
staticClass: _vm._$g("12-" + $30, "sc"), attrs: { _i: "13-" + $30 }
attrs: { _i: "12-" + $30 },
on: {
click: function($event) {
return _vm.$handleViewEvent($event)
}
}
}, },
[ [
_c( _vm._$g("14-" + $30, "i")
"v-uni-view", ? _c("v-uni-image", {
{
staticClass: _vm._$g("13-" + $30, "sc"),
attrs: { _i: "13-" + $30 }
},
[
_c("v-uni-image", {
staticClass: _vm._$g("14-" + $30, "sc"), staticClass: _vm._$g("14-" + $30, "sc"),
attrs: { attrs: {
src: _vm._$g("14-" + $30, "a-src"), src: _vm._$g("14-" + $30, "a-src"),
mode: "aspectFit", mode: "aspectFit",
_i: "14-" + $30 _i: "14-" + $30
} }
}), })
: _vm._e(),
_vm._$g("15-" + $30, "i")
? _c("v-uni-image", {
staticClass: _vm._$g("15-" + $30, "sc"),
attrs: {
src: _vm._$g("15-" + $30, "a-src"),
mode: "aspectFit",
_i: "15-" + $30
}
})
: _vm._e(),
_vm._$g("16-" + $30, "i")
? _c("v-uni-image", {
staticClass: _vm._$g("16-" + $30, "sc"),
attrs: {
src: _vm._$g("16-" + $30, "a-src"),
mode: "aspectFit",
_i: "16-" + $30
}
})
: _vm._e(),
_c(
"v-uni-view",
{
staticClass: _vm._$g("17-" + $30, "sc"),
attrs: { _i: "17-" + $30 }
},
[
_c( _c(
"v-uni-view", "v-uni-view",
{ {
staticClass: _vm._$g("15-" + $30, "sc"), staticClass: _vm._$g("18-" + $30, "sc"),
attrs: { _i: "15-" + $30 } attrs: { _i: "18-" + $30 }
}, },
[ [_vm._v(_vm._$g("18-" + $30, "t0-0"))]
_c( ),
"v-uni-view", _c(
{
staticClass: _vm._$g("16-" + $30, "sc"),
attrs: { _i: "16-" + $30 }
},
[_vm._v(_vm._$g("16-" + $30, "t0-0"))]
),
_c(
"v-uni-view",
{
staticClass: _vm._$g("17-" + $30, "sc"),
attrs: { _i: "17-" + $30 }
},
[_vm._v(_vm._$g("17-" + $30, "t0-0"))]
)
],
1
)
],
1
),
_vm._$g("18-" + $30, "i")
? _c(
"v-uni-view", "v-uni-view",
{ {
staticClass: _vm._$g("18-" + $30, "sc"), staticClass: _vm._$g("19-" + $30, "sc"),
attrs: { _i: "18-" + $30 } attrs: { _i: "19-" + $30 }
}, },
[ [_vm._v(_vm._$g("19-" + $30, "t0-0"))]
_c("v-uni-image", {
staticClass: _vm._$g("19-" + $30, "sc"),
attrs: {
src: _vm._$g("19-" + $30, "a-src"),
mode: "aspectFit",
_i: "19-" + $30
}
})
],
1
) )
: _vm._e(), ],
_c( 1
)
],
1
),
_vm._$g("20-" + $30, "i")
? _c(
"v-uni-view", "v-uni-view",
{ {
staticClass: _vm._$g("20-" + $30, "sc"), staticClass: _vm._$g("20-" + $30, "sc"),
attrs: { _i: "20-" + $30 } attrs: { _i: "20-" + $30 }
}, },
[_vm._v(_vm._$g("20-" + $30, "t0-0"))] [
_c("v-uni-image", {
staticClass: _vm._$g("21-" + $30, "sc"),
attrs: {
src: _vm._$g("21-" + $30, "a-src"),
mode: "aspectFit",
_i: "21-" + $30
}
})
],
1
) )
], : _vm._e(),
1 _c(
"v-uni-view",
{
staticClass: _vm._$g("22-" + $30, "sc"),
attrs: { _i: "22-" + $30 }
},
[_vm._v(_vm._$g("22-" + $30, "t0-0"))]
) )
: _vm._e() ],
1
)
}) })
], ],
2 2
@ -19956,253 +19977,108 @@ var render = function() {
attrs: { _i: 11 } attrs: { _i: 11 }
}), }),
_vm._l(_vm._$g(12, "f"), function(item, index, $20, $30) { _vm._l(_vm._$g(12, "f"), function(item, index, $20, $30) {
return _vm._$g("12-" + $30, "i") return _c(
? _c( "v-uni-view",
{
key: item,
staticClass: _vm._$g("12-" + $30, "sc"),
class: _vm._$g("12-" + $30, "c"),
attrs: { _i: "12-" + $30 }
},
[
_c(
"v-uni-view", "v-uni-view",
{ {
key: item, staticClass: _vm._$g("13-" + $30, "sc"),
staticClass: _vm._$g("12-" + $30, "sc"), attrs: { _i: "13-" + $30 }
attrs: { _i: "12-" + $30 }
}, },
[ [
_c( _vm._$g("14-" + $30, "i")
"v-uni-view", ? _c("v-uni-image", {
{
staticClass: _vm._$g("13-" + $30, "sc"),
attrs: { _i: "13-" + $30 }
},
[
_c("v-uni-image", {
staticClass: _vm._$g("14-" + $30, "sc"), staticClass: _vm._$g("14-" + $30, "sc"),
attrs: { attrs: {
src: _vm._$g("14-" + $30, "a-src"), src: _vm._$g("14-" + $30, "a-src"),
mode: "aspectFit", mode: "aspectFit",
_i: "14-" + $30 _i: "14-" + $30
} }
}), })
_c( : _vm._e(),
"v-uni-view", _vm._$g("15-" + $30, "i")
{ ? _c("v-uni-image", {
staticClass: _vm._$g("15-" + $30, "sc"), staticClass: _vm._$g("15-" + $30, "sc"),
attrs: { _i: "15-" + $30 }
},
[
_c(
"v-uni-view",
{
staticClass: _vm._$g("16-" + $30, "sc"),
attrs: { _i: "16-" + $30 }
},
[_vm._v(_vm._$g("16-" + $30, "t0-0"))]
),
_c(
"v-uni-view",
{
staticClass: _vm._$g("17-" + $30, "sc"),
attrs: { _i: "17-" + $30 }
},
[_vm._v(_vm._$g("17-" + $30, "t0-0"))]
)
],
1
)
],
1
),
_c(
"v-uni-view",
{
staticClass: _vm._$g("18-" + $30, "sc"),
attrs: { _i: "18-" + $30 }
},
[
_c("v-uni-image", {
staticClass: _vm._$g("19-" + $30, "sc"),
attrs: { attrs: {
src: _vm._$g("19-" + $30, "a-src"), src: _vm._$g("15-" + $30, "a-src"),
mode: "aspectFit", mode: "aspectFit",
_i: "19-" + $30 _i: "15-" + $30
},
on: {
click: function($event) {
return _vm.$handleViewEvent($event)
}
} }
}), })
_vm._v(_vm._$g("18-" + $30, "t1-0")) : _vm._e(),
], _vm._$g("16-" + $30, "i")
1 ? _c("v-uni-image", {
) staticClass: _vm._$g("16-" + $30, "sc"),
], attrs: {
1 src: _vm._$g("16-" + $30, "a-src"),
) mode: "aspectFit",
: _vm._e() _i: "16-" + $30
}), }
_vm._l(_vm._$g(20, "f"), function(item, index, $21, $31) { })
return _vm._$g("20-" + $31, "i") : _vm._e(),
? _c(
"v-uni-view",
{
key: item,
staticClass: _vm._$g("20-" + $31, "sc"),
attrs: { _i: "20-" + $31 }
},
[
_c( _c(
"v-uni-view", "v-uni-view",
{ {
staticClass: _vm._$g("21-" + $31, "sc"), staticClass: _vm._$g("17-" + $30, "sc"),
attrs: { _i: "21-" + $31 } attrs: { _i: "17-" + $30 }
}, },
[ [
_c("v-uni-image", {
staticClass: _vm._$g("22-" + $31, "sc"),
attrs: {
src: _vm._$g("22-" + $31, "a-src"),
mode: "aspectFit",
_i: "22-" + $31
}
}),
_c( _c(
"v-uni-view", "v-uni-view",
{ {
staticClass: _vm._$g("23-" + $31, "sc"), staticClass: _vm._$g("18-" + $30, "sc"),
attrs: { _i: "23-" + $31 } attrs: { _i: "18-" + $30 }
}, },
[ [_vm._v(_vm._$g("18-" + $30, "t0-0"))]
_c( ),
"v-uni-view", _c(
{ "v-uni-view",
staticClass: _vm._$g("24-" + $31, "sc"), {
attrs: { _i: "24-" + $31 } staticClass: _vm._$g("19-" + $30, "sc"),
}, attrs: { _i: "19-" + $30 }
[_vm._v(_vm._$g("24-" + $31, "t0-0"))]
),
_c(
"v-uni-view",
{
staticClass: _vm._$g("25-" + $31, "sc"),
attrs: { _i: "25-" + $31 }
},
[_vm._v(_vm._$g("25-" + $31, "t0-0"))]
)
],
1
)
],
1
),
_c(
"v-uni-view",
{
staticClass: _vm._$g("26-" + $31, "sc"),
attrs: { _i: "26-" + $31 }
},
[
_c("v-uni-image", {
staticClass: _vm._$g("27-" + $31, "sc"),
attrs: {
src: _vm._$g("27-" + $31, "a-src"),
mode: "aspectFit",
_i: "27-" + $31
}, },
on: { [_vm._v(_vm._$g("19-" + $30, "t0-0"))]
click: function($event) { )
return _vm.$handleViewEvent($event)
}
}
}),
_vm._v(_vm._$g("26-" + $31, "t1-0"))
], ],
1 1
) )
], ],
1 1
) ),
: _vm._e() _c(
}),
_vm._l(_vm._$g(28, "f"), function(item, index, $22, $32) {
return _vm._$g("28-" + $32, "i")
? _c(
"v-uni-view", "v-uni-view",
{ {
key: item, staticClass: _vm._$g("20-" + $30, "sc"),
staticClass: _vm._$g("28-" + $32, "sc"), attrs: { _i: "20-" + $30 }
attrs: { _i: "28-" + $32 }
}, },
[ [
_c( _c("v-uni-image", {
"v-uni-view", staticClass: _vm._$g("21-" + $30, "sc"),
{ attrs: {
staticClass: _vm._$g("29-" + $32, "sc"), src: _vm._$g("21-" + $30, "a-src"),
attrs: { _i: "29-" + $32 } mode: "aspectFit",
}, _i: "21-" + $30
[
_c("v-uni-image", {
staticClass: _vm._$g("30-" + $32, "sc"),
attrs: {
src: _vm._$g("30-" + $32, "a-src"),
mode: "aspectFit",
_i: "30-" + $32
}
}),
_c(
"v-uni-view",
{
staticClass: _vm._$g("31-" + $32, "sc"),
attrs: { _i: "31-" + $32 }
},
[
_c(
"v-uni-view",
{
staticClass: _vm._$g("32-" + $32, "sc"),
attrs: { _i: "32-" + $32 }
},
[_vm._v(_vm._$g("32-" + $32, "t0-0"))]
),
_c(
"v-uni-view",
{
staticClass: _vm._$g("33-" + $32, "sc"),
attrs: { _i: "33-" + $32 }
},
[_vm._v(_vm._$g("33-" + $32, "t0-0"))]
)
],
1
)
],
1
),
_c(
"v-uni-view",
{
staticClass: _vm._$g("34-" + $32, "sc"),
attrs: { _i: "34-" + $32 }
}, },
[ on: {
_c("v-uni-image", { click: function($event) {
staticClass: _vm._$g("35-" + $32, "sc"), return _vm.$handleViewEvent($event)
attrs: { }
src: _vm._$g("35-" + $32, "a-src"), }
mode: "aspectFit", }),
_i: "35-" + $32 _vm._v(_vm._$g("20-" + $30, "t1-0"))
},
on: {
click: function($event) {
return _vm.$handleViewEvent($event)
}
}
}),
_vm._v(_vm._$g("34-" + $32, "t1-0"))
],
1
)
], ],
1 1
) )
: _vm._e() ],
1
)
}) })
], ],
2 2

BIN
unpackage/dist/dev/app-plus/static/tongyonh/img500.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

13
utils/WalletUtil.js

@ -54,6 +54,7 @@ let fullWallet = {
let WalletUtil = { let WalletUtil = {
//初次创建钱包 //初次创建钱包
initialWallet: function(mnemonic, password) { initialWallet: function(mnemonic, password) {
console.log(password,'password')
let walletInfo = fullWallet; let walletInfo = fullWallet;
let btc = TokenUtil.generateBtc(mnemonic); let btc = TokenUtil.generateBtc(mnemonic);
walletInfo.BTC[0].password = password; walletInfo.BTC[0].password = password;
@ -80,7 +81,7 @@ let WalletUtil = {
let walletList = walletInfo[type]; let walletList = walletInfo[type];
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) {
walletInfo[k].name = name walletList[k].name = name
break; break;
} }
} }
@ -89,7 +90,7 @@ let WalletUtil = {
//助记词新建 //助记词新建
mnemonicEstablishWallet: function(type, mnemonic, password) { mnemonicEstablishWallet: function(type, mnemonic, password) {
let walletInfo = uni.getStorageSync('walletInfo'); let walletInfo = uni.getStorageSync('walletInfo');
console.log(password,'password')
let walletdec; let walletdec;
switch (type) { switch (type) {
case 'BTC': case 'BTC':
@ -117,6 +118,7 @@ let WalletUtil = {
privateKeyEstablishWallet: function(type, privateKey, password) { privateKeyEstablishWallet: function(type, privateKey, password) {
let walletInfo = uni.getStorageSync('walletInfo'); let walletInfo = uni.getStorageSync('walletInfo');
console.log(type) console.log(type)
console.log(password,'password')
let walletdec; let walletdec;
switch (type) { switch (type) {
case 'BTC': case 'BTC':
@ -143,6 +145,11 @@ let WalletUtil = {
let walletList = []; let walletList = [];
if (type) { if (type) {
walletList = walletInfo[type] walletList = walletInfo[type]
for (var k = 0, length = walletList.length; k < length; k++) {
let address = walletList[k].address;
walletList[k].ellipsisAddress = address.substring(0, 6) + '...' + address.substring(25,
address.length)
}
} else { } else {
for (let obj in walletInfo) { for (let obj in walletInfo) {
for (var k = 0, length = walletInfo[obj].length; k < length; k++) { for (var k = 0, length = walletInfo[obj].length; k < length; k++) {
@ -157,8 +164,10 @@ let WalletUtil = {
return walletList; return walletList;
}, },
selectWallet: function(type, address) { selectWallet: function(type, 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()
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) {
uni.setStorageSync('wallet', walletList[k]); uni.setStorageSync('wallet', walletList[k]);

Loading…
Cancel
Save