face.vue 808 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. let increment = 100 / 3; // 每秒递增的进度值
  18. let countdown = setInterval(() => {
  19. this.progress += increment;
  20. if (this.progress >= 100) {
  21. this.progress = 100;
  22. clearInterval(countdown); // 达到100后清除定时器
  23. uni.$emit('face');
  24. uni.navigateBack();
  25. }
  26. }, 1000);
  27. }
  28. };
  29. </script>
  30. <style lang="scss">
  31. .face {
  32. text-align: center;
  33. padding-top: 30px;
  34. .desc {
  35. margin-top: 15px;
  36. color: #969696;
  37. }
  38. }
  39. </style>