loading.vue 879 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view>
  3. <view class="count-down">
  4. {{countDown}}
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. timer: null,
  13. countDown: 5,
  14. }
  15. },
  16. created() {
  17. this.timer = setInterval(() => {
  18. if (this.countDown > 0) {
  19. this.countDown--
  20. } else {
  21. clearInterval(this.timer)
  22. uni.reLaunch({
  23. url: '/pages/lr/list',
  24. })
  25. }
  26. }, 1000)
  27. },
  28. methods: {
  29. }
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .count-down {
  34. position: absolute;
  35. top: 40%;
  36. left: 50%;
  37. transform: translateX(-50%);
  38. height: 150rpx;
  39. line-height: 150rpx;
  40. width: 150rpx;
  41. border: 2px dashed orange;
  42. border-radius: 50%;
  43. text-align: center;
  44. font-size: 100rpx;
  45. font-weight: bold;
  46. color: orange;
  47. }
  48. </style>