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. 82
      pages/menu/token/btc/index.vue
  5. 14
      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> <template>
<view class=""> <view class="">
<navigation :showBack="true" :bgnum="true"> <navigation :showBack="true" :bgnum="true">
Receive {{addressInfo.name}} Receive
</navigation> </navigation>
<view class="main"> <view class="main">
<view class="main_con"> <view class="main_con">
<image src="../../../static/tongyonh/bye.png" mode="aspectFit" class="logoimg" v-if="addressInfo.type=='BTC'"></image> <image :src="addressInfo.icon" mode="aspectFit" class="logoimg" ></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>
<view class="title"> <view class="title">
{{addressInfo.type}} Receiving address {{addressInfo.name}} Receiving address
</view> </view>
<view class="code_con"> <view class="code_con">
<tki-qrcode ref="qrcode" :val="addressInfo.address" :size="size" :unit="unit" :background="background" <tki-qrcode ref="qrcode" :val="addressInfo.address" :size="size" :unit="unit" :background="background"
@ -102,9 +100,8 @@
// #endif // #endif
}, },
}, },
onLoad(item) { onLoad() {
this.addressInfo= uni.getStorageSync('infoWallet') this.addressInfo=uni.getStorageSync('coin')
console.log(this.addressInfo,111)
} }
}; };
</script> </script>

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

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

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

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

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

@ -1,32 +1,27 @@
<template> <template>
<view class=""> <view class="">
<navigation :showBack="true" :bgnum="true"> <navigation :showBack="true" :bgnum="true">
<text class="big_title" v-if="userObject.coinList[0].xname=='Bitcoin'"> <text class="big_title">
BTC {{coin.name}}
</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> </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': coin.type=='ETH', 'money_con2': coin.type=='BTC', 'money_con3': coin.type=='TRX'}">
<view class="textcon1"> <view class="textcon1">
<text class="text1"> <text class="text1">
<view class=""> <view class="">
{{infoWallet.balance}} {{coin.balance}}
</view> </view>
<text class="text2"> $ {{balancePrice}}</text> <text class="text2"> $ {{coin.balancePrice}}</text>
</text> </text>
<image src="../../../../static/tongyonh/ethereum.png" mode="aspectFit" class="img1" <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" <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" <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>
<view class="textcon1"> <view class="textcon1">
<view class="v1"> <view class="v1">
@ -56,13 +51,12 @@
<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" <view class="item1" v-for="(item,index) in trxs" @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"
v-if="address==item.to"></image> v-if="item.type=='in'"></image>
<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="item.type=='out'"></image>
<view class="textcon"> <view class="textcon">
<view class="text1"> <view class="text1">
@ -122,11 +116,8 @@
data() { data() {
return { return {
// address // address
coinInfo: {}, trxs:{},
trxs: [], coin: {},
trxs2: [],
address: '',
userObject: {},
showInfo: false, showInfo: false,
list: [{ list: [{
name: 'All', name: 'All',
@ -154,7 +145,6 @@
}, },
methods: { methods: {
goSend() { goSend() {
uni.setStorageSync('infoWallet',this.infoWallet)
uni.navigateTo({ uni.navigateTo({
url: '/pages/menu/sendToken/transfer/index' url: '/pages/menu/sendToken/transfer/index'
}) })
@ -166,7 +156,7 @@
}) })
}, },
goDetail(item, index) { goDetail(item, index) {
uni.setStorageSync('transDetail',this.trxs2[index]) uni.setStorageSync('transDetail', this.trxs[index])
uni.navigateTo({ uni.navigateTo({
url: '/pages/menu/transction/detail/index' url: '/pages/menu/transction/detail/index'
}) })
@ -188,11 +178,8 @@
}, },
getWalletInfo() { getWalletInfo() {
this.userObject = this.infoWallet
var that = this var that = this
console.log(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)
this.$dataUtil.transactionData(this.trueType, this.type, this.address, this.contract,
this.pageNum, this.pageSize, this.pageNum, this.pageSize,
function(data) { function(data) {
console.log(data, 121211212112121) console.log(data, 121211212112121)
@ -202,44 +189,15 @@
that.showInfo = false; that.showInfo = false;
} }
that.trxs = data 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) { onLoad() {
const item = uni.getStorageSync('wallet') this.coin = uni.getStorageSync('coin');
console.log(item,2222) this.change(0);
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);
}, },
onReachBottom() { onReachBottom() {
this.pageSize += 5; this.pageSize += 5;
this.getWalletInfo() this.getWalletInfo()

14
pages/menu/wallet/index.vue

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

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

2
utils/WalletUtil.js

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

Loading…
Cancel
Save