loading.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view>
  3. <view class="count-wrap">
  4. <view class="count-down">
  5. {{countDown}}
  6. </view>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. timer: null,
  15. countDown: 3,
  16. }
  17. },
  18. onLoad(options) {
  19. const { id } = options
  20. this.timer = setInterval(() => {
  21. if (this.countDown > 0) {
  22. this.countDown--
  23. } else {
  24. clearInterval(this.timer)
  25. uni.reLaunch({
  26. url: '/pages/lr/list?id=' + id,
  27. })
  28. }
  29. }, 1000)
  30. },
  31. methods: {
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. .count-wrap {
  37. position: absolute;
  38. top: 40%;
  39. left: 50%;
  40. transform: translateX(-50%);
  41. }
  42. .count-down {
  43. height: 150rpx;
  44. line-height: 150rpx;
  45. width: 150rpx;
  46. border: 2px dashed #01c362;
  47. border-radius: 50%;
  48. text-align: center;
  49. font-size: 100rpx;
  50. font-weight: bold;
  51. color: #01c362;
  52. animation: zoom 1s linear infinite;
  53. }
  54. @keyframes zoom {
  55. 0% {
  56. transform: scale(1.4);
  57. }
  58. 50% {
  59. transform: scale(1.2);
  60. }
  61. 100% {
  62. transform: scale(1);
  63. }
  64. }
  65. </style>