Browse Source

修改

master
vee 4 years ago
parent
commit
9f77dfc101
  1. 2
      pages/menu/sendToken/transfer/index.css
  2. 167
      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. 342
      unpackage/dist/dev/app-plus/app-service.js
  7. 354
      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;
position: absolute;
z-index: 9999;
bottom: 0;
bottom: -70rpx;
padding-top: 24rpx;
padding-bottom: 100rpx;
width: 100%;

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

@ -150,7 +150,7 @@
</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> -->
<view class="zhiwen_con" v-if="showFinger">
<view class="tiao" @click="cancel">
@ -164,7 +164,7 @@
Touch the fingerprint sensor
</view>
<view class="flex con">
<view class="textt1" @click="goPassword">
<view class="textt1" @click="goPassword" v-if="!passShow">
Use Password
</view>
<view class="textt2" @click="cancel">
@ -174,7 +174,7 @@
</view>
</view>
<view class="zhiwen_con" v-if="false">
<view class="zhiwen_con" v-if="fingerFail">
<view class="tiao">
</view>
<view class="bigtitle">
@ -183,10 +183,10 @@
<view class="bottom_con">
<image src="../../../../static/tongyonh/alert-circle.png" mode="aspectFit" class="img1"></image>
<view class="text1 red">
Fingerprint not recognized. <br>Try again.
Fingerprint not recognized. <br><text @click="">Try again</text> .
</view>
<view class="flex con">
<view class="textt1">
<view class="textt1" @click="goPassword">
Use Password
</view>
<view class="textt2">
@ -196,7 +196,7 @@
</view>
</view>
<view class="zhiwen_con" v-if="false">
<view class="zhiwen_con" v-if="fingerSuccess">
<view class="tiao">
</view>
<view class="bigtitle">
@ -207,14 +207,14 @@
<view class="text1 green">
Fingerprint recognized.
</view>
<view class="flex con">
<!-- <view class="flex con">
<view class="textt1">
Use Password
</view>
<view class="textt2">
Cancel
</view>
Confirm
</view>
</view> -->
</view>
</view>
@ -245,6 +245,10 @@
addressInfo:{},
recipientAddress:'',
transAmount:'',
fingerSuccess:false,
fingerFail:false,
// 使
passShow:false,
//
transInfoPass:{
fromAddress:'',
@ -274,8 +278,7 @@
this.showFinger=true
this.showBottom=false;
// true
var bltype=this.$walletUtil.fingerprint();
console.log(bltype,444444)
this.fingerprint();
//
this.transInfoPass.fromAddress=this.addressInfo.address;
this.transInfoPass.toAddress=this.recipientAddress;
@ -321,17 +324,147 @@
})
return
}
if( this.transAmount>this.addressInfo.balance){
// if( this.transAmount>this.addressInfo.balance){
// uni.showToast({
// title: 'Sorry, your credit is running low',
// icon: 'none',
// duration: 1500
// })
// return
// }
this.showBottom=true;
this.show=true;
},
//
fingerprint: function(sett) {
let bltype=true;
// #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) {
uni.showToast({
title: 'Sorry, your credit is running low',
title: 'This device does not support fingerprint identification',
icon: 'none',
duration: 1500
})
return
// 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;
}
this.showBottom=true;
});
// 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){
console.log(text)
uni.navigateTo({
@ -344,6 +477,10 @@
if(uni.getStorageSync('myTransAddress')){
this.recipientAddress=uni.getStorageSync('myTransAddress').address
}
//
if(uni.getStorageSync('fingerPass')){
this.passShow=uni.getStorageSync('fingerPass')
}
this.addressInfo=uni.getStorageSync('infoWallet')
console.log(this.addressInfo,1111)
}

61
pages/menu/setting/index.css

@ -32,3 +32,64 @@
color: #A3AED0;
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">
Fingerprint password
</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 class="item flex">
<view class="text1">
@ -45,6 +45,67 @@
</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>
</template>
@ -55,12 +116,181 @@
data() {
return {
checked: false,
show:false,
showFinger:false,
fingerSuccess:false,
fingerFail:false,
};
},
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) {
// console.log(status);
},
},
onLoad() {
//
if(uni.getStorageSync('fingerPass')){
this.checked=uni.getStorageSync('fingerPass')
}
}
};
</script>

4
pages/menu/wallet/index.vue

@ -125,6 +125,7 @@
console.log(uni.getStorageSync('wallet'),'钱包');
thar.userObj = uni.getStorageSync('wallet');
thar.userObj2 = uni.getStorageSync('wallet');
thar.userObj.address = thar.userObj.address.substring(0, 6) + '...' + thar.userObj.address
.substring(25,
thar.userObj.address.length);
@ -132,7 +133,8 @@
if (!thar.isStop) {
thar.updateData()
}
}, 5000);
}, 2000);
},
goOther() {

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

File diff suppressed because one or more lines are too long

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

Loading…
Cancel
Save