|
@ -1,34 +1,19 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<navigation :showBack="true" :bgnum="true"> |
|
|
<navigation :showBack="true" :bgnum="true"> |
|
|
<text class="big_title"> |
|
|
{{xname}} |
|
|
{{userObjectss.name2}} |
|
|
|
|
|
</text> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</navigation> |
|
|
</navigation> |
|
|
<view class="main"> |
|
|
<view class="main"> |
|
|
<view class="money_con" |
|
|
<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'}"> |
|
|
: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"> |
|
|
<view class="textcon1"> |
|
|
<text class="text1"> |
|
|
<text class="text1"> |
|
|
<view class="" v-if="userObject.coinList[0].xname=='Bitcoin'"> |
|
|
<view class="" > |
|
|
0.00 BTC |
|
|
{{infoWallet.balance}} |
|
|
</view> |
|
|
|
|
|
<view class="" v-if="userObject.coinList[0].xname=='Ethereum'"> |
|
|
|
|
|
0.00 |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="" v-if="userObject.coinList[0].xname=='TRON'"> |
|
|
|
|
|
0.00 TRX |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<text class="text2">≈ $0.0</text> |
|
|
<text class="text2">≈ $0.0</text> |
|
|
</text> |
|
|
</text> |
|
|
<!-- <image src="../../../../static/tongyonh/ethereum.png" mode="aspectFit" class="img1" |
|
|
|
|
|
v-if="userObject.coinList[0].xname=='Ethereum'"></image> |
|
|
|
|
|
<image src="../../../../static/tongyonh/Frame28.png" mode="aspectFit" class="img1" |
|
|
|
|
|
v-if="userObject.coinList[0].xname=='Bitcoin'"></image> |
|
|
|
|
|
<image src="../../../../static/tongyonh/tronicon.png" mode="aspectFit" class="img1" |
|
|
|
|
|
v-if="userObject.coinList[0].xname=='TRON'"></image> --> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<view class="textcon1"> |
|
|
<view class="textcon1"> |
|
|
<view class="v1"> |
|
|
<view class="v1"> |
|
@ -58,39 +43,7 @@ |
|
|
<u-empty text="No content" mode="list" v-if="showInfo"></u-empty> |
|
|
<u-empty text="No content" mode="list" v-if="showInfo"></u-empty> |
|
|
|
|
|
|
|
|
<view class="" v-if="!showInfo"> |
|
|
<view class="" v-if="!showInfo"> |
|
|
<view class="item1" v-for="(item,index) in trxs" v-if="current==1&&address==item.from" |
|
|
<view class="item1" v-for="(item,index) in trxs" |
|
|
@click="goDetail(item,index)"> |
|
|
|
|
|
<view class="lef_con"> |
|
|
|
|
|
<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" v-if="address==item.from"> |
|
|
|
|
|
{{item.to}} |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="text2" v-if="address==item.from"> |
|
|
|
|
|
{{item.time}} |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="rig_con"> |
|
|
|
|
|
<view class="text1"> |
|
|
|
|
|
<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 class="item1" v-for="(item,index) in trxs" v-if="current==0" |
|
|
|
|
|
@click="goDetail(item,index)"> |
|
|
@click="goDetail(item,index)"> |
|
|
<view class="lef_con"> |
|
|
<view class="lef_con"> |
|
|
<image src="../../../../static/tongyonh/arrow-up-left.png" mode="aspectFit" class="img1" |
|
|
<image src="../../../../static/tongyonh/arrow-up-left.png" mode="aspectFit" class="img1" |
|
@ -98,11 +51,9 @@ |
|
|
<image src="../../../../static/tongyonh/arrow-up-left_1.png" mode="aspectFit" |
|
|
<image src="../../../../static/tongyonh/arrow-up-left_1.png" mode="aspectFit" |
|
|
class="img1" v-if="address==item.from"></image> |
|
|
class="img1" v-if="address==item.from"></image> |
|
|
<view class="textcon"> |
|
|
<view class="textcon"> |
|
|
<view class="text1" v-if="address==item.from"> |
|
|
|
|
|
{{item.to}} |
|
|
<view class="text1"> |
|
|
</view> |
|
|
{{item.address}} |
|
|
<view class="text1" v-if="address==item.to"> |
|
|
|
|
|
{{item.from}} |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<view class="text2"> |
|
|
<view class="text2"> |
|
|
{{item.time}} |
|
|
{{item.time}} |
|
@ -126,37 +77,8 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="item1" v-for="(item,index) in trxs" v-if="current==2&&address==item.to" |
|
|
|
|
|
@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> |
|
|
|
|
|
<view class="textcon"> |
|
|
|
|
|
<view class="text1" v-if="address==item.to"> |
|
|
|
|
|
{{item.from}} |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="text2" v-if="address==item.to"> |
|
|
|
|
|
{{item.time}} |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="rig_con"> |
|
|
|
|
|
<view class="text1"> |
|
|
|
|
|
<text v-if="address==item.to">+</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> |
|
|
|
|
|
|
|
@ -192,29 +114,33 @@ |
|
|
trxs2: [], |
|
|
trxs2: [], |
|
|
address: '', |
|
|
address: '', |
|
|
userObject: {}, |
|
|
userObject: {}, |
|
|
userObjectss: {}, |
|
|
|
|
|
showInfo: false, |
|
|
showInfo: false, |
|
|
list: [{ |
|
|
list: [{ |
|
|
name: 'All' |
|
|
name: 'All', |
|
|
|
|
|
|
|
|
}, { |
|
|
}, { |
|
|
name: 'Send' |
|
|
name: 'Send', |
|
|
|
|
|
|
|
|
}, { |
|
|
}, { |
|
|
name: 'Receive', |
|
|
name: 'Receive', |
|
|
|
|
|
|
|
|
}], |
|
|
}], |
|
|
infoWallet:{}, |
|
|
infoWallet: {}, |
|
|
current: 0, |
|
|
current: 0, |
|
|
pageSize:10, |
|
|
pageSize: 20, |
|
|
pageNum:1, |
|
|
pageNum: 1, |
|
|
param : { |
|
|
|
|
|
'address':'', |
|
|
balance:0, |
|
|
'pageNum':1, |
|
|
|
|
|
'pageSize':10, |
|
|
address:'', |
|
|
'address2':'', |
|
|
type:'all', |
|
|
}, |
|
|
trueType:'', |
|
|
|
|
|
contract:'', |
|
|
|
|
|
xname:'', |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
goSend(){ |
|
|
goSend() { |
|
|
let itemm = JSON.stringify(this.infoWallet) |
|
|
let itemm = JSON.stringify(this.infoWallet) |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: '/pages/menu/sendToken/transfer2/index?item=' + itemm |
|
|
url: '/pages/menu/sendToken/transfer2/index?item=' + itemm |
|
@ -234,92 +160,68 @@ |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
change(index) { |
|
|
change(index) { |
|
|
console.log(index) |
|
|
if(index==0){ |
|
|
|
|
|
this.type='all' |
|
|
|
|
|
} |
|
|
|
|
|
if(index==1){ |
|
|
|
|
|
this.type='send' |
|
|
|
|
|
} |
|
|
|
|
|
if(index==2){ |
|
|
|
|
|
this.type='receive' |
|
|
|
|
|
} |
|
|
this.current = index; |
|
|
this.current = index; |
|
|
console.log(this.current) |
|
|
console.log(this.current) |
|
|
|
|
|
this.getWalletInfo(); |
|
|
}, |
|
|
}, |
|
|
getWalletInfo(){ |
|
|
|
|
|
if (this.infoWallet.coinList[0].xname == 'Ethereum') { |
|
|
getWalletInfo() { |
|
|
this.param.address2=this.infoWallet.address |
|
|
this.userObject = this.infoWallet |
|
|
this.address = this.userObjectss.contractAddress |
|
|
var that = this |
|
|
this.address2 =this.userObjectss.contractAddress |
|
|
this.$dataUtil.transactionData(this.trueType, this.type, this.address, this.contract, |
|
|
console.log( this.userObjectss.contractAddress,111) |
|
|
this.pageNum, this.pageSize, |
|
|
this.param.address= this.userObjectss.contractAddress |
|
|
function(data) { |
|
|
console.log(this.param,2222) |
|
|
console.log(data,121211212112121) |
|
|
this.userObject = this.infoWallet |
|
|
if(data.length==0){ |
|
|
const post = api.addressOther( |
|
|
that.showInfo=true; |
|
|
this.param |
|
|
}else{ |
|
|
) |
|
|
that.showInfo=false; |
|
|
post.then(res => { |
|
|
|
|
|
console.log(res, 77) |
|
|
|
|
|
if (res.data.code == 404) { |
|
|
|
|
|
this.showInfo = true; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
that.trxs = data |
|
|
|
|
|
that.trxs2 = data |
|
|
|
|
|
console.log(that.trxs, 12121) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.trxs = res.data.data |
|
|
|
|
|
console.log(this.trxs,7878) |
|
|
|
|
|
for (var i = 0; i < this.trxs.length; i++) { |
|
|
|
|
|
this.trxs[i].from = this.trxs[i].from.substring(0, 6) + '...' + this.trxs[i].from |
|
|
|
|
|
.substring(35, this.trxs[i].from.length); |
|
|
|
|
|
this.trxs[i].to = this.trxs[i].to.substring(0, 6) + '...' + this.trxs[i].to.substring( |
|
|
|
|
|
35, this.trxs[i].to.length); |
|
|
|
|
|
this.trxs[i].time = index.formatyymmddhhmmss(this.trxs[i].time); |
|
|
|
|
|
this.trxs[i].value = parseFloat(this.trxs[i].value).toFixed(0) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
this.address = this.address.substring(0, 6) + '...' + this.address.substring(35, this.address.length); |
|
|
|
|
|
this.getInfo() |
|
|
|
|
|
} else if (this.infoWallet.coinList[0].xname == 'TRON') { |
|
|
|
|
|
this.address = this.infoWallet.address |
|
|
|
|
|
this.param.address=this.address |
|
|
|
|
|
this.address2 = this.infoWallet.address |
|
|
|
|
|
this.userObject =this.infoWallet |
|
|
|
|
|
const post = api.addresstrx( |
|
|
|
|
|
this.param |
|
|
|
|
|
) |
|
|
|
|
|
post.then(res => { |
|
|
|
|
|
if (res.data.code == 404) { |
|
|
|
|
|
this.showInfo = true; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (res.data.data.network == 'TRX') { |
|
|
|
|
|
this.trxs = res.data.data.txs |
|
|
|
|
|
for (var i = 0; i < this.trxs.length; i++) { |
|
|
|
|
|
this.trxs[i].from = this.trxs[i].from.substring(0, 6) + '...' + this.trxs[i].from |
|
|
|
|
|
.substring(35, this.trxs[i].from.length); |
|
|
|
|
|
this.trxs[i].to = this.trxs[i].to.substring(0, 6) + '...' + this.trxs[i].to.substring( |
|
|
|
|
|
35, this.trxs[i].to.length); |
|
|
|
|
|
this.trxs[i].time = index.formatyymmddhhmmss(this.trxs[i].time); |
|
|
|
|
|
this.trxs[i].value = parseFloat(this.trxs[i].value).toFixed(5) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
this.address = this.address.substring(0, 6) + '...' + this.address.substring(35, this.address.length); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
getInfo() { |
|
|
getInfo() { |
|
|
this.param.address=this.address2 |
|
|
this.param.address = this.address2 |
|
|
const post = api.addressOther( |
|
|
const post = api.address( |
|
|
this.param |
|
|
this.param |
|
|
) |
|
|
) |
|
|
post.then(res => { |
|
|
post.then(res => { |
|
|
this.trxs2 = res.data.data.txs |
|
|
this.trxs2 = res.data.data.txs |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
this.userObjectss=uni.getStorageSync('daiInfo') |
|
|
|
|
|
console.log(this.userObjectss,777) |
|
|
|
|
|
const item = JSON.parse(option.item); |
|
|
const item = JSON.parse(option.item); |
|
|
this.infoWallet = item |
|
|
this.infoWallet = item |
|
|
this.getWalletInfo() |
|
|
this.address=item.address |
|
|
|
|
|
this.trueType=item.type |
|
|
|
|
|
var index=uni.getStorageSync('otherCoin') |
|
|
|
|
|
this.contract=item.coinList[index].contractAddress |
|
|
|
|
|
|
|
|
|
|
|
this.xname=item.coinList[index].xname |
|
|
|
|
|
console.log(this.infoWallet,1111) |
|
|
|
|
|
this.getWalletInfo() |
|
|
}, |
|
|
}, |
|
|
onReachBottom() { |
|
|
onReachBottom() { |
|
|
this.param.pageSize+=5; |
|
|
this.pageSize += 5; |
|
|
this.getWalletInfo() |
|
|
this.getWalletInfo() |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|