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.

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