MoreContent.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  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. // window.location.replace('http://192.168.20.50:8082/spg.html?m=KJ-et2X3su4ofm')
  301. window.location.replace('https://culture.4dage.com/NanjingMuseumWuJinZangNew/scene/smg.html?m=KJ-et2X3su4ofm')
  302. }
  303. // 提示语的显示隐藏
  304. const titShow = ref(true)
  305. // 向右是-1
  306. // 向左是 1
  307. const indexFlag = ref(0)
  308. // 左右滑动
  309. const onSwipeChange = (val) => {
  310. let numResTemp = indexAc.value + val
  311. let indexFlagTemp = -val
  312. if (val === -1 && indexAc.value === 0) {
  313. return
  314. }
  315. if (val === 1 && indexAc.value === listArr.length - 1) {
  316. return
  317. }
  318. titShow.value = false
  319. indexAc.value = numResTemp
  320. indexFlag.value = indexFlagTemp
  321. }
  322. // 点击底部的指示器 改变 indexAc
  323. const clickSonIndFu = (index) => {
  324. if (index === indexAc.value) return
  325. titShow.value = false
  326. isOpcMove.value = false
  327. setTimeout(() => {
  328. isOpcMove.value = true
  329. }, 300)
  330. indexAc.value = index
  331. }
  332. // 是否触发移动的逻辑
  333. const isMoveFu = (index, num) => {
  334. let numRes
  335. if (index === indexAc.value) numRes = 0
  336. else numRes = indexFlag.value * num * 2
  337. return numRes
  338. }
  339. // 当前页面的宽度
  340. const pageWidth = ref(0)
  341. // 当前有4个页面
  342. const pageNum = 4
  343. onMounted(() => {
  344. pageWidth.value = window.innerWidth >= 500 ? 500 : window.innerWidth
  345. })
  346. // 当前页面的索引
  347. const indexAc = ref(0)
  348. onBeforeMount(() => {
  349. if (route.query.anchorIdx) {
  350. indexAc.value = Number(route.query.anchorIdx)
  351. }
  352. })
  353. // 视频的显示和播放
  354. const isShowVideo = ref("")
  355. const videoRef = ref(null)
  356. // 点击查看详情 / 人文
  357. const playVideoFu = (val, flag) => {
  358. if (flag) {
  359. router.replace({
  360. name: val,
  361. })
  362. } else {
  363. isShowVideo.value = val
  364. nextTick(() => {
  365. videoRef.value.play()
  366. })
  367. }
  368. }
  369. </script>
  370. <style lang="less" scoped>
  371. body {
  372. -webkit-transform: translate3d(0, 0, 0);
  373. transform: translate3d(0, 0, 0);
  374. }
  375. .ZMoveBox {
  376. width: 100%;
  377. height: 100%;
  378. background-color: #f5f5f3;
  379. position: relative;
  380. .ZMbox {
  381. width: 1000px;
  382. height: 100%;
  383. overflow: hidden;
  384. position: relative;
  385. left: 0;
  386. top: 0;
  387. display: flex;
  388. background-image: url("../assets/images/fade-chapter-wood/bg-more-content.jpg");
  389. background-size: contain;
  390. transition: transform 1.2s;
  391. -webkit-transform: translateZ(0);
  392. -moz-transform: translateZ(0);
  393. -ms-transform: translateZ(0);
  394. -o-transform: translateZ(0);
  395. transform: translateZ(0);
  396. -webkit-backface-visibility: hidden;
  397. backface-visibility: hidden;
  398. .ROW {
  399. position: relative;
  400. transition: opacity 1.2s;
  401. height: 100%;
  402. .hotspot {
  403. position: absolute;
  404. top: 46%;
  405. left: 15%;
  406. z-index: 20;
  407. }
  408. .ROWtxt {
  409. z-index: 100;
  410. position: relative;
  411. top: 28%;
  412. left: 55%;
  413. .ROWtxtTabBox {
  414. position: absolute;
  415. top: 65%;
  416. left: -10%;
  417. .ROWtxtTab {
  418. padding: 8px 0;
  419. background-image: url(@/assets/images/fade-chapter-btn-bg-big.png);
  420. background-size: contain;
  421. background-repeat: no-repeat;
  422. background-position: center center;
  423. font-family: KaiTi;
  424. font-weight: 400;
  425. writing-mode: vertical-lr;
  426. letter-spacing: 0.2em;
  427. white-space: pre;
  428. color: #b8ae7a;
  429. margin-bottom: 10px;
  430. }
  431. }
  432. div.ROWtxtIcon {
  433. pointer-events: none;
  434. font-size: 38px;
  435. font-family: KingHwa_OldSong;
  436. color: #474747;
  437. writing-mode: vertical-lr;
  438. letter-spacing: 0.3em;
  439. white-space: pre;
  440. position: relative;
  441. img.deco {
  442. z-index: 10;
  443. position: absolute;
  444. bottom: 1em;
  445. right: -0.05em;
  446. width: 40%;
  447. }
  448. }
  449. }
  450. & > img {
  451. position: absolute;
  452. bottom: 0;
  453. height: 100%;
  454. transition: transform 1.2s;
  455. -webkit-transform: translateZ(0);
  456. -moz-transform: translateZ(0);
  457. -ms-transform: translateZ(0);
  458. -o-transform: translateZ(0);
  459. transform: translateZ(0);
  460. -webkit-backface-visibility: hidden;
  461. backface-visibility: hidden;
  462. }
  463. .ROW1_1 {
  464. z-index: 5;
  465. left: 0;
  466. }
  467. .ROW1_2 {
  468. z-index: 4;
  469. right: -15%;
  470. }
  471. .ROW1_3 {
  472. z-index: 3;
  473. left: 0%;
  474. }
  475. .ROW1_4 {
  476. z-index: 3;
  477. right: -50%;
  478. }
  479. .ROW1_5 {
  480. z-index: 2;
  481. right: -12%;
  482. }
  483. .ROW1_6 {
  484. height: 35%;
  485. left: -5%;
  486. }
  487. .ROW1_7 {
  488. height: 45%;
  489. left: 20%;
  490. }
  491. .ROW2_1 {
  492. z-index: 5;
  493. right: -13%;
  494. }
  495. .ROW2_2 {
  496. z-index: 4;
  497. right: -22%;
  498. }
  499. .ROW2_3 {
  500. z-index: 4;
  501. left: -38%;
  502. }
  503. .ROW2_4 {
  504. z-index: 3;
  505. left: -38%;
  506. }
  507. .ROW2_5 {
  508. z-index: 3;
  509. right: 2%;
  510. }
  511. .ROW2_6 {
  512. left: 0;
  513. height: 30%;
  514. }
  515. .ROW2_7 {
  516. left: -24%;
  517. height: 40%;
  518. }
  519. .ROW2_8 {
  520. left: 0%;
  521. }
  522. .ROW3_1 {
  523. left: -24%;
  524. }
  525. .ROW3_2 {
  526. height: 30%;
  527. right: -14%;
  528. }
  529. .ROW3_3 {
  530. right: -14%;
  531. }
  532. .ROW3_4 {
  533. right: -24%;
  534. }
  535. .ROW3_5 {
  536. right: -36%;
  537. }
  538. .ROW3_6 {
  539. z-index: 3;
  540. right: -3%;
  541. }
  542. .ROW3_7 {
  543. z-index: 4;
  544. left: -48%;
  545. }
  546. .ROW3_8 {
  547. z-index: 4;
  548. right: -20%;
  549. }
  550. .ROW3_9 {
  551. z-index: 4;
  552. right: -37%;
  553. }
  554. .ROW3_10 {
  555. z-index: 5;
  556. right: -3%;
  557. }
  558. .ROW3_11 {
  559. z-index: 5;
  560. left: -15%;
  561. }
  562. .ROW4_1 {
  563. z-index: 5;
  564. left: 2%;
  565. height: 40%;
  566. }
  567. .ROW4_2 {
  568. left: -26%;
  569. }
  570. .ROW4_3 {
  571. left: -13%;
  572. }
  573. .ROW4_4 {
  574. left: -28%;
  575. }
  576. .ROW4_5 {
  577. z-index: 3;
  578. right: 8%;
  579. }
  580. .ROW4_6 {
  581. z-index: 3;
  582. left: -30%;
  583. }
  584. .ROW4_7 {
  585. z-index: 4;
  586. left: -70%;
  587. }
  588. .ROW4_8 {
  589. z-index: 4;
  590. right: -5%;
  591. }
  592. .ROW4_9 {
  593. z-index: 5;
  594. right: -5%;
  595. }
  596. .ROW4_10 {
  597. z-index: 4;
  598. left: -60%;
  599. }
  600. }
  601. .ROW2 {
  602. .ROWtxt {
  603. top: 33%;
  604. left: 52%;
  605. .ROWtxtTabBox {
  606. top: 61%;
  607. left: -9%;
  608. }
  609. }
  610. }
  611. // 最后一页的文字
  612. .ROW4 {
  613. .ROWtxt {
  614. top: 15%;
  615. left: 37%;
  616. }
  617. }
  618. .ROWlast {
  619. font-family: "KingHwa_OldSong";
  620. color: white;
  621. z-index: 20;
  622. width: 20%;
  623. & > img {
  624. pointer-events: none;
  625. width: 118px;
  626. }
  627. .game-box {
  628. width: 198%;
  629. background: url(@/assets/images/game-bg.png);
  630. background-size: 100% 100%;
  631. padding: 75%;
  632. white-space: nowrap;
  633. display: flex;
  634. justify-content: center;
  635. align-items: center;
  636. margin-top: 62%;
  637. margin-left: -25%;
  638. font-size: 18px;
  639. }
  640. .online-box {
  641. font-weight: 700;
  642. color: #768c77;
  643. width: 50%;
  644. white-space: nowrap;
  645. display: flex;
  646. justify-content: center;
  647. align-items: center;
  648. margin-left: 54%;
  649. font-size: 18px;
  650. }
  651. .about-box{
  652. display: flex;
  653. flex-direction: column;
  654. align-items: center;
  655. justify-content: center;
  656. color: #688067;
  657. font-size: 12px;
  658. transform: translateX(-30%);
  659. position: fixed;
  660. bottom: 40px;
  661. >div{
  662. white-space: nowrap;
  663. }
  664. >.strong{
  665. font-weight: bold;
  666. }
  667. }
  668. }
  669. }
  670. // 视频盒子
  671. .RWbox {
  672. position: absolute;
  673. left: 0;
  674. top: 0;
  675. width: 100%;
  676. height: 100%;
  677. z-index: 150;
  678. .RWvideoTxt {
  679. width: 18%;
  680. position: absolute;
  681. z-index: 10;
  682. top: 32%;
  683. left: 44%;
  684. }
  685. & > video {
  686. width: 100%;
  687. }
  688. }
  689. // 指示器
  690. .pagination {
  691. position: absolute;
  692. z-index: 20;
  693. left: 50%;
  694. transform: translateX(-50%);
  695. bottom: 2%;
  696. }
  697. // 提示语
  698. .operation-tip {
  699. position: absolute;
  700. z-index: 30;
  701. left: 50%;
  702. bottom: 7%;
  703. transform: translateX(-50%);
  704. color: #7f9470;
  705. font-size: 12px;
  706. letter-spacing: 3px;
  707. pointer-events: none;
  708. display: flex;
  709. align-items: center;
  710. opacity: 1;
  711. transition: opacity 1s;
  712. img {
  713. width: 30px;
  714. }
  715. }
  716. .operation-tipHide {
  717. opacity: 0;
  718. }
  719. }
  720. </style>