-
zhangwei
2025-03-06 02ad32582e3a3b0e6f4b2d1b50593eff1d0558e3
src/components/tem/tem-session.vue
@@ -143,60 +143,61 @@
               videoCtx.takePhoto({
                  quality: 'original',
                  success: (e) => {
                     console.log(e.tempImagePath,'e.tempImagePath');
                     //上传照片接口,图片换成远端url地址 自行替换
                     uploadImage(e.tempImagePath).then((res) => {
                        this.setData({
                           faceImg: res
                        })
                        wx.showLoading({
                           title: '正在验证',
                        })
                     // uploadImage(e.tempImagePath).then((res) => {
                     //    this.setData({
                     //       faceImg: res
                     //    })
                     //    wx.showLoading({
                     //       title: '正在验证',
                     //    })
                        try {
                           // 执行后端分析人脸
                           api({
                              img: res
                           }).then((writeoffRes) => {
                              //识别成功
                              //自行处理识别成功结果
                           }).catch(err => {
                              wx.hideLoading();
                              wx.showModal({
                                 title: err.msg,
                                 showCancel: false,
                                 confirmText: '重新核验',
                                 complete: (res) => {
                                    if (res.confirm) {
                                       this.setData({
                                          startVerify: false,
                                          faceImg: "",
                                          verifyText: '请移动面容到框内',
                                          isCentre: false,
                                          face: {}
                                       }, () => {
                                          this.handleStart()
                                       })
                                    }
                                 }
                              })
                           })
                        } catch (error) {
                           console.log(error)
                        }
                     }).catch(() => {
                        this.setData({
                           startVerify: false,
                           faceImg: "",
                           verifyText: '请移动面容到框内',
                           isCentre: false,
                           face: {}
                        }, () => {
                           this.handleStart()
                           wx.showToast({
                              title: '网络连接失败,请重试',
                           })
                        })
                     })
                     //    try {
                     //       // 执行后端分析人脸
                     //       api({
                     //          img: res
                     //       }).then((writeoffRes) => {
                     //          //识别成功
                     //          //自行处理识别成功结果
                     //       }).catch(err => {
                     //          wx.hideLoading();
                     //          wx.showModal({
                     //             title: err.msg,
                     //             showCancel: false,
                     //             confirmText: '重新核验',
                     //             complete: (res) => {
                     //                if (res.confirm) {
                     //                   this.setData({
                     //                      startVerify: false,
                     //                      faceImg: "",
                     //                      verifyText: '请移动面容到框内',
                     //                      isCentre: false,
                     //                      face: {}
                     //                   }, () => {
                     //                      this.handleStart()
                     //                   })
                     //                }
                     //             }
                     //          })
                     //       })
                     //    } catch (error) {
                     //       console.log(error)
                     //    }
                     // }).catch(() => {
                     //    this.setData({
                     //       startVerify: false,
                     //       faceImg: "",
                     //       verifyText: '请移动面容到框内',
                     //       isCentre: false,
                     //       face: {}
                     //    }, () => {
                     //       this.handleStart()
                     //       wx.showToast({
                     //          title: '网络连接失败,请重试',
                     //       })
                     //    })
                     // })
                  }
               })
            })
@@ -298,15 +299,15 @@
   }
   .camera {
      width: 600rpx;
      height: 600rpx;
      border-radius: 50% 50%;
      width: 800rpx;
      height: 800rpx;
      /* border-radius: 50% 50%; */
      margin: 0 auto;
   }
   .faceImg {
      width: 600rpx;
      height: 600rpx;
      width: 800rpx;
      height: 800rpx;
      border-radius: 50% 50%;
      margin: 0 auto;
      position: absolute;