Browse Source

修改

master
vee 4 years ago
parent
commit
d38cc8c87a
  1. 13
      pages/menu/sendToken/index.vue
  2. 2
      pages/menu/sendToken/transfer/index.css
  3. 32
      pages/menu/sendToken/transfer/index.vue
  4. 138
      pages/menu/token/btc/index.vue
  5. 20
      pages/menu/wallet/index.vue
  6. BIN
      static/tongyonh/Frame 30.png
  7. BIN
      static/tongyonh/Frame300.png
  8. BIN
      static/tongyonh/erwei.png
  9. 81
      utils/DataUtil.js
  10. 2
      utils/WalletUtil.js

13
pages/menu/sendToken/index.vue

@ -1,15 +1,13 @@
<template>
<view class="">
<navigation :showBack="true" :bgnum="true">
Receive
{{addressInfo.name}} Receive
</navigation>
<view class="main">
<view class="main_con">
<image src="../../../static/tongyonh/bye.png" mode="aspectFit" class="logoimg" v-if="addressInfo.type=='BTC'"></image>
<image src="../../../static/tongyonh/tron1.png" mode="aspectFit" class="logoimg" v-if="addressInfo.type=='TRX'"></image>
<image src="../../../static/tongyonh/Frame3299.png" mode="aspectFit" class="logoimg" v-if="addressInfo.type=='ETH'"></image>
<image :src="addressInfo.icon" mode="aspectFit" class="logoimg" ></image>
<view class="title">
{{addressInfo.type}} Receiving address
{{addressInfo.name}} Receiving address
</view>
<view class="code_con">
<tki-qrcode ref="qrcode" :val="addressInfo.address" :size="size" :unit="unit" :background="background"
@ -102,9 +100,8 @@
// #endif
},
},
onLoad(item) {
this.addressInfo= uni.getStorageSync('infoWallet')
console.log(this.addressInfo,111)
onLoad() {
this.addressInfo=uni.getStorageSync('coin')
}
};
</script>

2
pages/menu/sendToken/transfer/index.css

@ -9,7 +9,7 @@
background-color: #fff;
border-radius: 26rpx;
padding-left: 26rpx;
padding-right: 40rpx;
padding-right: 26rpx;
margin-top: 98rpx;
box-shadow: 0 10rpx 30rpx 10rpx #EAEDF0;
position: relative;

32
pages/menu/sendToken/transfer/index.vue

@ -3,17 +3,17 @@
<navigation :showBack="false" :bgnum="true">
<image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" class="back" @click="back()"></image>
<text class="big_title">
{{addressInfo.type}} Transfer
{{coin.name}} Transfer
</text>
</navigation>
<view class="main">
<view class="main_con">
<view class="yuan">
<image :src="addressInfo.coinList[0].icon" mode="aspectFit" class="img1"></image>
<image :src="coin.icon" mode="aspectFit" class="img1"></image>
</view>
<view class="title">
{{addressInfo.type}}
{{coin.name}}
</view>
<view class="item">
<view class="top flex">
@ -41,7 +41,7 @@
<view class="inputcon2 flex">
<view class="inputc flex">
<view class="textt">
{{addressInfo.type}}
{{coin.name}}
</view>
<input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="0.0000000" class="input3" v-model="transAmount" />
@ -57,7 +57,7 @@
</view>
<view class="top flex bottom">
<view class="text3">
Balance: {{addressInfo.balance}}
Balance: {{coin.balance}}
</view>
<view class="text1 bg" @click="forAll">
ALL
@ -89,7 +89,7 @@
<input type="text" v-model="fee" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="Please enter a note (off-chain)" class="input2" />
<view class="rig">
<text class="text1 ac">{{addressInfo.type}}</text> | <text class="text2">USDT</text>
<text class="text2">{{coin.type}}</text>
</view>
</view>
</view>
@ -107,14 +107,14 @@
<image :src="addressInfo.coinList[0].icon" mode="aspectFit" class="img1"></image>
</view>
<view class="title">
{{addressInfo.type}}
{{coin.type}}
</view>
<view class="title_con flex">
<view class="text1">
Amount
</view>
<view class="text1">
{{transAmount}} {{addressInfo.type}}
{{transAmount}} {{coin.name}}
</view>
</view>
<view class="item">
@ -122,7 +122,7 @@
Send address
</view>
<view class="text2">
{{addressInfo.address}}
{{coin.address}}
</view>
</view>
<view class="item">
@ -146,7 +146,7 @@
Transaction fee
</view>
<view class="text2">
{{fee}} {{addressInfo.type}}
{{fee}} {{coin.type}}
</view>
</view>
@ -243,6 +243,7 @@
export default {
data() {
return {
coin:{},
fee: 1000,
show: false,
show2: false,
@ -314,7 +315,7 @@
},
//
forAll() {
this.transAmount = this.addressInfo.balance
this.transAmount = this.coin.balance
},
//
Confirm() {
@ -603,17 +604,12 @@
}
},
onLoad() {
//
if (uni.getStorageSync('myTransAddress')) {
this.recipientAddress = uni.getStorageSync('myTransAddress').address
uni.removeStorageSync('myTransAddress')
}
this.coin=uni.getStorageSync('coin')
//
if (uni.getStorageSync('fingerPass')) {
this.passShow = uni.getStorageSync('fingerPass')
}
this.addressInfo = uni.getStorageSync('infoWallet')
console.log(this.addressInfo, 1111)
}
};
</script>

