Browse Source

修改

master
vee 4 years ago
parent
commit
45fd6b3b24
  1. 3
      manifest.json
  2. 15
      package-lock.json
  3. 1
      package.json
  4. 14
      pages.json
  5. 381
      pages/menu/sendToken/addAddress/index2.vue
  6. 44
      pages/menu/sendToken/address/index.vue
  7. 314
      pages/menu/sendToken/address/index2.vue
  8. 12
      pages/menu/sendToken/transfer/index.vue
  9. 2
      pages/menu/setting/currency/index.vue
  10. 8
      pages/menu/setting/index.vue
  11. 4
      pages/menu/wallet/cwallet/index.vue
  12. 2
      pages/menu/wallet/index.vue
  13. 4
      unpackage/dist/dev/app-plus/app-config-service.js
  14. 59287
      unpackage/dist/dev/app-plus/app-service.js
  15. 35564
      unpackage/dist/dev/app-plus/app-view.js
  16. 24
      utils/EthUtil.js
  17. 6
      utils/SystemConfiguration.js
  18. 86
      utils/axios.js

3
manifest.json

@ -5,6 +5,9 @@
"versionName" : "1.0",
"versionCode" : "100",
"transformPx" : false,
"networkTimeout": {
"request": 10000 //()
},
/* 5+App */
"app-plus" : {
// h5+runtime

15
package-lock.json

@ -2393,11 +2393,24 @@
"resolved": "https://registry.nlark.com/next-tick/download/next-tick-1.0.0.tgz",
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
},
"node": {
"version": "17.1.0",
"resolved": "https://registry.npmmirror.com/node/download/node-17.1.0.tgz",
"integrity": "sha512-1gg810R7sKtFkCYMdIhOyYDCuRJZyLvP+lTX8Z9AMAiUdHPoeNu0KQN59CzBud5L/vMtFPkbsCwWOy1aTYOL8g==",
"requires": {
"node-bin-setup": "^1.0.0"
}
},
"node-addon-api": {
"version": "2.0.2",
"resolved": "https://registry.nlark.com/node-addon-api/download/node-addon-api-2.0.2.tgz",
"integrity": "sha1-Qyz6gpYs5JSxMunXKhWyn3H/XTI="
},
"node-bin-setup": {
"version": "1.0.6",
"resolved": "https://registry.npm.taobao.org/node-bin-setup/download/node-bin-setup-1.0.6.tgz",
"integrity": "sha1-S1ybuTfs5wLXBps2ynivRoRndSg="
},
"node-gyp-build": {
"version": "4.3.0",
"resolved": "https://registry.nlark.com/node-gyp-build/download/node-gyp-build-4.3.0.tgz?cache=0&sync_timestamp=1631436711963&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fnode-gyp-build%2Fdownload%2Fnode-gyp-build-4.3.0.tgz",
@ -2761,7 +2774,7 @@
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.nlark.com/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1618847119601&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz",
"resolved": "https://registry.nlark.com/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1622604551741&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz",
"integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc="
},
"send": {

1
package.json

@ -21,6 +21,7 @@
"ethereumjs-tx": "^1.3.7",
"ethers": "^5.5.1",
"js-md5": "^0.7.3",
"node": "^17.1.0",
"tki-qrcode": "^0.1.6",
"tronweb": "^3.2.6",
"vue-clipboard2": "^0.3.3",

14
pages.json

@ -191,12 +191,7 @@
}
},
{
"path": "pages/menu/sendToken/addAddress/index2",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/menu/profile/index",
@ -211,12 +206,7 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/menu/sendToken/address/index2",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/menu/sendToken/address/index",
"style": {

381
pages/menu/sendToken/addAddress/index2.vue

@ -1,381 +0,0 @@
<template>
<view class="hr">
<navigation :showBack="true" :bgnum="true">
<text class="big_title">
{{i18n.Addaddress}}
</text>
</navigation>
<view class="main">
<view class="main_con">
<view class="item">
<view class="top flex">
<view class="text1">
{{i18n.curr}}
</view>
</view>
<view class="inputcon">
<input type="text" value="" v-model="value"
placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="Please select the currency" class="input1" @click="showSelect()"
:disabled="true" />
<image src="../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="img1">
</image>
</view>
</view>
<view class="item">
<view class="top flex">
<view class="text1">
{{i18n.Address}}
</view>
</view>
<view class="inputcon">
<input type="text" value="" @input="showSave()"
placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="Please enter the recipient address" class="input1" v-model="bigAddress" />
<image src="../../../../static/tongyonh/Frame330.png" mode="aspectFit" class="img2"
@click="chooseImage"></image>
</view>
</view>
<view class="item">
<view class="top flex">
<view class="text1">
{{i18n.Name}}
</view>
</view>
<view class="inputcon">
<input type="text" @input="showSave" value=""
placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="Please enter the name"
class="input1" v-model="addressName" />
</view>
</view>
<view class="btn" @click="handove()" :class="save?'sheng':''">
{{i18n.Save}}
</view>
</view>
<u-mask z-index="10" :show="show" @click="show = false"></u-mask>
</view>
<view class="big_con w100" v-if="show">
<view class="tiao" @click="show=false,value=''"></view>
<view class="title">
{{i18n.selectcurrency}}
</view>
<view class="bottom_con zindex" v-if="show">
<u-radio-group v-model="value">
<view class="item flex" v-for="(item, index) in list" :key="index" @click="handove2(item,index)">
<view class="text1 flex">
<image :src="item.url" mode="aspectFit" class="img"></image>
<view class="textcon">
<view class="text1">
{{item.lang}}
</view>
<view class="text2">
{{item.name}}
</view>
</view>
</view>
<u-radio :name="item.name" :disabled="item.disabled" active-color="#5B53FF">
</u-radio>
</view>
</u-radio-group>
<view class="select_btn" @click="selectA">
{{i18n.langSelect}}
</view>
</view>
</view>
</view>
</template>
<script>
import cont from "@/components/navigation/navigation.vue"
export default {
data() {
return {
info: {},
addressName: '',
bigAddress: '',
save: false,
show: false,
checked: false,
list: [{
url: '../../../../static/tongyonh/bye.png',
lang: 'Bitcoin',
disabled: false,
name: "BTC"
},
{
url: '../../../../static/tongyonh/Frame3299.png',
lang: 'Ethereum',
disabled: false,
name: "ETH"
},
{
url: '../../../../static/tongyonh/tron1.png',
lang: 'Tron',
disabled: false,
name: "TRX"
},
],
// u-radio-groupv-modelradioname
value: '',
transfer:'',
}
},
onLoad() {
},
computed: {
i18n() {
return this.$t('index')
},
},
methods: {
selectA() {
this.show = false
},
//
chooseImage() {
var _this = this
uni.chooseImage({
count: 1, //9
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //
success: function(res) {
_this.imgShow = res.tempFilePaths[0]
}
});
},
handove2(item, index) {
this.value = item.name;
this.show = false;
},
showSave() {
if (this.bigAddress != '' && this.name != '' && this.value != '') {
this.save = true;
} else {
this.save = false;
}
},
handove(item) {
if (this.value == '') {
this.save = false
uni.showToast({
title: 'Please select a currency',
icon: 'none',
duration: 1500
})
return;
}
if (this.bigAddress == '' || this.addressName == '') {
this.save = false
uni.showToast({
title: 'Address or name cannot be empty',
icon: 'none',
duration: 1500
})
return;
}
if (this.value == 'BTC') {
console.log(uni.getStorageSync('BTCAddressInfo'), 777)
if (uni.getStorageSync('BTCAddressInfo').length > 0) {
let btc = new Object;
btc.address = this.bigAddress;
btc.name = this.addressName
btc.coinList = [{
name: "BTC",
name2: "BTC",
xname: 'Bitcoin',
icon: require('@/static/tongyonh/bye.png')
}];
let BTCAddressInfo = []
BTCAddressInfo = uni.getStorageSync('BTCAddressInfo')
BTCAddressInfo.push(btc)
uni.setStorageSync('BTCAddressInfo', BTCAddressInfo)
console.log(BTCAddressInfo, 1111)
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 1500
})
uni.reLaunch({
url: '../address/index2'
})
} else {
let btc = new Object;
btc.address = this.bigAddress;
btc.name = this.addressName
btc.coinList = [{
name: "BTC",
name2: "BTC",
xname: 'Bitcoin',
icon: require('@/static/tongyonh/bye.png')
}];
console.log(btc, 4444)
let BTCAddressInfo = []
BTCAddressInfo.push(btc)
console.log(BTCAddressInfo, 4444)
uni.setStorageSync('BTCAddressInfo', BTCAddressInfo)
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 1500
})
setTimeout(() => {
uni.reLaunch({
url: '../address/index2'
})
}, 1500)
}
}
if (this.value == 'ETH') {
console.log(uni.getStorageSync('ETHAddressInfo'), 777)
if (uni.getStorageSync('ETHAddressInfo').length > 0) {
let eth = new Object;
eth.address = this.bigAddress;
eth.name = this.addressName
eth.coinList = [{
name: "ETH",
name2: "ETH",
xname: 'Ethereum',
icon: require('@/static/tongyonh/Frame3299.png')
}];
let ETHAddressInfo = []
ETHAddressInfo = uni.getStorageSync('ETHAddressInfo')
ETHAddressInfo.push(eth)
uni.setStorageSync('ETHAddressInfo', ETHAddressInfo)
console.log(ETHAddressInfo, 1111)
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 1500
})
setTimeout(() => {
uni.reLaunch({
url: '../address/index2'
})
}, 1500)
} else {
let eth = new Object;
eth.address = this.bigAddress;
eth.name = this.addressName
eth.coinList = [{
name: "ETH",
name2: "ETH",
xname: 'Ethereum',
icon: require('@/static/tongyonh/Frame3299.png')
}];
console.log(eth, 4444)
let ETHAddressInfo = []
ETHAddressInfo.push(eth)
console.log(ETHAddressInfo, 4444)
uni.setStorageSync('ETHAddressInfo', ETHAddressInfo)
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 1500
})
setTimeout(() => {
uni.reLaunch({
url: '../address/index2'
})
}, 1500)
}
}
if (this.value == 'TRX') {
console.log(uni.getStorageSync('TRXAddressInfo'), 777)
if (uni.getStorageSync('TRXAddressInfo').length > 0) {
let trx = new Object;
trx.address = this.bigAddress;
trx.name = this.addressName
trx.coinList = [{
name: "TRX",
name2: "TRX",
xname: 'TRON',
icon: require('@/static/tongyonh/tron1.png')
}];
let TRXAddressInfo = []
TRXAddressInfo = uni.getStorageSync('TRXAddressInfo')
TRXAddressInfo.push(trx)
uni.setStorageSync('TRXAddressInfo', TRXAddressInfo)
console.log(TRXAddressInfo, 1111)
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 1500
})
setTimeout(() => {
uni.reLaunch({
url: '../address/index2'
})
}, 1500)
} else {
let trx = new Object;
trx.address = this.bigAddress;
trx.name = this.addressName
trx.coinList = [{
name: "TRX",
name2: "TRX",
xname: 'TRON',
icon: require('@/static/tongyonh/tron1.png')
}];
console.log(trx, 4444)
let TRXAddressInfo = []
TRXAddressInfo.push(trx)
console.log(TRXAddressInfo, 4444)
uni.setStorageSync('TRXAddressInfo', TRXAddressInfo)
uni.showToast({
title: 'Successfully',
icon: 'success',
duration: 1500
})
setTimeout(() => {
uni.reLaunch({
url: '../address/index2'
})
}, 1500)
}
}
},
showSelect() {
this.show = true;
},
}
};
</script>
<style scoped>
page {
background: #FAFAFA;
height: 100%;
}
</style>
<style>
@import './index.css';
</style>

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

