Browse Source

修改

master
vee 4 years ago
parent
commit
9f77dfc101
  1. 2
      pages/menu/sendToken/transfer/index.css
  2. 175
      pages/menu/sendToken/transfer/index.vue
  3. 61
      pages/menu/setting/index.css
  4. 232
      pages/menu/setting/index.vue
  5. 4
      pages/menu/wallet/index.vue
  6. 348
      unpackage/dist/dev/app-plus/app-service.js
  7. 364
      unpackage/dist/dev/app-plus/app-view.js
  8. 26
      utils/WalletUtil.js

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

@ -263,7 +263,7 @@
padding: 0 24rpx; padding: 0 24rpx;
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
bottom: 0; bottom: -70rpx;
padding-top: 24rpx; padding-top: 24rpx;
padding-bottom: 100rpx; padding-bottom: 100rpx;
width: 100%; width: 100%;

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

@ -150,7 +150,7 @@
</view> </view>
</view> </view>
<u-mask z-index="10" :show="show" @click="show = false"></u-mask> <u-mask z-index="10" :show="show"></u-mask>
<!-- <u-mask z-index="1000" :show="show2" @click="show2 = false"></u-mask> --> <!-- <u-mask z-index="1000" :show="show2" @click="show2 = false"></u-mask> -->
<view class="zhiwen_con" v-if="showFinger"> <view class="zhiwen_con" v-if="showFinger">
<view class="tiao" @click="cancel"> <view class="tiao" @click="cancel">
@ -164,7 +164,7 @@
Touch the fingerprint sensor Touch the fingerprint sensor
</view> </view>
<view class="flex con"> <view class="flex con">
<view class="textt1" @click="goPassword"> <view class="textt1" @click="goPassword" v-if="!passShow">
Use Password Use Password
</view> </view>
<view class="textt2" @click="cancel"> <view class="textt2" @click="cancel">
@ -174,7 +174,7 @@
</view> </view>
</view> </view>
<view class="zhiwen_con" v-if="false"> <view class="zhiwen_con" v-if="fingerFail">
<view class="tiao"> <view class="tiao">
</view> </view>
<view class="bigtitle"> <view class="bigtitle">
@ -183,10 +183,10 @@
<view class="bottom_con"> <view class="bottom_con">
<image src="../../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image> <image src="../../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image>
<view class="text1 red"> <view class="text1 red">
Fingerprint not recognized. <br>Try again. Fingerprint not recognized. <br><text @click="">Try again</text> .
</view> </view>
<view class="flex con"> <view class="flex con">
<view class="textt1"> <view class="textt1" @click="goPassword">
Use Password Use Password
</view> </view>
<view class="textt2"> <view class="textt2">
@ -196,7 +196,7 @@
</view> </view>
</view> </view>
<view class="zhiwen_con" v-if="false"> <view class="zhiwen_con" v-if="fingerSuccess">
<view class="tiao"> <view class="tiao">
</view> </view>
<view class="bigtitle"> <view class="bigtitle">
@ -207,14 +207,14 @@
<view class="text1 green"> <view class="text1 green">
Fingerprint recognized. Fingerprint recognized.
</view> </view>
<view class="flex con"> <!-- <view class="flex con">
<view class="textt1"> <view class="textt1">
Use Password Use Password
</view> </view>
<view class="textt2"> <view class="textt2">
Cancel Confirm
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
@ -245,6 +245,10 @@
addressInfo:{}, addressInfo:{},
recipientAddress:'', recipientAddress:'',
transAmount:'', transAmount:'',
fingerSuccess:false,
fingerFail:false,
// 使
passShow:false,
// //
transInfoPass:{ transInfoPass:{
fromAddress:'', fromAddress:'',
@ -274,8 +278,7 @@
this.showFinger=true this.showFinger=true
this.showBottom=false; this.showBottom=false;
// true // true
var bltype=this.$walletUtil.fingerprint(); this.fingerprint();
console.log(bltype,444444)
// //
this.transInfoPass.fromAddress=this.addressInfo.address; this.transInfoPass.fromAddress=this.addressInfo.address;
this.transInfoPass.toAddress=this.recipientAddress; this.transInfoPass.toAddress=this.recipientAddress;
@ -321,17 +324,147 @@
}) })
return return
} }
if( this.transAmount>this.addressInfo.balance){ // if( this.transAmount>this.addressInfo.balance){
uni.showToast({ // uni.showToast({
title: 'Sorry, your credit is running low', // title: 'Sorry, your credit is running low',
icon: 'none', // icon: 'none',
duration: 1500 // duration: 1500
}) // })
return // return
} // }
this.showBottom=true; this.showBottom=true;
this.show=true; this.show=true;
}, },
//
fingerprint: function(sett) {
let bltype=true;
// #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) {
uni.showToast({
title: 'This device does not support fingerprint identification',
icon: 'none',
duration: 1500
})
// this.disabled = true;
} else if (!plus.fingerprint.isKeyguardSecure()) {
uni.showToast({
title: 'This device is not equipped with a password lock screen and cannot use fingerprint identification',
icon: 'none',
duration: 1500
})
} else if (!plus.fingerprint.isEnrolledFingerprints()) {
uni.showToast({
title: 'There is no fingerprint entered in this device. Please turn it on in the setting',
icon: 'none',
duration: 1500
})
// this.disabled = true;
} else {
// this.result = '';
// // this.disabled = false;
// #ifdef MP-WEIXIN
// this.disabled = false;
uni.showToast({
title: 'Please use it in wechat real machine. The simulator does not support it',
icon: 'none',
duration: 1500
})
// #endif
// #ifndef APP-PLUS || MP-WEIXIN
uni.showToast({
title: 'Fingerprint identification is not supported on this platform',
icon: 'none',
duration: 1500,
})
// #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;
that.fingerSuccess=true;
console.log(that.fingerSuccess,454545)
}, 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
// #ifdef MP-WEIXIN
wx.startSoterAuthentication({
requestAuthModes: ['fingerPrint'],
challenge: '123456',
authContent: '请用指纹解锁',
success(res) {
uni.showToast({
title: '识别成功',
mask: false,
duration: 1500
});
}
})
// #endif
}
// #endif
},
goAddress(text){ goAddress(text){
console.log(text) console.log(text)
uni.navigateTo({ uni.navigateTo({
@ -344,6 +477,10 @@
if(uni.getStorageSync('myTransAddress')){ if(uni.getStorageSync('myTransAddress')){
this.recipientAddress=uni.getStorageSync('myTransAddress').address this.recipientAddress=uni.getStorageSync('myTransAddress').address
} }
//
if(uni.getStorageSync('fingerPass')){
this.passShow=uni.getStorageSync('fingerPass')
}
this.addressInfo=uni.getStorageSync('infoWallet') this.addressInfo=uni.getStorageSync('infoWallet')
console.log(this.addressInfo,1111) console.log(this.addressInfo,1111)
} }

61
pages/menu/setting/index.css

@ -32,3 +32,64 @@
color: #A3AED0; color: #A3AED0;
margin-right: 20rpx; margin-right: 20rpx;
} }
.zhiwen_con{
background-color: #F8F8F9;
border-radius: 26rpx 26rpx 0 0;
padding: 0 24rpx;
position: absolute;
z-index: 9999;
bottom: 0;
padding-top: 24rpx;
padding-bottom: 100rpx;
width: 100%;
}
.zhiwen_con .tiao{
width: 96rpx;
height: 8rpx;
background-color: #C9D4EA;
border-radius: 8rpx;
margin: 0 auto;
}
.zhiwen_con .bigtitle{
text-align: center;
font-weight: 700;
font-size: 36rpx;
padding-top: 34rpx;
padding-bottom: 36rpx;
}
.zhiwen_con .bottom_con {
background-color: #fff;
border-radius: 26rpx;
padding-left: 26rpx;
padding-right: 40rpx;
position: relative;
height: 480rpx;
padding-top: 100rpx;
}
.zhiwen_con .bottom_con .img1{
display: block;
width: 96rpx;
height: 106rpx;
margin: 0 auto;
}
.zhiwen_con .bottom_con .text1{
text-align: center;
color: #7D87A6;
font-size: 28rpx;
margin-top: 45rpx;
margin-bottom: 80rpx;
}
.zhiwen_con .bottom_con .con .textt1{
color: #5B53FF;
}
.zhiwen_con .bottom_con .con .textt2{
color: #639AF2;
}
.red{
color: #F16063 !important;
}
.green{
color: #6AD6A8 !important;
}

232
pages/menu/setting/index.vue

@ -15,7 +15,7 @@
<view class="text1"> <view class="text1">
Fingerprint password Fingerprint password
</view> </view>
<u-switch v-model="checked" active-color="#5B53FF"></u-switch> <u-switch v-model="checked" active-color="#5B53FF" @change="fingerPass()"></u-switch>
</view> </view>
<view class="item flex"> <view class="item flex">
<view class="text1"> <view class="text1">
@ -45,6 +45,67 @@
</view> </view>
</view> </view>
</view> </view>
<u-mask z-index="10" :show="show"></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="textt2" @click="cancel">
Cancel
</view>
</view>
</view>
</view>
<view class="zhiwen_con" v-if="fingerFail">
<view class="tiao">
</view>
<view class="bigtitle">
Fingerprint password
</view>
<view class="bottom_con">
<image src="../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image>
<view class="text1 red">
Fingerprint not recognized. <br><text @click="fingerPass('try')">Try again.</text>
</view>
<view class="flex con">
<view class="textt2" @click="cancelFail">
Cancel
</view>
</view>
</view>
</view>
<view class="zhiwen_con" v-if="fingerSuccess">
<view class="tiao" @click="cancelSucc">
</view>
<view class="bigtitle">
Fingerprint password
</view>
<view class="bottom_con">
<image src="../../../static/tongyonh/x-circle.png" mode="aspectFit" class="img1"></image>
<view class="text1 green">
Fingerprint recognized.
</view>
<view class="flex con">
<view class="textt2" @click="cancelSucc">
Confirm
</view>
</view>
</view>
</view>
</view> </view>
</template> </template>
@ -55,12 +116,181 @@
data() { data() {
return { return {
checked: false, checked: false,
show:false,
showFinger:false,
fingerSuccess:false,
fingerFail:false,
}; };
}, },
methods: { methods: {
cancel(){
this.showFinger=false;
this.checked=false;
this.show=false;
this.$walletUtil.printCancel();
},
cancelSucc(){
this.fingerSuccess=false
this.show=false;
},
cancelFail(){
this.fingerFail=false
this.show=false;
},
fingerPass(test){
console.log(this.checked)
if(this.checked||test=='try'){
console.log(111)
this.show=true;
this.showFinger=true;
this.fingerprint(true);
}
if(!this.checked){
uni.setStorageSync('fingerPass',false)
}
},
fingerprint: function(sett) {
let bltype=true;
// #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) {
uni.showToast({
title: 'This device does not support fingerprint identification',
icon: 'none',
duration: 1500
})
// this.disabled = true;
} else if (!plus.fingerprint.isKeyguardSecure()) {
uni.showToast({
title: 'This device is not equipped with a password lock screen and cannot use fingerprint identification',
icon: 'none',
duration: 1500
})
} else if (!plus.fingerprint.isEnrolledFingerprints()) {
uni.showToast({
title: 'There is no fingerprint entered in this device. Please turn it on in the setting',
icon: 'none',
duration: 1500
})
// this.disabled = true;
} else {
// this.result = '';
// // this.disabled = false;
// #ifdef MP-WEIXIN
// this.disabled = false;
uni.showToast({
title: 'Please use it in wechat real machine. The simulator does not support it',
icon: 'none',
duration: 1500
})
// #endif
// #ifndef APP-PLUS || MP-WEIXIN
uni.showToast({
title: 'Fingerprint identification is not supported on this platform',
icon: 'none',
duration: 1500,
})
// #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)
console.log(that.showFinger,454545)
that.showFinger=false;
that.fingerSuccess=true;
console.log(that.showFinger,454545)
}, 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.showFinger=false;
that.fingerFail=true;
that.checked=false
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.showFinger=false;
that.fingerFail=true;
that.checked=false
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.showFinger=false;
that.checked=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.showFinger=false;
that.checked=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
// #ifdef MP-WEIXIN
wx.startSoterAuthentication({
requestAuthModes: ['fingerPrint'],
challenge: '123456',
authContent: '请用指纹解锁',
success(res) {
uni.showToast({
title: '识别成功',
mask: false,
duration: 1500
});
}
})
// #endif
}
// #endif
},
change(status) { change(status) {
// console.log(status); // console.log(status);
}, },
},
onLoad() {
//
if(uni.getStorageSync('fingerPass')){
this.checked=uni.getStorageSync('fingerPass')
}
} }
}; };
</script> </script>

