mpvue小程序实现人脸识别/视频录制/身份验证/CryptoJS加密 等功能

本文介绍了如何使用mpvue小程序集成人脸识别、视频录制、身份验证以及CryptoJS加密等功能,详细阐述了关键代码实现过程,并展示了实际效果。
摘要由CSDN通过智能技术生成

mpvue小程序实现人脸识别/视频录制/身份验证/CryptoJS加密 等功能

先看效果图
在这里插入图片描述
在这里插入图片描述
mpvue小程序与数据宝对接实现人脸识别/视频录制/身份验证/CryptoJS 加密 等功能关键代码 index.vue

<template>
  <div class="page-body">
    <!-- 人脸识别引导提示内容 图一 -->
    <cover-view v-if="showFaceTip" class="showFaceClass">
      <cover-image :src="imgUrl.faceTip" style="width:100%;height:1100rpx;" />
      <button class="startButton" @click="runRecord" style="width:500rpx;">开始录制</button>
    </cover-view>
    <!-- 录制视频代码 图二 -->
    <div v-else class="showCameraBox">
      <cover-view class="longTip" v-show="longTip">'长按'底部按钮录制一段3~5S视频</cover-view>
      <div class="cameraBox">
        <camera
          @error="error"
          v-show="!imgsrc"
          device-position="front"
          flash="on"
          style="width: 100%;height:100%;"
        ></camera>
        <img v-show="imgsrc" mode="widthFix" :src="imgsrc" style="width:100%;height:100%;" />
      </div>
      <div class="btnRecord">
        <canvas canvas-id="firstCanvas" class="canvas"></canvas>
        <button
          v-if="cameraBtn"
          style="cursor:pointer;"
          class="wrap"
          id="wrap"
          :style="style"
          @touchstart="takePhoto"
          @touchend="handleTouchEnd"
          @longpress="handleLongPress"
        >
          <div class="inner" :style="style2"></div>
        </button>
        <button v-else style="cursor:pointer;" class="wrap" id="wrap" @tap="takePhoto">
          <div class="inner" :style="style2"></div>
        </button>
      </div>
    </div>
    <!-- 弹框提示 -->
    <mp-loading :showLoading="isShowLoading" loadingText="加载中..." :mask="isShowMask"></mp-loading>
  </div>
</template>
<style scoped>
.longTip {
  position: fixed;
  z-index: 99999999;
  top: 60rpx;
  color: rgba(212, 141, 52, 1);
}
.showFaceClass {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background: #000000;
  display: flex;
  align-items: center;
  flex-direction: column;
  z-index: 99999999;
}
.showCameraBox {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background: #000000;
  z-index: -1;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.startButton {
  position: fixed;
  bottom: 200rpx;
  width: 490rpx;
  height: 91rpx;
  padding: 0 60rpx;
  box-sizing: border-box;
  text-align: center;
  line-height: 91rpx;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值