@ -11,7 +11,7 @@
<view class="main">
<view class="big_item">
<view class="item flex" v-for="(item,index) in BTCAddressInfo" @click="goTransfer(item)">
<view class="item flex" v-for="(item,index) in BTCAddressInfo" @click="goTransfer(item.address)">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
@ -37,16 +37,16 @@
<view class="itemm flexx" @click.stop="editItem(index)">
<image src="../../../../static/tongyonh/create_24px.png" mode="aspectFit" class="img">
</image>
{{i18n.edit}}
{{i18n.edit}}
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
{{i18n.Delete}}
{{i18n.Delete}}
</view>
</view>
</view>
<view class="item flex" v-for="(item,index) in ETHAddressInfo" @click="goTransfer(item)">
<view class="item flex" v-for="(item,index) in ETHAddressInfo" @click="goTransfer(item.address)">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
@ -71,11 +71,11 @@
<view class="itemm flexx" @click.stop="editItem(index)">
<image src="../../../../static/tongyonh/create_24px.png" mode="aspectFit" class="img">
</image>
{{i18n.edit}}
{{i18n.edit}}
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
{{i18n.Delete}}
{{i18n.Delete}}
</view>
</view>
</view>
@ -84,7 +84,7 @@
<view class="item flex" v-for="(item,index) in TRXAddressInfo" @click="goTransfer(item)">
<view class="item flex" v-for="(item,index) in TRXAddressInfo" @click="goTransfer(item.address)">
<view class="textcon flex">
<view class="bigcon">
<view class="textimg flexx">
@ -113,7 +113,7 @@
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
{{i18n.Delete}}
{{i18n.Delete}}
</view>
</view>
</view>
@ -150,7 +150,7 @@
export default {
data() {
return {
sourcePage:'',
sourcePage: '',
ethIndex: 0,
btcIndex: 0,
trxIndex: 0,
@ -162,7 +162,7 @@
itemCoin: '',
itemAddress: '',
info: {},
transfer: '',
isSelect: false,
show: false,
show2: false,
show3: false,
@ -191,25 +191,27 @@
},
methods: {
//
goTransfer(item) {
console.log(this.transfer,12316546)
if (this.transfer) {
uni.setStorageSync('myTransAddress', item)
goTransfer(address) {
if (this.isSelect) {
let transInfoPass = uni.getStorageSync('transInfoPass')
transInfoPass.toAddress = address
uni.setStorageSync('transInfoPass',transInfoPass)
uni.navigateTo({
url: '../transfer/index'
url: '../transfer/index?item=address'
})
}
},
back() {
uni.removeStorageSync("sourcePage")
if(this.sourcePage){
if (this.sourcePage) {
uni.reLaunch({
url: this.sourcePage
})
}else{
} else {
uni.navigateBack({
})
}
@ -303,11 +305,11 @@
}
},
onLoad(item) {
this.sourcePage=uni.getStorageSync('sourcePage')
this.sourcePage = uni.getStorageSync('sourcePage')
//
if (item.item) {
this.transfer = item.item
this.isSelect = true;
}

314
pages/menu/sendToken/address/index2.vue

@ -1,314 +0,0 @@
<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>
<text class="big_title">
{{i18n.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>
<view class="text1">
{{item.address}}
</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>
{{i18n.edit}}
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
{{i18n.Delete}}
</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>
<view class="text1">
{{item.address}}
</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>
{{i18n.edit}}
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
{{i18n.Delete}}
</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>
<view class="text1">
{{item.address}}
</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>
{{i18n.edit}}
</view>
<view class="itemm flexx red" @click.stop="deleteItem()">
<image src="../../../../static/tongyonh/trash.png" mode="aspectFit" class="img"></image>
{{i18n.Delete}}
</view>
</view>
</view>
</view>
<view class="info_con green" v-if="showImte">
<view class="text">
{{itemCoin}} {{itemAddress}}
</view>
<view class="text text2">
{{i18n.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>
</template>
<script>
import cont from "@/components/navigation/navigation.vue"
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: [
{
name: 'Single address',
checked: true,
disabled: false
},
{
name: 'Batch add 10 addresses',
checked: false,
disabled: false
},
{
name: 'Batch add 50 addresses',
checked: false,
disabled: false
}
]
}
},
computed: {
i18n() {
return this.$t('index')
},
},
methods: {
//
goTransfer(item){
if(this.transfer){
uni.setStorageSync('myTransAddress',item)
uni.navigateTo({
url:'../transfer/index'
})
}
},
back(){
uni.navigateTo({
url:'/pages/menu/sendToken/transfer/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
}
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)
}
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)
}
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)
}
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/index2'
})
}
},
onLoad(item) {
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('TRXAddressInfo').length>0){
this.TRXAddressInfo=uni.getStorageSync('TRXAddressInfo')
console.log(this.TRXAddressInfo,777)
}
}
};
</script>
<style scoped>
page {
background: #FAFAFA;
height: 100%;
}
</style>
<style>
@import './index.css';
</style>

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

