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.

349 lines
8.8 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 :src="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/SoftHardware/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 { hardware_list as case_detail_list } from '@/mock/case_software'
  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(3, 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. margin-top: 120px;
  243. width: 100%;
  244. margin-bottom: 83px;
  245. display: flex;
  246. justify-content: center;
  247. .img {
  248. width: auto;
  249. clip-path: inset(4px 4px 4px 4px);
  250. // max-width: 300px;
  251. height: 239px;
  252. border-radius: 20px;
  253. object-fit: cover;
  254. transition-property: all;
  255. transition-duration: 0.7s;
  256. animation-fill-mode: forwards;
  257. }
  258. }
  259. .bottom_wrap {
  260. display: flex;
  261. align-items: center;
  262. justify-content: space-between;
  263. .en {
  264. font-family: Source Han Sans CN;
  265. font-size: 14px;
  266. font-weight: normal;
  267. line-height: normal;
  268. letter-spacing: 0em;
  269. color: #000000;
  270. white-space: nowrap;
  271. }
  272. .detail {
  273. transition-property: all;
  274. transition-duration: 0.2s;
  275. animation-fill-mode: forwards;
  276. white-space: nowrap;
  277. padding: 11px 40px;
  278. border-radius: 324px;
  279. background: #f6f6f6;
  280. display: flex;
  281. width: 100%;
  282. align-items: center;
  283. justify-content: center;
  284. font-family: Source Han Sans CN;
  285. font-size: 16px;
  286. font-weight: normal;
  287. line-height: normal;
  288. letter-spacing: 0.1em;
  289. color: #787878;
  290. cursor: pointer;
  291. }
  292. }
  293. &:hover {
  294. .bottom_wrap {
  295. .detail {
  296. background: #2a4ee1;
  297. color: #ffffff;
  298. }
  299. }
  300. .img_wrap {
  301. .img {
  302. transform: translateY(-20px);
  303. }
  304. }
  305. }
  306. }
  307. .more_card {
  308. border-radius: 21px;
  309. width: 100%;
  310. background: #000;
  311. height: 578px;
  312. box-sizing: border-box;
  313. position: relative;
  314. overflow: hidden;
  315. .more_img {
  316. height: 578px;
  317. object-fit: cover;
  318. }
  319. .modal {
  320. opacity: 0;
  321. position: absolute;
  322. left: 0;
  323. top: 0;
  324. width: 100%;
  325. height: 100%;
  326. background: rgba(0, 0, 0, 0.8);
  327. box-shadow: inset 0px 0px 100px 0px #000000;
  328. }
  329. &:hover {
  330. .modal {
  331. opacity: 1;
  332. }
  333. }
  334. }
  335. }
  336. }
  337. </style>