MoreContent.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. <template>
  2. <!-- pc端才使用 v-touch-->
  3. <!--
  4. v-touch:swipe.left="() => onSwipeChange(1)"
  5. v-touch:swipe.right="() => onSwipeChange(-1)"
  6. :swipe-options="{ direction: 'horizontal' }"
  7. -->
  8. <div
  9. class="ZMoveBox"
  10. @touchstart="(e) => touchstart(e.touches[0].pageX)"
  11. @touchmove="(e) => touchmove(e.touches[0].pageX)"
  12. @touchend="(e) => touchend((val) => onSwipeChange(val))"
  13. >
  14. <div
  15. class="ZMbox"
  16. :style="`width: ${pageWidth * pageNum}px;
  17. transform: translateX(-${indexAc * pageWidth}px) translateZ(0)
  18. `"
  19. >
  20. <div
  21. v-for="(item1, index1) in listArr"
  22. :key="index1"
  23. :class="`ROW ${item1.classWai}`"
  24. :style="`width:${pageWidth}px; opacity:${
  25. index1 === indexAc ? '1' : isOpcMove ? '0' : ''
  26. }`"
  27. >
  28. <!-- 热点 -->
  29. <HotspotComp
  30. v-if="index1 === 0"
  31. class="hotspot"
  32. @click="
  33. router.replace({
  34. name: 'BambooHot',
  35. })
  36. "
  37. />
  38. <div
  39. v-show="index1 === indexAc"
  40. class="ROWtxt"
  41. >
  42. <div
  43. v-if="item1.nameArr"
  44. class="ROWtxtTabBox"
  45. >
  46. <div
  47. v-for="(item2, index2) in item1.nameArr"
  48. :key="index2"
  49. class="ROWtxtTab animation-show-long-hide"
  50. @click="item2.fu()"
  51. >
  52. {{ item2.txt }}
  53. </div>
  54. </div>
  55. <div
  56. v-else
  57. class="ROWlast"
  58. >
  59. <img
  60. src="@/assets/images/wu-jing-cang.png"
  61. alt=""
  62. >
  63. <div
  64. class="game-box"
  65. @click="OpenScene()"
  66. >
  67. 线上展厅
  68. </div>
  69. <div
  70. class="online-box"
  71. @click="
  72. () => {
  73. store.state.haveShownStartup = false;
  74. router.replace('/?back=1');
  75. }
  76. "
  77. >
  78. 重新开始
  79. </div>
  80. <div class="about-box">
  81. <div style="display: flex">
  82. <div style="font-weight: bold;">
  83. 《无尽藏》展览策展人:
  84. </div><span>庞鸥</span>
  85. </div>
  86. <div style="font-weight: bold;margin-top: 5px;">
  87. 线上策展团队:
  88. </div>
  89. <div>南京博物院:南京博物院:张莅坤 刘佳 李文彬 张晓婉</div>
  90. <div>珠海市四维时代网络科技有限公司</div>
  91. </div>
  92. </div>
  93. <div
  94. v-if="item1.nameArr"
  95. class="ROWtxtIcon"
  96. >
  97. {{ item1.name }}
  98. <img
  99. class="deco"
  100. src="@/assets/images/more-content-deco.png"
  101. alt=""
  102. draggable="false"
  103. >
  104. </div>
  105. </div>
  106. <!--
  107. :style="`transform: translateX(${isMoveFu(index1, item3.num)}px)`"
  108. -->
  109. <img
  110. v-for="(item3, index3) in item1.imgArr"
  111. :key="index3"
  112. :class="`${item3.className}`"
  113. :src="
  114. require(`@/assets/images/fade-chapter-wood/${item3.imgName}.png`)
  115. "
  116. :style="`transform: translateX(${isMoveFu(
  117. index1,
  118. item3.num
  119. )}px) translateZ(0)`"
  120. alt=""
  121. >
  122. </div>
  123. </div>
  124. <!-- 指示器 -->
  125. <ProgressBar
  126. class="pagination"
  127. :totle-unit="4"
  128. :type="1"
  129. :cur-percentage="indexAc"
  130. color-ac="#7B916B"
  131. color="#7B916B60"
  132. @go-to-slide="clickSonIndFu"
  133. />
  134. <!-- 返回按钮 -->
  135. <BtnBack
  136. style="z-index: 200"
  137. @click="router.replace('/?back=1')"
  138. />
  139. <!-- 提示语 -->
  140. <div :class="`operation-tip ${titShow && route.query.anchorIdx !='3' ? '' : 'operation-tipHide'}`">
  141. 左右滑动
  142. <img
  143. class=""
  144. :src="require(`@/assets/images/icon_operation_h_green.png`)"
  145. alt=""
  146. draggable="false"
  147. >
  148. </div>
  149. <!-- 跳转的视频 -->
  150. <Transition name="fade-in">
  151. <div
  152. v-if="isShowVideo"
  153. :class="`RWbox`"
  154. >
  155. <video
  156. ref="videoRef"
  157. :src="
  158. require(`@/assets/videos/${
  159. isShowVideo === 'RWvideo'
  160. ? 'fade-at-mo-zhu'
  161. : 'fade-at-shuang-gou'
  162. }.mp4`)
  163. "
  164. playsinline
  165. muted
  166. webkit-playsinline="true"
  167. x5-video-player-type="h5"
  168. @ended="
  169. router.replace({
  170. name: isShowVideo === 'RWvideo' ? 'PoemList' : 'ShuanggouDetail',
  171. })
  172. "
  173. />
  174. <img
  175. v-show="isShowVideo === 'RWvideo'"
  176. class="RWvideoTxt"
  177. src="@/assets/images/RW/titile_mozhu-min.png"
  178. alt=""
  179. >
  180. </div>
  181. </Transition>
  182. </div>
  183. </template>
  184. <script setup>
  185. import { ref, onBeforeMount, nextTick, onMounted } from "vue"
  186. import { useRoute, useRouter } from "vue-router"
  187. import { useStore } from "vuex"
  188. import useMoveFu from "../moveFu"
  189. const { touchstart, touchmove, touchend } = useMoveFu()
  190. const listArr = [
  191. {
  192. name: "双钩设色",
  193. nameArr: [
  194. {
  195. txt: "查看详情",
  196. fu: () => {
  197. playVideoFu("XQvideo")
  198. },
  199. },
  200. ],
  201. classWai: "ROW1",
  202. imgArr: [
  203. { className: "ROW1_1", imgName: "1_01", num: 100 },
  204. { className: "ROW1_2", imgName: "1_02", num: 100 },
  205. { className: "ROW1_3", imgName: "2_01", num: 80 },
  206. // { className: "ROW1_4", imgName: "2_03", num: 80 },
  207. // { className: "ROW1_5", imgName: "3_01", num: 60 },
  208. { className: "ROW1_6", imgName: "4_01", num: 120 },
  209. { className: "ROW1_7", imgName: "4_02", num: 120 },
  210. ],
  211. },
  212. {
  213. name: "墨竹",
  214. nameArr: [
  215. {
  216. txt: "人文",
  217. fu: () => {
  218. playVideoFu("RWvideo")
  219. },
  220. },
  221. {
  222. txt: "画作",
  223. fu: () => {
  224. playVideoFu("PaintingList", true)
  225. },
  226. },
  227. {
  228. txt: "竹谱",
  229. fu: () => {
  230. playVideoFu("BambooBook", true)
  231. },
  232. },
  233. ],
  234. classWai: "ROW2",
  235. imgArr: [
  236. { className: "ROW2_1", imgName: "1_03", num: 100 },
  237. { className: "ROW2_2", imgName: "2_02", num: 80 },
  238. { className: "ROW2_3", imgName: "2_03", num: 80 },
  239. // { className: "ROW2_4", imgName: "3_01", num: 60 },
  240. // { className: "ROW2_5", imgName: "3_02", num: 60 },
  241. { className: "ROW2_6", imgName: "4_01", num: 120 },
  242. { className: "ROW2_7", imgName: "4_02", num: 120 },
  243. // { className: "ROW2_8", imgName: "4_05", num: 40 },
  244. ],
  245. },
  246. {
  247. name: "画作创作",
  248. nameArr: [
  249. {
  250. txt: "开始体验",
  251. fu: () => {
  252. router.replace("/game")
  253. },
  254. },
  255. ],
  256. classWai: "ROW3",
  257. imgArr: [
  258. // { className: "ROW3_1", imgName: "4_07", num: 40 },
  259. { className: "ROW3_2", imgName: "4_08", num: 120 },
  260. // { className: "ROW3_3", imgName: "4_09", num: 40 },
  261. // { className: "ROW3_4", imgName: "4_10", num: 40 },
  262. // { className: "ROW3_5", imgName: "4_12", num: 40 },
  263. // { className: "ROW3_6", imgName: "3_04", num: 60 },
  264. { className: "ROW3_7", imgName: "2_02", num: 80 },
  265. { className: "ROW3_8", imgName: "2_04", num: 80 },
  266. { className: "ROW3_9", imgName: "2_05", num: 80 },
  267. { className: "ROW3_10", imgName: "1_04", num: 100 },
  268. { className: "ROW3_11", imgName: "1_01", num: 100 },
  269. ],
  270. },
  271. {
  272. name: "最后一页",
  273. classWai: "ROW4",
  274. imgArr: [
  275. { className: "ROW4_1", imgName: "4_08", num: 120 },
  276. // { className: "ROW4_2", imgName: "4_09", num: 40 },
  277. // { className: "ROW4_3", imgName: "4_10", num: 40 },
  278. // { className: "ROW4_4", imgName: "4_12", num: 40 },
  279. // { className: "ROW4_5", imgName: "3_03", num: 60 },
  280. { className: "ROW4_6", imgName: "3_04", num: 80 },
  281. { className: "ROW4_7", imgName: "2_04", num: 80 },
  282. { className: "ROW4_8", imgName: "2_04-1", num: 80 },
  283. { className: "ROW4_9", imgName: "1_05", num: 100 },
  284. // { className: "ROW4_10", imgName: "2_05", num: 100 },
  285. ],
  286. },
  287. ]
  288. const route = useRoute()
  289. const router = useRouter()
  290. const store = useStore()
  291. // 点击指示器移动透明的问题
  292. const isOpcMove = ref(true)
  293. // 点击线上展厅
  294. const OpenScene = () => {
  295. const musicDom = document.getElementById("bg-music")
  296. musicDom.pause()
  297. router.replace("/scene")
  298. // window.open('https://www.4dkankan.com/spg.html?m=KJ-et2X3su4ofm', '_parent')
  299. // window.location.replace('https://www.4dkankan.com/spg.html?m=KJ-et2X3su4ofm')
  300. }
  301. // 提示语的显示隐藏
  302. const titShow = ref(true)
  303. // 向右是-1
  304. // 向左是 1
  305. const indexFlag = ref(0)
  306. // 左右滑动
  307. const onSwipeChange = (val) => {
  308. let numResTemp = indexAc.value + val
  309. let indexFlagTemp = -val
  310. if (val === -1 && indexAc.value === 0) {
  311. return
  312. }
  313. if (val === 1 && indexAc.value === listArr.length - 1) {
  314. return
  315. }
  316. titShow.value = false
  317. indexAc.value = numResTemp
  318. indexFlag.value = indexFlagTemp
  319. }
  320. // 点击底部的指示器 改变 indexAc
  321. const clickSonIndFu = (index) => {
  322. if (index === indexAc.value) return
  323. titShow.value = false
  324. isOpcMove.value = false
  325. setTimeout(() => {
  326. isOpcMove.value = true
  327. }, 300)
  328. indexAc.value = index
  329. }
  330. // 是否触发移动的逻辑
  331. const isMoveFu = (index, num) => {
  332. let numRes
  333. if (index === indexAc.value) numRes = 0
  334. else numRes = indexFlag.value * num * 2
  335. return numRes
  336. }
  337. // 当前页面的宽度
  338. const pageWidth = ref(0)
  339. // 当前有4个页面
  340. const pageNum = 4
  341. onMounted(() => {
  342. pageWidth.value = window.innerWidth >= 500 ? 500 : window.innerWidth
  343. })
  344. // 当前页面的索引
  345. const indexAc = ref(0)
  346. onBeforeMount(() => {
  347. if (route.query.anchorIdx) {
  348. indexAc.value = Number(route.query.anchorIdx)
  349. }
  350. })
  351. // 视频的显示和播放
  352. const isShowVideo = ref("")
  353. const videoRef = ref(null)
  354. // 点击查看详情 / 人文
  355. const playVideoFu = (val, flag) => {
  356. if (flag) {
  357. router.replace({
  358. name: val,
  359. })
  360. } else {
  361. isShowVideo.value = val
  362. nextTick(() => {
  363. videoRef.value.play()
  364. })
  365. }
  366. }
  367. </script>
  368. <style lang="less" scoped>
  369. body {
  370. -webkit-transform: translate3d(0, 0, 0);
  371. transform: translate3d(0, 0, 0);
  372. }
  373. .ZMoveBox {
  374. width: 100%;
  375. height: 100%;
  376. background-color: #f5f5f3;
  377. position: relative;
  378. .ZMbox {
  379. width: 1000px;
  380. height: 100%;
  381. overflow: hidden;
  382. position: relative;
  383. left: 0;
  384. top: 0;
  385. display: flex;
  386. background-image: url("../assets/images/fade-chapter-wood/bg-more-content.jpg");
  387. background-size: contain;
  388. transition: transform 1.2s;
  389. -webkit-transform: translateZ(0);
  390. -moz-transform: translateZ(0);
  391. -ms-transform: translateZ(0);
  392. -o-transform: translateZ(0);
  393. transform: translateZ(0);
  394. -webkit-backface-visibility: hidden;
  395. backface-visibility: hidden;
  396. .ROW {
  397. position: relative;
  398. transition: opacity 1.2s;
  399. height: 100%;
  400. .hotspot {
  401. position: absolute;
  402. top: 46%;
  403. left: 15%;
  404. z-index: 20;
  405. }
  406. .ROWtxt {
  407. z-index: 100;
  408. position: relative;
  409. top: 28%;
  410. left: 55%;
  411. .ROWtxtTabBox {
  412. position: absolute;
  413. top: 65%;
  414. left: -10%;
  415. .ROWtxtTab {
  416. padding: 8px 0;
  417. background-image: url(@/assets/images/fade-chapter-btn-bg-big.png);
  418. background-size: contain;
  419. background-repeat: no-repeat;
  420. background-position: center center;
  421. font-family: KaiTi;
  422. font-weight: 400;
  423. writing-mode: vertical-lr;
  424. letter-spacing: 0.2em;
  425. white-space: pre;
  426. color: #b8ae7a;
  427. margin-bottom: 10px;
  428. }
  429. }
  430. div.ROWtxtIcon {
  431. pointer-events: none;
  432. font-size: 38px;
  433. font-family: KingHwa_OldSong;
  434. color: #474747;
  435. writing-mode: vertical-lr;
  436. letter-spacing: 0.3em;
  437. white-space: pre;
  438. position: relative;
  439. img.deco {
  440. z-index: 10;
  441. position: absolute;
  442. bottom: 1em;
  443. right: -0.05em;
  444. width: 40%;
  445. }
  446. }
  447. }
  448. & > img {
  449. position: absolute;
  450. bottom: 0;
  451. height: 100%;
  452. transition: transform 1.2s;
  453. -webkit-transform: translateZ(0);
  454. -moz-transform: translateZ(0);
  455. -ms-transform: translateZ(0);
  456. -o-transform: translateZ(0);
  457. transform: translateZ(0);
  458. -webkit-backface-visibility: hidden;
  459. backface-visibility: hidden;
  460. }
  461. .ROW1_1 {
  462. z-index: 5;
  463. left: 0;
  464. }
  465. .ROW1_2 {
  466. z-index: 4;
  467. right: -15%;
  468. }
  469. .ROW1_3 {
  470. z-index: 3;
  471. left: 0%;
  472. }
  473. .ROW1_4 {
  474. z-index: 3;
  475. right: -50%;
  476. }
  477. .ROW1_5 {
  478. z-index: 2;
  479. right: -12%;
  480. }
  481. .ROW1_6 {
  482. height: 35%;
  483. left: -5%;
  484. }
  485. .ROW1_7 {
  486. height: 45%;
  487. left: 20%;
  488. }
  489. .ROW2_1 {
  490. z-index: 5;
  491. right: -13%;
  492. }
  493. .ROW2_2 {
  494. z-index: 4;
  495. right: -22%;
  496. }
  497. .ROW2_3 {
  498. z-index: 4;
  499. left: -38%;
  500. }
  501. .ROW2_4 {
  502. z-index: 3;
  503. left: -38%;
  504. }
  505. .ROW2_5 {
  506. z-index: 3;
  507. right: 2%;
  508. }
  509. .ROW2_6 {
  510. left: 0;
  511. height: 30%;
  512. }
  513. .ROW2_7 {
  514. left: -24%;
  515. height: 40%;
  516. }
  517. .ROW2_8 {
  518. left: 0%;
  519. }
  520. .ROW3_1 {
  521. left: -24%;
  522. }
  523. .ROW3_2 {
  524. height: 30%;
  525. right: -14%;
  526. }
  527. .ROW3_3 {
  528. right: -14%;
  529. }
  530. .ROW3_4 {
  531. right: -24%;
  532. }
  533. .ROW3_5 {
  534. right: -36%;
  535. }
  536. .ROW3_6 {
  537. z-index: 3;
  538. right: -3%;
  539. }
  540. .ROW3_7 {
  541. z-index: 4;
  542. left: -48%;
  543. }
  544. .ROW3_8 {
  545. z-index: 4;
  546. right: -20%;
  547. }
  548. .ROW3_9 {
  549. z-index: 4;
  550. right: -37%;
  551. }
  552. .ROW3_10 {
  553. z-index: 5;
  554. right: -3%;
  555. }
  556. .ROW3_11 {
  557. z-index: 5;
  558. left: -15%;
  559. }
  560. .ROW4_1 {
  561. z-index: 5;
  562. left: 2%;
  563. height: 40%;
  564. }
  565. .ROW4_2 {
  566. left: -26%;
  567. }
  568. .ROW4_3 {
  569. left: -13%;
  570. }
  571. .ROW4_4 {
  572. left: -28%;
  573. }
  574. .ROW4_5 {
  575. z-index: 3;
  576. right: 8%;
  577. }
  578. .ROW4_6 {
  579. z-index: 3;
  580. left: -30%;
  581. }
  582. .ROW4_7 {
  583. z-index: 4;
  584. left: -70%;
  585. }
  586. .ROW4_8 {
  587. z-index: 4;
  588. right: -5%;
  589. }
  590. .ROW4_9 {
  591. z-index: 5;
  592. right: -5%;
  593. }
  594. .ROW4_10 {
  595. z-index: 4;
  596. left: -60%;
  597. }
  598. }
  599. .ROW2 {
  600. .ROWtxt {
  601. top: 33%;
  602. left: 52%;
  603. .ROWtxtTabBox {
  604. top: 61%;
  605. left: -9%;
  606. }
  607. }
  608. }
  609. // 最后一页的文字
  610. .ROW4 {
  611. .ROWtxt {
  612. top: 15%;
  613. left: 37%;
  614. }
  615. }
  616. .ROWlast {
  617. font-family: "KingHwa_OldSong";
  618. color: white;
  619. z-index: 20;
  620. width: 20%;
  621. & > img {
  622. pointer-events: none;
  623. width: 118px;
  624. }
  625. .game-box {
  626. width: 198%;
  627. background: url(@/assets/images/game-bg.png);
  628. background-size: 100% 100%;
  629. padding: 75%;
  630. white-space: nowrap;
  631. display: flex;
  632. justify-content: center;
  633. align-items: center;
  634. margin-top: 62%;
  635. margin-left: -25%;
  636. font-size: 18px;
  637. }
  638. .online-box {
  639. font-weight: 700;
  640. color: #768c77;
  641. width: 50%;
  642. white-space: nowrap;
  643. display: flex;
  644. justify-content: center;
  645. align-items: center;
  646. margin-left: 54%;
  647. font-size: 18px;
  648. }
  649. .about-box{
  650. display: flex;
  651. flex-direction: column;
  652. align-items: center;
  653. justify-content: center;
  654. color: #688067;
  655. font-size: 12px;
  656. transform: translateX(-30%);
  657. position: fixed;
  658. bottom: 40px;
  659. >div{
  660. white-space: nowrap;
  661. }
  662. >.strong{
  663. font-weight: bold;
  664. }
  665. }
  666. }
  667. }
  668. // 视频盒子
  669. .RWbox {
  670. position: absolute;
  671. left: 0;
  672. top: 0;
  673. width: 100%;
  674. height: 100%;
  675. z-index: 150;
  676. .RWvideoTxt {
  677. width: 18%;
  678. position: absolute;
  679. z-index: 10;
  680. top: 32%;
  681. left: 44%;
  682. }
  683. & > video {
  684. width: 100%;
  685. }
  686. }
  687. // 指示器
  688. .pagination {
  689. position: absolute;
  690. z-index: 20;
  691. left: 50%;
  692. transform: translateX(-50%);
  693. bottom: 2%;
  694. }
  695. // 提示语
  696. .operation-tip {
  697. position: absolute;
  698. z-index: 30;
  699. left: 50%;
  700. bottom: 7%;
  701. transform: translateX(-50%);
  702. color: #7f9470;
  703. font-size: 12px;
  704. letter-spacing: 3px;
  705. pointer-events: none;
  706. display: flex;
  707. align-items: center;
  708. opacity: 1;
  709. transition: opacity 1s;
  710. img {
  711. width: 30px;
  712. }
  713. }
  714. .operation-tipHide {
  715. opacity: 0;
  716. }
  717. }
  718. </style>