ShuangGouSheSeDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <script setup>
  2. import { onMounted, ref, computed, inject } from "vue"
  3. import { useRouter } from "vue-router"
  4. import useSizeAdapt from "@/useFunctions/useSizeAdapt"
  5. import HotspotComp from "@/components/HotspotComp.vue"
  6. const router = useRouter()
  7. const $env = inject("$env")
  8. const goBack = () => {
  9. router.replace({
  10. name: "MoreContent",
  11. query: {
  12. anchorIdx: 0,
  13. },
  14. })
  15. }
  16. const { windowSizeInCssForRef, windowSizeWhenDesignForRef } = useSizeAdapt()
  17. const reverseArray = (array) => {
  18. return array.slice().reverse()
  19. }
  20. const goPaintingDetail = () => {
  21. router.replace(`/shuanggou-painting-detail?idx=0&&m=${curIndex.value}`)
  22. }
  23. const x = window.innerWidth / window.innerHeight
  24. onMounted(() => {
  25. console.log("shuchubili", x)
  26. })
  27. const text = [
  28. [
  29. "双钩,中国画技法名。用线条钩描",
  30. "物象的轮廓,通称“勾勒”,因基本上",
  31. "是用左右或上下两笔钩描合拢,故亦",
  32. "称“双钩”。大部用于工笔花鸟画。又",
  33. "旧时摹搨法书。沿字的笔迹两边用细",
  34. "劲的墨线线钩出轮廓,也叫“双钩”;",
  35. "双钩后填墨的称为“双钩”",
  36. ],
  37. [
  38. "设色,国画中晕染彩色的意思,“廓",
  39. "填”。画面中只要出现彩色就可以说",
  40. "是设色作品。与设色相反的是“水墨”,",
  41. "指画面中不出现彩色,或者极少出现",
  42. "彩色的,以墨色为主绘制的作品。",
  43. ],
  44. ]
  45. const text2 = [
  46. "双钩,中国画技法名。用线条钩描物象的轮廓,通称“勾勒”,因基本上是用左右或上下两笔钩描合拢,故亦称“双钩”。大部用于工笔花鸟画。又旧时摹搨法书。沿字的笔迹两边用细劲的墨线钩出轮廓,也叫“双钩”;双钩后填墨的称为“双钩廓填”。",
  47. "设色,国画中晕染彩色的意思,画面中只要出现彩色就可以说是设色作品。与设色相反的是“水墨”,指画面中不出现彩色,或者极少出现彩色的,以墨色为主绘制的作品。",
  48. ]
  49. const curIndex = ref(0)
  50. const lastX = ref(0)
  51. const isShowOperationTip = ref(true)
  52. // 开始滑动
  53. const handletouchstart = (event) => {
  54. lastX.value = event.changedTouches[0].pageX
  55. isShowOperationTip.value = false
  56. isShowOperationTip2.value = false
  57. }
  58. // 监听活动
  59. const touchEnd = (event) => {
  60. let currentX = event.changedTouches[0].pageX
  61. let tx = currentX - lastX.value
  62. if (tx < 0) {
  63. if (curIndex.value == 0) {
  64. curIndex.value = 1
  65. }
  66. } else if (tx > 0) {
  67. if (curIndex.value == 1) {
  68. curIndex.value = 0
  69. }
  70. }
  71. }
  72. const isShowVideoBox = ref(false)
  73. const goToSlide = (index) => {
  74. curIndex.value = index
  75. }
  76. const isShowOperationTip2 = ref(false)
  77. const openVideoBox = () => {
  78. isShowVideoBox.value = true
  79. // 背景音乐打开
  80. const audioEl = document.getElementById("bg-music")
  81. audioEl.pause()
  82. isShowOperationTip2.value = true
  83. }
  84. const closeVieoBox = () => {
  85. isShowVideoBox.value = false
  86. // 背景音乐打开
  87. const audioEl = document.getElementById("bg-music")
  88. audioEl.play()
  89. }
  90. const curPercentage = computed(() => {
  91. return curIndex.value
  92. })
  93. </script>
  94. <template>
  95. <div
  96. class="home"
  97. >
  98. <div class="title">
  99. <div
  100. class="title-detail"
  101. :style="{ color: curIndex == 1 ? 'rgba(71, 71, 71, 0.15)' : '' }"
  102. @click="curIndex = 0"
  103. >
  104. <div>双</div>
  105. <div>构</div>
  106. </div>
  107. <div
  108. class="title-detail"
  109. :style="{ color: curIndex == 0 ? 'rgba(71, 71, 71, 0.15)' : '' }"
  110. @click="curIndex = 1"
  111. >
  112. <div>设</div>
  113. <div>色</div>
  114. </div>
  115. <img
  116. src="@/assets/images/icon_video_active.png"
  117. class="icon-video"
  118. @click="openVideoBox"
  119. >
  120. <span
  121. class="video-text"
  122. @click="openVideoBox"
  123. >观看视频</span>
  124. <!-- 两个提示 -->
  125. <div
  126. v-show="curIndex == 1"
  127. class="operation-video-tip"
  128. style="top: -10vh; right: -30%"
  129. >
  130. <div>点击查看</div>
  131. <img
  132. class=""
  133. :src="require(`@/assets/images/icon-click-tip-green.png`)"
  134. alt=""
  135. draggable="false"
  136. >
  137. </div>
  138. <div
  139. v-show="curIndex == 0"
  140. class="operation-video-tip"
  141. style="top:38%; right: -52%"
  142. >
  143. <img
  144. class=""
  145. :src="require(`@/assets/images/icon-click-tip-green.png`)"
  146. alt=""
  147. draggable="false"
  148. >
  149. <div>点击查看</div>
  150. </div>
  151. </div>
  152. <div class="shuanggou-yezi">
  153. <img
  154. src="@/assets/images/shuanggou-top-left.png"
  155. alt=""
  156. >
  157. <HotspotComp
  158. v-show="true"
  159. class="hotspot-1"
  160. @click="goPaintingDetail"
  161. />
  162. </div>
  163. <!-- <img
  164. class="text"
  165. src="@/assets/images/shuanggou-text.png"
  166. alt=""
  167. > -->
  168. <!-- <div
  169. class="text"
  170. :style="{ top: x > 0.5 ? 'auto' : '', bottom: x > 0.5 ? '15vh' : 'auto' }"
  171. >
  172. <div
  173. v-for="(item, index) in reverseArray(text[curIndex])"
  174. :key="index"
  175. >
  176. {{ item }}
  177. </div>
  178. </div> -->
  179. <div
  180. class="text"
  181. :style="{ top: x > 0.5 ? 'auto' : '', bottom: x > 0.5 ? '10vh' : 'auto' }"
  182. >
  183. {{ text2[curIndex] }}
  184. </div>
  185. <ProgressBar
  186. class="progress-bar"
  187. :totle-unit="2"
  188. :cur-percentage="curPercentage"
  189. color-ac="#7B916B"
  190. color="#7B916B60"
  191. :type="1"
  192. @go-to-slide="goToSlide"
  193. />
  194. <img
  195. class="right-bottom"
  196. src="@/assets/images/right-bottom.png"
  197. alt=""
  198. >
  199. <div class="system-btns">
  200. <BtnBack
  201. color="green"
  202. @click="goBack"
  203. />
  204. <!-- <OperationTip
  205. id="operationH"
  206. class="operation-h"
  207. text=""
  208. direction="h"
  209. :is-show="isShowOperationTip"
  210. /> -->
  211. <!-- <OperationTip
  212. class="operation-h"
  213. color="green"
  214. text=""
  215. direction="h"
  216. /> -->
  217. </div>
  218. </div>
  219. <!-- 视频box -->
  220. <div
  221. v-if="isShowVideoBox"
  222. class="video-box"
  223. >
  224. <img
  225. v-show="curIndex == 1"
  226. class="bg-img"
  227. src="@/assets/images/img_shese.jpg"
  228. alt=""
  229. >
  230. <img
  231. v-show="curIndex == 0"
  232. class="bg-img"
  233. src="@/assets/images/img_shuanggou.jpg"
  234. alt=""
  235. >
  236. <!-- <OperationTip
  237. class="operation-h-video"
  238. text="向左划动"
  239. direction="h"
  240. :is-show="isShowOperationTip2"
  241. /> -->
  242. <video
  243. playsinline
  244. webkit-playsinline="true"
  245. x5-video-player-type="h5"
  246. :poster="`${$env.BASE_URL}configMultiMedia/video/${
  247. curIndex == 0 ? 'shuanggou' : 'shese'
  248. }.png`"
  249. :src="`${$env.BASE_URL}configMultiMedia/video/${
  250. curIndex == 0 ? 'shuanggou' : 'shese'
  251. }.mp4`"
  252. controls
  253. />
  254. <div>{{ curIndex == 0 ? "双钩" : "设色" }}</div>
  255. <BtnBack
  256. class="video-box-close"
  257. @click="closeVieoBox"
  258. />
  259. </div>
  260. </template>
  261. <style lang="less" scoped>
  262. * {
  263. transition: all 1s ease;
  264. }
  265. .home {
  266. width: 100%;
  267. height: 100%;
  268. position: relative;
  269. background: #ffffff;
  270. .title {
  271. color: #474747;
  272. font-size: calc(
  273. 48 / v-bind("windowSizeWhenDesignForRef") *
  274. v-bind("windowSizeInCssForRef")
  275. );
  276. line-height: calc(
  277. 48 / v-bind("windowSizeWhenDesignForRef") *
  278. v-bind("windowSizeInCssForRef")
  279. );
  280. writing-mode: vertical-rl !important;
  281. font-family: "KingHwa_OldSong";
  282. position: absolute;
  283. right: 13%;
  284. top: 26%;
  285. letter-spacing: 10px;
  286. z-index: 10;
  287. display: flex;
  288. justify-content: center;
  289. align-items: center;
  290. .title-detail {
  291. display: flex;
  292. // flex-direction: column;
  293. }
  294. .icon-video {
  295. width: calc(
  296. 36 / v-bind("windowSizeWhenDesignForRef") *
  297. v-bind("windowSizeInCssForRef")
  298. );
  299. height: calc(
  300. 36 / v-bind("windowSizeWhenDesignForRef") *
  301. v-bind("windowSizeInCssForRef")
  302. );
  303. margin-top: 10px;
  304. }
  305. .video-text{
  306. color: #7b916b;
  307. font-family: KaiTi;
  308. writing-mode: horizontal-tb;
  309. font-size: calc(
  310. 14 / v-bind("windowSizeWhenDesignForRef") *
  311. v-bind("windowSizeInCssForRef")
  312. );
  313. letter-spacing: 0px;
  314. }
  315. .operation-video-tip {
  316. position: absolute;
  317. right: 0;
  318. display: flex;
  319. align-items: center;
  320. pointer-events: none;
  321. letter-spacing: 1px;
  322. & > img {
  323. width: 40px;
  324. }
  325. & > div {
  326. margin-top: 4px;
  327. // position: relative;
  328. // line-height: 20px;
  329. // left: 9px;
  330. font-weight: 400;
  331. font-family: KaiTi;
  332. color: #7b916b;
  333. text-align: center;
  334. font-size: 18px;
  335. writing-mode: vertical-rl;
  336. }
  337. }
  338. .video-btn{
  339. width: calc(
  340. 36 / v-bind("windowSizeWhenDesignForRef") *
  341. v-bind("windowSizeInCssForRef")
  342. );
  343. height: calc(
  344. 36 / v-bind("windowSizeWhenDesignForRef") *
  345. v-bind("windowSizeInCssForRef")
  346. );
  347. display: flex;
  348. flex-direction: column;
  349. font-size: calc(
  350. 14 / v-bind("windowSizeWhenDesignForRef") *
  351. v-bind("windowSizeInCssForRef")
  352. );
  353. font-family: KaiTi;
  354. color: #7b916b;
  355. }
  356. }
  357. .shuanggou-yezi {
  358. width: 100%;
  359. animation: fade-in 2s forwards;
  360. position: relative;
  361. z-index: 2;
  362. @keyframes fade-in {
  363. 0% {
  364. opacity: 0;
  365. }
  366. 100% {
  367. opacity: 1;
  368. }
  369. }
  370. > img {
  371. width: 100%;
  372. margin-top: -3%;
  373. }
  374. > .hotspot-1 {
  375. position: absolute;
  376. bottom: 28%;
  377. left: 17%;
  378. pointer-events: initial;
  379. z-index: 3;
  380. }
  381. }
  382. .text {
  383. display: flex;
  384. position: absolute;
  385. right: 32%;
  386. top: 45vh;
  387. // top: calc(50 /v-bind('windowSizeWhenDesignForRef')/v-bind('windowSizeInCssForRef'));
  388. color: #707f48;
  389. font-size: calc(
  390. 18 / v-bind("windowSizeWhenDesignForRef") *
  391. v-bind("windowSizeInCssForRef")
  392. );
  393. line-height: calc(
  394. 26 / v-bind("windowSizeWhenDesignForRef") *
  395. v-bind("windowSizeInCssForRef")
  396. );
  397. font-family: "KaiTi";
  398. // writing-mode: vertical-rl;
  399. letter-spacing: 2px;
  400. text-align: justify;
  401. height: 30vh;
  402. width: 50%;
  403. text-indent: 2em;
  404. @media screen and (min-width: 600px) {
  405. bottom: 9vh !important;
  406. }
  407. }
  408. .right-bottom {
  409. width: 100%;
  410. position: absolute;
  411. bottom: 0;
  412. right: 0;
  413. }
  414. .progress-bar {
  415. position: absolute;
  416. left: 0;
  417. bottom: 15px;
  418. left: 50%;
  419. transform: translateX(-50%);
  420. width: 90%;
  421. height: 15px;
  422. z-index: 3;
  423. color: #e1edd95d;
  424. transition: all 1s;
  425. z-index: 1;
  426. }
  427. .system-btns {
  428. width: 100%;
  429. padding: 0
  430. calc(
  431. 20 / v-bind(windowSizeWhenDesignForRef) * v-bind(windowSizeInCssForRef)
  432. );
  433. display: flex;
  434. // flex-direction: column;
  435. justify-content: flex-end;
  436. position: absolute;
  437. bottom: calc(
  438. 60 / v-bind(windowSizeWhenDesignForRef) * v-bind(windowSizeInCssForRef)
  439. );
  440. z-index: 2;
  441. .operation-h {
  442. width: calc(
  443. 36 / v-bind("windowSizeWhenDesignForRef") *
  444. v-bind("windowSizeInCssForRef")
  445. );
  446. transition: opacity 0.5s ease-in-out;
  447. }
  448. }
  449. }
  450. .video-box {
  451. width: 100%;
  452. height: 100%;
  453. position: absolute;
  454. top: 0;
  455. left: 0;
  456. z-index: 10;
  457. .operation-h-video {
  458. position: fixed;
  459. left: 50%;
  460. transform: translateX(-50%);
  461. top: -34vh;
  462. z-index: 21;
  463. }
  464. .video-box-close {
  465. position: absolute;
  466. left: calc(
  467. 30 / v-bind("windowSizeWhenDesignForRef") *
  468. v-bind("windowSizeInCssForRef")
  469. );
  470. bottom: calc(
  471. 35 / v-bind("windowSizeWhenDesignForRef") *
  472. v-bind("windowSizeInCssForRef")
  473. );
  474. }
  475. > .bg-img {
  476. width: 100%;
  477. height: 100%;
  478. object-fit: cover;
  479. position: absolute;
  480. top: 0;
  481. left: 0;
  482. }
  483. > video {
  484. width: 100%;
  485. position: absolute;
  486. top: 50%;
  487. transform: translateY(-50%);
  488. }
  489. > div {
  490. color: #ffffff;
  491. position: absolute;
  492. bottom: 10%;
  493. font-size: calc(
  494. 24 / v-bind("windowSizeWhenDesignForRef") *
  495. v-bind("windowSizeInCssForRef")
  496. );
  497. line-height: calc(
  498. 29 / v-bind("windowSizeWhenDesignForRef") *
  499. v-bind("windowSizeInCssForRef")
  500. );
  501. font-family: "KingHwa_OldSong";
  502. left: 50%;
  503. transform: translateX(-50%);
  504. }
  505. }
  506. </style>