<template> <view class="cmain"> <view class="face"> <cmd-circle stroke-color="#4581fb" :strokeWidth="13" type="circle" :percent="parseInt(progress.toFixed(0))" :width="200"></cmd-circle> <view class="desc">请误遮挡眼睛</view> </view> </view> </template> <script> export default { data() { return { progress: 0 }; }, onLoad() { uni.startFacialRecognitionVerify(); let increment = 100 / 3; // 每秒递增的进度值 let countdown = setInterval(() => { this.progress += increment; if (this.progress >= 100) { this.progress = 100; clearInterval(countdown); // 达到100后清除定时器 //uni.$emit('face'); //uni.navigateBack(); } }, 1000); } }; </script> <style lang="scss"> .face { text-align: center; padding-top: 30px; .desc { margin-top: 15px; color: #969696; } } </style>