bitcooo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

287 lines
7.5 KiB

<template>
<view class="rela">
<view class="main">
<image src="../../static/tongyonh/Group285.png" mode="aspectFit" class="logo"></image>
<view class="fingcon">
<image src="../../static/tongyonh/zhiwen.png" mode="aspectFit" class="finimg" @click="goFinger"></image>
<view class="te1">
{{i18n.Clicktoverify}}
</view>
</view>
<view class="passTex" @click="gopwd">
<!-- <view class="lans" @click="show = true">
{{i18n.lans}}
</view> -->
{{i18n.Loginwith}}
</view>
</view>
<u-mask z-index="10" :show="show"></u-mask>
<view class="hou_jia" v-if="showFinger">
<view class="Log">
{{i18n.Login}}
</view>
<image src="../../static/tongyonh/zww.png" mode="aspectFit" class="zzw" @click="goFinger()"></image>
<view class="Log" @click="cancel">
{{i18n.Cancel}}
</view>
</view>
<u-select :confirm-text="cnt" :cancel-text="can" v-model="show" :list="list3" @confirm="confirm"></u-select>
</view>
</template>
<script>
import cont from "@/components/navigation/navigation.vue"
export default {
data() {
return {
cnt:this.$t('index').Confirm,
can:this.$t('index').Cancel,
checked: false,
show: false,
showFinger: false,
fingerSuccess: false,
fingerFail: false,
hou_jia_w: false,
language: this.$store.state.language == 'en' ? 'English' : '简体中文',
show: false,
list3: [{
label: this.$t('index').langfan,
disabled: false,
value: "b",
},
{
label: this.$t('index').langjian,
disabled: false,
value: "a",
},
{
label: this.$t('index').eng,
disabled: false,
value: "c",
},
],
};
},
methods: {
gopwd() {
uni.navigateTo({
url: '/pages/fingerPage/password/index'
})
console.log(123456465)
},
confirm(e){
uni.setStorageSync('lang',e[0].value)
if (e[0].value == 'c') {
this._i18n.locale = 'en'
this.$store.commit('setLanguage', 'en')
uni.setStorageSync('langTrue', 'English')
uni.setStorageSync("language", 'en')
uni.redirectTo({
url:'/pages/fingerPage/index'
})
} else if (e[0].value == 'a') {
this._i18n.locale = 'zh-CN'
this.$store.commit('setLanguage', 'zh-CN')
uni.setStorageSync("language", 'zh-CN')
uni.setStorageSync('langTrue', '简体中文')
uni.redirectTo({
url:'/pages/fingerPage/index'
})
} else if (e[0].value == 'b'){
this._i18n.locale = 'zh-CNF'
this.$store.commit('setLanguage', 'zh-CNF')
uni.setStorageSync("language", 'zh-CNF')
uni.setStorageSync('langTrue', '繁體中文')
uni.redirectTo({
url:'/pages/fingerPage/index'
})
}
},
goFinger(){
this.showFinger=true;
this.show=true;
this.fingerPass()
},
// 依旧保留指纹
cancel_hou() {
this.hou_jia_w = false;
this.show = false;
this.checked = true;
},
// 确认取消指纹
confirm_hou() {
this.checked = false
this.hou_jia_w = false;
this.show = false;
uni.setStorageSync('fingerPass', false)
},
// 关闭所有
cancel() {
this.showFinger = false;
this.checked = false;
this.show = false;
this.printCancel();
},
// 取消指纹识别
printCancel() {
this.show = false;
this.showFinger = false
console.log(this.showFinger,777777777777)
plus.fingerprint.cancel();
},
fingerPass() {
console.log(this.checked)
// 如果是启动的就调指纹
this.show = true;
this.showFinger = true;
this.fingerprint(true);
},
fingerprint: function() {
// 进来先判断本机有没有指纹
// #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) {
uni.showToast({
title: this.$t('index').fingerprintidentification,
icon: 'none',
duration: 1500
})
// this.disabled = true;
} else if (!plus.fingerprint.isKeyguardSecure()) {
uni.showToast({
title: this.$t('index').notequipped,
icon: 'none',
duration: 1500
})
} else if (!plus.fingerprint.isEnrolledFingerprints()) {
uni.showToast({
title: this.$t('index').oninthesetting,
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.setStorageSync('fingerPass', true)
that.showFinger = false;
that.fingerSuccess = true;
that.show = false;
uni.reLaunch({
url:'/pages/menu/wallet/index'
})
}, function(e) {
// 指纹识别失败后的各种情况
switch (e.code) {
case e.AUTHENTICATE_MISMATCH:
plus.nativeUI.toast(that.$t('index').Fingerprintmatchingfailed);
// uni.setStorageSync('fingerPass',false)
that.showFinger=false;
that.fingerFail=true;
that.checked=false
that.show=false;
break;
case e.AUTHENTICATE_OVERLIMIT:
plus.nativeUI.closeWaiting(); //兼容Android平台关闭等待框
plus.nativeUI.alert(that.$t('index').Thenumberoffingerprint);
// uni.setStorageSync('fingerPass',false)
that.showFinger=false;
that.fingerFail=true;
that.checked=false
that.show=false;
break;
case e.CANCEL:
plus.nativeUI.toast(that.$t('index').Recognitioncancelled);
// uni.setStorageSync('fingerPass',false)
that.showFinger=false;
that.checked=false
that.fingerFail=true;
that.show=false;
break;
default:
plus.nativeUI.closeWaiting(); //兼容Android平台关闭等待框
// uni.setStorageSync('fingerPass',false)
that.showFinger=false;
that.checked=false
that.show=false;
that.fingerFail=true;
plus.nativeUI.alert(that.$t('index').Fingerprintidentificationfailed);
break;
}
});
// Android平台手动弹出等待提示框
if ('Android' == plus.os.name) {
this.show = true;
/* plus.nativeUI.showWaiting('指纹识别中...').onclose = function() {
plus.fingerprint.cancel();
} */
}
// #endif
}
// #endif
},
change(status) {
},
},
onLoad() {
// 每次进来拿缓存里有没有指纹
if (uni.getStorageSync('fingerPass')) {
this.showFinger=true;
this.show=true;
this.fingerPass()
}
},
computed: {
i18n() {
return this.$t('index')
},
}
};
</script>
<style scoped>
</style>
<style>
@import './index.css';
</style>