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.
248 lines
5.8 KiB
248 lines
5.8 KiB
<template>
|
|
<view class="">
|
|
<navigation :showBack="true" :bgnum="true">
|
|
{{xname2}}
|
|
</navigation>
|
|
<view class="main">
|
|
<view class="money_con"
|
|
:class="{'money_con': userObject.coinList[0].xname=='Ethereum', 'money_con2': userObject.coinList[0].xname=='Bitcoin', 'money_con3': userObject.coinList[0].xname=='TRON'}">
|
|
<view class="textcon1">
|
|
<text class="text1">
|
|
<view class="" >
|
|
{{balance}}
|
|
</view>
|
|
<text class="text2" v-if="xbalance">≈ $ {{xbalance}}</text>
|
|
<text class="text2" v-if="!xbalance">≈ $ 0.00</text>
|
|
</text>
|
|
|
|
</view>
|
|
<view class="textcon1">
|
|
<view class="v1">
|
|
<view class="t1">
|
|
0.0
|
|
</view>
|
|
<view class="t2">
|
|
Existing balance
|
|
</view>
|
|
</view>
|
|
<view class="v1 v2">
|
|
<view class="t1">
|
|
0.0
|
|
</view>
|
|
<view class="t2">
|
|
Freeze balance
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="select_con">
|
|
<view class="select">
|
|
<u-tabs height="120" bar-width="172" active-color="#6F69FF" inactive-color="#A3AED0" :list="list"
|
|
:is-scroll="false" :current="current" @change="change"></u-tabs>
|
|
|
|
<u-empty text="No content" mode="list" v-if="showInfo"></u-empty>
|
|
|
|
<view class="" v-if="!showInfo">
|
|
<view class="item1" v-for="(item,index) in trxs"
|
|
@click="goDetail(item,index)">
|
|
<view class="lef_con">
|
|
<image src="../../../../static/tongyonh/arrow-up-left.png" mode="aspectFit" class="img1"
|
|
v-if="address==item.to"></image>
|
|
<image src="../../../../static/tongyonh/arrow-up-left_1.png" mode="aspectFit"
|
|
class="img1" v-if="address==item.from"></image>
|
|
<view class="textcon">
|
|
|
|
<view class="text1">
|
|
{{item.address}}
|
|
</view>
|
|
<view class="text2">
|
|
{{item.time}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="rig_con">
|
|
<view class="text1">
|
|
<text v-if="address==item.to">+</text>
|
|
<text v-if="address==item.from">-</text>
|
|
{{item.value}}
|
|
<text class="">
|
|
{{item.network}}
|
|
</text>
|
|
|
|
|
|
|
|
</view>
|
|
<image src="../../../../static/tongyonh/Shape.png" mode="aspectFit" class="img1">
|
|
</image>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
<view class="btnconn">
|
|
<view class="btn active" @click="goSend">
|
|
<image src="../../../../static/tongyonh/arrow-up-leftw.png" mode="aspectFit" class="arrow-up-left">
|
|
</image>
|
|
Send
|
|
</view>
|
|
<view class="btn" @click="goReceive">
|
|
<image src="../../../../static/tongyonh/arrow-up-leftp.png" mode="aspectFit" class="arrow-up-left">
|
|
</image>
|
|
<text class="btn13">Receive</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import cont from "@/components/navigation/navigation.vue"
|
|
import api from '@/utils/api'
|
|
import index from '@/utils/index.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
// 拿账单的address
|
|
coinInfo: {},
|
|
trxs: [],
|
|
trxs2: [],
|
|
address: '',
|
|
userObject: {},
|
|
showInfo: false,
|
|
list: [{
|
|
name: 'All',
|
|
|
|
}, {
|
|
name: 'Send',
|
|
|
|
}, {
|
|
name: 'Receive',
|
|
|
|
}],
|
|
infoWallet: {},
|
|
current: 0,
|
|
pageSize: 20,
|
|
pageNum: 1,
|
|
|
|
balance:0,
|
|
|
|
address:'',
|
|
type:'all',
|
|
trueType:'',
|
|
contract:'',
|
|
xname:'',
|
|
xname2:'',
|
|
}
|
|
},
|
|
methods: {
|
|
goSend() {
|
|
let itemm = JSON.stringify(this.infoWallet)
|
|
uni.navigateTo({
|
|
url: '/pages/menu/sendToken/transfer2/index?contractAddress=' + this.contractAddress
|
|
})
|
|
},
|
|
goReceive() {
|
|
var a=uni.getStorageSync('otherCoin')
|
|
console.log(this.infoWallet.coinList[a],444)
|
|
uni.setStorageSync('infoWallet',this.infoWallet.coinList[a])
|
|
|
|
uni.navigateTo({
|
|
url: '/pages/menu/sendToken/index2'
|
|
})
|
|
},
|
|
goDetail(item, index) {
|
|
uni.setStorageSync('transDetail',this.trxs2[index])
|
|
uni.navigateTo({
|
|
url: '/pages/menu/transction/detail/index'
|
|
})
|
|
|
|
},
|
|
change(index) {
|
|
if(index==0){
|
|
this.type='all'
|
|
}
|
|
if(index==1){
|
|
this.type='send'
|
|
}
|
|
if(index==2){
|
|
this.type='receive'
|
|
}
|
|
this.current = index;
|
|
console.log(this.current)
|
|
this.getWalletInfo();
|
|
},
|
|
|
|
getWalletInfo() {
|
|
this.userObject = this.infoWallet
|
|
var that = this
|
|
this.$dataUtil.transactionData(this.trueType, this.type, this.address, this.contract,
|
|
this.pageNum, this.pageSize,
|
|
function(data) {
|
|
console.log(data,121211212112121)
|
|
if(data.length==0){
|
|
that.showInfo=true;
|
|
}else{
|
|
that.showInfo=false;
|
|
}
|
|
that.trxs = data
|
|
that.trxs2 = data
|
|
console.log(that.trxs, 12121)
|
|
})
|
|
},
|
|
getInfo() {
|
|
this.param.address = this.address2
|
|
const post = api.address(
|
|
this.param
|
|
)
|
|
post.then(res => {
|
|
this.trxs2 = res.data.data.txs
|
|
})
|
|
}
|
|
},
|
|
onLoad() {
|
|
// 获取显示信息
|
|
this.infoWallet = uni.getStorageSync('wallet')
|
|
this.address=this.infoWallet.address
|
|
this.trueType=this.infoWallet.type
|
|
var index=uni.getStorageSync('otherCoin')
|
|
console.log(this.infoWallet.coinList[index].contractAddress)
|
|
console.log(this.infoWallet,1111)
|
|
this.contract=this.infoWallet.coinList[index].contractAddress
|
|
this.xname=this.infoWallet.coinList[index].xname
|
|
this.xname2=this.infoWallet.coinList[index].name
|
|
this.xbalance=this.infoWallet.coinList[index].balancePrice
|
|
this.contractAddress=this.infoWallet.coinList[index].contractAddress
|
|
// 获取显示信息
|
|
|
|
this.getWalletInfo()
|
|
},
|
|
onPullDownRefresh() {
|
|
console.log('refresh');
|
|
this.getWalletInfo();
|
|
setTimeout(function() {
|
|
uni.stopPullDownRefresh();
|
|
}, 500);
|
|
},
|
|
onReachBottom() {
|
|
this.pageSize += 5;
|
|
this.getWalletInfo()
|
|
}
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
page {
|
|
background: #FAFAFA;
|
|
|
|
}
|
|
</style>
|
|
|
|
<style>
|
|
@import './index.css';
|
|
</style>
|
|
|