You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.1 KiB

3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
3 months ago
1 month ago
1 month ago
3 months ago
1 month ago
1 month ago
1 month ago
2 weeks ago
1 month ago
2 weeks ago
1 month ago
1 month ago
1 month ago
2 weeks ago
1 month ago
3 months ago
1 month ago
3 months ago
4 weeks ago
3 months ago
1 month ago
3 months ago
  1. <template>
  2. <view class="content padding">
  3. <view class="con" v-for="(item,index) in dataList" :key="index">
  4. <view class="h5">{{ item.name }}</view>
  5. <view class="ul">
  6. <view class="li" v-for="(item2,index) in item.pidList" :key="index" @click="goPage(item2)">
  7. <view class="icon">
  8. <image :src="item2.cover" mode=""></image>
  9. </view>
  10. <view class="text">{{ item2.name }}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script setup>
  17. import { ref } from 'vue'
  18. import carStore from '@/store/modules/car.js'
  19. let usecarStore = carStore()
  20. import { columnFid, columnPid } from '@/config/api.js'
  21. function goPage(item) {
  22. usecarStore.setCar('knowType', item.param)
  23. uni.navigateTo({
  24. url: '/pages/exercises/brushQuestions/brushQuestions'
  25. })
  26. }
  27. let dataList = ref([])
  28. async function columnFidFn() {
  29. dataList.value = []
  30. let obj = {
  31. type: '3',
  32. stepType: usecarStore.carInfo.stepType,
  33. carType: usecarStore.carInfo.carType,
  34. city: usecarStore.carInfo.city
  35. }
  36. const {data: res} = await columnFid(obj)
  37. for(let i=0; i<res.length; i++) {
  38. res[i].pidList = await columnPidFn(res[i].id,)
  39. dataList.value.push(res[i])
  40. }
  41. console.log(dataList.value)
  42. }
  43. columnFidFn()
  44. async function columnPidFn(pid) {
  45. const {data: res} = await columnPid(pid, usecarStore.carInfo.city)
  46. return res
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. image {
  51. display: block;
  52. width: 100%;
  53. height: 100%;
  54. }
  55. .content {
  56. width: 100%;
  57. .con {
  58. padding: 50rpx 0 20rpx 0;
  59. .h5 {
  60. font-weight: bold;
  61. margin-bottom: 10rpx;
  62. font-size: 32rpx;
  63. }
  64. .ul {
  65. display: flex;
  66. flex-wrap: wrap;
  67. .li {
  68. width: 25%;
  69. display: flex;
  70. flex-direction: column;
  71. align-items: center;
  72. padding: 30rpx 0;
  73. .icon {
  74. width: 68rpx;
  75. height: 68rpx;
  76. // box-shadow: 0px 2rpx 5rpx 0px rgba(239,143,76,0.5);
  77. border-radius: 26rpx;
  78. overflow: hidden;
  79. }
  80. .text {
  81. font-weight: 500;
  82. margin-top: 20rpx;
  83. font-size: 28rpx;
  84. white-space: nowrap;
  85. }
  86. }
  87. }
  88. }
  89. }
  90. </style>