138
pages/menu/token/btc/index.vue

@ -1,32 +1,27 @@
<template>
<view class="">
<navigation :showBack="true" :bgnum="true">
<text class="big_title" v-if="userObject.coinList[0].xname=='Bitcoin'">
BTC
</text>
<text class="big_title" v-if="userObject.coinList[0].xname=='Ethereum'">
ETH
</text>
<text class="big_title" v-if="userObject.coinList[0].xname=='TRON'">
TRX
<text class="big_title">
{{coin.name}}
</text>
</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'}">
:class="{'money_con': coin.type=='ETH', 'money_con2': coin.type=='BTC', 'money_con3': coin.type=='TRX'}">
<view class="textcon1">
<text class="text1">
<view class="" >
{{infoWallet.balance}}
<view class="">
{{coin.balance}}
</view>
<text class="text2"> $ {{balancePrice}}</text>
<text class="text2"> $ {{coin.balancePrice}}</text>
</text>
<image src="../../../../static/tongyonh/ethereum.png" mode="aspectFit" class="img1"
v-if="userObject.coinList[0].xname=='Ethereum'"></image>
v-if="coin.type=='ETH'&&!coin.contractAddress"></image>
<image src="../../../../static/tongyonh/Frame28.png" mode="aspectFit" class="img1"
v-if="userObject.coinList[0].xname=='Bitcoin'"></image>
v-if="coin.type=='BTC'&&!coin.contractAddress"></image>
<image src="../../../../static/tongyonh/tronicon.png" mode="aspectFit" class="img1"
v-if="userObject.coinList[0].xname=='TRON'"></image>
v-if="coin.type=='TRX'&&!coin.contractAddress"></image>
</view>
<view class="textcon1">
<view class="v1">
@ -56,15 +51,14 @@
<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="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>
v-if="item.type=='in'"></image>
<image src="../../../../static/tongyonh/arrow-up-left_1.png" mode="aspectFit"
class="img1" v-if="address==item.from"></image>
class="img1" v-if="item.type=='out'"></image>
<view class="textcon">
<view class="text1">
{{item.address}}
</view>
@ -90,7 +84,7 @@
</view>
</view>
</view>
</view>
@ -122,124 +116,88 @@
data() {
return {
// address
coinInfo: {},
trxs: [],
trxs2: [],
address: '',
userObject: {},
trxs:{},
coin: {},
showInfo: false,
list: [{
name: 'All',
}, {
name: 'Send',
}, {
name: 'Receive',
}],
infoWallet: {},
current: 0,
pageSize: 20,
pageNum: 1,
balance:0,
address:'',
type:'all',
trueType:'',
contract:'',
balancePrice:'',
balance: 0,
address: '',
type: 'all',
trueType: '',
contract: '',
balancePrice: '',
}
},
methods: {
goSend() {
uni.setStorageSync('infoWallet',this.infoWallet)
uni.navigateTo({
url: '/pages/menu/sendToken/transfer/index'
})
},
goReceive() {
uni.setStorageSync('infoWallet',this.infoWallet)
uni.setStorageSync('infoWallet', this.infoWallet)
uni.navigateTo({
url: '/pages/menu/sendToken/index'
})
},
goDetail(item, index) {
uni.setStorageSync('transDetail',this.trxs2[index])
uni.setStorageSync('transDetail', this.trxs[index])
uni.navigateTo({
url: '/pages/menu/transction/detail/index'
})
},
change(index) {
if(index==0){
this.type='all'
if (index == 0) {
this.type = 'all'
}
if(index==1){
this.type='send'
if (index == 1) {
this.type = 'send'
}
if(index==2){
this.type='receive'
if (index == 2) {
this.type = 'receive'
}
this.current = index;
console.log(this.current)
this.getWalletInfo();
this.getWalletInfo();
},
getWalletInfo() {
this.userObject = this.infoWallet
var that = this
console.log(this.trueType, this.type, this.address, this.contract,
this.pageNum, this.pageSize)
this.$dataUtil.transactionData(this.trueType, this.type, this.address, this.contract,
this.$dataUtil.transactionData(this.coin.type, this.type, this.coin.address, this.coin.contractAddress,
this.pageNum, this.pageSize,
function(data) {
console.log(data,121211212112121)
if(data.length==0){
that.showInfo=true;
}else{
that.showInfo=false;
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(option) {
const item = uni.getStorageSync('wallet')
console.log(item,2222)
this.infoWallet = item
this.address=item.address
this.trueType=item.type
this.balancePrice=item.balancePrice
console.log(this.infoWallet,1111)
this.getWalletInfo()
},
onPullDownRefresh() {
console.log('refresh');
this.getWalletInfo();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 500);
onLoad() {
this.coin = uni.getStorageSync('coin');
this.change(0);
},
onReachBottom() {
this.pageSize += 5;
this.getWalletInfo()

20
pages/menu/wallet/index.vue

@ -131,7 +131,7 @@
// thar.$walletUtil.updateBalance();
// thar.updateData();
// }, 100);
thar.$walletUtil.updateBalance();
// thar.$walletUtil.updateBalance();
console.log(thar.isStop,4444)
if (!thar.isStop) {
@ -160,17 +160,13 @@
},
goTrans(itemm, index) {
if (index == 0) {
uni.navigateTo({
url: '/pages/menu/token/btc/index'
})
} else {
//
uni.setStorageSync('otherCoin', index)
uni.navigateTo({
url: '/pages/menu/token/btc/index2'
})
}
let coin = this.userObj.coinList[index];
coin.type=this.userObj.type;
coin.address=this.userObj.address;
uni.setStorageSync('coin',coin)
uni.navigateTo({
url: '/pages/menu/token/btc/index'
})
},

BIN
static/tongyonh/Frame 30.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 955 B

BIN
static/tongyonh/Frame300.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 955 B

After

Width:  |  Height:  |  Size: 752 B

BIN
static/tongyonh/erwei.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 955 B

After

Width:  |  Height:  |  Size: 752 B

81
utils/DataUtil.js

@ -32,7 +32,6 @@ let DataUtil = {
for (let i = 0; i < data.length; i++) {
if (!data[i].toAlias) {
debugger;
if ((data[i].from != address && dataType == 'send') || (data[i]
.to != address && dataType == 'receive')) {
continue;
@ -49,18 +48,18 @@ let DataUtil = {
}
if (data[i].from === address) {
let address = data[i].to;
address = address.substring(0, 6) + '...' + address.substring(
25,
address.length)
transactionData.address = address;
let newaddress = data[i].to;
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(
newaddress.length-6,
newaddress.length)
transactionData.address = newaddress;
transactionData.type = 'out';
} else {
let address = data[i].from;
address = address.substring(0, 6) + '...' + address.substring(
25,
address.length)
transactionData.address = address;
let newaddress = data[i].from;
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(
newaddress.length-6,
newaddress.length)
transactionData.address = newaddress;
transactionData.type = 'in';
}
@ -109,18 +108,18 @@ let DataUtil = {
}
if (data[i].from === address) {
let address = data[i].to;
address = address.substring(0, 6) + '...' + address.substring(
36,
address.length)
transactionData.address = address;
let newaddress = data[i].to;
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(
newaddress.length-6,
newaddress.length)
transactionData.address = newaddress;
transactionData.type = 'out';
} else {
let address = data[i].from;
address = address.substring(0, 6) + '...' + address.substring(
36,
address.length)
transactionData.address = address;
let newaddress = data[i].from;
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(
newaddress.length-6,
newaddress.length)
transactionData.address = newaddress;
transactionData.type = 'in';
}
@ -159,8 +158,8 @@ let DataUtil = {
for (let i = 0; i < data.length; i++) {
if ((data[i].from != add && dataType == 'send') || (data[i]
.to != add && dataType == 'receive') || data[i].tType !=
if ((data[i].from != address && dataType == 'send') || (data[i]
.to != address && dataType == 'receive') || data[i].tType !=
'Transfer') {
continue;
}
@ -176,16 +175,16 @@ let DataUtil = {
}
if (data[i].from === address) {
var address = data[i].to
address = address.substring(0, 6) + '...' + address.substring(36,
address.length);
transactionData.address = address;
var newaddress = data[i].to
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(newaddress.length-6,
newaddress.length);
transactionData.address = newaddress;
transactionData.type = 'out';
} else {
var address = data[i].from
address = address.substring(0, 6) + '...' + address.substring(36,
address.length);
transactionData.address = address;
var newaddress = data[i].from
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(newaddress.length-6,
newaddress.length);
transactionData.address = newaddress;
transactionData.type = 'in';
}
@ -233,18 +232,18 @@ let DataUtil = {
}
if (data[i].from === address) {
var address = data[i].to
address = address.substring(0, 6) + '...' + address.substring(
25,
address.length);
transactionData.address = address;
var newaddress = data[i].to
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(
newaddress.length-6,
newaddress.length);
transactionData.address = newaddress;
transactionData.type = 'out';
} else {
var address = data[i].from
address = address.substring(0, 6) + '...' + address.substring(
25,
address.length);
transactionData.address = address;
var newaddress = data[i].from
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(
newaddress.length-6,
newaddress.length);
transactionData.address = newaddress;
transactionData.type = 'in';
}

2
utils/WalletUtil.js

@ -45,7 +45,7 @@ let fullWallet = {
icon: require('@/static/tongyonh/tron1.png')
},
{
name: "TRC20-USDT",
name: "USDT",
xname: 'Tether USD',
balance: 0,
contractAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',

Loading…
Cancel
Save