MoreContent.vue 16 KB

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