index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <div class="cell-container">
  3. <div class="cell-box" :class="{
  4. 'is-row': isRow,
  5. }">
  6. <van-cell title-class="uni-app-fontsize-paragraph" class="cell" :title="item.title" is-link center v-for="(item, index) in classDataLeft" :key="index" :border="false" @click="
  7. () => {
  8. goExercise({
  9. excellIssueName: item.excellIssueName,
  10. sort: 2,
  11. });
  12. }
  13. ">
  14. <template #icon>
  15. <div class="icon-red">{{ index + 1 }}</div>
  16. </template>
  17. </van-cell>
  18. <van-cell title-class="uni-app-fontsize-paragraph" class="cell" :title="
  19. item.excellIssueName ||
  20. item.placeIssueName ||
  21. item.classIssueName ||
  22. item.sequeIssueName
  23. " is-link center v-for="(item, index) in classDataSpecial" :key="index" :border="false" @click="
  24. () => {
  25. goExercise({
  26. excellIssueName: item.excellIssueName,
  27. sort: 2,
  28. });
  29. }
  30. ">
  31. <template #icon>
  32. <div class="icon-red">{{ '新' }}</div>
  33. </template>
  34. </van-cell>
  35. <!-- <van-cell
  36. v-if="query.title !== '地方专题'"
  37. @click="
  38. () => {
  39. push({
  40. name: 'classify',
  41. query: {
  42. ...query,
  43. title: '地方专题',
  44. path: 'selectDfQuestionInfo',
  45. sort: 4,
  46. },
  47. });
  48. }
  49. "
  50. class="cell"
  51. title="地方专题"
  52. is-link
  53. center
  54. :border="false"
  55. >
  56. <template #icon>
  57. <div class="icon-blue">{{ "地" }}</div>
  58. </template>
  59. </van-cell> -->
  60. </div>
  61. <div style="padding-right: 0rpx" class="cell-box">
  62. <van-cell class="cell" :title="
  63. item.placeIssueName ||
  64. item.classIssueName ||
  65. item.excellIssueName ||
  66. item.sequeIssueName
  67. " @click="
  68. () => {
  69. goExercise({
  70. excellIssueName: item.excellIssueName,
  71. });
  72. }
  73. " is-link center v-for="(item, index) in classDataRight" :key="index" :border="false">
  74. <template #icon>
  75. <div class="icon-red">{{ index + 1 }}</div>
  76. </template>
  77. </van-cell>
  78. </div>
  79. <div style="height: 40rpx; width: 750rpx"></div>
  80. <m-classify-tip :content="classifyTip"></m-classify-tip>
  81. <view class="wxad">
  82. <ad ad-type="video" :ad-intervals="100" unit-id="adunit-8eb44bbd7e3147d4"></ad>
  83. </view>
  84. </div>
  85. </template>
  86. <script>
  87. import api from "@/api/index";
  88. import utils from "@/utils/index";
  89. export default {
  90. data() {
  91. return {
  92. isRow: false,
  93. classifyTip: [
  94. "软件题库已同步更新至车管所最新,左边的红色必学题,每套题必须学完.",
  95. "模拟考试能连续5次以上达到96分左右,即可参加考试",
  96. "如果模拟考试达不到要求,请把右边的选学题也学习一遍",
  97. ],
  98. classDataSpecial: [],
  99. classDataRight: [],
  100. classDataLeft: [],
  101. query: {
  102. vehicle: "",
  103. },
  104. };
  105. },
  106. onLoad(query) {
  107. this.query = query;
  108. this.isRow = this.query.vehicle === "摩托车";
  109. this.getClassData();
  110. },
  111. methods: {
  112. goExercise(extraQuery) {
  113. let query = Object.assign({}, this.query);
  114. if (extraQuery) {
  115. query = {
  116. ...query,
  117. ...extraQuery,
  118. };
  119. } else {
  120. }
  121. uni.navigateTo({
  122. url: "/otherPages/exercise/index?" + utils.mapToUrlQuery(query),
  123. });
  124. },
  125. getClassData() {
  126. api.exam.studentQuestion2InfoGetQuestionColumn({
  127. subject:'k1',
  128. model:'cart'
  129. }).then(res=>{
  130. this.classDataLeft = res.data;
  131. })
  132. // if (this.query.vehicle === "摩托车") {
  133. // api.exam
  134. // .studentQuestionInfoSelectJxQuestionInfo({
  135. // ...this.query,
  136. // })
  137. // .then((res) => {
  138. // this.classDataLeft = res.data;
  139. // });
  140. // } else {
  141. // api.exam
  142. // .studentQuestionInfoSelectJxQuestionInfo({
  143. // ...this.query,
  144. // excellIssueName: "选学",
  145. // })
  146. // .then((res) => {
  147. // this.classDataRight = res.data;
  148. // });
  149. // api.exam
  150. // .studentQuestionInfoSelectJxQuestionInfo({
  151. // ...this.query,
  152. // excellIssueName: "必",
  153. // })
  154. // .then((res) => {
  155. // // res.data.shift();
  156. // this.classDataLeft = res.data;
  157. // api.exam
  158. // .studentQuestionInfoSelectJxQuestionInfo({
  159. // ...this.query,
  160. // excellIssueName: "新",
  161. // })
  162. // .then((res) => {
  163. // this.classDataSpecial = [...res.data];
  164. // });
  165. // });
  166. // }
  167. },
  168. },
  169. };
  170. // getTopicClass(query.path as string, {
  171. // ...query,
  172. // excellIssueName: "必",
  173. // }).then(({ data }) => {
  174. // // res.data.data.shift();
  175. // console.log(data);
  176. // classDataLeft.value = data.data;
  177. // getTopicClass(query.path as string, {
  178. // ...query,
  179. // excellIssueName: "新增",
  180. // }).then(({ data }) => {
  181. // // data.data.shift();
  182. // classDataLeft.value = [...classDataLeft.value, ...data.data];
  183. // });
  184. // getTopicClass(query.path as string, {
  185. // ...query,
  186. // excellIssueName: "地方",
  187. // }).then(({ data }) => {
  188. // // data.data.shift();
  189. // classDataLeft.value = [...classDataLeft.value, ...data.data];
  190. // });
  191. // });
  192. // getTopicClass(query.path as string, {
  193. // ...query,
  194. // excellIssueName: "选学",
  195. // }).then(({ data }) => {
  196. // classDataRight.value = data.data;
  197. // });
  198. </script>
  199. <style lang="scss" scoped>
  200. .cell-container {
  201. display: flex;
  202. flex-direction: row;
  203. flex-wrap: wrap;
  204. padding: 30rpx 30rpx;
  205. justify-content: space-between;
  206. width: 100%;
  207. box-sizing: border-box;
  208. }
  209. .cell-box {
  210. display: flex;
  211. align-content: flex-start;
  212. align-items: flex-start;
  213. flex-wrap: wrap;
  214. flex-direction: row;
  215. justify-content: space-between;
  216. box-sizing: border-box;
  217. .cell {
  218. width: 334rpx;
  219. margin-bottom: 30rpx;
  220. box-shadow: 0px 0px 10rpx rgba(124, 129, 136, 0.2);
  221. }
  222. .icon-blue {
  223. width: 40rpx;
  224. height: 40rpx;
  225. background: #498ef5;
  226. border-radius: 50%;
  227. font-weight: 500;
  228. font-family: PingFang SC;
  229. font-size: 26rpx;
  230. display: flex;
  231. justify-content: center;
  232. align-items: center;
  233. color: #ffffff;
  234. margin-right: 10rpx;
  235. }
  236. .icon-red {
  237. width: 50rpx;
  238. height: 50rpx;
  239. background: red;
  240. border-radius: 50%;
  241. font-weight: 500;
  242. font-family: PingFang SC;
  243. font-size: 26rpx;
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. color: #ffffff;
  248. margin-right: 10rpx;
  249. }
  250. }
  251. .is-row {
  252. flex-direction: row;
  253. width: 100%;
  254. justify-content: space-between;
  255. }
  256. </style>