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.
192 lines
4.4 KiB
192 lines
4.4 KiB
<template>
|
|
<view class="">
|
|
<navigation :showBack="true" :bgnum="true">
|
|
<text class="big_title">
|
|
Manage
|
|
</text>
|
|
</navigation>
|
|
<view class="main">
|
|
<view class="item">
|
|
<view class="text1">
|
|
Address
|
|
</view>
|
|
<view class="text2">
|
|
{{userObj.address}}
|
|
</view>
|
|
</view>
|
|
|
|
<view class="item item2">
|
|
<view class="name flex bor" @click="showAddress=true">
|
|
<view class="text1">
|
|
Name
|
|
</view>
|
|
<view class="address" >
|
|
Set name
|
|
<image src="../../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="img1"></image>
|
|
</view>
|
|
</view>
|
|
<view class="name flex" @click="goTrans()" v-if="itemMnemonic">
|
|
<view class="text1">
|
|
Backup mnemonic
|
|
</view>
|
|
<view class="address">
|
|
<image src="../../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="img1"></image>
|
|
</view>
|
|
</view>
|
|
<view class="name flex" @click="goKey()">
|
|
<view class="text1">
|
|
Backup private key
|
|
</view>
|
|
<view class="address">
|
|
<image src="../../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="img1"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="showAddress" v-if="showAddress">
|
|
<image src="../../../../../static/tongyonh/xg.png" mode="aspectFit" class="img1" @click="showAddress=false"></image>
|
|
<view class="title">
|
|
New wallet name
|
|
</view>
|
|
<u-input placeholder="Please enter wallet name" border-color="#E9EDF7" v-model="value" :type="type" :border="border" />
|
|
<view class="btnconn">
|
|
<view class="btn" @click="showAddress=false">
|
|
Cancel
|
|
</view>
|
|
<view class="btn active" @click="setName()">
|
|
Confirm
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<u-mask z-index='100' :show="showAddress" @click="showAddress = false"></u-mask>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import cont from "@/components/navigation/navigation.vue"
|
|
export default {
|
|
data() {
|
|
return {
|
|
value: '',
|
|
type: 'text',
|
|
border: true,
|
|
height: 90,
|
|
autoHeight: true,
|
|
showAddress:false,
|
|
userObj:{},
|
|
itemMnemonic:true,
|
|
walletInfo:{},
|
|
nameIndex:-1,
|
|
}
|
|
},
|
|
methods: {
|
|
setName(){
|
|
if(this.value==''){
|
|
uni.showToast({
|
|
title: 'Name cannot be empty',
|
|
icon: 'none',
|
|
duration: 1500
|
|
})
|
|
}
|
|
this.walletInfo=uni.getStorageSync('walletInfo');
|
|
console.log(this.userObj.coinList[0].xname)
|
|
if(this.userObj.coinList[0].xname=='Bitcoin'){
|
|
this.walletInfo.BTC[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=='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(){
|
|
console.log(this.userObj,444)
|
|
let item = JSON.stringify(this.userObj)
|
|
uni.navigateTo({
|
|
url:'../../../backUp/transPawMan/index?item='+item
|
|
})
|
|
|
|
},
|
|
goKey(){
|
|
console.log(this.userObj,444)
|
|
let item = JSON.stringify(this.userObj)
|
|
uni.navigateTo({
|
|
url:'../../../backUp/transPawKeyOut/index?item='+item
|
|
})
|
|
|
|
},
|
|
},
|
|
onLoad: function(option) {
|
|
this.nameIndex=uni.getStorageSync('nameIndex')
|
|
const item = JSON.parse(option.item);
|
|
console.log(item)
|
|
this.userObj = item
|
|
if(!this.userObj.mnemonic){
|
|
this.itemMnemonic=false;
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
page {
|
|
background: #FAFAFA;
|
|
|
|
}
|
|
</style>
|
|
|
|
<style>
|
|
@import './index.css';
|
|
</style>
|
|
|