todo.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="todo-page" >
  3. <div class="title" >
  4. <div class="desc" >代办事项</div>
  5. <div class="reload" @click="reload" >
  6. <van-icon name="replay" :class="[loading? 'ratota-ani': '']" />
  7. 刷新
  8. </div>
  9. </div>
  10. <div class="todo-card" @click="goPageDetail" >
  11. <div class="card-tile" >
  12. 待审核订单
  13. </div>
  14. <div class="todo-count" >
  15. {{count}}
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script setup >
  21. import { onMounted, ref } from 'vue'
  22. import { useRouter } from 'vue-router'
  23. import { crmMessagNumAPI } from '@/api/order'
  24. import { useSchedulerOnce } from 'flicker-vue-hooks'
  25. const router = useRouter()
  26. const count = ref(0)
  27. const loading = ref(false)
  28. const reload = () => {
  29. loading.value = true
  30. useSchedulerOnce( async () => {
  31. await getCrmMessagNumAPI()
  32. loading.value = false
  33. }, 100)
  34. }
  35. const getCrmMessagNumAPI = async () => {
  36. const { data } = await crmMessagNumAPI()
  37. count.value = data.checkOrder
  38. }
  39. const goPageDetail = () => {
  40. router.push({
  41. path: '/todoDetail'
  42. })
  43. }
  44. onMounted(() => {
  45. getCrmMessagNumAPI()
  46. })
  47. </script>
  48. <style lang='less' scoped >
  49. .todo-page {
  50. width: 100vw;
  51. height: 100vh;
  52. background-color: #f9f8f8;
  53. padding: 24px;
  54. box-sizing: border-box;
  55. .title {
  56. width: 100%;
  57. display: flex;
  58. justify-content: space-between;
  59. align-items: center;
  60. padding-top: 48px;
  61. font-size: 32px;
  62. .desc {
  63. font-size: 60px;
  64. font-weight: 600;
  65. }
  66. .reload {
  67. width: 160px;
  68. height: 60px;
  69. background-color: #0643A2;
  70. border-radius: 8px;
  71. display: flex;
  72. justify-content: center;
  73. align-items: center;
  74. color: #fff;
  75. }
  76. }
  77. .todo-card {
  78. width: 700px;
  79. height: 280px;
  80. background-color: #fff;
  81. border-radius: 24px;
  82. margin: 0 auto;
  83. margin-top: 48px;
  84. padding: 24px;
  85. box-sizing: border-box;
  86. .card-tile {
  87. width: 200px;
  88. height: 40px;
  89. font-size: 32px;
  90. border-left: 8px solid #0643A2;
  91. }
  92. .todo-count {
  93. width: 100%;
  94. text-align: left;
  95. margin-top: 48px;
  96. font-size: 80px;
  97. font-weight: 600;
  98. color: red;
  99. padding-left: 48px;
  100. }
  101. }
  102. .ratota-ani {
  103. animation: ratota-keyframes 1s linear infinite;
  104. }
  105. @keyframes ratota-keyframes {
  106. 0% {
  107. transform: rotate(0deg);
  108. }
  109. 100% {
  110. transform: rotate(360deg);
  111. }
  112. }
  113. }
  114. </style>