ShuangGouSheSeDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  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. :style="{ color: curIndex == 1 ? 'rgba(71, 71, 71, 0.15)' : '' }"
  101. @click="curIndex = 0"
  102. >
  103. 双钩
  104. </div>
  105. <div
  106. :style="{ color: curIndex == 0 ? 'rgba(71, 71, 71, 0.15)' : '' }"
  107. @click="curIndex = 1"
  108. >
  109. 设色
  110. </div>
  111. <img
  112. src="@/assets/images/icon_video_active.png"
  113. class="icon-video"
  114. @click="openVideoBox"
  115. >
  116. <span
  117. class="video-text"
  118. @click="openVideoBox"
  119. >观看视频</span>
  120. <!-- 两个提示 -->
  121. <div
  122. v-show="curIndex == 1"
  123. class="operation-video-tip"
  124. style="top: -10vh; right: -30%"
  125. >
  126. <div>点击查看</div>
  127. <img
  128. class=""
  129. :src="require(`@/assets/images/icon-click-tip-green.png`)"
  130. alt=""
  131. draggable="false"
  132. >
  133. </div>
  134. <div
  135. v-show="curIndex == 0"
  136. class="operation-video-tip"
  137. style="top:38%; right: -52%"
  138. >
  139. <img
  140. class=""
  141. :src="require(`@/assets/images/icon-click-tip-green.png`)"
  142. alt=""
  143. draggable="false"
  144. >
  145. <div>点击查看</div>
  146. </div>
  147. </div>
  148. <div class="shuanggou-yezi">
  149. <img
  150. src="@/assets/images/shuanggou-top-left.png"
  151. alt=""
  152. >
  153. <HotspotComp
  154. v-show="true"
  155. class="hotspot-1"
  156. @click="goPaintingDetail"
  157. />
  158. </div>
  159. <!-- <img
  160. class="text"
  161. src="@/assets/images/shuanggou-text.png"
  162. alt=""
  163. > -->
  164. <!-- <div
  165. class="text"
  166. :style="{ top: x > 0.5 ? 'auto' : '', bottom: x > 0.5 ? '15vh' : 'auto' }"
  167. >
  168. <div
  169. v-for="(item, index) in reverseArray(text[curIndex])"
  170. :key="index"
  171. >
  172. {{ item }}
  173. </div>
  174. </div> -->
  175. <div
  176. class="text"
  177. :style="{ top: x > 0.5 ? 'auto' : '', bottom: x > 0.5 ? '20vh' : 'auto' }"
  178. >
  179. {{ text2[curIndex] }}
  180. </div>
  181. <ProgressBar
  182. class="progress-bar"
  183. :totle-unit="2"
  184. :cur-percentage="curPercentage"
  185. color-ac="#7B916B"
  186. color="#7B916B60"
  187. :type="1"
  188. @go-to-slide="goToSlide"
  189. />
  190. <img
  191. class="right-bottom"
  192. src="@/assets/images/right-bottom.png"
  193. alt=""
  194. >
  195. <div class="system-btns">
  196. <BtnBack
  197. color="green"
  198. @click="goBack"
  199. />
  200. <!-- <OperationTip
  201. id="operationH"
  202. class="operation-h"
  203. text=""
  204. direction="h"
  205. :is-show="isShowOperationTip"
  206. /> -->
  207. <!-- <OperationTip
  208. class="operation-h"
  209. color="green"
  210. text=""
  211. direction="h"
  212. /> -->
  213. </div>
  214. </div>
  215. <!-- 视频box -->
  216. <div
  217. v-if="isShowVideoBox"
  218. class="video-box"
  219. >
  220. <img
  221. v-show="curIndex == 1"
  222. class="bg-img"
  223. src="@/assets/images/img_shese.jpg"
  224. alt=""
  225. >
  226. <img
  227. v-show="curIndex == 0"
  228. class="bg-img"
  229. src="@/assets/images/img_shuanggou.jpg"
  230. alt=""
  231. >
  232. <!-- <OperationTip
  233. class="operation-h-video"
  234. text="向左划动"
  235. direction="h"
  236. :is-show="isShowOperationTip2"
  237. /> -->
  238. <video
  239. playsinline
  240. webkit-playsinline="true"
  241. x5-video-player-type="h5"
  242. :poster="`${$env.BASE_URL}configMultiMedia/video/${
  243. curIndex == 0 ? 'shuanggou' : 'shese'
  244. }.png`"
  245. :src="`${$env.BASE_URL}configMultiMedia/video/${
  246. curIndex == 0 ? 'shuanggou' : 'shese'
  247. }.mp4`"
  248. controls
  249. />
  250. <div>{{ curIndex == 0 ? "双钩" : "设色" }}</div>
  251. <BtnBack
  252. class="video-box-close"
  253. @click="closeVieoBox"
  254. />
  255. </div>
  256. </template>
  257. <style lang="less" scoped>
  258. * {
  259. transition: all 1s ease;
  260. }
  261. .home {
  262. width: 100%;
  263. height: 100%;
  264. position: relative;
  265. background: #ffffff;
  266. .title {
  267. color: #474747;
  268. font-size: calc(
  269. 48 / v-bind("windowSizeWhenDesignForRef") *
  270. v-bind("windowSizeInCssForRef")
  271. );
  272. line-height: calc(
  273. 48 / v-bind("windowSizeWhenDesignForRef") *
  274. v-bind("windowSizeInCssForRef")
  275. );
  276. writing-mode: vertical-rl !important;
  277. font-family: "KingHwa_OldSong";
  278. position: absolute;
  279. right: 13%;
  280. top: 26%;
  281. letter-spacing: 10px;
  282. z-index: 10;
  283. display: flex;
  284. justify-content: center;
  285. align-items: center;
  286. .icon-video {
  287. width: calc(
  288. 36 / v-bind("windowSizeWhenDesignForRef") *
  289. v-bind("windowSizeInCssForRef")
  290. );
  291. height: calc(
  292. 36 / v-bind("windowSizeWhenDesignForRef") *
  293. v-bind("windowSizeInCssForRef")
  294. );
  295. margin-top: 10px;
  296. }
  297. .video-text{
  298. color: #7b916b;
  299. font-family: KaiTi;
  300. writing-mode: horizontal-tb;
  301. font-size: calc(
  302. 14 / v-bind("windowSizeWhenDesignForRef") *
  303. v-bind("windowSizeInCssForRef")
  304. );
  305. letter-spacing: 0px;
  306. }
  307. .operation-video-tip {
  308. position: absolute;
  309. right: 0;
  310. display: flex;
  311. align-items: center;
  312. pointer-events: none;
  313. letter-spacing: 1px;
  314. & > img {
  315. width: 40px;
  316. }
  317. & > div {
  318. margin-top: 4px;
  319. // position: relative;
  320. // line-height: 20px;
  321. // left: 9px;
  322. font-weight: 400;
  323. font-family: KaiTi;
  324. color: #7b916b;
  325. text-align: center;
  326. font-size: 18px;
  327. writing-mode: vertical-rl;
  328. }
  329. }
  330. .video-btn{
  331. width: calc(
  332. 36 / v-bind("windowSizeWhenDesignForRef") *
  333. v-bind("windowSizeInCssForRef")
  334. );
  335. height: calc(
  336. 36 / v-bind("windowSizeWhenDesignForRef") *
  337. v-bind("windowSizeInCssForRef")
  338. );
  339. display: flex;
  340. flex-direction: column;
  341. font-size: calc(
  342. 14 / v-bind("windowSizeWhenDesignForRef") *
  343. v-bind("windowSizeInCssForRef")
  344. );
  345. font-family: KaiTi;
  346. color: #7b916b;
  347. }
  348. }
  349. .shuanggou-yezi {
  350. width: 100%;
  351. animation: fade-in 2s forwards;
  352. position: relative;
  353. z-index: 2;
  354. @keyframes fade-in {
  355. 0% {
  356. opacity: 0;
  357. }
  358. 100% {
  359. opacity: 1;
  360. }
  361. }
  362. > img {
  363. width: 100%;
  364. margin-top: -3%;
  365. }
  366. > .hotspot-1 {
  367. position: absolute;
  368. bottom: 28%;
  369. left: 17%;
  370. pointer-events: initial;
  371. z-index: 3;
  372. }
  373. }
  374. .text {
  375. display: flex;
  376. position: absolute;
  377. right: 32%;
  378. top: 40vh;
  379. // top: calc(50 /v-bind('windowSizeWhenDesignForRef')/v-bind('windowSizeInCssForRef'));
  380. color: #707f48;
  381. font-size: calc(
  382. 18 / v-bind("windowSizeWhenDesignForRef") *
  383. v-bind("windowSizeInCssForRef")
  384. );
  385. line-height: calc(
  386. 26 / v-bind("windowSizeWhenDesignForRef") *
  387. v-bind("windowSizeInCssForRef")
  388. );
  389. font-family: "KaiTi";
  390. // writing-mode: vertical-rl;
  391. letter-spacing: 2px;
  392. text-align: justify;
  393. height: 30vh;
  394. width: 50%;
  395. text-indent: 2em;
  396. @media screen and (min-width: 600px) {
  397. bottom: 9vh !important;
  398. }
  399. }
  400. .right-bottom {
  401. width: 100%;
  402. position: absolute;
  403. bottom: 0;
  404. right: 0;
  405. }
  406. .progress-bar {
  407. position: absolute;
  408. left: 0;
  409. bottom: 15px;
  410. left: 50%;
  411. transform: translateX(-50%);
  412. width: 90%;
  413. height: 15px;
  414. z-index: 3;
  415. color: #e1edd95d;
  416. transition: all 1s;
  417. z-index: 1;
  418. }
  419. .system-btns {
  420. width: 100%;
  421. padding: 0
  422. calc(
  423. 20 / v-bind(windowSizeWhenDesignForRef) * v-bind(windowSizeInCssForRef)
  424. );
  425. display: flex;
  426. // flex-direction: column;
  427. justify-content: flex-end;
  428. position: absolute;
  429. bottom: calc(
  430. 60 / v-bind(windowSizeWhenDesignForRef) * v-bind(windowSizeInCssForRef)
  431. );
  432. z-index: 2;
  433. .operation-h {
  434. width: calc(
  435. 36 / v-bind("windowSizeWhenDesignForRef") *
  436. v-bind("windowSizeInCssForRef")
  437. );
  438. transition: opacity 0.5s ease-in-out;
  439. }
  440. }
  441. }
  442. .video-box {
  443. width: 100%;
  444. height: 100%;
  445. position: absolute;
  446. top: 0;
  447. left: 0;
  448. z-index: 10;
  449. .operation-h-video {
  450. position: fixed;
  451. left: 50%;
  452. transform: translateX(-50%);
  453. top: -34vh;
  454. z-index: 21;
  455. }
  456. .video-box-close {
  457. position: absolute;
  458. left: calc(
  459. 30 / v-bind("windowSizeWhenDesignForRef") *
  460. v-bind("windowSizeInCssForRef")
  461. );
  462. bottom: calc(
  463. 35 / v-bind("windowSizeWhenDesignForRef") *
  464. v-bind("windowSizeInCssForRef")
  465. );
  466. }
  467. > .bg-img {
  468. width: 100%;
  469. height: 100%;
  470. object-fit: cover;
  471. position: absolute;
  472. top: 0;
  473. left: 0;
  474. }
  475. > video {
  476. width: 100%;
  477. position: absolute;
  478. top: 50%;
  479. transform: translateY(-50%);
  480. }
  481. > div {
  482. color: #ffffff;
  483. position: absolute;
  484. bottom: 10%;
  485. font-size: calc(
  486. 24 / v-bind("windowSizeWhenDesignForRef") *
  487. v-bind("windowSizeInCssForRef")
  488. );
  489. line-height: calc(
  490. 29 / v-bind("windowSizeWhenDesignForRef") *
  491. v-bind("windowSizeInCssForRef")
  492. );
  493. font-family: "KingHwa_OldSong";
  494. left: 50%;
  495. transform: translateX(-50%);
  496. }
  497. }
  498. </style>