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.
181 lines
4.9 KiB
181 lines
4.9 KiB
<template>
|
|
<view class="">
|
|
<navigation :showBack="false" :bgnum="true">
|
|
<image src="../../../static/tongyonh/san.png" mode="aspectFit" class="renYou" slot="logo"
|
|
@click="goCwallet()"></image>
|
|
<image src="../../../static/tongyonh/erwei.png" mode="aspectFit" class="renYou2" slot="logo"
|
|
@click="chooseImage()"></image>
|
|
<text class="big_title">
|
|
Wallet
|
|
</text>
|
|
</navigation>
|
|
<view class="main">
|
|
<view :class="{'money_con': userObj.coinList[0].xname=='Ethereum', 'money_con2': userObj.coinList[0].xname=='Bitcoin', 'money_con3': userObj.coinList[0].xname=='TRON'}">
|
|
<image src="../../../static/tongyonh/ethereum.png" mode="aspectFit" class="imgicon" v-if="userObj.coinList[0].xname=='Ethereum'"></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>
|
|
<view class="textcon1 flex">
|
|
<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/eyeno.png" mode="aspectFit" class="img1" @click="showMoney22()" v-if="showMoney2"></image>
|
|
</view>
|
|
<view class="textcon2" v-if="showMoney1">
|
|
$ {{userObj.balance}}
|
|
</view>
|
|
<view class="textcon2" v-if="showMoney2">
|
|
***
|
|
</view>
|
|
<view class="textcon3">
|
|
{{this.userObj.address}}
|
|
</view>
|
|
</view>
|
|
|
|
<view class="bot_con">
|
|
<view class="jiacon">
|
|
<view class="title">
|
|
Assets
|
|
</view>
|
|
<image src="../../../static/tongyonh/IconGroup.png" mode="aspectFit" class="jiaimg" v-if="userObj.coinList[0].xname!='Bitcoin'&&userObj.coinList[0].xname!='TRON'" @click="goOther"></image>
|
|
</view>
|
|
<view class="scroll">
|
|
<view class="item flexx" @click="goTrans(item,index)" v-for="item,index in this.userObj.coinList">
|
|
<view class="left flex">
|
|
<image :src="item.icon" mode="aspectFit" class="img1"></image>
|
|
<view class="textcon">
|
|
<view class="text1">
|
|
{{item.name2}}
|
|
</view>
|
|
<view class="text2">
|
|
{{item.xname}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="rig">
|
|
<view class="text1">
|
|
{{item.balance}}
|
|
</view>
|
|
<view class="text2">
|
|
=$0.00
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
<tab-bar :selectActive="1"></tab-bar>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import cont from "@/components/navigation/navigation.vue"
|
|
import token from "@/utils/TokenUtil"
|
|
export default {
|
|
data() {
|
|
return {
|
|
eth: '',
|
|
trc: 'Hello',
|
|
walletInfo:{},
|
|
userObj:{},
|
|
userObj2:{},
|
|
showMoney1:true,
|
|
showMoney2:false,
|
|
btcBalance:0,
|
|
}
|
|
},
|
|
|
|
onLoad() {
|
|
this.setStorage();
|
|
|
|
|
|
var a=uni.getStorageSync('wallet')
|
|
if(a!=''){
|
|
this.userObj=uni.getStorageSync('wallet');
|
|
console.log(this.userObj,1212121)
|
|
this.userObj2=uni.getStorageSync('wallet');
|
|
this.userObj.address = this.userObj.address.substring(0, 6)+'...'+this.userObj.address.substring(25,this.userObj.address.length);
|
|
}
|
|
},
|
|
methods: {
|
|
|
|
goOther(){
|
|
console.log(this.userObj2,8888)
|
|
let item = JSON.stringify(this.userObj2)
|
|
uni.navigateTo({
|
|
url:'otherCoin/index?type='+item
|
|
})
|
|
},
|
|
showMoney(){
|
|
this.showMoney1=false
|
|
this.showMoney2=true
|
|
},
|
|
showMoney22(){
|
|
this.showMoney1=true
|
|
this.showMoney2=false
|
|
},
|
|
setStorage() {
|
|
this.walletInfo = uni.getStorageSync('walletInfo');
|
|
this.userObj=this.walletInfo.BTC[0]
|
|
this.userObj.address = this.userObj.address.substring(0, 6)+'...'+this.userObj.address.substring(25,this.userObj.address.length);
|
|
console.log(this.walletInfo.BTC[0])
|
|
},
|
|
goTrans(itemm,index) {
|
|
console.log(index,444)
|
|
let item = JSON.stringify(this.userObj2)
|
|
if(this.userObj2.coinList[0].xname=='Bitcoin'){
|
|
uni.navigateTo({
|
|
url:'/pages/menu/token/btctrue/index?item='+item
|
|
})
|
|
}else{
|
|
if(index==0){
|
|
uni.navigateTo({
|
|
url:'/pages/menu/token/btc/index?item='+item
|
|
})
|
|
}else{
|
|
uni.setStorageSync('daiInfo',itemm)
|
|
uni.navigateTo({
|
|
url:'/pages/menu/token/btc/index2?item='+item
|
|
})
|
|
}
|
|
|
|
|
|
}
|
|
|
|
},
|
|
// 唤醒摄像头
|
|
chooseImage() {
|
|
var _this = this
|
|
uni.chooseImage({
|
|
count: 1, //默认9
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
sourceType: ['album', 'camera'], //从相册选择、摄像头
|
|
success: function(res) {
|
|
_this.imgShow = res.tempFilePaths[0]
|
|
}
|
|
});
|
|
// ass()
|
|
},
|
|
|
|
goCwallet() {
|
|
uni.navigateTo({
|
|
url: './cwallet/index'
|
|
})
|
|
}
|
|
},
|
|
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
page {
|
|
background: #FAFAFA;
|
|
}
|
|
</style>
|
|
|
|
<style>
|
|
@import './index.css';
|
|
</style>
|
|
|