hjyd的手机端
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.

149 lines
3.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="track_container">
  3. <div class="card_wrap">
  4. <div
  5. :class="item.bg ? 'card bg' : 'card'"
  6. v-for="item in trackList"
  7. :key="item.id"
  8. >
  9. <div v-if="item.id != activeTab" class="stand">
  10. <img class="icon" :src="item.pic" />
  11. <p class="title">{{ item.title }}</p>
  12. <div class="btn" @click="toClassifyPage(item.id)">点击查看更多</div>
  13. </div>
  14. <div v-else class="selected">
  15. <img :src="getImg(item.id)" alt="" class="img" />
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script setup>
  22. import { trackList } from '@/mock'
  23. import A1 from '@/static/img/caseshow/healthcare.png'
  24. import A2 from '@/static/img/caseshow/hardware.png'
  25. import A3 from '@/static/img/caseshow/industry.png'
  26. import A4 from '@/static/img/caseshow/railway.png'
  27. import A5 from '@/static/img/caseshow/outdoors.png'
  28. import A6 from '@/static/img/caseshow/specialequip.png'
  29. import A7 from '@/static/img/caseshow/healthcare.png'
  30. import A8 from '@/static/img/caseshow/smarthome.png'
  31. import A9 from '@/static/img/caseshow/electronics.png'
  32. import { useRoute, useRouter } from 'vue-router'
  33. const router = useRouter()
  34. const route = useRoute()
  35. import { watch } from 'vue'
  36. const props = defineProps({
  37. activeTab: {
  38. type: Number,
  39. },
  40. })
  41. watch(
  42. () => route.query.t,
  43. () => {
  44. router.go(0)
  45. },
  46. )
  47. const toClassifyPage = id => {
  48. router.push({
  49. path: '/case-show',
  50. query: {
  51. t: id,
  52. },
  53. })
  54. }
  55. const getImg = id => {
  56. if (id == 1) {
  57. return A1
  58. }
  59. if (id == 2) {
  60. return A2
  61. }
  62. if (id == 3) {
  63. return A3
  64. }
  65. if (id == 4) {
  66. return A4
  67. }
  68. if (id == 5) {
  69. return A5
  70. }
  71. if (id == 6) {
  72. return A6
  73. }
  74. if (id == 7) {
  75. return A7
  76. }
  77. if (id == 8) {
  78. return A8
  79. }
  80. if (id == 9) {
  81. return A9
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .track_container {
  87. .card_wrap {
  88. display: grid;
  89. grid-template-columns: repeat(3, 1fr);
  90. grid-template-rows: repeat(3, 1fr);
  91. box-sizing: border-box;
  92. .card {
  93. flex: 1;
  94. background: #fff;
  95. .stand {
  96. display: flex;
  97. flex-direction: column;
  98. align-items: center;
  99. padding: 20px 0;
  100. .icon {
  101. width: auto;
  102. height: 20px;
  103. margin-bottom: 11px;
  104. }
  105. .title {
  106. font-size: 16px;
  107. transform: scale(0.5);
  108. line-height: 8px;
  109. font-family: Alibaba PuHuiTi;
  110. font-weight: 400;
  111. color: #262626;
  112. margin-bottom: 4px;
  113. }
  114. .btn {
  115. border: 1px solid #262626;
  116. padding: 8px 16px;
  117. display: flex;
  118. align-items: center;
  119. justify-content: center;
  120. font-size: 12px;
  121. transform: scale(0.5);
  122. font-family: Alibaba PuHuiTi;
  123. font-weight: 300;
  124. color: #262626;
  125. white-space: nowrap;
  126. }
  127. }
  128. .selected {
  129. display: flex;
  130. align-items: center;
  131. justify-content: center;
  132. flex: 1;
  133. height: 100%;
  134. .img {
  135. width: 90px;
  136. height: 90px;
  137. box-shadow: 0px 2px 7px 0px rgba(8, 69, 71, 0.09);
  138. border-radius: 11px;
  139. }
  140. }
  141. }
  142. .bg {
  143. background: #fafafa;
  144. }
  145. }
  146. }
  147. </style>