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.

340 lines
10 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
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
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
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="wrap">
  3. <div class="empty" v-if="showEmpty"></div>
  4. <div class="flex_center" id="hardware_detail_container_flex_center">
  5. <div class="hardware_detail_container" id="hardware_detail_container">
  6. <div class="content">
  7. <Tabs @onMySonFunc="funcToSon" :isCase="false" />
  8. <Trumbs @onMySonFunc="funcToSon" :isCase="false" />
  9. <div class="content_detail">
  10. <div class="left_swiper">
  11. <div class="header_intro">
  12. <p>
  13. {{
  14. hardware_list[hardware_id] &&
  15. hardware_list[hardware_id][hardwareExampleId]?.title
  16. }}
  17. </p>
  18. </div>
  19. <div class="case_swiper_wrap" :key="componentKey">
  20. <swiper
  21. :pagination="true"
  22. :modules="modules"
  23. :autoHeight="true"
  24. class="case_detail_swiper"
  25. >
  26. <swiper-slide
  27. v-for="item in hardware_list[hardware_id] &&
  28. hardware_list[hardware_id][hardwareExampleId]?.swiperList"
  29. :key="item.id"
  30. >
  31. <div class="swiper_div_wrap">
  32. <img v-lazy="item.picUrl" class="img_swiper" alt="" />
  33. </div>
  34. </swiper-slide>
  35. </swiper>
  36. </div>
  37. </div>
  38. <div class="placeholder">
  39. <div
  40. class="right_detail"
  41. v-on:mouseover="mouseover"
  42. v-on:mouseleave="mouseleave"
  43. @scroll="handleScroll"
  44. :key="componentKey"
  45. >
  46. <div class="detail_header">
  47. <div>详情页</div>
  48. <div class="right">
  49. <p class="en">DETAILS PAGE</p>
  50. </div>
  51. </div>
  52. <div class="article">
  53. <Paragraph
  54. :text="
  55. hardware_list[hardware_id] &&
  56. hardware_list[hardware_id][hardwareExampleId]?.detailList
  57. ?.topText
  58. "
  59. :isHtml="
  60. hardware_list[hardware_id] &&
  61. hardware_list[hardware_id][hardwareExampleId]?.detailList
  62. ?.isHtml
  63. "
  64. />
  65. <div
  66. class="card_container"
  67. v-for="(item, index) in hardware_list[hardware_id] &&
  68. hardware_list[hardware_id][hardwareExampleId]?.detailList
  69. ?.card"
  70. :key="index"
  71. >
  72. <CardTitle
  73. :title="item?.cardTitle"
  74. :blue_title="item?.cardBlueTitle"
  75. :en="item?.en"
  76. />
  77. <IMG
  78. :double="item?.isDouble"
  79. :pic1="item?.pic1"
  80. :pic2="item?.pic2"
  81. />
  82. <Paragraph
  83. :isHtml="item.isHtml"
  84. v-if="item?.cardText"
  85. :text="item?.cardText"
  86. />
  87. <Intro
  88. v-if="item?.cardIntro"
  89. :cardIntro="item?.cardIntro"
  90. />
  91. <video
  92. v-if="item?.video"
  93. controls
  94. style="width: 100%; height: auto; object-fit: fill"
  95. controlslist="nodownload"
  96. >
  97. <source :src="item?.video" />
  98. </video>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </template>
  109. <script setup>
  110. import { ref, onMounted } from 'vue'
  111. import { handleScreenAuto, handleScreenToFlexCenter } from '@/common/utils'
  112. // Import Swiper Vue.js components
  113. import { Swiper, SwiperSlide } from 'swiper/vue'
  114. import { Pagination } from 'swiper'
  115. import { hardware_list } from '@/mock/hardware'
  116. import { useDetailStore, useSwiperStore } from '@/store'
  117. import { storeToRefs } from 'pinia'
  118. import Video from 'cpns/Video'
  119. import 'swiper/css'
  120. import 'swiper/css/pagination'
  121. import Paragraph from 'cpns/Paragraph'
  122. import IMG from 'cpns/Img'
  123. import CardTitle from 'cpns/CardTitle'
  124. import Tabs from 'cpns/Tabs'
  125. import Trumbs from 'cpns/Trumbs'
  126. import Intro from 'cpns/Intro'
  127. const showEmpty = ref(true)
  128. const modules = ref([Pagination])
  129. const detailStore = useDetailStore()
  130. const swiperStore = useSwiperStore()
  131. const { hardware_id, hardwareExampleId } = storeToRefs(detailStore)
  132. const componentKey = ref(0)
  133. const forceRerender = () => {
  134. componentKey.value = 1 + componentKey.value
  135. }
  136. const funcToSon = () => {
  137. forceRerender()
  138. }
  139. onMounted(() => {
  140. const func = () => {
  141. handleScreenAuto('#hardware_detail_container')
  142. handleScreenToFlexCenter(
  143. '#hardware_detail_container',
  144. '#hardware_detail_container_flex_center',
  145. )
  146. }
  147. func()
  148. window.onresize = func
  149. })
  150. const mouseover = function () {
  151. swiperStore.swiper.disable()
  152. }
  153. const mouseleave = function () {
  154. swiperStore.swiper.enable()
  155. }
  156. const handleScroll = e => {
  157. const { scrollTop, clientHeight, scrollHeight } = e.target
  158. if (scrollTop == 0) {
  159. swiperStore.swiper.enable()
  160. }
  161. if (scrollTop + clientHeight === scrollHeight) {
  162. swiperStore.swiper.enable()
  163. }
  164. }
  165. </script>
  166. <style lang="scss" scoped>
  167. .wrap {
  168. width: 100vw;
  169. height: 100vh;
  170. background: $common_bg;
  171. position: relative;
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. flex-direction: column;
  176. padding-bottom: 50px;
  177. ::-webkit-scrollbar {
  178. width: 25px;
  179. background-color: #f1f1f1;
  180. }
  181. ::-webkit-scrollbar-thumb {
  182. background-color: #c1c1c1;
  183. }
  184. ::-webkit-scrollbar-button:vertical:end:increment {
  185. width: 25px;
  186. height: 25px;
  187. background: url(../../../../assets/img/scroll/bottom.png) no-repeat;
  188. background-size: 100% 100%;
  189. }
  190. ::-webkit-scrollbar-button:vertical:start:decrement {
  191. width: 25px;
  192. height: 25px;
  193. background: url(../../../../assets/img/scroll/top.png) no-repeat;
  194. background-size: 100% 100%;
  195. }
  196. ::-webkit-scrollbar-button:vertical:end:increment,
  197. ::-webkit-scrollbar-button:vertical:start:decrement {
  198. display: block;
  199. }
  200. .empty {
  201. width: 100%;
  202. min-height: 90px;
  203. }
  204. .flex_center {
  205. flex: 1;
  206. overflow: hidden;
  207. display: flex;
  208. align-items: center;
  209. justify-content: center;
  210. .hardware_detail_container {
  211. max-width: 100vw;
  212. height: 100%;
  213. .content {
  214. box-sizing: border-box;
  215. width: 100%;
  216. height: 100%;
  217. padding: 40px 153px 0 153px;
  218. display: flex;
  219. justify-content: space-between;
  220. flex-direction: column;
  221. .content_detail {
  222. flex: 1;
  223. box-sizing: border-box;
  224. margin-top: 30px;
  225. display: flex;
  226. justify-content: space-between;
  227. position: relative;
  228. .left_swiper {
  229. width: 1024px;
  230. position: relative;
  231. flex: 1;
  232. display: flex;
  233. // justify-content: space-between;
  234. flex-direction: column;
  235. .case_swiper_wrap {
  236. // flex: 1;
  237. }
  238. .swiper_div_wrap {
  239. // width: 1024px;
  240. width: 100%;
  241. // height: 576px;
  242. overflow: hidden;
  243. .img_swiper {
  244. width: 1024px;
  245. height: 576px;
  246. object-fit: cover;
  247. }
  248. }
  249. .header_intro {
  250. height: 80px;
  251. padding: 0 43px;
  252. display: flex;
  253. justify-content: space-between;
  254. align-items: center;
  255. font-size: 28px;
  256. font-family: DFPYuanW7-GB;
  257. box-sizing: border-box;
  258. font-weight: 400;
  259. z-index: 333;
  260. background: linear-gradient(90deg, #283fe7, #4b17e1);
  261. color: #fafafa;
  262. .p_text {
  263. font-size: 22px;
  264. font-family: 'ZonaPro';
  265. font-weight: 800;
  266. }
  267. }
  268. }
  269. .placeholder {
  270. flex: 1;
  271. position: relative;
  272. height: 656px;
  273. z-index: 999;
  274. .right_detail {
  275. transition-property: all;
  276. transition-duration: 0.1s;
  277. animation-fill-mode: forwards;
  278. position: absolute;
  279. top: 0;
  280. right: 0;
  281. flex: 1;
  282. z-index: 999;
  283. overflow: scroll;
  284. z-index: 100;
  285. height: 100%;
  286. width: 100%;
  287. scrollbar-width: none; /* firefox */
  288. overflow-x: auto;
  289. .detail_header {
  290. position: sticky;
  291. top: 0;
  292. left: 0;
  293. right: 0;
  294. width: 100%;
  295. padding: 0 25px;
  296. height: 80px;
  297. background: linear-gradient(90deg, #283fe7, #4b17e1);
  298. font-size: 20px;
  299. font-family: DFPYuanW7-GB;
  300. font-weight: 400;
  301. color: #ffffff;
  302. display: flex;
  303. justify-content: space-between;
  304. align-items: center;
  305. box-sizing: border-box;
  306. .right {
  307. display: flex;
  308. align-items: center;
  309. font-size: 18px;
  310. font-family: Alibaba PuHuiTi;
  311. .en {
  312. font-size: 10px;
  313. font-family: ' ZonaPro';
  314. }
  315. }
  316. }
  317. .article {
  318. min-height: 100%;
  319. background: #fff;
  320. z-index: 222;
  321. .card_container {
  322. background: linear-gradient(#f9f9f9, #fff);
  323. }
  324. }
  325. }
  326. .right_detail:hover {
  327. z-index: 120;
  328. width: 220%;
  329. }
  330. }
  331. }
  332. }
  333. }
  334. }
  335. }
  336. </style>