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.

97 lines
2.0 KiB

2 months ago
2 weeks ago
2 months ago
2 weeks ago
2 months ago
2 weeks ago
2 months ago
2 weeks ago
2 months ago
2 weeks ago
2 weeks ago
2 months ago
2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
2 months ago
2 weeks ago
2 months ago
1 day ago
2 months ago
2 weeks ago
2 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. }
  35. const {data: res} = await columnFid(obj)
  36. for(let i=0; i<res.length; i++) {
  37. res[i].pidList = await columnPidFn(res[i].id)
  38. dataList.value.push(res[i])
  39. }
  40. console.log(dataList.value)
  41. }
  42. columnFidFn()
  43. async function columnPidFn(pid) {
  44. const {data: res} = await columnPid(pid)
  45. return res
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. image {
  50. display: block;
  51. width: 100%;
  52. height: 100%;
  53. }
  54. .content {
  55. width: 100%;
  56. .con {
  57. padding: 50rpx 0 20rpx 0;
  58. .h5 {
  59. font-weight: bold;
  60. margin-bottom: 10rpx;
  61. font-size: 32rpx;
  62. }
  63. .ul {
  64. display: flex;
  65. flex-wrap: wrap;
  66. .li {
  67. width: 25%;
  68. display: flex;
  69. flex-direction: column;
  70. align-items: center;
  71. padding: 30rpx 0;
  72. .icon {
  73. width: 68rpx;
  74. height: 68rpx;
  75. // box-shadow: 0px 2rpx 5rpx 0px rgba(239,143,76,0.5);
  76. border-radius: 26rpx;
  77. overflow: hidden;
  78. }
  79. .text {
  80. font-weight: 500;
  81. margin-top: 20rpx;
  82. font-size: 28rpx;
  83. white-space: nowrap;
  84. }
  85. }
  86. }
  87. }
  88. }
  89. </style>