@ -611,13 +611,19 @@
goAddress(text) {
uni.setStorageSync('transInfoPass',this.transInfoPass)
uni.navigateTo({
url: '../address/index2'
url: '../address/index?item=transfer'
})
}
},
onLoad() {
onLoad(a) {
if(a.item){
this.transInfoPass=uni.getStorageSync('transInfoPass');
}else{
uni.removeStorageSync('transInfoPass')
}
this.coin = uni.getStorageSync('coin')
if (this.coin.balancePrice) {

2
pages/menu/setting/currency/index.vue

@ -1,7 +1,7 @@
<template>
<view class="">
<navigation :showBack="true" :bgnum="true">
Language
Currency
</navigation>
<view class="main">
<view class="main_con">

8
pages/menu/setting/index.vue

@ -22,7 +22,7 @@
<image src="../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="img1"></image>
</view>
</view>
<view class="item flex">
<view class="item flex" @click="goCurr()">
<view class="text1">
{{i18n.curr}}
</view>
@ -99,6 +99,11 @@
uni.navigateTo({
url:'./lang/index'
})
},
goCurr(){
uni.navigateTo({
url:'./currency/index'
})
},
//
cancel_hou(){
@ -273,6 +278,7 @@
if(uni.getStorageSync('fingerPass')){
this.checked=uni.getStorageSync('fingerPass')
}
},
computed: {

4
pages/menu/wallet/cwallet/index.vue

@ -123,8 +123,10 @@
},
onLoad() {
async onLoad() {
// this.$walletUtil.updateBalance();
//var a=await this.$EthUtil.getBalance('0x6a851246689eb8fc77a9bf68df5860f13f679fa0');
// console.log(a)
this.setStorage()
if(uni.getStorageSync('walleti')){
//

2
pages/menu/wallet/index.vue

@ -104,6 +104,7 @@
this.isStop = true
},
onLoad() {
//
this.userObj = uni.getStorageSync('wallet');
let that = this;
@ -126,6 +127,7 @@
// },
methods: {
goOther() {
uni.navigateTo({
url: 'otherCoin/index'
})

4
unpackage/dist/dev/app-plus/app-config-service.js

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

24
utils/EthUtil.js

@ -1,4 +1,5 @@
import abi from 'utils/EthAbi.js'
import systemConfiguration from 'utils/SystemConfiguration.js'
const Web3 = require('web3');
const Tx = require('ethereumjs-tx');
let web3;
@ -6,13 +7,14 @@ let web3;
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"));
web3 = new Web3(new Web3.providers.HttpProvider(systemConfiguration.constant.ethNode));
}
let eth = {
// //获取主币eth余额
// getBalance: async function(address, type) {
// getBalance: async function(address) {
// web3 = new Web3(new Web3.providers.HttpProvider(systemConfiguration.constant.ethNode));
// let balance = await web3.eth.getBalance(address);
// console.log("余额:",balance)
// return Number(balance) / Math.pow(10, 18);
@ -37,7 +39,7 @@ let eth = {
},
//获取主币eth余额
getBalance: function(address,success) {
getBalance:async function(address) {
web3 = new Web3();
const data = {
'jsonrpc': '2.0',
@ -45,20 +47,14 @@ let eth = {
'method': 'eth_getBalance',
'params': [address, "latest"]
};
uni.request({
url: 'https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161', //仅为示例,并非真实接口地址。
let res =await uni.request({
url: 'http://47.245.25.82:8545', //仅为示例,并非真实接口地址。
method: 'POST',
data: data,
dataType: 'json',
success: (res) => {
console.log()
let balance = Number(web3.utils.hexToNumberString(res['data']['result'])) / Math.pow(10, 18)
console.log(balance,45465465)
success(balance)
}
});
dataType: 'json'});
try {
let web3 = new Web3();
let balance = Number(web3.utils.hexToNumberString(res[1].data.result)) / Math.pow(10, 18)
console.log(balance,45465465)
return balance
} catch (e) {

6
utils/SystemConfiguration.js

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

86
utils/axios.js

@ -4,7 +4,7 @@ import SystemConfiguration from './SystemConfiguration.js';
let baseURL = SystemConfiguration.constant
const service = axios.create({
withCredentials: false, //表示跨域请求时是否需要使用凭证
withCredentials: false, //表示跨域请求时是否需要使用凭证
crossDomain: true,
// baseURL,
timeout: 160000
@ -13,7 +13,7 @@ const service = axios.create({
// request请求拦截器,在请求之前做一些处理
service.interceptors.request.use(
config => {
console.log('请求之前成功',config.url)
console.log(config)
uni.showLoading({
title: 'loading',
@ -22,14 +22,14 @@ service.interceptors.request.use(
console.log('============================')
// if (config.urlType=='eth') {
// config.url = config.url
// } else {
// config.url = baseURL.serverUrl + config.url
// }
config.baseURL=baseURL.serverUrl
config.baseURL = baseURL.serverUrl
config.url = config.url
// if (token) {
// // config.headers['Authori-zation'] = token
// config.headers['Authorization'] = token
@ -39,7 +39,7 @@ service.interceptors.request.use(
// // 给请求头添加user-token
// config.headers["user-token"] = store.state.token;
// }
return config;
},
error => {
@ -50,7 +50,7 @@ service.interceptors.request.use(
// 配置成功后的响应拦截器
service.interceptors.response.use(res => {
uni.hideLoading()
uni.hideLoading()
console.log(res)
if (res.status == 200) {
return res.data
@ -72,42 +72,44 @@ service.interceptors.response.use(res => {
// 在main.js中放入这段自定义适配器的代码,就可以实现uniapp的app和小程序开发中能使用axios进行跨域网络请求,并支持携带cookie
axios.defaults.adapter = function(config) { //自己定义个适配器,用来适配uniapp的语法
return new Promise((resolve, reject) => {
console.log(config,'我请求的')
var settle = require('axios/lib/core/settle');
var buildURL = require('axios/lib/helpers/buildURL');
uni.request({
method: config.method.toUpperCase(),
url: config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer),
return new Promise((resolve, reject) => {
header: config.headers,
data: config.data,
dataType: config.dataType,
responseType: config.responseType,
sslVerify: config.sslVerify,
complete: function complete(response) {
//console.log("执行完成:",config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer),response.data)
response = {
data: response.data,
status: response.statusCode,
errMsg: response.errMsg,
header: response.header,
config: config
};
console.log(config, '我请求的',config)
var settle = require('axios/lib/core/settle');
var buildURL = require('axios/lib/helpers/buildURL');
settle(resolve, reject, response);
},
fail:res =>{
uni.showToast({
title: res,
icon:'none',
duration: 1500
})
}
})
})
uni.request({
method: config.method.toUpperCase(),
url: config.baseURL + '/' + buildURL(config.url, config.params, config
.paramsSerializer),
header: config.headers,
data: config.data,
dataType: config.dataType,
responseType: config.responseType,
sslVerify: config.sslVerify,
complete: function complete(response) {
//console.log("执行完成:",config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer),response.data)
response = {
data: response.data,
status: response.statusCode,
errMsg: response.errMsg,
header: response.header,
config: config
};
settle(resolve, reject, response);
},
fail: res => {
uni.hideLoading()
uni.showToast({
title: res,
icon: 'none',
duration: 1500
})
}
})
})
}
export default service

Loading…
Cancel
Save