工业设计
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.

346 lines
8.6 KiB

2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="design_detail_container">
  3. <Header :active="true" />
  4. <img :src="getTitleImg()" class="big_img" alt="" />
  5. <div class="cards_case_container">
  6. <div
  7. class="card"
  8. @click="showDetailModal(item.id)"
  9. v-for="item in case_detail_list[activeTab]"
  10. :key="item"
  11. >
  12. <div class="title">{{ item.title }}</div>
  13. <div class="img_wrap">
  14. <img v-lazy="item.thumb" class="img" alt="" />
  15. </div>
  16. <div class="bottom_wrap">
  17. <!-- <p class="en"></p> -->
  18. <div class="detail">案例详情</div>
  19. </div>
  20. </div>
  21. <!-- <div class="more_card">
  22. <img class="more_img" :src="More" alt="" />
  23. <div class="modal"></div>
  24. </div> -->
  25. <div class="btns_box">
  26. <div :class="activeClass('1')" @click="changeDetail('1')">
  27. 医疗健康
  28. <p class="line" v-if="activeTab == '1'"></p>
  29. </div>
  30. <div :class="activeClass('2')" @click="changeDetail('2')">
  31. 智能硬件
  32. <p class="line" v-if="activeTab == '2'"></p>
  33. </div>
  34. <div :class="activeClass('3')" @click="changeDetail('3')">
  35. 工业设备
  36. <p class="line" v-if="activeTab == '3'"></p>
  37. </div>
  38. <div :class="activeClass('4')" @click="changeDetail('4')">
  39. 高铁设备
  40. <p class="line" v-if="activeTab == '4'"></p>
  41. </div>
  42. <div :class="activeClass('5')" @click="changeDetail('5')">
  43. 户外设备
  44. <p class="line" v-if="activeTab == '5'"></p>
  45. </div>
  46. <div :class="activeClass('6')" @click="changeDetail('6')">
  47. 特种设备
  48. <p class="line" v-if="activeTab == '6'"></p>
  49. </div>
  50. <div :class="activeClass('7')" @click="changeDetail('7')">
  51. 智能家居
  52. <p class="line" v-if="activeTab == '7'"></p>
  53. </div>
  54. <div :class="activeClass('8')" @click="changeDetail('8')">
  55. 实验仪器
  56. <p class="line" v-if="activeTab == '8'"></p>
  57. </div>
  58. <div :class="activeClass('9')" @click="changeDetail('9')">
  59. 消费电子
  60. <p class="line" v-if="activeTab == '9'"></p>
  61. </div>
  62. </div>
  63. </div>
  64. <Bottom />
  65. <DetailModal
  66. v-if="showModalVisible"
  67. :hiddenDetailModal="hiddenDetailModal"
  68. :productInfo="productInfo"
  69. />
  70. </div>
  71. </template>
  72. <script setup>
  73. import Header from 'cpns/design/Header'
  74. import A1 from '@/assets/design/detail/1.png'
  75. import A2 from '@/assets/design/detail/2.png'
  76. import A3 from '@/assets/design/detail/3.png'
  77. import A4 from '@/assets/design/detail/4.png'
  78. import A5 from '@/assets/design/detail/5.png'
  79. import A6 from '@/assets/design/detail/6.png'
  80. import A7 from '@/assets/design/detail/7.png'
  81. import A8 from '@/assets/design/detail/8.png'
  82. import A9 from '@/assets/design/detail/9.png'
  83. import More from '@/assets/design/detail/more.png'
  84. import Bottom from 'cpns/NewBottomWhite.vue'
  85. import { ref, onMounted, watch } from 'vue'
  86. import { useRoute } from 'vue-router'
  87. import DetailModal from 'cpns/design/DetailModal'
  88. import { case_detail_img_data } from '@/mock/case'
  89. import { case_detail_list } from '@/mock/case_industry'
  90. const showModalVisible = ref(false)
  91. const activeClass = i => {
  92. if (activeTab.value == i) {
  93. return 'btn active'
  94. }
  95. return 'btn'
  96. }
  97. const route = useRoute()
  98. const activeTab = ref('1')
  99. const changeDetail = index => {
  100. activeTab.value = index
  101. }
  102. const getTitleImg = () => {
  103. const val = activeTab.value
  104. if (val == '1') {
  105. return A1
  106. }
  107. if (val == '2') {
  108. return A2
  109. }
  110. if (val == '3') {
  111. return A3
  112. }
  113. if (val == '4') {
  114. return A4
  115. }
  116. if (val == '5') {
  117. return A5
  118. }
  119. if (val == '6') {
  120. return A6
  121. }
  122. if (val == '7') {
  123. return A7
  124. }
  125. if (val == '8') {
  126. return A8
  127. }
  128. if (val == '9') {
  129. return A9
  130. }
  131. }
  132. const productInfo = ref({})
  133. const showDetailModal = id => {
  134. // 取消html的滚动条
  135. const rootTag = document.getElementById('iflytop')
  136. rootTag.style.overflow = 'hidden'
  137. rootTag.style.height = '100%'
  138. showModalVisible.value = true
  139. // 根据activeTab和id确定详情数据
  140. productInfo.value = case_detail_list[activeTab.value][id]
  141. }
  142. const hiddenDetailModal = () => {
  143. // 恢复html的滚动条
  144. const rootTag = document.getElementById('iflytop')
  145. rootTag.style['overflow-y'] = 'scroll'
  146. rootTag.style['overflow-x'] = 'hidden'
  147. rootTag.style.height = 'auto'
  148. productInfo.value = {}
  149. showModalVisible.value = false
  150. }
  151. onMounted(() => {
  152. document.body.scrollTop = document.documentElement.scrollTop = 0
  153. if (route.query?.t) {
  154. activeTab.value = route.query?.t
  155. }
  156. })
  157. watch(
  158. () => route.query?.t,
  159. () => {
  160. activeTab.value = route.query?.t
  161. },
  162. { immediate: true, deep: true },
  163. )
  164. </script>
  165. <style lang="scss" scoped>
  166. .design_detail_container {
  167. .big_img {
  168. width: 100vw;
  169. height: auto;
  170. }
  171. .cards_case_container {
  172. background: #f6f6f6;
  173. padding: 110px;
  174. display: grid;
  175. grid-template-columns: repeat(4, 1fr);
  176. column-gap: 40px;
  177. row-gap: 40px;
  178. position: relative;
  179. .btns_box {
  180. position: absolute;
  181. left: 110px;
  182. right: 110px;
  183. top: -53px;
  184. height: 106px;
  185. border-radius: 483px;
  186. background: #fff;
  187. display: flex;
  188. align-items: center;
  189. justify-content: space-evenly;
  190. .btn {
  191. font-family: Source Han Sans CN;
  192. font-size: 18px;
  193. font-weight: normal;
  194. line-height: normal;
  195. letter-spacing: 0em;
  196. color: #030303;
  197. cursor: pointer;
  198. position: relative;
  199. padding: 9px 26px;
  200. .line {
  201. position: absolute;
  202. left: 50%;
  203. bottom: 0;
  204. width: 38px;
  205. height: 2px;
  206. border-radius: 276px;
  207. background: #2a4ee1;
  208. transform: translateX(-50%);
  209. }
  210. transition-property: all;
  211. transition-duration: 0.1s;
  212. animation-fill-mode: forwards;
  213. &:hover {
  214. // transform: scale(1.1);
  215. color: $theme-color;
  216. font-weight: bold;
  217. }
  218. }
  219. .active {
  220. color: #2a4ee1;
  221. }
  222. }
  223. .card {
  224. border-radius: 21px;
  225. width: 100%;
  226. background: #ffffff;
  227. box-sizing: border-box;
  228. cursor: pointer;
  229. padding: 38px 43px 23px 43px;
  230. .title {
  231. white-space: nowrap;
  232. font-family: Source Han Sans CN;
  233. font-size: 22px;
  234. font-weight: normal;
  235. line-height: normal;
  236. letter-spacing: 0em;
  237. color: #787878;
  238. margin-bottom: 51px;
  239. }
  240. .img_wrap {
  241. height: 306px;
  242. width: 100%;
  243. margin-bottom: 83px;
  244. display: flex;
  245. justify-content: center;
  246. .img {
  247. height: 306px;
  248. width: 284px;
  249. border-radius: 20px;
  250. object-fit: cover;
  251. transition-property: all;
  252. transition-duration: 0.7s;
  253. animation-fill-mode: forwards;
  254. }
  255. }
  256. .bottom_wrap {
  257. display: flex;
  258. align-items: center;
  259. justify-content: space-between;
  260. .en {
  261. font-family: Source Han Sans CN;
  262. font-size: 14px;
  263. font-weight: normal;
  264. line-height: normal;
  265. letter-spacing: 0em;
  266. color: #000000;
  267. white-space: nowrap;
  268. }
  269. .detail {
  270. transition-property: all;
  271. transition-duration: 0.2s;
  272. animation-fill-mode: forwards;
  273. white-space: nowrap;
  274. padding: 11px 40px;
  275. border-radius: 324px;
  276. background: #f6f6f6;
  277. display: flex;
  278. width: 100%;
  279. align-items: center;
  280. justify-content: center;
  281. font-family: Source Han Sans CN;
  282. font-size: 16px;
  283. font-weight: normal;
  284. line-height: normal;
  285. letter-spacing: 0.1em;
  286. color: #787878;
  287. cursor: pointer;
  288. }
  289. }
  290. &:hover {
  291. .bottom_wrap {
  292. .detail {
  293. background: #2a4ee1;
  294. color: #ffffff;
  295. }
  296. }
  297. .img_wrap {
  298. .img {
  299. transform: translateY(-20px);
  300. }
  301. }
  302. }
  303. }
  304. .more_card {
  305. border-radius: 21px;
  306. width: 100%;
  307. background: #000;
  308. height: 578px;
  309. box-sizing: border-box;
  310. position: relative;
  311. overflow: hidden;
  312. .more_img {
  313. height: 578px;
  314. object-fit: cover;
  315. }
  316. .modal {
  317. opacity: 0;
  318. position: absolute;
  319. left: 0;
  320. top: 0;
  321. width: 100%;
  322. height: 100%;
  323. background: rgba(0, 0, 0, 0.8);
  324. box-shadow: inset 0px 0px 100px 0px #000000;
  325. }
  326. &:hover {
  327. .modal {
  328. opacity: 1;
  329. }
  330. }
  331. }
  332. }
  333. }
  334. </style>