Browse Source

下拉刷新

master
vee 4 years ago
parent
commit
fd50283974
  1. 9
      pages/menu/about/index.vue
  2. 781
      pages/menu/sendToken/addAddress2/index.vue
  3. 6
      pages/menu/wallet/index.vue
  4. 16
      unpackage/dist/dev/app-plus/app-service.js
  5. 2
      unpackage/dist/dev/app-plus/app-view.js
  6. 33
      utils/EthUtil.js
  7. 3
      utils/TronUtil.js
  8. 10
      utils/WalletUtil.js
  9. 44
      utils/locales/zh-F.js
  10. 20
      utils/locales/zh.js

9
pages/menu/about/index.vue

@ -57,7 +57,7 @@
export default { export default {
data() { data() {
return { return {
version:'1.0.0' version: '1.0.0'
}; };
}, },
computed: { computed: {
@ -67,7 +67,12 @@
}, },
onLoad() { onLoad() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.version=plus.runtime.versionName; let that=this
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
console.log(wgtinfo,123132)
that.version = wgtinfo.version;
})
// #endif // #endif
}, },
methods: { methods: {

781
pages/menu/sendToken/addAddress2/index.vue

@ -2,92 +2,95 @@
<view class="hr"> <view class="hr">
<navigation :showBack="true" :bgnum="true"> <navigation :showBack="true" :bgnum="true">
<text class="big_title"> <text class="big_title">
{{i18n.Addaddress}} {{i18n.Addaddress}}
</text> </text>
</navigation> </navigation>
<view class="main"> <view class="main">
<view class="main_con"> <view class="main_con">
<view class="item"> <view class="item">
<view class="top flex"> <view class="top flex">
<view class="text1"> <view class="text1">
{{i18n.curr}} {{i18n.curr}}
</view> </view>
</view> </view>
<view class="inputcon"> <view class="inputcon">
<input type="text" value="" v-model="value" placeholder-style="font-size: 30rpx; color: #D0D0D2;" :placeholder="teee1" class="input1" @click="showSelect()" :disabled="true"/> <input type="text" value="" v-model="value"
<image src="../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="img1"></image> placeholder-style="font-size: 30rpx; color: #D0D0D2;" :placeholder="teee1" class="input1"
</view> @click="showSelect()" :disabled="true" />
</view> <image src="../../../../static/tongyonh/chevron_right_24px.png" mode="aspectFit" class="img1">
</image>
</view>
</view>
<view class="item"> <view class="item">
<view class="top flex"> <view class="top flex">
<view class="text1"> <view class="text1">
{{i18n.Address}} {{i18n.Address}}
</view> </view>
</view> </view>
<view class="inputcon"> <view class="inputcon">
<input type="text" value="" @input="showSave()" placeholder-style="font-size: 30rpx; color: #D0D0D2;" :placeholder="teee2" class="input1" v-model="bigAddress"/> <input type="text" value="" @input="showSave()"
<image src="../../../../static/tongyonh/Frame330.png" mode="aspectFit" class="img2" @click="chooseImage"></image> placeholder-style="font-size: 30rpx; color: #D0D0D2;" :placeholder="teee2" class="input1"
</view> v-model="bigAddress" />
<image src="../../../../static/tongyonh/Frame330.png" mode="aspectFit" class="img2"
@click="chooseImage"></image>
</view>
</view> </view>
<view class="item"> <view class="item">
<view class="top flex"> <view class="top flex">
<view class="text1"> <view class="text1">
{{i18n.Name}} {{i18n.Name}}
</view> </view>
</view> </view>
<view class="inputcon"> <view class="inputcon">
<input type="text" @input="showSave" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" :placeholder="teee3" class="input1" v-model="addressName"/> <input type="text" @input="showSave" value=""
</view> placeholder-style="font-size: 30rpx; color: #D0D0D2;" :placeholder="teee3" class="input1"
</view> v-model="addressName" />
</view>
</view>
<view class="btn" @click="handove()" :class="save?'sheng':''"> <view class="btn" @click="handove()" :class="save?'sheng':''">
{{i18n.Save}} {{i18n.Save}}
</view> </view>
</view> </view>
<u-mask z-index="10" :show="show" @click="show = false"></u-mask> <u-mask z-index="10" :show="show" @click="show = false"></u-mask>
</view> </view>
<view class="big_con w100" v-if="show"> <view class="big_con w100" v-if="show">
<view class="tiao" @click="show=false"></view> <view class="tiao" @click="show=false"></view>
<view class="title"> <view class="title">
{{i18n.selectcurrency}} {{i18n.selectcurrency}}
</view> </view>
<view class="bottom_con zindex" v-if="show"> <view class="bottom_con zindex" v-if="show">
<u-radio-group v-model="value" > <u-radio-group v-model="value">
<view class="item flex" v-for="(item, index) in list" :key="index" @click="handove2(item)"> <view class="item flex" v-for="(item, index) in list" :key="index" @click="handove2(item)">
<view class="text1 flex"> <view class="text1 flex">
<image :src="item.url" mode="aspectFit" class="img"></image> <image :src="item.url" mode="aspectFit" class="img"></image>
<view class="textcon"> <view class="textcon">
<view class="text1"> <view class="text1">
{{item.lang}} {{item.lang}}
</view> </view>
<view class="text2"> <view class="text2">
{{item.name}} {{item.name}}
</view> </view>
</view> </view>
</view>
<u-radio :name="item.name" :disabled="item.disabled" active-color="#5B53FF">
</u-radio>
</view> </view>
<u-radio </u-radio-group>
<view class="select_btn">
:name="item.name" {{i18n.langSelect}}
:disabled="item.disabled" </view>
active-color="#5B53FF"
>
</u-radio>
</view>
</u-radio-group>
<view class="select_btn">
{{i18n.langSelect}}
</view> </view>
</view> </view>
</view> </view>
</view>
@ -98,52 +101,51 @@
export default { export default {
data() { data() {
return { return {
AddressInfo:{}, AddressInfo: {},
teee1:this.$t('index').selectcurrency, teee1: this.$t('index').selectcurrency,
teee2:this.$t('index').Pleaserecipientaddress, teee2: this.$t('index').Pleaserecipientaddress,
teee3:this.$t('index').enterthename, teee3: this.$t('index').enterthename,
info:{}, info: {},
addressName:'', addressName: '',
value:'', value: '',
bigAddress:'', bigAddress: '',
save:true, save: true,
AddressIndex:-1, AddressIndex: -1,
gai:{}, gai: {},
show: false, show: false,
checked: false, checked: false,
list: [ list: [{
{ url: '../../../../static/tongyonh/bye.png',
url:'../../../../static/tongyonh/bye.png', lang: 'Bitcoin',
lang:'Bitcoin', disabled: false,
disabled: false, name: "BTC"
name:"BTC" },
}, {
{ url: '../../../../static/tongyonh/Frame3299.png',
url:'../../../../static/tongyonh/Frame3299.png', lang: 'Ethereum',
lang:'Ethereum', disabled: false,
disabled: false, name: "ETH"
name:"ETH" },
}, {
{ url: '../../../../static/tongyonh/tron1.png',
url:'../../../../static/tongyonh/tron1.png', lang: 'Tron',
lang:'Tron', disabled: false,
disabled: false, name: "TRX"
name:"TRX" },
},
],
], // u-radio-groupv-modelradioname
// u-radio-groupv-modelradioname value: '',
value: '',
} }
}, },
onLoad() { onLoad() {
if(uni.getStorageSync('AddressInfo')){ if (uni.getStorageSync('AddressInfo')) {
this.info=uni.getStorageSync('AddressInfo') this.info = uni.getStorageSync('AddressInfo')
this.AddressInfo=uni.getStorageSync('AddressInfo') this.AddressInfo = uni.getStorageSync('AddressInfo')
this.addressName=this.AddressInfo.name this.addressName = this.AddressInfo.name
this.bigAddress=this.AddressInfo.address, this.bigAddress = this.AddressInfo.address,
this.value=uni.getStorageSync('AddressName') this.value = uni.getStorageSync('AddressName')
this.AddressIndex=uni.getStorageSync('AddressIndex') this.AddressIndex = uni.getStorageSync('AddressIndex')
} }
}, },
computed: { computed: {
@ -153,305 +155,306 @@ show: false,
}, },
methods: { methods: {
// //
chooseImage() { chooseImage() {
var _this = this var _this = this
uni.chooseImage({ uni.scanCode({
count: 1, //9
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //
success: function(res) { success: function(res) {
_this.imgShow = res.tempFilePaths[0] console.log('扫码内容', res.result)
_this.bigAddress = res.result;
} }
}); });
// ass() // ass()
}, },
handove2(item){ handove2(item) {
this.value=item.name; this.value = item.name;
this.show=false; this.show = false;
}, },
showSave(){ showSave() {
if(this.bigAddress!=''&&this.name!=''&&this.value!=''){ if (this.bigAddress != '' && this.name != '' && this.value != '') {
this.save=true; this.save = true;
}else{ } else {
this.save=false; this.save = false;
} }
}, },
handove(item){ handove(item) {
if(this.value==''){ if (this.value == '') {
this.save=false this.save = false
uni.showToast({ uni.showToast({
title: this.$t('index').selectcurrency, title: this.$t('index').selectcurrency,
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
return; return;
} }
if(this.bigAddress==''||this.addressName==''){ if (this.bigAddress == '' || this.addressName == '') {
this.save=false this.save = false
uni.showToast({ uni.showToast({
title: this.$t('index').Addressorname, title: this.$t('index').Addressorname,
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
return; return;
} }
if(this.info.coinList[0].name2=='TRX'){ if (this.info.coinList[0].name2 == 'TRX') {
this.$walletUtil.updateAddress(this.info.coinList[0].name2,this.value); this.$walletUtil.updateAddress(this.info.coinList[0].name2, this.value);
if(this.value=='ETH'){ if (this.value == 'ETH') {
this.gai = uni.getStorageSync('ETHAddressInfo') this.gai = uni.getStorageSync('ETHAddressInfo')
this.gai2 = uni.getStorageSync('TRXAddressInfo') this.gai2 = uni.getStorageSync('TRXAddressInfo')
var index=uni.getStorageSync('editIndex') var index = uni.getStorageSync('editIndex')
let eth=new Object; let eth = new Object;
eth.address=this.bigAddress; eth.address = this.bigAddress;
eth.name=this.addressName eth.name = this.addressName
eth.coinList=[{ eth.coinList = [{
name:"ETH", name: "ETH",
name2:"ETH", name2: "ETH",
xname:'Ethereum', xname: 'Ethereum',
icon:require('@/static/tongyonh/Frame3299.png') icon: require('@/static/tongyonh/Frame3299.png')
}]; }];
this.gai2.splice(index,1) this.gai2.splice(index, 1)
uni.setStorageSync('TRXAddressInfo',this.gai2) uni.setStorageSync('TRXAddressInfo', this.gai2)
this.gai.push(eth); this.gai.push(eth);
uni.setStorageSync('ETHAddressInfo',this.gai) uni.setStorageSync('ETHAddressInfo', this.gai)
uni.showToast({ uni.showToast({
title: this.$t('index').Successful, title: this.$t('index').Successful,
icon: 'success', icon: 'success',
duration: 1500 duration: 1500
}) })
uni.navigateTo({ uni.navigateTo({
url:'../address/index' url: '../address/index'
}) })
} }
if(this.value=='TRX'){ if (this.value == 'TRX') {
this.gai = uni.getStorageSync('TRXAddressInfo') this.gai = uni.getStorageSync('TRXAddressInfo')
var index=uni.getStorageSync('editIndex') var index = uni.getStorageSync('editIndex')
let trx=new Object; let trx = new Object;
trx.address=this.bigAddress; trx.address = this.bigAddress;
trx.name=this.addressName trx.name = this.addressName
trx.coinList=[{ trx.coinList = [{
name:"TRX", name: "TRX",
name2:"TRX", name2: "TRX",
xname:'TRON', xname: 'TRON',
icon:require('@/static/tongyonh/tron1.png') icon: require('@/static/tongyonh/tron1.png')
}];
this.gai[index]=trx;
uni.setStorageSync( 'TRXAddressInfo',this.gai)
uni.showToast({
title: this.$t('index').Successful,
icon: 'success',
duration: 1500
})
uni.navigateTo({
url:'../address/index'
})
}
if(this.value=='BTC'){
this.gai = uni.getStorageSync('BTCAddressInfo')
this.gai2 = uni.getStorageSync('TRXAddressInfo')
var index=uni.getStorageSync('editIndex')
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')
}]; }];
this.gai2.splice(index,1) this.gai[index] = trx;
uni.setStorageSync('TRXAddressInfo',this.gai2) uni.setStorageSync('TRXAddressInfo', this.gai)
this.gai.push(btc); uni.showToast({
uni.setStorageSync('BTCAddressInfo',this.gai) title: this.$t('index').Successful,
uni.showToast({ icon: 'success',
title: this.$t('index').Successful, duration: 1500
icon: 'success', })
duration: 1500 uni.navigateTo({
}) url: '../address/index'
uni.navigateTo({ })
url:'../address/index'
}) }
}
}
if (this.value == 'BTC') {
if(this.info.coinList[0].name2=='ETH'){ this.gai = uni.getStorageSync('BTCAddressInfo')
if(this.value=='TRX'){ this.gai2 = uni.getStorageSync('TRXAddressInfo')
this.gai = uni.getStorageSync('TRXAddressInfo') var index = uni.getStorageSync('editIndex')
this.gai2 = uni.getStorageSync('ETHAddressInfo') let btc = new Object;
var index=uni.getStorageSync('editIndex') btc.address = this.bigAddress;
let trx=new Object; btc.name = this.addressName
trx.address=this.bigAddress; btc.coinList = [{
trx.name=this.addressName name: "BTC",
name2: "BTC",
trx.coinList=[{ xname: 'Bitcoin',
name:"TRX", icon: require('@/static/tongyonh/bye.png')
name2:"TRX", }];
xname:'TRON', this.gai2.splice(index, 1)
icon:require('@/static/tongyonh/tron1.png') uni.setStorageSync('TRXAddressInfo', this.gai2)
}]; this.gai.push(btc);
this.gai2.splice(index,1) uni.setStorageSync('BTCAddressInfo', this.gai)
uni.setStorageSync('ETHAddressInfo',this.gai2) uni.showToast({
this.gai.push(trx); title: this.$t('index').Successful,
uni.setStorageSync('TRXAddressInfo',this.gai) icon: 'success',
uni.showToast({ duration: 1500
title: this.$t('index').Successful, })
icon: 'success', uni.navigateTo({
duration: 1500 url: '../address/index'
}) })
uni.navigateTo({ }
url:'../address/index' }
})
} if (this.info.coinList[0].name2 == 'ETH') {
if(this.value=='ETH'){ if (this.value == 'TRX') {
this.gai = uni.getStorageSync('ETHAddressInfo') this.gai = uni.getStorageSync('TRXAddressInfo')
var index=uni.getStorageSync('editIndex') this.gai2 = uni.getStorageSync('ETHAddressInfo')
let eth=new Object; var index = uni.getStorageSync('editIndex')
eth.address=this.bigAddress; let trx = new Object;
eth.name=this.addressName trx.address = this.bigAddress;
eth.coinList=[{ trx.name = this.addressName
name:"ETH",
name2:"ETH", trx.coinList = [{
xname:'Ethereum', name: "TRX",
icon:require('@/static/tongyonh/Frame3299.png') name2: "TRX",
}]; xname: 'TRON',
this.gai[index]=eth; icon: require('@/static/tongyonh/tron1.png')
uni.setStorageSync('ETHAddressInfo',this.gai) }];
uni.showToast({ this.gai2.splice(index, 1)
title: this.$t('index').Successful, uni.setStorageSync('ETHAddressInfo', this.gai2)
icon: 'success', this.gai.push(trx);
duration: 1500 uni.setStorageSync('TRXAddressInfo', this.gai)
}) uni.showToast({
uni.navigateTo({ title: this.$t('index').Successful,
url:'../address/index' icon: 'success',
}) duration: 1500
})
} uni.navigateTo({
url: '../address/index'
if(this.value=='BTC'){ })
this.gai = uni.getStorageSync('BTCAddressInfo') }
this.gai2 = uni.getStorageSync('ETHAddressInfo') if (this.value == 'ETH') {
var index=uni.getStorageSync('editIndex') this.gai = uni.getStorageSync('ETHAddressInfo')
let btc=new Object; var index = uni.getStorageSync('editIndex')
btc.address=this.bigAddress; let eth = new Object;
btc.name=this.addressName eth.address = this.bigAddress;
btc.coinList=[{ eth.name = this.addressName
name:"BTC", eth.coinList = [{
name2:"BTC", name: "ETH",
xname:'Bitcoin', name2: "ETH",
icon:require('@/static/tongyonh/bye.png') xname: 'Ethereum',
}]; icon: require('@/static/tongyonh/Frame3299.png')
this.gai2.splice(index,1) }];
uni.setStorageSync('ETHAddressInfo',this.gai2) this.gai[index] = eth;
this.gai.push(btc); uni.setStorageSync('ETHAddressInfo', this.gai)
uni.setStorageSync('BTCAddressInfo',this.gai) uni.showToast({
uni.showToast({ title: this.$t('index').Successful,
title: this.$t('index').Successful, icon: 'success',
icon: 'success', duration: 1500
duration: 1500 })
}) uni.navigateTo({
uni.navigateTo({ url: '../address/index'
url:'../address/index' })
})
} }
}
if (this.value == 'BTC') {
this.gai = uni.getStorageSync('BTCAddressInfo')
if(this.info.coinList[0].name2=='BTC'){ this.gai2 = uni.getStorageSync('ETHAddressInfo')
if(this.value=='TRX'){ var index = uni.getStorageSync('editIndex')
this.gai = uni.getStorageSync('TRXAddressInfo') let btc = new Object;
this.gai2 = uni.getStorageSync('BTCAddressInfo') btc.address = this.bigAddress;
var index=uni.getStorageSync('editIndex') btc.name = this.addressName
let trx=new Object; btc.coinList = [{
trx.address=this.bigAddress; name: "BTC",
trx.name=this.addressName name2: "BTC",
xname: 'Bitcoin',
trx.coinList=[{ icon: require('@/static/tongyonh/bye.png')
name:"TRX", }];
name2:"TRX", this.gai2.splice(index, 1)
xname:'TRON', uni.setStorageSync('ETHAddressInfo', this.gai2)
icon:require('@/static/tongyonh/tron1.png') this.gai.push(btc);
}]; uni.setStorageSync('BTCAddressInfo', this.gai)
this.gai2.splice(index,1) uni.showToast({
uni.setStorageSync('BTCAddressInfo',this.gai2) title: this.$t('index').Successful,
this.gai.push(trx); icon: 'success',
uni.setStorageSync('TRXAddressInfo',this.gai) duration: 1500
uni.showToast({ })
title: this.$t('index').Successful, uni.navigateTo({
icon: 'success', url: '../address/index'
duration: 1500 })
}) }
uni.navigateTo({ }
url:'../address/index'
})
} if (this.info.coinList[0].name2 == 'BTC') {
if(this.value=='BTC'){ if (this.value == 'TRX') {
this.gai = uni.getStorageSync('BTCAddressInfo') this.gai = uni.getStorageSync('TRXAddressInfo')
var index=uni.getStorageSync('editIndex') this.gai2 = uni.getStorageSync('BTCAddressInfo')
let btc=new Object; var index = uni.getStorageSync('editIndex')
btc.address=this.bigAddress; let trx = new Object;
btc.name=this.addressName trx.address = this.bigAddress;
btc.coinList=[{ trx.name = this.addressName
name:"BTC",
name2:"BTC", trx.coinList = [{
xname:'Bitcoin', name: "TRX",
icon:require('@/static/tongyonh/bye.png') name2: "TRX",
}]; xname: 'TRON',
this.gai[index]=btc; icon: require('@/static/tongyonh/tron1.png')
uni.setStorageSync('BTCAddressInfo',this.gai) }];
uni.showToast({ this.gai2.splice(index, 1)
title: this.$t('index').Successful, uni.setStorageSync('BTCAddressInfo', this.gai2)
icon: 'success', this.gai.push(trx);
duration: 1500 uni.setStorageSync('TRXAddressInfo', this.gai)
}) uni.showToast({
uni.navigateTo({ title: this.$t('index').Successful,
url:'../address/index' icon: 'success',
}) duration: 1500
})
} uni.navigateTo({
url: '../address/index'
if(this.value=='ETH'){ })
this.gai = uni.getStorageSync('ETHAddressInfo') }
this.gai2 = uni.getStorageSync('BTCAddressInfo') if (this.value == 'BTC') {
var index=uni.getStorageSync('editIndex') this.gai = uni.getStorageSync('BTCAddressInfo')
let eth=new Object; var index = uni.getStorageSync('editIndex')
eth.address=this.bigAddress; let btc = new Object;
eth.name=this.addressName btc.address = this.bigAddress;
eth.coinList=[{ btc.name = this.addressName
name:"ETH", btc.coinList = [{
name2:"ETH", name: "BTC",
xname:'Ethereum', name2: "BTC",
icon:require('@/static/tongyonh/Frame3299.png') xname: 'Bitcoin',
}]; icon: require('@/static/tongyonh/bye.png')
this.gai2.splice(index,1) }];
uni.setStorageSync('BTCAddressInfo',this.gai2) this.gai[index] = btc;
this.gai.push(eth); uni.setStorageSync('BTCAddressInfo', this.gai)
uni.setStorageSync('ETHAddressInfo',this.gai) uni.showToast({
uni.showToast({ title: this.$t('index').Successful,
title: this.$t('index').Successful, icon: 'success',
icon: 'success', duration: 1500
duration: 1500 })
}) uni.navigateTo({
uni.navigateTo({ url: '../address/index'
url:'../address/index' })
})
} }
}
}, if (this.value == 'ETH') {
showSelect(){ this.gai = uni.getStorageSync('ETHAddressInfo')
this.show=true; this.gai2 = uni.getStorageSync('BTCAddressInfo')
}, var index = uni.getStorageSync('editIndex')
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')
}];
this.gai2.splice(index, 1)
uni.setStorageSync('BTCAddressInfo', this.gai2)
this.gai.push(eth);
uni.setStorageSync('ETHAddressInfo', this.gai)
uni.showToast({
title: this.$t('index').Successful,
icon: 'success',
duration: 1500
})
uni.navigateTo({
url: '../address/index'
})
}
}
},
showSelect() {
this.show = true;
},
} }
}; };
</script> </script>
<style scoped> <style scoped>
page { page {
background: #FAFAFA; background: #FAFAFA;
height: 100%; height: 100%;
} }
</style> </style>

6
pages/menu/wallet/index.vue

@ -116,9 +116,9 @@
if (currency) { if (currency) {
this.currency = currency; this.currency = currency;
} }
uni.setStorageSync('isWallet', true);
//
//
//console.log(this.$TronUtil.decode("TBk72yKTJWppCsa7XrsU7Qhfo4yNvbm8rE"))
this.userObj = uni.getStorageSync('wallet'); this.userObj = uni.getStorageSync('wallet');
this.userObj = await this.$walletUtil.updateBalance(); this.userObj = await this.$walletUtil.updateBalance();
@ -146,7 +146,7 @@
let param = { let param = {
'appId': uni.getSystemInfoSync().platform 'appId': uni.getSystemInfoSync().platform
} }
console.log('ss' + this.$api) console.log('ss' + JSON.stringify(uni.getSystemInfoSync()))
const response = await this.$api.versionUpgrade(param) const response = await this.$api.versionUpgrade(param)
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => { plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
console.log('当前版本号' + wgtinfo.versionCode) console.log('当前版本号' + wgtinfo.versionCode)

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

File diff suppressed because one or more lines are too long

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

@ -14404,7 +14404,7 @@ if(false) {}
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ./node_modules/css-loader/dist/runtime/api.js */ 13); var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ./node_modules/css-loader/dist/runtime/api.js */ 13);
exports = ___CSS_LOADER_API_IMPORT___(false); exports = ___CSS_LOADER_API_IMPORT___(false);
// Module // Module
exports.push([module.i, "\nbody[data-v-7c44e0c6] {\n\t\tbackground: #FAFAFA;\n height: 100%;\n}\n", ""]); exports.push([module.i, "\nbody[data-v-7c44e0c6] {\n\tbackground: #FAFAFA;\n\theight: 100%;\n}\n", ""]);
// Exports // Exports
module.exports = exports; module.exports = exports;

33
utils/EthUtil.js

@ -5,9 +5,9 @@ const Tx = require('ethereumjs-tx');
let web3; let web3;
// let tx; // let tx;
if (typeof web3 !== 'undefined') { if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider); web3 = new Web3(web3.currentProvider);
} else { } else {
web3 = new Web3(new Web3.providers.HttpProvider(systemConfiguration.constant.ethNode)); web3 = new Web3(new Web3.providers.HttpProvider(systemConfiguration.constant.ethNode));
} }
@ -34,24 +34,25 @@ let eth = {
const gasPrice = await web3.eth.getGasPrice().then((v) => { const gasPrice = await web3.eth.getGasPrice().then((v) => {
return v return v
}); });
console.log(gasPrice,'gasPrice') console.log(gasPrice, 'gasPrice')
return gasPrice; return gasPrice;
}, },
//获取主币eth余额 //获取主币eth余额
getBalance:async function(address) { getBalance: async function(address) {
web3 = new Web3(); web3 = new Web3();
const data = { const data = {
'jsonrpc': '2.0', 'jsonrpc': '2.0',
'id': '1', 'id': '1',
'method': 'eth_getBalance', 'method': 'eth_getBalance',
'params': [address, "latest"] 'params': [address, "latest"]
}; };
let res =await uni.request({ let res = await uni.request({
url: systemConfiguration.constant.ethNode, //仅为示例,并非真实接口地址。 url: systemConfiguration.constant.ethNode, //仅为示例,并非真实接口地址。
method: 'POST', method: 'POST',
data: data, data: data,
dataType: 'json'}); dataType: 'json'
});
try { try {
let balance = Number(web3.utils.hexToNumberString(res[1].data.result)) / Math.pow(10, 18) let balance = Number(web3.utils.hexToNumberString(res[1].data.result)) / Math.pow(10, 18)
return balance return balance
@ -68,8 +69,8 @@ let eth = {
return s + num; return s + num;
}, },
// 获取bms,bmdt,usdt/erc余额 // 获取bms,bmdt,usdt/erc余额
getTokenBalance:async function(address, contract,success) { getTokenBalance: async function(address, contract, success) {
web3 = new Web3(); web3 = new Web3();
const data = { const data = {
'jsonrpc': '2.0', 'jsonrpc': '2.0',
'id': '1', 'id': '1',
@ -81,16 +82,16 @@ let eth = {
}; };
let res =await uni.request({ let res = await uni.request({
url: systemConfiguration.constant.ethNode, //仅为示例,并非真实接口地址。 url: systemConfiguration.constant.ethNode, //仅为示例,并非真实接口地址。
method: 'POST', method: 'POST',
data: data, data: data,
dataType: 'json' dataType: 'json'
}); });
let resData=res[res.length-1]; let resData = res[res.length - 1];
console.log(resData,5555555555) console.log(resData, 5555555555)
let balance = Number(web3.utils.hexToNumberString(resData.data.result)) / Math.pow(10, 18) let balance = Number(web3.utils.hexToNumberString(resData.data.result)) / Math.pow(10, 18)
console.log(balance,'balance') console.log(balance, 'balance')
return balance; return balance;
}, },
@ -208,10 +209,10 @@ let eth = {
}, },
transaction:async function(fromAddress, toAddress, value, privateKey, contract, success){ transaction: async function(fromAddress, toAddress, value, privateKey, contract, success) {
if(contract){ if (contract) {
await this.sendTokenTransaction(fromAddress, toAddress, value, privateKey, contract, success); await this.sendTokenTransaction(fromAddress, toAddress, value, privateKey, contract, success);
}else{ } else {
await this.sendTransaction(fromAddress, toAddress, value, privateKey, success) await this.sendTransaction(fromAddress, toAddress, value, privateKey, success)
} }

3
utils/TronUtil.js

@ -142,7 +142,8 @@ let tron = {
} }
}); });
} },
} }
export default tron export default tron

