Browse Source

修改

master
vee 4 years ago
parent
commit
597f46eb93
  1. 5
      main.js
  2. 89
      pages/menu/market/index.vue
  3. 2
      pages/menu/profile/index.css
  4. 175
      pages/menu/profile/index.vue
  5. 4
      pages/menu/sendToken/addAddress/index.css
  6. 1
      pages/menu/sendToken/addAddress/index.vue
  7. 454
      pages/menu/sendToken/address/index.vue
  8. 4
      pages/menu/sendToken/index.css
  9. 28
      pages/menu/sendToken/transfer/index.vue
  10. 83
      pages/menu/token/btc/index.vue
  11. 12
      pages/menu/transction/detail/index.vue
  12. 4
      pages/menu/wallet/add/index.css
  13. 4
      pages/menu/wallet/mwallet/manage/index.css
  14. 3
      pages/menu/wallet/mwallet/manage/index.vue
  15. 142
      unpackage/dist/dev/app-plus/app-service.js
  16. 50
      unpackage/dist/dev/app-plus/app-view.js
  17. 263
      utils/DataUtil.js
  18. 8
      utils/SystemConfiguration.js
  19. 3
      utils/api.js
  20. 2
      utils/locales/en.js

5
main.js

@ -14,7 +14,6 @@ import util from 'ethereumjs-util'
import store from './store'
import walletUtil from './utils/WalletUtil.js'
import dataUtil from './utils/DataUtil.js'
Vue.prototype.$store = store
Vue.prototype.tronweb = tronweb
Vue.prototype.bip32 = bip32
@ -24,7 +23,6 @@ Vue.prototype.bitcoin = bitcoin
Vue.prototype.ethers = ethers
Vue.prototype.$axios = axios
Vue.prototype.$walletUtil = walletUtil
Vue.prototype.$dataUtil = dataUtil
// 自定义底部导航栏
import tabBar from 'components/tabBar/tabBar.vue'
@ -56,10 +54,13 @@ import TokenUtil from './utils/TokenUtil.js'
import EthUtil from './utils/EthUtil.js'
import TronUtil from './utils/TronUtil.js'
import api from './utils/api.js'
import SystemConfiguration from './utils/SystemConfiguration.js'
Vue.prototype.$Token = TokenUtil
Vue.prototype.$EthUtil = EthUtil
Vue.prototype.$TronUtil = TronUtil
Vue.prototype.$api = api
Vue.prototype.$SystemConfiguration = SystemConfiguration
Vue.prototype.$_i18n = i18n
// Vue.prototype.$showDialog = true
App.mpType = 'app'

89
pages/menu/market/index.vue

@ -15,23 +15,20 @@
<view class="scroll">
<view class="item flex" v-for="(item,index) in recordInfo">
<view class="text2 pairs">
<strong>{{item.name}}</strong><span class="t1">/USDT</span>
<strong>{{item.symbol}}</strong><span class="t1">/USDT</span>
</view>
<view class="text2 price">
<view class="">
<strong>${{item.current_price_usd}}</strong>
<strong>${{item.last}}</strong>
</view>
<view class="t1">
{{item.current_price}}
{{item.priceCny}}
</view>
</view>
<view class="btn " :class="item.change_percent>0?'red':'green'">
<!-- <image src="../../../static/tongyonh/arrow-down-left1.png" mode="aspectFit" class="img1"
v-if="item.change_percent>=0"></image>
<image src="../../../static/tongyonh/arrow-down-left.png" mode="aspectFit" class="img1"
v-if="item.change_percent<0"></image> -->
{{item.change_percent>0?'+':''}}{{item.change_percent}}%
{{item.rose>0?'+':''}}{{item.rose}}%
</view>
</view>
</view>
@ -50,53 +47,55 @@
export default {
data() {
return {
recordInfo: [],
isStop: false
recordInfo: []
}
},
onUnload: function() {
this.isStop = true
},
computed: {
i18n() {
return this.$t('index')
},
},
i18n() {
return this.$t('index')
},
},
methods: {
getHomeSlideFunc() {
var _self = this;
uni.request({
url: 'https://dncapi.fxhapp.com/api/coin/web-coinrank?page=1&type=0&pagesize=10', //
header: {
'content-type': 'application/x-www-form-urlencoded', //
},
success: (res) => {
this.recordInfo = res.data.data
setTimeout(function() {
console.log(_self.isStop)
if (!_self.isStop) {
_self.getHomeSlideFunc()
}
}, 2000)
this.$forceUpdate()
}
});
async getHomeSlideFunc() {
const response = await this.$api.getCoinTickerList()
// this.collectinInfo=response.data
this.recordInfo = response.data.value
},
},
onLoad() {
this.getHomeSlideFunc()
this.getHomeSlideFunc();
let that=this
uni.onSocketOpen(function (res) {
});
uni.connectSocket({
url: that.$SystemConfiguration.constant.coinTickerWs
});
uni.sendSocketMessage({
data: '{"type":"add_ticker"}'
});
uni.onSocketMessage(function(res) {
let data=JSON.parse(res.data);
console.log(data,11111)
that.recordInfo = data.value
});
},onUnload: function() {
uni.onSocketClose(function (res) {
console.log('WebSocket 已关闭!');
});
},onHide:function(){
uni.onSocketClose(function (res) {
console.log('WebSocket 已关闭!');
});
}
};
</script>