4
pages/menu/wallet/index.vue

@ -125,6 +125,7 @@
console.log(uni.getStorageSync('wallet'),'钱包'); console.log(uni.getStorageSync('wallet'),'钱包');
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.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);
@ -132,7 +133,8 @@
if (!thar.isStop) { if (!thar.isStop) {
thar.updateData() thar.updateData()
} }
}, 5000);
}, 2000);
}, },
goOther() { goOther() {

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

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

26
utils/WalletUtil.js

@ -359,8 +359,7 @@ let WalletUtil = {
// #endif // #endif
}, },
fingerprint: function(sett) {
fingerprint: function() {
let bltype=true; let bltype=true;
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) { if (!plus.fingerprint.isSupport()) {
@ -372,7 +371,7 @@ let WalletUtil = {
// this.disabled = true; // this.disabled = true;
} else if (!plus.fingerprint.isKeyguardSecure()) { } else if (!plus.fingerprint.isKeyguardSecure()) {
uni.showToast({ uni.showToast({
title: 'This device does not support 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
}) })
@ -390,14 +389,14 @@ let WalletUtil = {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// this.disabled = false; // this.disabled = false;
uni.showToast({ uni.showToast({
title: '请在微信真机中使用,模拟器不支持', 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: '此平台不支持指纹识别', title: 'Fingerprint identification is not supported on this platform',
icon: 'none', icon: 'none',
duration: 1500, duration: 1500,
}) })
@ -405,15 +404,22 @@ let WalletUtil = {
let that=this; let that=this;
let forSett=true;
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.fingerprint.authenticate(function() { plus.fingerprint.authenticate(function() {
plus.nativeUI.closeWaiting(); //兼容Android平台关闭等待框 plus.nativeUI.closeWaiting(); //兼容Android平台关闭等待框
uni.showToast({ // uni.showToast({
title: 'Fingerprint identification succeeded', // title: 'Fingerprint identification succeeded',
icon: 'none', // icon: 'none',
duration: 1500, // duration: 1500,
}) // })
// 存储设置里开启指纹后的状态,隐藏使用密码
console.log(forSett,12121)
if(sett){
uni.setStorageSync('fingerPass',true)
console.log(forSett,12121)
}
//plus.nativeUI.alert('Fingerprint identification succeeded'); //plus.nativeUI.alert('Fingerprint identification succeeded');
}, function(e) { }, function(e) {
switch (e.code) { switch (e.code) {

Loading…
Cancel
Save