<template>
	<view class="">
		<navigation :showBack="false" :bgnum="true">
			<image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" class="back" @click="back()"></image>
			<text class="big_title">
				{{i18n.mwallet}}
			</text>
			<text class="renYou" @click="goMwallett()">	{{i18n.addwallet}}</text>
		</navigation>
		<view class="main flexx">
			<view class="imgcon">
				<image @click="getHeight('one'),setStorage()" ref="one"   src="../../../../static/tongyonh/filter-left.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'),setStorage('ETH')"  ref="eth"  src="../../../../static/tongyonh/Frame3299.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 class="bot_con"> 
	 <view class="tiao" ref="tiao" :class="{'ethh': type=='eth','btch': type=='btc','trxh': type=='trx'}">
	 	<!--  -->
	 </view>
	 
	 <view  class="item flexx" v-for="item,index in walletInfo"  :class="{'pur': item.type=='ETH','red':  item.type=='TRX'}">
	  <view class="left flex">
	  	<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="text1">
	    		{{item.name}}
	    	</view>
	 	<view class="text2">
	 		{{item.ellipsisAddress}}
	 	</view>
	    </view>
	  </view>
	  <view class="rig">
		  <image src="../../../../static/tongyonh/ellipsis.png" mode="aspectFit" class="img1" @click="goManager(item,index)"></image>
	  <view class="">
	  	 {{item.balance}}
	  </view>
	
	  </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,
				walletInfo:{},
				walletInfo2:{},
						}
		},
		methods: {
		back(){
		uni.redirectTo({
			url:'../cwallet/index'
		})
		},
			
			
			goMwallett(){
				uni.navigateTo({
					url:'../add/index'
				})
			},
		getHeight(type){
			if(type=='one'){
			this.type='none'
				this.typeBoll=false;
			}
			if(type=='eth'){
				
				this.type='eth'
				this.typeBoll=true;
			
			}
		if(type=='btc'){
			
			this.type='btc'
			this.typeBoll=true;
		}
		if(type=='trx'){
			this.type='trx'
			this.typeBoll=true;
		}
		},
		
		setStorage(type) {
			if(type){
				this.walletInfo=this.$walletUtil.getWalletList(type)
				console.log(this.walletInfo,22222)
				console.log(this.walletInfo)
			}else{
				this.walletInfo=this.$walletUtil.getWalletList()
				console.log(this.walletInfo,22222)
			}
				
		},
			goManager(itemm){
				// uni.setStorageSync('nameIndex',index)

					console.log(itemm,11111)
					uni.setStorageSync('addressDetailInfo',itemm)
					uni.navigateTo({
						url:'../../../menu/wallet/mwallet/manage/index'
					})
		
			},
			
			
			
		},
		onLoad() {
			this.setStorage()
		},
		computed: {
			i18n() {
				return this.$t('index')
			},
		}
	};
</script>
<style scoped>
	page{
		background: #FAFAFA;
	}
</style>

<style>

	@import './index.css';

</style>
