ct-mattress/pages/my.vue

60 lines
1.2 KiB
Vue
Raw Normal View History

2023-12-05 16:45:28 +08:00
<template>
2024-01-27 16:37:52 +08:00
<view class="page">
2024-09-26 17:35:25 +08:00
<button @click="click" style="margin-top:500rpx ;">按钮</button>
2024-08-28 11:04:46 +08:00
2023-12-05 16:45:28 +08:00
</view>
</template>
<script>
export default {
data() {
return {
2024-01-27 16:37:52 +08:00
bgc: {
2024-08-28 11:04:46 +08:00
backgroundColor: "#4C97E7",
2024-01-27 16:37:52 +08:00
},
2024-08-28 11:04:46 +08:00
2024-01-23 19:15:52 +08:00
}
},
methods: {
2024-09-26 17:35:25 +08:00
click(){
// 检查是否支持生物认证
uni.checkIsSupportSoterAuthentication({
success: (res) => {
// 调用人脸识别API
wx.startFacialRecognitionVerify({
name: '吴鹏', // 用户名称
idCardNumber: '430523200402073551', // 身份证号码
success: (result) => {
if (result.errMsg === 'startFacialRecognitionVerify:ok') {
// 处理人脸识别成功的情况
console.log('人脸识别成功');
}
},
fail: (error) => {
// 处理人脸识别失败的情况
uni.showToast({
title: '人脸识别失败',
icon: 'none',
duration: 2000
});
}
});
},
fail: (err) => {
console.log('支持生物认证失败', err);
}
});
}
2024-08-28 11:04:46 +08:00
2024-01-23 19:15:52 +08:00
}
}
2023-12-05 16:45:28 +08:00
</script>
2024-08-28 11:04:46 +08:00
<style lang="scss">
page {
background-color: #fff;
2024-01-27 16:37:52 +08:00
}
2024-01-23 19:15:52 +08:00
2024-08-28 11:04:46 +08:00
</style>