10
utils/WalletUtil.js

@ -67,7 +67,7 @@ let WalletUtil = {
walletInfo.BTC[0].privateKey = btc.privateKey; walletInfo.BTC[0].privateKey = btc.privateKey;
walletInfo.BTC[0].address = btc.address; walletInfo.BTC[0].address = btc.address;
walletInfo.BTC[0].ellipsisAddress = walletInfo.BTC[0].address.substring(0, 6) + '...' + walletInfo.BTC[ walletInfo.BTC[0].ellipsisAddress = walletInfo.BTC[0].address.substring(0, 6) + '...' + walletInfo.BTC[
0].address.substring(25, 0].address.substring(walletInfo.BTC[0].address.length-6,
walletInfo.BTC[0].address.length) walletInfo.BTC[0].address.length)
let eth = TokenUtil.generateEth(mnemonic) let eth = TokenUtil.generateEth(mnemonic)
walletInfo.ETH[0].password = password; walletInfo.ETH[0].password = password;
@ -173,7 +173,7 @@ let WalletUtil = {
walletList = walletInfo[type] walletList = walletInfo[type]
for (var k = 0, length = walletList.length; k < length; k++) { for (var k = 0, length = walletList.length; k < length; k++) {
let address = walletList[k].address; let address = walletList[k].address;
walletList[k].ellipsisAddress = address.substring(0, 6) + '...' + address.substring(25, walletList[k].ellipsisAddress = address.substring(0, 6) + '...' + address.substring(address.length - 6,
address.length) address.length)
} }
} else { } else {
@ -208,6 +208,7 @@ let WalletUtil = {
} }
}, },
updateBalance: async function(success) { updateBalance: async function(success) {
uni.setStorageSync('isWallet', true);
const wallet = uni.getStorageSync('wallet'); const wallet = uni.getStorageSync('wallet');
let params = { let params = {
coinName: wallet.type coinName: wallet.type
@ -282,7 +283,9 @@ let WalletUtil = {
} }
wallet.ellipsisAddress=wallet.address.substring(0, 6) + '...' + wallet.address.substring(
wallet.address.length - 6,
wallet.address.length);
wallet.balancePrice = (wallet.balance * mainCoinP.data.priceInUsd).toFixed(2); wallet.balancePrice = (wallet.balance * mainCoinP.data.priceInUsd).toFixed(2);
wallet.balanceCnyPrice = (wallet.balance * mainCoinP.data.priceCny).toFixed(2); wallet.balanceCnyPrice = (wallet.balance * mainCoinP.data.priceCny).toFixed(2);
wallet.totalBalancePrice=(Number(wallet.totalBalancePrice)+Number(wallet.balancePrice)).toFixed(2); wallet.totalBalancePrice=(Number(wallet.totalBalancePrice)+Number(wallet.balancePrice)).toFixed(2);
@ -301,6 +304,7 @@ let WalletUtil = {
} }
} }
uni.setStorageSync('walletInfo', walletInfo); uni.setStorageSync('walletInfo', walletInfo);
uni.setStorageSync('isWallet', false);
return wallet; return wallet;
}, },