2
pages/menu/profile/index.css

@ -30,7 +30,7 @@ padding-bottom: 350rpx;
height: 72rpx;
}
.main_con .item .text1{
font-size: 32rpx;
font-size: 28rpx;
margin-left: 24rpx;
}
.main_con .item .img2{

175
pages/menu/profile/index.vue

@ -2,77 +2,77 @@
<view class="">
<navigation :showBack="false" :bgnum="true">
<text class="big_title">
{{i18n.protit}}
{{i18n.protit}}
</text>
</navigation>
<view class="main">
<view class="main_con">
<view class="title">
{{i18n.apps}}
</view>
<view class="item flex" @click="goMan()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/profile1.png" class="img1" mode="aspectFit"></image>
<text class="text1"> {{i18n.magew}}</text>
<view class="main_con">
<view class="title">
{{i18n.apps}}
</view>
<view class="item flex" @click="goMan()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/profile1.png" class="img1" mode="aspectFit"></image>
<text class="text1"> {{i18n.magew}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
<view class="item flex" @click="goAddress()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/circle.png" class="img1" mode="aspectFit"></image>
<text class="text1">{{i18n.addBook}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
<view class="item flex" @click="goSettings()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/Frame68p.png" class="img1" mode="aspectFit"></image>
<text class="text1">{{i18n.Settings}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
<view class="item flex" @click="goHelp()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/Frame70.png" class="img1" mode="aspectFit"></image>
<text class="text1">{{i18n.helpcen}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
<view class="item flex" @click="goAbout()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/Frame71.png" class="img1" mode="aspectFit"></image>
<text class="text1">{{i18n.aboutus}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
<view class="item flex" @click="goAddress()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/circle.png" class="img1" mode="aspectFit"></image>
<text class="text1">{{i18n.addBook}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
<view class="item flex" @click="goSettings()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/Frame68p.png" class="img1" mode="aspectFit"></image>
<text class="text1">{{i18n.Settings}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
<view class="item flex" @click="goHelp()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/Frame70.png" class="img1" mode="aspectFit"></image>
<text class="text1">{{i18n.helpcen}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
<view class="item flex" @click="goAbout()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/Frame71.png" class="img1" mode="aspectFit"></image>
<text class="text1">{{i18n.aboutus}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
</view>
<view class="main_con">
<view class="title">
{{i18n.Hardware}}
</view>
<view class="item flex" @click="goMatching()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/Frame72.png" class="img1" mode="aspectFit"></image>
<text class="text1"> {{i18n.math}}</text>
<view class="main_con">
<view class="title">
{{i18n.Hardware}}
</view>
<view class="item flex" @click="goMatching()">
<view class="itemImg flex">
<image src="../../../static/tongyonh/Frame72.png" class="img1" mode="aspectFit"></image>
<text class="text1"> {{i18n.math}}</text>
</view>
<image src="../../../static/tongyonh/chevron_right_24px.png" class="img2" mode="aspectFit"></image>
</view>
</view>
</view>
</view>
</view>
<tab-bar :selectActive="5"></tab-bar>
</view>
<tab-bar :selectActive="5"></tab-bar>
</view>
</template>
@ -83,49 +83,50 @@
export default {
data() {
return {
}
},
methods: {
goMatching(){
goMatching() {
uni.showToast({
title: 'Not yet open',
icon: 'none',
duration: 1500
})
},
goAbout(){
uni.navigateTo({
url:'/pages/menu/about/index'
})
},
goHelp(){
goAbout() {
uni.navigateTo({
url: '/pages/menu/about/index'
})
},
goHelp() {
uni.showToast({
title: 'Not yet open',
icon: 'none',
duration: 1500
})
},
goSettings(){
goSettings() {
uni.navigateTo({
url:'/pages/menu/setting/index'
})
url: '/pages/menu/setting/index'
})
},
goMan() {
uni.navigateTo({
url: '/pages/menu/wallet/mwallet/index'
})
},
goAddress() {
uni.setStorageSync('sourcePage', '/pages/menu/profile/index');
uni.navigateTo({
url: '/pages/menu/sendToken/address/index'
})
},
goMan(){
uni.navigateTo({
url:'/pages/menu/wallet/mwallet/index'
})
},
goAddress(){
uni.navigateTo({
url:'/pages/menu/sendToken/address/index'
})
},
},
onLoad() {
},
computed: {
i18n() {
@ -135,9 +136,9 @@
};
</script>
<style scoped>
page{
background-color: #FAFAFA;
}
page {
background-color: #FAFAFA;
}
</style>
<style>

4
pages/menu/sendToken/addAddress/index.css

@ -386,7 +386,7 @@
}
.bottom_con .item .text2{
font-size: 30rpx;
font-size: 24rpx;
text-align: left;
color: #A3AED0;
font-weight: normal;
@ -396,7 +396,7 @@
margin-left: 15rpx;
}
.bottom_con .item .text1{
font-size: 32rpx;
font-size: 30rpx;
color: #000;
font-weight: normal;
}

1
pages/menu/sendToken/addAddress/index.vue

@ -102,7 +102,6 @@
export default {
data() {
return {
info: {},
addressName: '',
bigAddress: '',

454
pages/menu/sendToken/address/index.vue

@ -1,135 +1,145 @@
<template>
<view class="">
<navigation :showBack="false" :bgnum="true">
<image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" class="back" @click="back()" ></image>
<image src="../../../../static/tongyonh/IconGroup.png" mode="aspectFit" class="renYou" slot="logo" @click="goAddress()"></image>
<image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" class="back" @click="back()"></image>
<image src="../../../../static/tongyonh/IconGroup.png" mode="aspectFit" class="renYou" slot="logo"
@click="goAddress()"></image>
<text class="big_title">
Address
</text>
</navigation>
<view class="main">
<view class="big_item">
<view class="item flex" v-for="(item,index) in BTCAddressInfo" @click="goTransfer(item)">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
<image :src="item.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="textt">{{item.coinList[0].name}}</text>
<text class="textt2">{{item.name}}</text>
<view class="item flex" v-for="(item,index) in BTCAddressInfo" @click="goTransfer(item)">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
<image :src="item.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="textt">{{item.coinList[0].name}}</text>
<text class="textt2">{{item.name}}</text>
</view>
<view class="text1">
{{item.address}}
</view>
</view>
<view class="text1">
{{item.address}}
</view>
<view class="btncon">
<image src="../../../../static/tongyonh/more_vert_24px_outlined.svg" mode="aspectFit"
class="img2" @click.stop="showIndex(item,index)">
</image>
</view>
<view class="set_con" v-if="show" v-show="index==btcIndex">
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img1"
@click.stop="show = false"></image>
<view class="itemm flexx" @click.stop="editItem(index)">
<image src="../../../../static/tongyonh/create_24px.png" mode="aspectFit" class="img">
</image>
Edit
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
Delete
</view>
</view>
</view>
<view class="btncon">
<image src="../../../../static/tongyonh/more_vert_24px_outlined.svg" mode="aspectFit" class="img2" @click.stop="showIndex(item,index)">
</image>
</view>
<view class="set_con" v-if="show" v-show="index==btcIndex">
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img1" @click.stop="show = false"></image>
<view class="itemm flexx" @click.stop="editItem(index)">
<image src="../../../../static/tongyonh/create_24px.png" mode="aspectFit" class="img"></image>
Edit
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
Delete
</view>
</view>
<view class="item flex" v-for="(item,index) in ETHAddressInfo" @click="goTransfer(item)">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
<image :src="item.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="textt">{{item.coinList[0].name}}</text>
<text class="textt2">{{item.name}}</text>
</view>
<view class="text1">
{{item.address}}
</view>
</view>
</view>
<view class="item flex" v-for="(item,index) in ETHAddressInfo" @click="goTransfer(item)">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
<image :src="item.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="textt">{{item.coinList[0].name}}</text>
<text class="textt2">{{item.name}}</text>
<view class="btncon">
<image src="../../../../static/tongyonh/more_vert_24px_outlined.svg" mode="aspectFit"
class="img2" @click.stop="showIndex(item,index)">
</image>
</view>
<view class="set_con" v-if="show2" v-show="index==ethIndex">
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img1"
@click.stop="show2 = false"></image>
<view class="itemm flexx" @click.stop="editItem(index)">
<image src="../../../../static/tongyonh/create_24px.png" mode="aspectFit" class="img">
</image>
Edit
</view>
<view class="text1">
{{item.address}}
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
Delete
</view>
</view>
</view>
<view class="btncon">
<image src="../../../../static/tongyonh/more_vert_24px_outlined.svg" mode="aspectFit" class="img2" @click.stop="showIndex(item,index)">
</image>
</view>
<view class="set_con" v-if="show2" v-show="index==ethIndex">
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img1" @click.stop="show2 = false"></image>
<view class="itemm flexx" @click.stop="editItem(index)">
<image src="../../../../static/tongyonh/create_24px.png" mode="aspectFit" class="img"></image>
Edit
<view class="item flex" v-for="(item,index) in TRXAddressInfo" @click="goTransfer(item)">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
<image :src="item.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="textt">{{item.coinList[0].name}}</text>
<text class="textt2">{{item.name}}</text>
</view>
<view class="text1">
{{item.address}}
</view>
</view>
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
Delete
<view class="btncon">
<image src="../../../../static/tongyonh/more_vert_24px_outlined.svg" mode="aspectFit"
class="img2" @click.stop="showIndex(item,index)">
</image>
</view>
</view>
</view>
<view class="item flex" v-for="(item,index) in TRXAddressInfo" @click="goTransfer(item)">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
<image :src="item.coinList[0].icon" mode="aspectFit" class="img"></image>
<text class="textt">{{item.coinList[0].name}}</text>
<text class="textt2">{{item.name}}</text>
<view class="set_con" v-if="show3" v-show="index==trxIndex">
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img1"
@click.stop="show3 = false"></image>
<view class="itemm flexx" @click.stop="editItem(index)">
<image src="../../../../static/tongyonh/create_24px.png" mode="aspectFit" class="img">
</image>
Edit
</view>
<view class="text1">
{{item.address}}
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
Delete
</view>
</view>
</view>
<view class="btncon">
<image src="../../../../static/tongyonh/more_vert_24px_outlined.svg" mode="aspectFit" class="img2" @click.stop="showIndex(item,index)">
</image>
</view>
<view class="set_con" v-if="show3" v-show="index==trxIndex">
<image src="../../../../static/tongyonh/xg.png" mode="aspectFit" class="img1" @click.stop="show3 = false"></image>
<view class="itemm flexx" @click.stop="editItem(index)">
<image src="../../../../static/tongyonh/create_24px.png" mode="aspectFit" class="img"></image>
Edit
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
Delete
</view>
</view>
</view>
</view>
<view class="info_con green" v-if="showImte">
<view class="info_con green" v-if="showImte">
<view class="text">
{{itemCoin}} {{itemAddress}}
{{itemCoin}} {{itemAddress}}
</view>
<view class="text text2">
DELETE
DELETE
</view>
</view>
</view>
<u-mask z-index="10" :show="show" ></u-mask>
<u-mask z-index="10" :show="show2" ></u-mask>
<u-mask z-index="10" :show="show3" ></u-mask>
</view>
<u-mask z-index="10" :show="show" @click="show = false"></u-mask>
<u-mask z-index="10" :show="show2" @click="show2 = false"></u-mask>
<u-mask z-index="10" :show="show3" @click="show3 = false"></u-mask>
</view>
@ -140,23 +150,23 @@
export default {
data() {
return {
ethIndex:0,
btcIndex:0,
trxIndex:0,
showImte:false,
BTCAddressInfo:{},
ETHAddressInfo:{},
TRXAddressInfo:{},
walletIndex:-1,
itemCoin:'',
itemAddress:'',
info:{},
transfer:'',
show: false,
show2: false,
show3: false,
list: [
{
sourcePage:'',
ethIndex: 0,
btcIndex: 0,
trxIndex: 0,
showImte: false,
BTCAddressInfo: {},
ETHAddressInfo: {},
TRXAddressInfo: {},
walletIndex: -1,
itemCoin: '',
itemAddress: '',
info: {},
transfer: '',
show: false,
show2: false,
show3: false,
list: [{
name: 'Single address',
checked: true,
disabled: false
@ -176,133 +186,137 @@ show3: false,
},
methods: {
//
goTransfer(item){
if(this.transfer){
uni.setStorageSync('myTransAddress',item)
goTransfer(item) {
console.log(this.transfer,12316546)
if (this.transfer) {
uni.setStorageSync('myTransAddress', item)
uni.navigateTo({
url:'../transfer/index'
url: '../transfer/index'
})
}
},
back(){
if(this.transfer){
uni.navigateBack({
back() {
uni.removeStorageSync("sourcePage")
if(this.sourcePage){
uni.reLaunch({
url: this.sourcePage
})
}else{
uni.reLaunch({
url:'/pages/menu/profile/index'
})
uni.navigateBack({
})
}
},
editItem(index){
console.log(index,78787)
uni.setStorageSync('editIndex',index)
uni.setStorageSync('AddressInfo',this.info)
uni.setStorageSync('AddressName',this.itemCoin)
uni.setStorageSync('AddressIndex',this.walletIndex)
uni.navigateTo({
url:'../addAddress2/index'
})
editItem(index) {
console.log(index, 78787)
uni.setStorageSync('editIndex', index)
uni.setStorageSync('AddressInfo', this.info)
uni.setStorageSync('AddressName', this.itemCoin)
uni.setStorageSync('AddressIndex', this.walletIndex)
uni.navigateTo({
url: '../addAddress2/index'
})
},
showIndex(item,index){
this.itemCoin=item.coinList[0].name
if(item.coinList[0].xname=='Bitcoin'){
this.btcIndex=index
this.show=true
}else if(item.coinList[0].xname=='Ethereum'){
this.show2=true
this.ethIndex=index
}else{
this.trxIndex=index
this.show3=true
showIndex(item, index) {
this.itemCoin = item.coinList[0].name
if (item.coinList[0].xname == 'Bitcoin') {
this.btcIndex = index
this.show = true
} else if (item.coinList[0].xname == 'Ethereum') {
this.show2 = true
this.ethIndex = index
} else {
this.trxIndex = index
this.show3 = true
}
this.info= item
this.itemCoin=item.coinList[0].name
this.itemAddress=item.address
this.walletIndex=index;
this.info = item
this.itemCoin = item.coinList[0].name
this.itemAddress = item.address
this.walletIndex = index;
},
deleteItem(){
console.log(this.walletIndex,4444444)
if(this.itemCoin=='BTC'){
console.log(this.BTCAddressInfo.length,'length')
if(this.BTCAddressInfo.length==1){
let BTCAddressInfo=[]
uni.setStorageSync('BTCAddressInfo',BTCAddressInfo)
deleteItem() {
console.log(this.walletIndex, 4444444)
if (this.itemCoin == 'BTC') {
console.log(this.BTCAddressInfo.length, 'length')
if (this.BTCAddressInfo.length == 1) {
let BTCAddressInfo = []
uni.setStorageSync('BTCAddressInfo', BTCAddressInfo)
}
console.log(this.BTCAddressInfo,1111)
console.log(this.walletIndex,44444)
this.BTCAddressInfo.splice(this.walletIndex,1)
console.log(this.BTCAddressInfo,'删除后')
uni.setStorageSync('BTCAddressInfo', this.BTCAddressInfo)
this.showImte=true;
this.show=false;
setTimeout(()=>{
this.showImte=false;
},1500)
console.log(this.BTCAddressInfo, 1111)
console.log(this.walletIndex, 44444)
this.BTCAddressInfo.splice(this.walletIndex, 1)
console.log(this.BTCAddressInfo, '删除后')
uni.setStorageSync('BTCAddressInfo', this.BTCAddressInfo)
this.showImte = true;
this.show = false;
setTimeout(() => {
this.showImte = false;
}, 1500)
}
if(this.itemCoin=='ETH'){
if(this.ETHAddressInfo.length==1){
let ETHAddressInfo=[]
uni.setStorageSync('ETHAddressInfo',ETHAddressInfo)
if (this.itemCoin == 'ETH') {
if (this.ETHAddressInfo.length == 1) {
let ETHAddressInfo = []
uni.setStorageSync('ETHAddressInfo', ETHAddressInfo)
}
console.log(this.ETHAddressInfo,1111)
console.log(this.walletIndex,44444)
this.ETHAddressInfo.splice(this.walletIndex,1)
uni.setStorageSync('ETHAddressInfo',this.ETHAddressInfo)
this.showImte=true;
this.show2=false;
setTimeout(()=>{
this.showImte=false;
},1500)
console.log(this.ETHAddressInfo, 1111)
console.log(this.walletIndex, 44444)
this.ETHAddressInfo.splice(this.walletIndex, 1)
uni.setStorageSync('ETHAddressInfo', this.ETHAddressInfo)
this.showImte = true;
this.show2 = false;
setTimeout(() => {
this.showImte = false;
}, 1500)
}
if(this.itemCoin=='TRX'){
if(this.TRXAddressInfo.length==1){
let TRXAddressInfo=[]
uni.setStorageSync('TRXAddressInfo',TRXAddressInfo)
if (this.itemCoin == 'TRX') {
if (this.TRXAddressInfo.length == 1) {
let TRXAddressInfo = []
uni.setStorageSync('TRXAddressInfo', TRXAddressInfo)
}
this.TRXAddressInfo.splice(this.walletIndex,1)
uni.setStorageSync('TRXAddressInfo',this.TRXAddressInfo)
this.showImte=true;
this.show3=false;
setTimeout(()=>{
this.showImte=false;
},1500)
this.TRXAddressInfo.splice(this.walletIndex, 1)
uni.setStorageSync('TRXAddressInfo', this.TRXAddressInfo)
this.showImte = true;
this.show3 = false;
setTimeout(() => {
this.showImte = false;
}, 1500)
}
},
goAddress(){
uni.navigateTo({
url:'../addAddress/index'
})
}
goAddress() {
uni.navigateTo({
url: '../addAddress/index'
})
}
},
onLoad(item) {
//
if(item){
this.transfer=item
}
this.sourcePage=uni.getStorageSync('sourcePage')
//
if (item.item) {
this.transfer = item.item
}
if(uni.getStorageSync('BTCAddressInfo').length>0){
this.BTCAddressInfo=uni.getStorageSync('BTCAddressInfo')
console.log(this.BTCAddressInfo,777)
if (uni.getStorageSync('BTCAddressInfo').length > 0) {
this.BTCAddressInfo = uni.getStorageSync('BTCAddressInfo')
console.log(this.BTCAddressInfo, 777)
}
if(uni.getStorageSync('ETHAddressInfo').length>0){
this.ETHAddressInfo=uni.getStorageSync('ETHAddressInfo')
console.log(this.ETHAddressInfo,777)
if (uni.getStorageSync('ETHAddressInfo').length > 0) {
this.ETHAddressInfo = uni.getStorageSync('ETHAddressInfo')
console.log(this.ETHAddressInfo, 777)
}
if(uni.getStorageSync('TRXAddressInfo').length>0){
this.TRXAddressInfo=uni.getStorageSync('TRXAddressInfo')
console.log(this.TRXAddressInfo,777)
if (uni.getStorageSync('TRXAddressInfo').length > 0) {
this.TRXAddressInfo = uni.getStorageSync('TRXAddressInfo')
console.log(this.TRXAddressInfo, 777)
}
}
};
@ -310,7 +324,7 @@ goAddress(){
<style scoped>
page {
background: #FAFAFA;
height: 100%;
height: 100%;
}
</style>

4
pages/menu/sendToken/index.css

@ -43,7 +43,7 @@
font-size: 32rpx;
}
.title{
font-size: 36rpx;
font-size: 32rpx;
text-align: center;
font-weight: 700;
margin-top: 15rpx;
@ -65,7 +65,7 @@
}
.main .text2{
color: #000;
font-size: 30rpx;
font-size: 28rpx;
margin-top: 52rpx;
background-color: #FAFAFA;
border-radius: 10rpx;

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

@ -21,14 +21,14 @@
{{i18n.Receivingaddress}}
</view>
<view class="text2" @click="goAddress('transfer')">
{{i18n.AdressBook}}
{{i18n.AddressBook}}
</view>
</view>
<view class="inputcon">
<input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="Please enter the recipient address" class="input1"
v-model="transInfoPass.toAddress" />
<image src="../../../../static/tongyonh/Frame330.png" mode="aspectFit" class="img1"></image>
<image src="../../../../static/tongyonh/Frame330.png" mode="aspectFit" class="img1" @click="scanCode"></image>
</view>
</view>
@ -438,12 +438,12 @@
this.show = true;
let that = this
if (this.coin.type === 'ETH') {
this.$EthUtil.getGas().then((res) => {
console.log(res, 'ETH')
this.$EthUtil.getGas().then((res) => {
console.log(res,'ETH')
this.$EthUtil.getGas().then((res) => {
that.transInfoPass.fee = res*61000/ Math.pow(10,6)
})
that.transInfoPass.fee = res * 61000 / Math.pow(10, 6)
})
})
} else if (this.coin.type === 'TRX') {
this.$TronUtil.getTransaction(this.transInfoPass.fromAddress,
@ -453,7 +453,7 @@
that.transaction = res;
uni.setStorageSync('transaction', that.transaction)
console.log(JSON.stringify(that.transaction))
let size = JSON.stringify(that.transaction).replace(/[^x00-xFF]/g,'**').length;
let size = JSON.stringify(that.transaction).replace(/[^x00-xFF]/g, '**').length;
console.log(size, "size")
console.log(size.toString().length, "size")
that.transInfoPass.fee = Number(size) * (size.toString().length + 1) * 1000 / Math.pow(10,
@ -472,6 +472,16 @@
}
},
scanCode() {
var _this = this
uni.scanCode({
success: function(res) {
console.log('扫码内容', res.result)
_this.transInfoPass.toAddress = res.result;
}
});
},
//
printCancel() {
@ -601,7 +611,7 @@
goAddress(text) {
console.log(text)
uni.navigateTo({
url: '../address/index?item=' + text
})
@ -624,7 +634,7 @@
if (uni.getStorageSync('fingerPass')) {
this.passShow = uni.getStorageSync('fingerPass')
}
}
};

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

@ -45,8 +45,9 @@
<view class="select_con">
<view class="select">
<u-tabs height="120" bar-width="172" active-font="13" inactive-font="13" active-color="#6F69FF" inactive-color="#A3AED0" :list="list"
:is-scroll="false" :current="current" @change="change"></u-tabs>
<u-tabs height="120" bar-width="172" active-font="13" inactive-font="13" 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>
@ -63,15 +64,15 @@
{{item.address}}
</view>
<view class="text2">
{{item.time}}
{{item.transactionTime}}
</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 v-if="item.type=='in'">+</text>
<text v-if="item.type=='out'">-</text>
{{item.amount}}
<text class="">
{{item.network}}
</text>
@ -116,14 +117,15 @@
data() {
return {
// address
trxs:{},
trxs: [],
coin: {},
isNoData:false,
showInfo: false,
list: [{
name: this.$t('index').All,
}, {
name: this.$t('index').Send,
name: this.$t('index').Send,
}, {
name: this.$t('index').Receive,
@ -144,10 +146,10 @@
}
},
computed: {
i18n() {
return this.$t('index')
},
},
i18n() {
return this.$t('index')
},
},
methods: {
goSend() {
uni.navigateTo({
@ -178,35 +180,52 @@
this.type = 'receive'
}
this.current = index;
console.log(this.current)
this.pageNum = 1;
this.trxs=[];
this.getWalletInfo();
this.isNoData=false;
},
onReachBottom() {
if(!this.isNoData){
this.pageNum=this.pageNum+1;
this.getWalletInfo();
}
},
async getWalletInfo() {
let params = {
address: this.coin.address,
chainName: this.coin.type,
contract: this.coin.contractAddress,
pageNum: this.pageNum,
pageSize: this.pageSize
}
if (this.type === 'send') {
params.fromAddress = this.coin.address;
} else if (this.type === 'receive') {
params.toAddress = this.coin.address
}
const response = await this.$api.getChainDataList(params)
if (response.data.rows.length == 0 ) {
this.isNoData=true;
if(this.pageNum == 1){
this.showInfo = true;
}
} else {
this.showInfo = false;
}
this.trxs=this.trxs.concat(response.data.rows);
getWalletInfo() {
var that = this
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;
}
that.trxs = data
})
}
},
onLoad() {
this.coin = uni.getStorageSync('coin');
this.change(0);
},
onReachBottom() {
this.pageSize += 5;
this.getWalletInfo()
}
};
</script>
<style scoped>

12
pages/menu/transction/detail/index.vue

@ -21,7 +21,7 @@
Amount
</view>
<view class="text1">
{{info.value}} {{info.network}}
{{info.amount}} {{info.coin}}
</view>
</view>
<view class="title_con flex">
@ -29,7 +29,7 @@
Time
</view>
<view class="text2">
{{info.time}}
{{info.transactionTime}}
</view>
</view>
<view class="title_con flex">
@ -37,7 +37,7 @@
Tx Fee
</view>
<view class="text2">
{{info.fee}} {{info.network}}
{{info.fee}} {{info.chainName}}
</view>
</view>
@ -58,8 +58,8 @@
<text v-else>(me)</text>
</view>
<view class="text2">
{{info.from}}
<image @click="copyTextMethod(info.from)" src="../../../../static/tongyonh/copy_24px.png" mode="aspectFit" class="img"></image>
{{info.fromAddress}}
<image @click="copyTextMethod(info.fromAddress)" src="../../../../static/tongyonh/copy_24px.png" mode="aspectFit" class="img"></image>
</view>
</view>
<view class="item">
@ -69,7 +69,7 @@
<text v-else>(others)</text>
</view>
<view class="text2">
{{info.to}}
{{info.toAddress}}
<image @click="copyTextMethod(info.to)" src="../../../../static/tongyonh/copy_24px.png" mode="aspectFit" class="img"></image>
</view>
</view>

4
pages/menu/wallet/add/index.css

@ -84,10 +84,10 @@
margin-right: 20rpx;
}
.bot_con .item .left .textcon .text1{
font-size: 32rpx;
font-size: 30rpx;
}
.bot_con .item .left .textcon .text2{
font-size: 28rpx;
font-size: 24rpx;
color: #B0BBD5;
}
.bot_con .item .rig{

4
pages/menu/wallet/mwallet/manage/index.css

@ -11,7 +11,7 @@
margin-bottom: 24rpx;
}
.main .item .text1{
font-size: 32rpx;
font-size: 30rpx;
color: #000;
margin-bottom: 16rpx;
}
@ -22,7 +22,7 @@ margin-bottom: 16rpx;
border-bottom: 2rpx solid #F4F7FE;
}
.main .item .text2{
font-size: 32rpx;
font-size: 28rpx;
color: #68769F;
word-break: break-word;
}

3
pages/menu/wallet/mwallet/manage/index.vue

@ -21,7 +21,7 @@
{{i18n.Name}}
</view>
<view class="address" >
{{i18n.Setname}}
{{userObj.name}}
<image src="../../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="img1"></image>
</view>
</view>
@ -103,6 +103,7 @@
})
}
console.log(this.userObj,2222)
this.userObj.name=this.value;
this.$walletUtil.updateWalletName(this.userObj.type,this.userObj.address,this.value)
uni.showToast({
title: 'Successfully',

142
unpackage/dist/dev/app-plus/app-service.js

File diff suppressed because one or more lines are too long

50
unpackage/dist/dev/app-plus/app-view.js

File diff suppressed because one or more lines are too long

263
utils/DataUtil.js

@ -1,263 +0,0 @@
import index from './index.js'
let DataUtil = {
transactionData: function(type, dataType, address, contract, pageNum, pageSize, success) {
console.log(type, dataType, address, contract, pageNum, pageSize, 1111)
switch (type) {
case 'BTC':
success([]);
break;
case 'ETH':
this.ethTransactionData(contract, dataType, address, pageNum, pageSize, success);
break;
case 'TRX':
this.trxTransactionData(contract, dataType, address, pageNum, pageSize, success);
break;
}
},
ethTransactionData: function(contract, dataType, address, pageNum, pageSize, success) {
let dataList = [];
if (!contract) {
uni.request({
url: 'http://scan.weirui0755.com/eth/api/eth/address/normal/' + address + '/' +
pageNum +
'/' + pageSize, //请求接口
header: {
'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
},
success: (res) => {
console.log(res, 1234654)
if (res.data.code === 1) {
var data = res.data.data;
for (let i = 0; i < data.length; i++) {
if (!data[i].toAlias) {
if ((data[i].from != address && dataType == 'send') || (data[i]
.to != address && dataType == 'receive')) {
continue;
}
var transactionData = {
value: data[i].value,
from: data[i].from,
to: data[i].to,
fee: data[i].fee,
txid: data[i].txid,
confirmations: data[i].confirmations,
block_no: data[i].block_no,
time: index.formatyymmddhhmmss33(data[i].time * 1000)
}
if (data[i].from === 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 newaddress = data[i].from;
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(
newaddress.length-6,
newaddress.length)
transactionData.address = newaddress;
transactionData.type = 'in';
}
dataList.push(transactionData)
}
}
}
success(dataList)
},
error: (res) => {
success(dataList)
}
});
} else {
uni.request({
url: 'http://scan.weirui0755.com/eth/api/eth/address/tokentrans/' + address + '/' +
contract + '/' + pageNum +
'/' + pageSize, //请求接口
header: {
'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
},
success: (res) => {
console.log(res, 1234654)
if (res.data.code === 1) {
var data = res.data.data;
for (let i = 0; i < data.length; i++) {
if (!data[i].toAlias) {
if ((data[i].from != address && dataType == 'send') || (data[i]
.to != address && dataType == 'receive')) {
continue;
}
var transactionData = {
value: data[i].value / Math.pow(10, data[i].tokenDecimals),
from: data[i].from,
to: data[i].to,
txid: data[i].txid,
fee: data[i].fee,
confirmations: data[i].conformations,
block_no: data[i].block_no,
time: index.formatyymmddhhmmss33(data[i].time * 1000)
}
if (data[i].from === 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 newaddress = data[i].from;
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(
newaddress.length-6,
newaddress.length)
transactionData.address = newaddress;
transactionData.type = 'in';
}
dataList.push(transactionData)
}
}
}
success(dataList)
}
});
}
}
,
trxTransactionData: function(contract, dataType, address, pageNum, pageSize, success) {
let dataList = [];
let add = address
if (contract == null || contract == '') {
uni.request({
url: 'http://scan.weirui0755.com/trx/api/trx/address/normal/' + address + '/' +
pageNum +
'/' + pageSize, //请求接口
header: {
'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
},
success: (res) => {
console.log(res.data.code)
if (res.data.code === 1) {
var data = res.data.data;
for (let i = 0; i < data.length; i++) {
if ((data[i].from != address && dataType == 'send') || (data[i]
.to != address && dataType == 'receive') || data[i].tType !=
'Transfer') {
continue;
}
var transactionData = {
value: data[i].value,
from: data[i].from,
to: data[i].to,
fee: data[i].fee,
txid: data[i].txid,
confirmations: data[i].confirmations,
block_no: data[i].block_no,
time: index.formatyymmddhhmmss33(data[i].time * 1000)
}
if (data[i].from === 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 newaddress = data[i].from
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(newaddress.length-6,
newaddress.length);
transactionData.address = newaddress;
transactionData.type = 'in';
}
console.log(transactionData.address, 123456)
dataList.push(transactionData)
}
}
success(dataList)
}
});
} else {
uni.request({
url: 'http://scan.weirui0755.com/trx/api/trx/address/tokentrans/' + address + '/' +
contract + '/' + pageNum +
'/' + pageSize, //请求接口
header: {
'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
},
success: (res) => {
console.log(res, 12346545555)
console.log(dataType, 5555555555)
if (res.data.code === 1) {
var data = res.data.data;
for (let i = 0; i < data.length; i++) {
console.log(!data[i].toAlias, 5555555555,data[i].to == add)
if ((data[i].to == add && dataType == 'send') || (data[i]
.from == add && dataType == 'receive')) {
continue;
}
var transactionData = {
value: data[i].value / Math.pow(10, data[i].tokenDecimals),
from: data[i].from,
to: data[i].to,
txid: data[i].txid,
fee: data[i].fee,
confirmations: data[i].conformations,
block_no: data[i].block_no,
time: index.formatyymmddhhmmss33(data[i].time * 1000)
}
if (data[i].from === 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 newaddress = data[i].from
newaddress = newaddress.substring(0, 6) + '...' + newaddress.substring(
newaddress.length-6,
newaddress.length);
transactionData.address = newaddress;
transactionData.type = 'in';
}
dataList.push(transactionData)
}
}
success(dataList)
}
});
}
}
}
export default DataUtil

8
utils/SystemConfiguration.js

@ -2,12 +2,12 @@ let isTest = true;
const constant = isTest ? {
//服务端连接
serverUrl: 'http://wallet-api.weirui0755.com'
serverUrl: 'http://wallet-api.weirui0755.com',
coinTickerWs:'ws://wallet-quartz.weirui0755.com/websocket'
} : {
//服务端连接
serverUrl: 'http://wallet-api.weirui0755.com'
serverUrl: 'http://wallet-api.weirui0755.com',
coinTickerWs:'ws://wallet-quartz.weirui0755.com/websocket'
}
export default {

3
utils/api.js

@ -10,7 +10,8 @@ const api = {
getContractInfoList: (params) => Vue.prototype.$axios.get('/api/contract/getContractInfoList?' + qs.stringify(params)),
//获取汇率
getCoinRate: (params) => Vue.prototype.$axios.get('/api/coinRate/getCoinRate?' + qs.stringify(params)),
getChainDataList: (params) => Vue.prototype.$axios.get('/api/chainData/getChainDataList?' + qs.stringify(params)),
getCoinTickerList: (params) => Vue.prototype.$axios.get('/api/coinTicker/getCoinTickerList'),
//--------------------------------- free ---------------------------------
}

2
utils/locales/en.js

@ -143,7 +143,7 @@ export default {
CopySuccessful:'Copy address Successful!',
// transfer
Transfer:'Transfer',
AdressBook:'Adress Book',
AddressBook:'Address Book',
Transferamount:'Transfer amount',
Balance:'Balance',
ALL:"ALL",

Loading…
Cancel
Save