face.vue 850 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <view class="cmain">
  3. <view class="face">
  4. <cmd-circle stroke-color="#4581fb" :strokeWidth="13" type="circle" :percent="parseInt(progress.toFixed(0))" :width="200"></cmd-circle>
  5. <view class="desc">请误遮挡眼睛</view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. data() {
  12. return {
  13. progress: 0
  14. };
  15. },
  16. onLoad() {
  17. uni.startFacialRecognitionVerify();
  18. let increment = 100 / 3; // 每秒递增的进度值
  19. let countdown = setInterval(() => {
  20. this.progress += increment;
  21. if (this.progress >= 100) {
  22. this.progress = 100;
  23. clearInterval(countdown); // 达到100后清除定时器
  24. //uni.$emit('face');
  25. //uni.navigateBack();
  26. }
  27. }, 1000);
  28. }
  29. };
  30. </script>
  31. <style lang="scss">
  32. .face {
  33. text-align: center;
  34. padding-top: 30px;
  35. .desc {
  36. margin-top: 15px;
  37. color: #969696;
  38. }
  39. }
  40. </style>