Browse Source

代码

master
Dread 4 years ago
parent
commit
0ddf2b9119
  1. 887
      pages/menu/sendToken/transfer/index.vue
  2. 20
      pages/menu/wallet/index.vue
  3. 21
      pages/menu/wallet/otherCoin/index.vue
  4. 10744
      unpackage/dist/dev/app-plus/app-service.js
  5. 35722
      unpackage/dist/dev/app-plus/app-view.js
  6. 2
      utils/WalletUtil.js
  7. 3
      utils/axios.js

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

@ -1,213 +1,219 @@
<template> <template>
<view class="ac"> <view class="ac">
<navigation :showBack="false" :bgnum="true"> <navigation :showBack="false" :bgnum="true">
<image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" class="back" @click="back()" ></image> <image src="../../../../static/tongyonh/Vector.png" mode="aspectFit" class="back" @click="back()"></image>
<text class="big_title"> <text class="big_title">
{{addressInfo.type}} Transfer {{addressInfo.type}} Transfer
</text> </text>
</navigation> </navigation>
<view class="main"> <view class="main">
<view class="main_con"> <view class="main_con">
<view class="yuan"> <view class="yuan">
<image :src="addressInfo.coinList[0].icon" mode="aspectFit" class="img1"></image> <image :src="addressInfo.coinList[0].icon" mode="aspectFit" class="img1"></image>
</view> </view>
<view class="title"> <view class="title">
{{addressInfo.type}}
</view>
<view class="item">
<view class="top flex">
<view class="text1">
Receiving address
</view>
<view class="text2" @click="goAddress('transfer')">
Adress Book
</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="recipientAddress" />
<image src="../../../../static/tongyonh/Frame330.png" mode="aspectFit" class="img1"></image>
</view>
</view>
<view class="item">
<view class="top flex">
<view class="text1">
Transfer amount
</view>
</view>
<view class="inputcon2 flex">
<view class="inputc flex">
<view class="textt">
{{addressInfo.type}} {{addressInfo.type}}
</view> </view>
<input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="0.0000000" class="input3" v-model="transAmount"/> <view class="item">
</view> <view class="top flex">
<text></text> <view class="text1">
<view class="inputc flex"> Receiving address
<view class="textt"> </view>
USD <view class="text2" @click="goAddress('transfer')">
</view> Adress Book
<input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="0.0000000" class="input3"/> </view>
</view> </view>
</view> <view class="inputcon">
<view class="top flex bottom"> <input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
<view class="text3"> placeholder="Please enter the recipient address" class="input1"
Balance: {{addressInfo.balance}} v-model="recipientAddress" />
</view> <image src="../../../../static/tongyonh/Frame330.png" mode="aspectFit" class="img1"></image>
<view class="text1 bg" @click="forAll"> </view>
ALL </view>
</view>
</view> <view class="item">
</view> <view class="top flex">
<view class="text1">
<view class="item"> Transfer amount
<view class="top flex"> </view>
<view class="text1"> </view>
Remark <view class="inputcon2 flex">
</view> <view class="inputc flex">
<view class="textt">
</view> {{addressInfo.type}}
<view class="inputcon"> </view>
<input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="Please enter a note (off-chain)" class="input1"/> <input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
</view> placeholder="0.0000000" class="input3" v-model="transAmount" />
</view> </view>
<text></text>
<view class="item"> <view class="inputc flex">
<view class="top flex"> <view class="textt">
<view class="text1"> USD
Transaction fee </view>
</view> <input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
placeholder="0.0000000" class="input3" />
</view> </view>
<view class="inputcon" > </view>
<input type="text" v-model="fee" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;" placeholder="Please enter a note (off-chain)" class="input2"/> <view class="top flex bottom">
<view class="rig"> <view class="text3">
<text class="text1 ac">{{addressInfo.type}}</text> | <text class="text2">USDT</text> Balance: {{addressInfo.balance}}
</view> </view>
</view> <view class="text1 bg" @click="forAll">
</view> ALL
</view> </view>
</view> </view>
</view>
<view class="big_con" v-if="showBottom">
<view class="tiao" @click="show=false"> <view class="item">
</view> <view class="top flex">
<view class="bigtitle"> <view class="text1">
Transfer confirmation Remark
</view> </view>
<view class="bottom_con">
<view class="yuan"> </view>
<image :src="addressInfo.coinList[0].icon" mode="aspectFit" class="img1"></image> <view class="inputcon">
</view> <input type="text" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
<view class="title"> placeholder="Please enter a note (off-chain)" class="input1" />
{{addressInfo.type}} </view>
</view> </view>
<view class="title_con flex">
<view class="text1"> <view class="item">
Amount <view class="top flex">
</view> <view class="text1">
<view class="text1"> Transaction fee
{{transAmount}} {{addressInfo.type}} </view>
</view>
</view> </view>
<view class="item"> <view class="inputcon">
<view class="text1"> <input type="text" v-model="fee" value="" placeholder-style="font-size: 30rpx; color: #D0D0D2;"
Send address placeholder="Please enter a note (off-chain)" class="input2" />
</view> <view class="rig">
<view class="text2"> <text class="text1 ac">{{addressInfo.type}}</text> | <text class="text2">USDT</text>
{{addressInfo.address}} </view>
</view>
</view>
</view> </view>
</view> </view>
<view class="item">
<view class="text1"> <view class="big_con" v-if="showBottom">
Receiving address <view class="tiao" @click="cancelAll">
</view>
<view class="text2">
{{recipientAddress}}
</view> </view>
</view> <view class="bigtitle">
<view class="item"> Transfer confirmation
<view class="text1">
Remark
</view> </view>
<view class="text2"> <view class="bottom_con">
1.00 TRX <view class="yuan">
<image :src="addressInfo.coinList[0].icon" mode="aspectFit" class="img1"></image>
</view>
<view class="title">
{{addressInfo.type}}
</view>
<view class="title_con flex">
<view class="text1">
Amount
</view>
<view class="text1">
{{transAmount}} {{addressInfo.type}}
</view>
</view>
<view class="item">
<view class="text1">
Send address
</view>
<view class="text2">
{{addressInfo.address}}
</view>
</view>
<view class="item">
<view class="text1">
Receiving address
</view>
<view class="text2">
{{recipientAddress}}
</view>
</view>
<view class="item">
<view class="text1">
Remark
</view>
<view class="text2">
1.00 TRX
</view>
</view>
<view class="item">
<view class="text1">
Transaction fee
</view>
<view class="text2">
{{fee}} {{addressInfo.type}}
</view>
</view>
<view class="goto" @click="confirmTo">
Confirm
</view>
</view> </view>
</view> </view>
<view class="item"> <u-mask z-index="10" :show="show"></u-mask>
<view class="text1"> <!-- <u-mask z-index="1000" :show="show2" @click="show2 = false"></u-mask> -->
Transaction fee <view class="zhiwen_con" v-if="showFinger">
<view class="tiao" @click="cancel">
</view> </view>
<view class="text2"> <view class="bigtitle">
{{fee}} {{addressInfo.type}} Fingerprint password
</view> </view>
</view> <view class="bottom_con">
<image src="../../../../static/tongyonh/zhiwen.png" mode="aspectFit" class="img1"></image>
<view class="goto" @click="confirmTo"> <view class="text1">
Confirm Touch the fingerprint sensor
</view> </view>
</view> <view class="flex con">
<view class="textt1" @click="goPassword" v-if="!passShow">
</view> Use Password
<u-mask z-index="10" :show="show"></u-mask>
<!-- <u-mask z-index="1000" :show="show2" @click="show2 = false"></u-mask> -->
<view class="zhiwen_con" v-if="showFinger">
<view class="tiao" @click="cancel">
</view>
<view class="bigtitle">
Fingerprint password
</view>
<view class="bottom_con">
<image src="../../../../static/tongyonh/zhiwen.png" mode="aspectFit" class="img1"></image>
<view class="text1">
Touch the fingerprint sensor
</view>
<view class="flex con">
<view class="textt1" @click="goPassword" v-if="!passShow">
Use Password
</view> </view>
<view class="textt2" @click="cancel"> <view class="textt2" @click="cancel">
Cancel Cancel
</view> </view>
</view>
</view>
</view> </view>
</view>
</view> <view class="zhiwen_con" v-if="fingerFail">
<view class="tiao">
<view class="zhiwen_con" v-if="fingerFail"> </view>
<view class="tiao"> <view class="bigtitle">
</view> Fingerprint password
<view class="bigtitle"> </view>
Fingerprint password <view class="bottom_con">
</view> <image src="../../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image>
<view class="bottom_con"> <view class="text1 red">
<image src="../../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image> Fingerprint not recognized. <br><text @click="confirmTo('try')">Try again</text> .
<view class="text1 red"> </view>
Fingerprint not recognized. <br><text @click="">Try again</text> . <view class="flex con">
</view> <view class="textt1" @click="goPassword">
<view class="flex con"> Use Password
<view class="textt1" @click="goPassword">
Use Password
</view> </view>
<view class="textt2"> <view class="textt2" @click="cancelFail">
Cancel Cancel
</view> </view>
</view>
</view>
</view> </view>
</view>
</view> <view class="zhiwen_con" v-if="fingerSuccess">
<view class="tiao">
<view class="zhiwen_con" v-if="fingerSuccess"> </view>
<view class="tiao"> <view class="bigtitle">
</view> Fingerprint password
<view class="bigtitle"> </view>
Fingerprint password <view class="bottom_con">
</view> <image src="../../../../static/tongyonh/x-circle.png" mode="aspectFit" class="img1"></image>
<view class="bottom_con"> <view class="text1 green">
<image src="../../../../static/tongyonh/x-circle.png" mode="aspectFit" class="img1"></image> Fingerprint recognized.
<view class="text1 green"> </view>
Fingerprint recognized. <!-- <view class="flex con">
</view>
<!-- <view class="flex con">
<view class="textt1"> <view class="textt1">
Use Password Use Password
</view> </view>
@ -215,18 +221,18 @@
Confirm Confirm
</view> </view>
</view> --> </view> -->
</view>
</view> </view>
</view>
<view class="btn_con" @click="Confirm">
<view class="btn">
Confirm
</view>
</view>
<view class="btn_con" @click="Confirm">
<view class="btn">
Confirm
</view>
</view>
</view>
</view>
@ -237,70 +243,83 @@
export default { export default {
data() { data() {
return { return {
fee:1000, fee: 1000,
show: false, show: false,
show2: false, show2: false,
showFinger:false, showFinger: false,
showBottom:false, showBottom: false,
addressInfo:{}, addressInfo: {},
recipientAddress:'', recipientAddress: '',
transAmount:'', transAmount: '',
fingerSuccess:false, fingerSuccess: false,
fingerFail:false, fingerFail: false,
// 使 // 使
passShow:false, passShow: false,
// //
transInfoPass:{ transInfoPass: {
fromAddress:'', fromAddress: '',
toAddress:"", toAddress: "",
privateKey:'', privateKey: '',
amount:'', amount: '',
} }
} }
}, },
methods: { methods: {
cancel(){ cancelAll(){
this.show=false this.show=false;
this.showFinger=false this.showBottom=false;
},
cancelFail() {
this.$walletUtil.printCancel()
this.fingerFail = false
this.showBottom = true;
this.showFinger = false;
},
cancel() {
this.showFinger = false
this.showBottom=true;
this.$walletUtil.printCancel() this.$walletUtil.printCancel()
}, },
// //
goPassword(){ goPassword() {
this.$walletUtil.printCancel(); this.$walletUtil.printCancel();
console.log(111) console.log(111)
uni.navigateTo({ uni.navigateTo({
url:'/pages/menu/sendToken/enPassword/index' url: '/pages/menu/sendToken/enPassword/index'
}) })
}, },
// //
confirmTo(){ confirmTo(type) {
this.show=true if (type == 'try') {
this.showFinger=true this.fingerFail = false;
this.showBottom=false; }
this.show = true
this.showFinger = true
this.showBottom = false;
// true // true
this.fingerprint(); this.fingerprint();
// //
this.transInfoPass.fromAddress=this.addressInfo.address; this.transInfoPass.fromAddress = this.addressInfo.address;
this.transInfoPass.toAddress=this.recipientAddress; this.transInfoPass.toAddress = this.recipientAddress;
this.transInfoPass.privateKey=this.addressInfo.privateKey; this.transInfoPass.privateKey = this.addressInfo.privateKey;
this.transInfoPass.amount=this.transAmount; this.transInfoPass.amount = this.transAmount;
console.log(this.transInfoPass,444) console.log(this.transInfoPass, 444)
// //
uni.setStorageSync('transInfoPass',this.transInfoPass) uni.setStorageSync('transInfoPass', this.transInfoPass)
}, },
back(){ back() {
uni.reLaunch({ uni.reLaunch({
url:'../../wallet/index' url: '../../wallet/index'
}) })
}, },
// //
forAll(){ forAll() {
this.transAmount=this.addressInfo.balance this.transAmount = this.addressInfo.balance
}, },
// //
Confirm(){ Confirm() {
// //
if(this.transAmount==''){ if (this.transAmount == '') {
uni.showToast({ uni.showToast({
title: 'Please enter the transfer amount', title: 'Please enter the transfer amount',
icon: 'none', icon: 'none',
@ -308,7 +327,7 @@
}) })
return return
} }
if(this.recipientAddress==''){ if (this.recipientAddress == '') {
uni.showToast({ uni.showToast({
title: 'Please enter the receiving address', title: 'Please enter the receiving address',
icon: 'none', icon: 'none',
@ -316,7 +335,7 @@
}) })
return return
} }
if(this.transAmount==''<0){ if (this.transAmount == '' < 0) {
uni.showToast({ uni.showToast({
title: 'The entered amount cannot be less than 0', title: 'The entered amount cannot be less than 0',
icon: 'none', icon: 'none',
@ -332,164 +351,276 @@
// }) // })
// return // return
// } // }
this.showBottom=true; this.showBottom = true;
this.show=true; this.show = true;
}, },
// //
fingerprint: function(sett) { fingerprint: function(sett) {
let bltype=true; let bltype = true;
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) { if (!plus.fingerprint.isSupport()) {
uni.showToast({ uni.showToast({
title: 'This device does not support fingerprint identification', title: 'This device does not support fingerprint identification',
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
// this.disabled = true; // this.disabled = true;
} else if (!plus.fingerprint.isKeyguardSecure()) { } else if (!plus.fingerprint.isKeyguardSecure()) {
uni.showToast({ uni.showToast({
title: 'This device is not equipped with a password lock screen and cannot use fingerprint identification', title: 'This device is not equipped with a password lock screen and cannot use fingerprint identification',
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
} else if (!plus.fingerprint.isEnrolledFingerprints()) { } else if (!plus.fingerprint.isEnrolledFingerprints()) {
uni.showToast({ uni.showToast({
title: 'There is no fingerprint entered in this device. Please turn it on in the setting', title: 'There is no fingerprint entered in this device. Please turn it on in the setting',
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
// this.disabled = true; // this.disabled = true;
} else { } else {
// this.result = ''; // this.result = '';
// // this.disabled = false; // // this.disabled = false;
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// this.disabled = false; // this.disabled = false;
uni.showToast({ uni.showToast({
title: 'Please use it in wechat real machine. The simulator does not support it', title: 'Please use it in wechat real machine. The simulator does not support it',
icon: 'none', icon: 'none',
duration: 1500 duration: 1500
}) })
// #endif // #endif
// #ifndef APP-PLUS || MP-WEIXIN // #ifndef APP-PLUS || MP-WEIXIN
uni.showToast({ uni.showToast({
title: 'Fingerprint identification is not supported on this platform', title: 'Fingerprint identification is not supported on this platform',
icon: 'none', icon: 'none',
duration: 1500, duration: 1500,
}) })
// #endif // #endif
let that=this;
// #ifdef APP-PLUS
plus.fingerprint.authenticate(function() {
plus.nativeUI.closeWaiting(); //Android
// uni.showToast({
// title: 'Fingerprint identification succeeded',
// icon: 'none',
// duration: 1500,
// })
// 使
// uni.setStorageSync('fingerPass',true)
that.showBottom=false; let that = this;
that.fingerSuccess=true; // #ifdef APP-PLUS
console.log(that.fingerSuccess,454545) plus.fingerprint.authenticate(function() {
}, function(e) { plus.nativeUI.closeWaiting(); //Android
switch (e.code) { console.log(that.transInfoPass,5656)
case e.AUTHENTICATE_MISMATCH: console.log(that.addressInfo,56556656)
// plus.nativeUI.toast('Fingerprint matching failed, please re-enter'); if (that.addressInfo.type == 'TRX') {
// uni.setStorageSync('fingerPass',false) console.log(that.addressInfo.type,11111)
console.log(that.showFinger,454545) console.log(that.transInfoPass,2222)
that.showBottom=false; // if (!this.contractAddress) {
that.fingerFail=true; //
console.log(that.fingerFail,454545) that.$TronUtil.sendTransaction(that.transInfoPass.fromAddress,that.transInfoPass.privateKey,that.transInfoPass.toAddress,that.transInfoPass.amount )
break; .then((res) => {
case e.AUTHENTICATE_OVERLIMIT: console.log(2222211111)
plus.nativeUI.closeWaiting(); //Android that.showFinger = false
// plus.nativeUI.alert('The number of fingerprint identification failures exceeds the limit. Please use other methods for authentication'); that.showBottom = false;
// uni.setStorageSync('fingerPass',false) that.fingerSuccess = true;
console.log(that.showFinger,454545) uni.showToast({
that.showBottom=false; title: 'Transfer succeeded',
that.fingerFail=true; icon: 'none',
console.log(that.fingerFail,454545) duration: 1500
break; })
case e.CANCEL: setTimeout(()=>{
plus.nativeUI.toast('Recognition has been cancelled'); that.fingerSuccess = false;
// uni.setStorageSync('fingerPass',false) uni.reLaunch({
console.log(that.showFinger,454545) url: '/pages/menu/wallet/index'
that.showBottom=false; })
that.fingerFail=true; },1000)
console.log(that.fingerFail,454545)
break;
default: }).catch(err => {
plus.nativeUI.closeWaiting(); //Android console.log(err,'cuowu')
uni.setStorageSync('fingerPass',false) that.showFinger=false;
console.log(that.showFinger,454545) that.showBottom=true;
that.showBottom=false; uni.showToast({
that.fingerFail=true; title: 'Transfer failed, please confirm the information is correct',
console.log(that.fingerFail,454545) icon: 'none',
plus.nativeUI.alert('Fingerprint identification failed, please try again'); duration: 1500
break; })
})
// }else{
// this.$TronUtil.sendRawTransaction(this.info.address, this.info.privateKey, this.toAddress, this.toValue,'',this.contractAddress )
// .then((res) => {
// uni.showToast({
// title: 'Successfully',
// icon: 'success',
// duration: 2000
// })
// this.show2 = false;
// uni.reLaunch({
// url: '/pages/menu/wallet/index'
// })
// }).catch(err => {
// console.log(err)
// uni.showToast({
// title: err,
// icon: 'none',
// duration: 2000
// })
// })
// }
} }
});
// Android
if ('Android' == plus.os.name) { if (that.addressInfo.type == 'ETH') {
this.show=true; console.log(that.addressInfo.type,11111)
/* plus.nativeUI.showWaiting('...').onclose = function() { console.log(that.transInfoPass,2222)
plus.fingerprint.cancel(); // if (!this.contractAddress) {
} */ //
} that.$EthUtil.transaction(that.transInfoPass.fromAddress,that.transInfoPass.privateKey,that.transInfoPass.toAddress,that.transInfoPass.amount )
// #endif .then((res) => {
console.log(2222211111)
// #ifdef MP-WEIXIN that.showFinger = false
wx.startSoterAuthentication({ that.showBottom = false;
requestAuthModes: ['fingerPrint'], that.fingerSuccess = true;
challenge: '123456', uni.showToast({
authContent: '请用指纹解锁', title: 'Transfer succeeded',
success(res) { icon: 'none',
uni.showToast({ duration: 1500
title: '识别成功', })
mask: false, setTimeout(()=>{
duration: 1500 that.fingerSuccess = false;
}); uni.reLaunch({
url: '/pages/menu/wallet/index'
})
},1000)
}).catch(err => {
console.log(err,'cuowu')
that.showFinger=false;
that.showBottom=true;
uni.showToast({
title: 'Transfer failed, please confirm the information is correct',
icon: 'none',
duration: 1500
})
})
// }else{
// this.$TronUtil.sendRawTransaction(this.info.address, this.info.privateKey, this.toAddress, this.toValue,'',this.contractAddress )
// .then((res) => {
// uni.showToast({
// title: 'Successfully',
// icon: 'success',
// duration: 2000
// })
// this.show2 = false;
// uni.reLaunch({
// url: '/pages/menu/wallet/index'
// })
// }).catch(err => {
// console.log(err)
// uni.showToast({
// title: err,
// icon: 'none',
// duration: 2000
// })
// })
// }
} }
})
// #endif
}, function(e) {
switch (e.code) {
case e.AUTHENTICATE_MISMATCH:
// plus.nativeUI.toast('Fingerprint matching failed, please re-enter');
// uni.setStorageSync('fingerPass',false)
console.log(that.showFinger, 454545)
that.showBottom = false;
that.fingerFail = true;
console.log(that.fingerFail, 454545)
break;
case e.AUTHENTICATE_OVERLIMIT:
plus.nativeUI.closeWaiting(); //Android
// plus.nativeUI.alert('The number of fingerprint identification failures exceeds the limit. Please use other methods for authentication');
// uni.setStorageSync('fingerPass',false)
console.log(that.showFinger, 454545)
that.showBottom = false;
that.fingerFail = true;
console.log(that.fingerFail, 454545)
break;
case e.CANCEL:
plus.nativeUI.toast('Recognition has been cancelled');
// uni.setStorageSync('fingerPass',false)
console.log(that.showFinger, 454545)
that.showBottom = false;
that.fingerFail = true;
console.log(that.fingerFail, 454545)
break;
default:
plus.nativeUI.closeWaiting(); //Android
uni.setStorageSync('fingerPass', false)
console.log(that.showFinger, 454545)
that.showBottom = false;
that.fingerFail = true;
console.log(that.fingerFail, 454545)
plus.nativeUI.alert('Fingerprint identification failed, please try again');
break;
}
});
// Android
if ('Android' == plus.os.name) {
this.show = true;
/* plus.nativeUI.showWaiting('...').onclose = function() {
plus.fingerprint.cancel();
} */
} }
// #endif // #endif
// #ifdef MP-WEIXIN
}, wx.startSoterAuthentication({
requestAuthModes: ['fingerPrint'],
challenge: '123456',
goAddress(text){ authContent: '请用指纹解锁',
console.log(text) success(res) {
uni.navigateTo({ uni.showToast({
url:'../address/index?item='+text title: '识别成功',
}) mask: false,
} duration: 1500
});
}
})
// #endif
}
// #endif
},
goAddress(text) {
console.log(text)
uni.navigateTo({
url: '../address/index?item=' + text
})
}
}, },
onLoad() { onLoad() {
// //
if(uni.getStorageSync('myTransAddress')){ if (uni.getStorageSync('myTransAddress')) {
this.recipientAddress=uni.getStorageSync('myTransAddress').address this.recipientAddress = uni.getStorageSync('myTransAddress').address
} uni.removeStorageSync('myTransAddress')
// }
if(uni.getStorageSync('fingerPass')){ //
this.passShow=uni.getStorageSync('fingerPass') if (uni.getStorageSync('fingerPass')) {
} this.passShow = uni.getStorageSync('fingerPass')
this.addressInfo=uni.getStorageSync('infoWallet') }
console.log(this.addressInfo,1111) this.addressInfo = uni.getStorageSync('infoWallet')
console.log(this.addressInfo, 1111)
} }
}; };
</script> </script>
<style scoped> <style scoped>
page { page {
background: #FAFAFA; background: #FAFAFA;
height: 100%; height: 100%;
} }
</style> </style>

20
pages/menu/wallet/index.vue

@ -125,22 +125,22 @@
thar.userObj = uni.getStorageSync('wallet'); thar.userObj = uni.getStorageSync('wallet');
thar.userObj2 = uni.getStorageSync('wallet'); thar.userObj2 = uni.getStorageSync('wallet');
// thar.userObj.address = thar.userObj.ellipsisAddress; // thar.userObj.address = thar.userObj.ellipsisAddress;
<<<<<<< HEAD
thar.userObj.address =thar.userObj.address.substring(0, 6) + '...' + thar.userObj.address.substring(25, // thar.userObj.address =thar.userObj.address.substring(0, 6) + '...' + thar.userObj.address.substring(25,
thar.userObj.address.length); // thar.userObj.address.length);
thar.$walletUtil.updateBalance(); // thar.$walletUtil.updateBalance();
thar.updateData(); // thar.updateData();
}, 100); // }, 100);
=======
thar.userObj.address = thar.userObj.address.substring(0, 6) + '...' + thar.userObj.address thar.userObj.address = thar.userObj.address.substring(0, 6) + '...' + thar.userObj.address
.substring(25, .substring(25,
thar.userObj.address.length); thar.userObj.address.length);
thar.$walletUtil.updateBalance(); // thar.$walletUtil.updateBalance();
if (!thar.isStop) { if (!thar.isStop) {
thar.updateData() thar.updateData()
} }
}, 2000); }, 10);
>>>>>>> ecf936884019d656c3291d2f722529a76c9bbfd5
}, },
goOther() { goOther() {

21
pages/menu/wallet/otherCoin/index.vue

@ -83,22 +83,23 @@
// //
addOther(item,index){ addOther(item,index){
console.log(item,444) console.log(item,444)
if(uni.getStorageSync('imgindex').length>0){ // if(uni.getStorageSync('imgindex').length>0){
this.imgindex.push(index) // this.imgindex.push(index)
this.toTop=true // this.toTop=true
setTimeout(()=>{ // setTimeout(()=>{
this.toTop=false // this.toTop=false
},1500) // },1500)
uni.setStorageSync('imgindex',this.imgindex) // uni.setStorageSync('imgindex',this.imgindex)
}else{ // }else{
this.imgindex.push(index) this.imgindex.push(index)
this.toTop=true this.toTop=true
setTimeout(()=>{ setTimeout(()=>{
this.toTop=false this.toTop=false
},1500) },1500)
uni.setStorageSync('imgindex',this.imgindex) uni.setStorageSync('imgindex',this.imgindex)
} // }
console.log(this.coinType,444444)
if(this.coinType=='ETH'){ if(this.coinType=='ETH'){
const walleti=uni.getStorageSync('walleti') const walleti=uni.getStorageSync('walleti')
const walletInfo=uni.getStorageSync('walletInfo') const walletInfo=uni.getStorageSync('walletInfo')
@ -118,7 +119,7 @@
contractAddress:item.contractAddress, contractAddress:item.contractAddress,
balance:this.tmoney, balance:this.tmoney,
}; };
walletInfo[this.coinType][i].coinList.push(b) walletInfo[this.coinType][i].coinList.push(b)
console.log(walletInfo[this.coinType][i],22222) console.log(walletInfo[this.coinType][i],22222)

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

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

2
utils/WalletUtil.js

@ -200,7 +200,7 @@ let WalletUtil = {
} }
} }
// this.updateBalance(); this.updateBalance();
}, },
updateBalance:function() { updateBalance:function() {
const wallet = uni.getStorageSync('wallet'); const wallet = uni.getStorageSync('wallet');

3
utils/axios.js

@ -73,11 +73,12 @@ service.interceptors.response.use(res => {
axios.defaults.adapter = function(config) { //自己定义个适配器,用来适配uniapp的语法 axios.defaults.adapter = function(config) { //自己定义个适配器,用来适配uniapp的语法
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(config) console.log(config,'我请求的')
var settle = require('axios/lib/core/settle'); var settle = require('axios/lib/core/settle');
var buildURL = require('axios/lib/helpers/buildURL'); var buildURL = require('axios/lib/helpers/buildURL');
uni.request({ uni.request({
method: config.method.toUpperCase(), method: config.method.toUpperCase(),
// url: buildURL(config.url, config.params, config.paramsSerializer),
url: config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer), url: config.baseURL+'/' + buildURL(config.url, config.params, config.paramsSerializer),
header: config.headers, header: config.headers,
data: config.data, data: config.data,

Loading…
Cancel
Save