|
@@ -17,6 +17,7 @@ const bottomTips = {
|
|
|
error: '脸部信息录入失败'
|
|
|
}
|
|
|
let T: number = 0;
|
|
|
+let notify = ""
|
|
|
const daoJiShi: number = 15;
|
|
|
Page({
|
|
|
|
|
@@ -46,7 +47,8 @@ Page({
|
|
|
})
|
|
|
wx.nextTick(() => {
|
|
|
this.getMssage().then(async (r: any) => {
|
|
|
- console.log('是否授权发送消息:', r)
|
|
|
+ console.log('是否授权发送消息:', r);
|
|
|
+ notify = r;
|
|
|
if (!ctx) ctx = wx.createCameraContext();
|
|
|
this.createVK();
|
|
|
ctx.startRecord({
|
|
@@ -138,6 +140,18 @@ Page({
|
|
|
},
|
|
|
})
|
|
|
// 静态图片检测模式下,每调一次 detectFace 接口就会触发一次 updateAnchors 事件
|
|
|
+ createVKSession?.on('updateAnchors', (anchors)=> {
|
|
|
+ anchors.forEach((anchor:any) => {
|
|
|
+ const W = anchor.size.width * 100;
|
|
|
+ let titlet = "";
|
|
|
+ if(W < 20 || W > 80 ) titlet = "请远离屏幕"
|
|
|
+ if(W < 20) titlet = "请靠近屏幕"
|
|
|
+ titlet && wx.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: titlet
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
createVKSession?.on('removeAnchors', () => {
|
|
|
wx.showToast({
|
|
|
title: "未检测到人脸, 请重新采集",
|
|
@@ -178,7 +192,9 @@ Page({
|
|
|
url: base.url + '/v3/upload',
|
|
|
filePath: res.tempVideoPath,
|
|
|
name: 'file', //服务器定义的Key值
|
|
|
- formData: {},
|
|
|
+ formData: {
|
|
|
+ notify
|
|
|
+ },
|
|
|
header: {
|
|
|
Authorization: wx.getStorageSync("token")
|
|
|
},
|