index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <m-nav-bar :title="query.title" />
  3. <div class="cell-box">
  4. <van-cell
  5. class="cell"
  6. :title="item.title"
  7. is-link
  8. center
  9. v-for="(item, index) in classData"
  10. :key="index"
  11. :border="false"
  12. @click="
  13. () => {
  14. push({
  15. name: 'exercise',
  16. query: {
  17. ...query,
  18. title:item.title,
  19. columnAll:item.columnId
  20. },
  21. });
  22. }
  23. ">
  24. <template #icon>
  25. <div class="icon">{{ index + 1 }}</div>
  26. </template>
  27. </van-cell>
  28. <view class="classify-tip">
  29. <m-classify-tip :content="classifyTip"></m-classify-tip>
  30. </view>
  31. </div>
  32. </template>
  33. <script setup lang="ts">
  34. import { getQuestionColumn, getTopicClass } from "@/api";
  35. import { ref } from "vue";
  36. import { RouterBus } from "@/hooks";
  37. const {
  38. route: { query },
  39. router: { push },
  40. } = new RouterBus();
  41. const classData = ref([]);
  42. const classifyTip = query.title === "地方专题" ? ref(["地方题库,如有个别地区增加【地方题库】,请选择该区域的【地方题库】+【必学题】学习,如果没有无需学习地方题库"]) : ref(["分类练习,学员可重点学习自己不懂的题目.", "建议新学员直接看软件必考题技巧,快速学习"]);
  43. getQuestionColumn({
  44. model:query['model'] as string,
  45. subject:query.subject=='1'?'k1_3':'k4_3'
  46. }).then(({ data }) => {
  47. //地方专题第一个选项去掉
  48. // if (query.title == "地方专题") {
  49. // data.data?.shift();
  50. // }
  51. classData.value = data.data;
  52. });
  53. </script>
  54. <style lang="scss" scoped>
  55. .classify-tip {
  56. width: 375px;
  57. margin-top: 20px;
  58. }
  59. .cell-box {
  60. display: flex;
  61. padding: 5px 15px;
  62. flex-wrap: wrap;
  63. justify-content: space-between;
  64. .cell {
  65. width: 167px;
  66. margin-top: 10px;
  67. box-shadow: 0px 0px 10px rgba(124, 129, 136, 0.2);
  68. }
  69. .icon {
  70. width: 20px;
  71. height: 20px;
  72. background: #498ef5;
  73. border-radius: 50%;
  74. font-weight: 500;
  75. font-family: PingFang SC;
  76. font-size: 13px;
  77. display: flex;
  78. justify-content: center;
  79. align-items: center;
  80. color: #ffffff;
  81. margin-right: 5px;
  82. }
  83. }
  84. </style>