44
utils/locales/zh-F.js

@ -27,8 +27,8 @@ export default {
protit: '我的', protit: '我的',
apps: '應用程序設定', apps: '應用程序設定',
magew: '管理錢包', magew: '管理錢包',
addBook: '地址目錄', addBook: '地址',
Settings: '設', Settings: '設',
helpcen: '幫助中心', helpcen: '幫助中心',
aboutus: '關於我們', aboutus: '關於我們',
Hardware: '硬體', Hardware: '硬體',
@ -87,21 +87,21 @@ export default {
Manage: '管理', Manage: '管理',
Name: '名字', Name: '名字',
Setname: '設定錢包名稱', Setname: '設定錢包名稱',
Backupprivatekey: '備份私密金鑰', Backupprivatekey: '備份私鑰',
Newwalletname: '新的錢包名稱', Newwalletname: '新的錢包名稱',
// transPawMan // transPawMan
keepyourmnemonics: '請保留你的記憶法。 任何獲得你的助記符的人都可以控制你的帳戶,包括轉移所有資金', keepyourmnemonics: '請保留你的助記詞。 任何獲得你的助記詞的人都可以控制你的帳戶,包括轉移所有資金',
Incorrectpassword: '密碼不正確', Incorrectpassword: '密碼不正確',
// keyout // keyout
keepyourprivatekey: '請保留您的私密金鑰。任何獲得您私密金鑰的人都可以控制您的帳戶,包括轉移所有資金', keepyourprivatekey: '請保留您的私鑰。任何獲得您私鑰的人都可以控制您的帳戶,包括轉移所有資金',
// showkey // showkey
Showprivatekey: '顯示私密金鑰', Showprivatekey: '顯示私鑰',
Showprivatekeytext: '文本', Showprivatekeytext: '文本',
ShowQRCode: '二維碼', ShowQRCode: '二維碼',
ShowCopy: '複製', ShowCopy: '複製',
ScantheQR: '掃描二維碼至....', ScantheQR: '掃描二維碼至....',
CopyprivatekeySuccessful: '複製私密金鑰成功', CopyprivatekeySuccessful: '複製私鑰成功',
Onemomentplease: '請稍等', Onemomentplease: '請稍等',
// market // market
TrandingPairs: '幣種', TrandingPairs: '幣種',
@ -125,10 +125,10 @@ export default {
// nftCollection // nftCollection
NFTcollection: 'NFT收藏品', NFTcollection: 'NFT收藏品',
Contractaddress: '合約地址', Contractaddress: '合約地址',
TokenID: '權杖ID', TokenID: '令牌ID',
entercontractaddress: '請輸入契约地址', entercontractaddress: '請輸入合約地址',
entertokenID: '請輸入權杖ID', entertokenID: '請輸入令牌ID',
Contracts: '契约', Contracts: '合約',
ID: 'ID', ID: 'ID',
Collectiondetails: '收藏品詳情', Collectiondetails: '收藏品詳情',
// btc index // btc index
@ -139,7 +139,7 @@ export default {
Receive: '接收', Receive: '接收',
// sendToken index // sendToken index
Receivingaddress: '接收地址', Receivingaddress: '接收地址',
ReceivingaddressError: '接地址錯誤', ReceivingaddressError: '接地址錯誤',
ScanQR: '掃描二維碼以轉移到資產', ScanQR: '掃描二維碼以轉移到資產',
Copyaddress: '複製地址', Copyaddress: '複製地址',
CopySuccessful: '複製地址成功!', CopySuccessful: '複製地址成功!',
@ -150,8 +150,8 @@ export default {
Balance: '餘額', Balance: '餘額',
ALL: "所有", ALL: "所有",
Remark: '備註', Remark: '備註',
Transactionfee: '交易費', Transactionfee: '礦工費',
Transferconfirmation: '轉帳確認', Transferconfirmation: '轉帳確認',
Amount: '金額', Amount: '金額',
Sendaddress: '發送地址', Sendaddress: '發送地址',
Fingerprintpassword: '指紋密碼', Fingerprintpassword: '指紋密碼',
@ -172,16 +172,16 @@ export default {
Hotassets: '熱門資產', Hotassets: '熱門資產',
Addedsuccessfully: '添加成功', Addedsuccessfully: '添加成功',
// backup5 // backup5
Importviaprivatekey: '通過私密金鑰導入', Importviaprivatekey: '通過私鑰導入',
Privatekeyimportverification: '私密金鑰導入驗證', Privatekeyimportverification: '私鑰導入驗證',
privatekeyanddo: '請輸入您的私密金鑰,不要將其洩露給其他人外部地址無法通過助記鍵恢復。 請妥善保管', privatekeyanddo: '請輸入您的私鑰,不要將其洩露給其他人外部地址無法通過助記鍵恢復。 請妥善保管',
enteryourprivatekey: '請輸入您的私密金鑰', enteryourprivatekey: '請輸入您的私鑰',
beempty: '不能為空', beempty: '不能為空',
beenimported: '錢包已經被導入', beenimported: '錢包已經被導入',
MnemonicsError:'助記詞錯誤', MnemonicsError:'助記詞錯誤',
// backup4 // backup4
Importmnemonics: '導入助記詞', Importmnemonics: '導入助記詞',
Mnemonicsimportverification: '助記輸入驗證', Mnemonicsimportverification: '助記輸入驗證',
Language: '語言', Language: '語言',
langfan: '繁體中文', langfan: '繁體中文',
langjian: '簡體中文', langjian: '簡體中文',
@ -192,16 +192,16 @@ export default {
Addaddress: '添加地址', Addaddress: '添加地址',
Save: '保存', Save: '保存',
selectcurrency: '請選擇幣種', selectcurrency: '請選擇幣種',
Pleaserecipientaddress: '請輸入收件人地址', Pleaserecipientaddress: '地址',
enterthename: '請輸入名稱', enterthename: '請輸入名稱',
Addressorname: '地址或名稱不能為空', Addressorname: '地址或名稱不能為空',
loading: '加載中', loading: '加載中',
closevalidation: '確認關閉驗證?', closevalidation: '確認關閉驗證?',
Login: '登入', Login: '登入',
Transactiondetails: '交易詳情', Transactiondetails: '交易詳情',
Confirmed: '確認交易', Confirmed: '成功',
Time: '時間', Time: '時間',
TxFee: '發送費', TxFee: '礦工費',
TransactionID: '交易ID', TransactionID: '交易ID',
others: '其他', others: '其他',
me: '我', me: '我',

20
utils/locales/zh.js

@ -27,7 +27,7 @@ export default {
protit: '我的', protit: '我的',
apps: '应用程序设置', apps: '应用程序设置',
magew: '管理钱包', magew: '管理钱包',
addBook: '地址目录', addBook: '地址',
Settings: '设置', Settings: '设置',
helpcen: '帮助中心', helpcen: '帮助中心',
aboutus: '关于我们', aboutus: '关于我们',
@ -136,20 +136,20 @@ export default {
Send: '发送', Send: '发送',
Receive: '接收', Receive: '接收',
// sendToken index // sendToken index
Receivingaddress: '接地址', Receivingaddress: '接地址',
ReceivingaddressError: '接地址错误', ReceivingaddressError: '接地址错误',
ScanQR: '扫描二维码以转移到资产', ScanQR: '扫描二维码以转移到资产',
Copyaddress: '复制地址', Copyaddress: '复制地址',
CopySuccessful: '复制地址成功!', CopySuccessful: '复制地址成功!',
// transfer // transfer
Transfer: '转账', Transfer: '转账',
AddressBook: '地址', AddressBook: '地址',
Transferamount: '转账金额', Transferamount: '转账金额',
Balance: '余额', Balance: '余额',
ALL: "所有", ALL: "所有",
Remark: '备注', Remark: '备注',
Transactionfee: '交易费', Transactionfee: '矿工费',
Transferconfirmation: '转账确认', Transferconfirmation: '转账确认',
Amount: '金额', Amount: '金额',
Sendaddress: '发送地址', Sendaddress: '发送地址',
Fingerprintpassword: '指纹密码', Fingerprintpassword: '指纹密码',
@ -179,7 +179,7 @@ export default {
MnemonicsError:'助记词错误', MnemonicsError:'助记词错误',
// backup4 // backup4
Importmnemonics: '导入助记词', Importmnemonics: '导入助记词',
Mnemonicsimportverification: '助记输入验证', Mnemonicsimportverification: '助记输入验证',
Language: '语言', Language: '语言',
langfan: '繁体中文', langfan: '繁体中文',
langjian: '简体中文', langjian: '简体中文',
@ -190,16 +190,16 @@ export default {
Addaddress: '添加地址', Addaddress: '添加地址',
Save: '保存', Save: '保存',
selectcurrency: '请选择币种', selectcurrency: '请选择币种',
Pleaserecipientaddress: '请输入收件人地址', Pleaserecipientaddress: '请输入地址',
enterthename: '请输入名称', enterthename: '请输入名称',
Addressorname: '地址或名称不能为空', Addressorname: '地址或名称不能为空',
loading: '加载中', loading: '加载中',
closevalidation: '确认关闭验证?', closevalidation: '确认关闭验证?',
Login: '登录', Login: '登录',
Transactiondetails: '交易详情', Transactiondetails: '交易详情',
Confirmed: '确认交易', Confirmed: '成功',
Time: '时间', Time: '时间',
TxFee: '发送费', TxFee: '矿工费',
TransactionID: '交易ID', TransactionID: '交易ID',
others: '其他', others: '其他',
me: '我', me: '我',

Loading…
Cancel
Save