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.
 
 
 
 

268 lines
6.9 KiB

<template>
<view class="">
<navigation :showBack="false" :bgnum="true">
<image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" slot="address" @click="back()" class="renYou2"></image>
<image src="../../../../static/tongyonh/IconGroup.png" mode="aspectFit" class="renYou" slot="logo" @click="goAddress()"></image>
<text class="big_title">
Address
</text>
</navigation>
<view class="main">
<view class="big_item">
<view class="item flex" v-for="(item,index) in BTCAddressInfo">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
<image :src="item.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="textt">{{item.coinList[0].name}}</text>
<text class="textt2">{{item.name}}</text>
</view>
<view class="text1">
{{item.address}}
</view>
</view>
</view>
<view class="btncon">
<image src="../../../../static/tongyonh/more_vert_24px_outlined.svg" mode="aspectFit" class="img2" @click="showIndex(item,index)">
</image>
</view>
</view>
<view class="item flex" v-for="(item,index) in ETHAddressInfo">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
<image :src="item.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="textt">{{item.coinList[0].name}}</text>
<text class="textt2">{{item.name}}</text>
</view>
<view class="text1">
{{item.address}}
</view>
</view>
</view>
<view class="btncon">
<image src="../../../../static/tongyonh/more_vert_24px_outlined.svg" mode="aspectFit" class="img2" @click="showIndex(item,index)">
</image>
</view>
</view>
<view class="item flex" v-for="(item,index) in TRXAddressInfo">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
<image :src="item.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="textt">{{item.coinList[0].name}}</text>
<text class="textt2">{{item.name}}</text>
</view>
<view class="text1">
{{item.address}}
</view>
</view>
</view>
<view class="btncon">
<image src="../../../../static/tongyonh/more_vert_24px_outlined.svg" mode="aspectFit" class="img2" @click="showIndex(item,index)">
</image>
</view>
</view>
<view class="set_con" v-if="show">
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img1" @click="show = false"></image>
<view class="itemm flexx" @click="editItem()">
<image src="../../../../static/tongyonh/create_24px.png" mode="aspectFit" class="img"></image>
Edit
</view>
<view class="itemm flexx red" @click="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
Delete
</view>
</view>
</view>
<view class="info_con green" v-if="showImte">
<view class="text">
{{itemCoin}} {{itemAddress}}
</view>
<view class="text text2">
DELETE
</view>
</view>
</view>
<u-mask z-index="10" :show="show" ></u-mask>
</view>
</template>
<script>
import cont from "@/components/navigation/navigation.vue"
export default {
data() {
return {
showImte:false,
BTCAddressInfo:{},
ETHAddressInfo:{},
TRXAddressInfo:{},
walletIndex:-1,
itemCoin:'',
itemAddress:'',
info:{},
show: false,
list: [
{
name: 'Single address',
checked: true,
disabled: false
},
{
name: 'Batch add 10 addresses',
checked: false,
disabled: false
},
{
name: 'Batch add 50 addresses',
checked: false,
disabled: false
}
]
}
},
methods: {
back(){
uni.navigateTo({
url:'/pages/menu/profile/index'
})
},
editItem(){
uni.setStorageSync('AddressInfo',this.info)
uni.setStorageSync('AddressName',this.itemCoin)
uni.setStorageSync('AddressIndex',this.walletIndex)
uni.navigateTo({
url:'../addAddress2/index'
})
},
showIndex(item,index){
this.info= item
this.itemCoin=item.coinList[0].name
this.itemAddress=item.address
this.show=true;
this.walletIndex=index;
},
deleteItem(){
if(this.itemCoin=='BTC'){
if(this.BTCAddressInfo.length==1){
let BTCAddressInfo=[]
uni.setStorageSync('BTCAddressInfo',BTCAddressInfo)
}
console.log(this.BTCAddressInfo,1111)
console.log(this.walletIndex,44444)
let BTCAddressInfo=[]
BTCAddressInfo=uni.getStorageSync('BTCAddressInfo')
BTCAddressInfo=BTCAddressInfo.splice(this.walletIndex,1)
console.log(BTCAddressInfo,77777)
uni.setStorageSync('BTCAddressInfo',BTCAddressInfo)
this.showImte=true;
console.log(BTCAddressInfo,2222)
this.show=false;
setTimeout(()=>{
uni.reLaunch({
url:'../address/index'
})
},1500)
}
if(this.itemCoin=='ETH'){
if(this.ETHAddressInfo.length==1){
let ETHAddressInfo=[]
uni.setStorageSync('ETHAddressInfo',ETHAddressInfo)
}
console.log(this.ETHAddressInfo,1111)
console.log(this.walletIndex,44444)
let ETHAddressInfo=[]
ETHAddressInfo=uni.getStorageSync('ETHAddressInfo')
ETHAddressInfo=ETHAddressInfo.splice(this.walletIndex-1,1)
console.log(ETHAddressInfo,77777)
uni.setStorageSync('ETHAddressInfo',ETHAddressInfo)
this.showImte=true;
console.log(ETHAddressInfo,2222)
this.show=false;
setTimeout(()=>{
uni.reLaunch({
url:'../address/index'
})
},1500)
}
if(this.itemCoin=='TRX'){
if(this.TRXAddressInfo.length==1){
let TRXAddressInfo=[]
uni.setStorageSync('TRXAddressInfo',TRXAddressInfo)
}
console.log(this.TRXAddressInfo,1111)
console.log(this.walletIndex,44444)
let TRXAddressInfo=[]
TRXAddressInfo=uni.getStorageSync('TRXAddressInfo')
TRXAddressInfo=TRXAddressInfo.splice(this.walletIndex-1,1)
console.log(TRXAddressInfo,77777)
uni.setStorageSync('TRXAddressInfo',TRXAddressInfo)
this.showImte=true;
console.log(TRXAddressInfo,2222)
this.show=false;
setTimeout(()=>{
uni.reLaunch({
url:'../address/index'
})
},1500)
}
},
goAddress(){
uni.navigateTo({
url:'../addAddress/index'
})
}
},
onLoad() {
if(uni.getStorageSync('BTCAddressInfo')){
this.BTCAddressInfo=uni.getStorageSync('BTCAddressInfo')
console.log(this.BTCAddressInfo,777)
}
if(uni.getStorageSync('ETHAddressInfo')){
this.ETHAddressInfo=uni.getStorageSync('ETHAddressInfo')
console.log(this.ETHAddressInfo,777)
}
if(uni.getStorageSync('TRXAddressInfo')){
this.TRXAddressInfo=uni.getStorageSync('TRXAddressInfo')
console.log(this.TRXAddressInfo,777)
}
}
};
</script>
<style scoped>
page {
background: #FAFAFA;
height: 100%;
}
</style>
<style>
@import './index.css';
</style>