bitcooo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

239 lines
7.1 KiB

<template>
<view class="">
<navigation :showBack="true" :bgnum="true">
<text class="big_title">
Choose a wallet
</text>
<text class="renYou" @click="goMwallet()">Manage</text>
</navigation>
<view class="main flexx">
<view class="imgcon">
<image @click="getHeight('one')" 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('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>
</view>
<view class="bot_con">
<view class="tiao" ref="tiao" :class="{'ethh': type=='eth','btch': type=='btc','trxh': type=='trx'}">
<!-- -->
</view>
<view class="item flexx" @click="gou(item,index)" v-for="item,index in walletInfoBTC" v-if="type=='btc' || typeBoll==false">
<view class="left flex">
<image src="../../../../static/tongyonh/btc_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">
0.00
</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">
0.00
</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">
0.00
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import cont from "@/components/navigation/navigation.vue"
import tabBar from "@/components/tabBar/tabBar.vue"
export default {
data() {
return {
type:'',
typeBoll:false,
walletInfoBTC:[],
walletInfoBTC2:[],
walletInfoETH:[],
walletInfoETH2:[],
walletInfoTRX:[],
walletInfoTRX2:[],
walletInfo:{},
walletInfo2:{},
num:'',
}
},
methods: {
gou(index,i){
this.num=index.privateKey
uni.setStorageSync('walleti',this.num)
console.log(index)
if(index.coinList[0].name=='BTC'){
console.log(this.walletInfoBTC2[i])
uni.setStorageSync('wallet',this.walletInfoBTC2[i])
setTimeout(()=>{
uni.reLaunch({
url:'../index'
})
},5)
}
if(index.coinList[0].name=='ETH'){
console.log(this.walletInfoETH2[i],777777777)
uni.setStorageSync('wallet',this.walletInfoETH2[i])
setTimeout(()=>{
uni.reLaunch({
url:'../index'
})
},5)
}
if(index.coinList[0].name=='TRX'){
console.log(this.walletInfoTRX2[i])
uni.setStorageSync('wallet',this.walletInfoTRX2[i])
setTimeout(()=>{
uni.reLaunch({
url:'../index'
})
},5)
}
},
goMwallet(){
uni.navigateTo({
url:'../mwallet/index'
})
},
getHeight(type){
console.log(111)
if(type=='one'){
this.type='none'
this.typeBoll=false;
}
if(type=='eth'){
// var a=this.$refs.eth.$el.offsetTop;
// var b=a-57;
// console.log(b,77777777)
// this.$refs.tiao.$el.style.top=b+"px";
this.type='eth'
this.typeBoll=true;
}
if(type=='btc'){
// var a=this.$refs.btc.$el.offsetTop;
// var b=a-57;
// console.log(b,77777777)
// this.$refs.tiao.$el.style.top=b+"px";
this.type='btc'
this.typeBoll=true;
}
if(type=='trx'){
// console.log(this.$refs.trx.offsetTop,1111)
// var a=this.$refs.trx.$el.offsetTop;
// var b=a-57;
// console.log(b,77777777)
// this.$refs.tiao.$el.style.top=b+"px";
this.type='trx'
this.typeBoll=true;
}
},
getStorage(){
this.walletInfo2 = uni.getStorageSync('walletInfo');
this.walletInfoBTC2=this.walletInfo2.BTC;
this.walletInfoETH2=this.walletInfo2.ETH;
this.walletInfoTRX2=this.walletInfo2.TRON;
},
setStorage() {
this.walletInfo = uni.getStorageSync('walletInfo');
this.walletInfoBTC=this.walletInfo.BTC;
this.num=this.walletInfoBTC[0].privateKey
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){
console.log(itemm)
let item = JSON.stringify(itemm)
uni.navigateTo({
url:'../../../menu/wallet/mwallet/manage/index?item='+item
})
},
},
onLoad() {
this.getStorage()
this.setStorage()
if(uni.getStorageSync('walleti')!=''){
this.num=uni.getStorageSync('walleti')
}
}
};
</script>
<style scoped>
page{
background: #FAFAFA;
} </style> <style> @import './index.css'; </style>