index.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
  6. <script src="./vue.min.js"></script>
  7. <!-- 引入样式 -->
  8. <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
  9. <!-- 引入组件库 -->
  10. <script src="https://unpkg.com/element-plus"></script>
  11. <title>珠海市自然资源局倾斜建筑展示</title>
  12. <style>
  13. body {
  14. margin: 0;
  15. }
  16. * {
  17. box-sizing: border-box;
  18. margin: 0;
  19. padding: 0;
  20. }
  21. #app {
  22. min-width: 100vw;
  23. height: 100vh;
  24. box-sizing: border-box;
  25. overflow: hidden;
  26. }
  27. #bg-video {
  28. width: 100%;
  29. height: 100%;
  30. object-fit: cover;
  31. position: absolute;
  32. top: 0;
  33. left: 0;
  34. }
  35. #bg-audio {
  36. position: absolute;
  37. top: 0;
  38. left: 0;
  39. }
  40. .welcome-btn {
  41. padding: 15px 40px;
  42. background: url(./img/beginBg.png);
  43. background-size: 100% 100%;
  44. position: absolute;
  45. bottom: 15vh;
  46. left: 50%;
  47. transform: translateX(-50%);
  48. display: flex;
  49. justify-content: center;
  50. align-items: center;
  51. font-size: 1.2em;
  52. letter-spacing: 5px;
  53. cursor: pointer;
  54. color: #cbb18e;
  55. }
  56. .page2-box {
  57. width: 100%;
  58. height: 100%;
  59. position: absolute;
  60. top: 0;
  61. left: 0;
  62. z-index: 2;
  63. }
  64. .page2-box>.info-box {
  65. max-width: 250px;
  66. /* min-width: 12vw; */
  67. position: absolute;
  68. top: 10px;
  69. left: 10px;
  70. }
  71. .info-title-box {
  72. max-width: 250px;
  73. /* min-width: 12vw; */
  74. padding: 10px;
  75. background: url(./img/info-title-bg.png);
  76. background-size: 100% 100%;
  77. display: flex;
  78. justify-content: center;
  79. align-items: center;
  80. color: white;
  81. cursor: pointer;
  82. }
  83. .info-title-box>.text {
  84. display: flex;
  85. justify-content: center;
  86. align-items: center;
  87. color: white;
  88. max-width: 55%;
  89. }
  90. .info-title-box>.text>.scroll-wrap {
  91. max-width: 100%;
  92. display: inline-block;
  93. vertical-align: top;
  94. overflow: hidden;
  95. white-space: nowrap;
  96. }
  97. .info-title-box>.text>.scroll-wrap>.scroll-item {
  98. animation: scroll linear 7s alternate infinite;
  99. float: left;
  100. }
  101. @keyframes scroll {
  102. 0% {
  103. margin-left: 0;
  104. transform: translateX(0);
  105. }
  106. 10% {
  107. margin-left: 0;
  108. transform: translateX(0);
  109. }
  110. 90% {
  111. margin-left: 100%;
  112. transform: translateX(-100%);
  113. }
  114. 100% {
  115. margin-left: 100%;
  116. transform: translateX(-100%);
  117. }
  118. }
  119. .info-title-box>.line {
  120. width: 1px;
  121. height: 20px;
  122. margin: auto 20px;
  123. background: white;
  124. }
  125. .info-title-box>img {
  126. width: 20px;
  127. /* height: 25px; */
  128. }
  129. .info-desc-box {
  130. width: 100%;
  131. max-height: 70vh;
  132. overflow-y: auto;
  133. background: rgba(94, 27, 19, .6431372549019608);
  134. backdrop-filter: blur(10px);
  135. border-radius: 10px 10px;
  136. color: white;
  137. padding: 30px;
  138. text-indent: 2em;
  139. letter-spacing: 2px;
  140. transition: opacity 1s ease;
  141. margin-top: 10px;
  142. opacity: 0;
  143. }
  144. .info-desc-box::-webkit-scrollbar {
  145. width: 8px;
  146. background-color: transparent;
  147. }
  148. .info-desc-box::-webkit-scrollbar-thumb {
  149. border-radius: 10px;
  150. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  151. background-color: #911212;
  152. }
  153. .info-desc-box::-webkit-scrollbar-track {
  154. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  155. border-radius: 10px;
  156. background-color: transparent;
  157. }
  158. .options-box {
  159. width: 100%;
  160. height: 50px;
  161. display: flex;
  162. justify-content: space-between;
  163. align-items: center;
  164. position: absolute;
  165. bottom: 30px;
  166. bottom: calc(30px + constant(safe-area-inset-bottom));
  167. bottom: calc(30px + env(safe-area-inset-bottom));
  168. left: 0;
  169. padding: 0 20px;
  170. z-index: 2;
  171. }
  172. /* .guide-options-box>img{
  173. opacity: 0.5;
  174. } */
  175. .guide-options-box>.left-box>.option-item>img {
  176. opacity: 0.4;
  177. }
  178. .guide-options-box>.left-box>.option-item>.el-image {
  179. opacity: 0.4;
  180. }
  181. .guide-options-box>.right-box>.option-item>img {
  182. opacity: 0.4;
  183. }
  184. .options-box>.left-box>.option-item {
  185. cursor: pointer;
  186. position: relative;
  187. }
  188. .options-box>.right-box>.option-item {
  189. cursor: pointer;
  190. position: relative;
  191. }
  192. .options-box>.left-box>.option-item>.tip-box {
  193. background: url(./img/tip-bg.png);
  194. background-size: 100% 100%;
  195. pointer-events: none;
  196. transition: all .5s;
  197. opacity: 0;
  198. position: absolute;
  199. left: 50%;
  200. transform: translateX(-50%);
  201. top: -40px;
  202. width: 80px;
  203. height: 37px;
  204. line-height: 30px;
  205. text-align: center;
  206. font-size: 14px;
  207. color: #fff;
  208. }
  209. .options-box>.left-box>.option-item>.guide-tip-box {
  210. position: absolute;
  211. bottom: 55px;
  212. left: 50%;
  213. transform: translateX(-50%);
  214. font-size: 18px;
  215. white-space: nowrap;
  216. z-index: 70;
  217. color: #cbb18e;
  218. display: flex;
  219. flex-direction: column;
  220. align-items: center;
  221. justify-content: center;
  222. }
  223. .options-box>.left-box>.option-item>.guide-tip-box>.play-text {
  224. transform: translateX(25%);
  225. }
  226. .options-box>.left-box>.option-item>.guide-tip-box>.guide-cicle {
  227. width: 20px !important;
  228. height: 20px !important;
  229. }
  230. .options-box>.left-box>.option-item>.guide-tip-box>.guide-line {
  231. width: 5px !important;
  232. }
  233. .options-box>.right-box>.option-item>.guide-tip-box {
  234. position: absolute;
  235. bottom: 55px;
  236. left: 50%;
  237. transform: translateX(-50%);
  238. font-size: 18px;
  239. white-space: nowrap;
  240. z-index: 70;
  241. color: #cbb18e;
  242. display: flex;
  243. flex-direction: column;
  244. align-items: center;
  245. justify-content: center;
  246. }
  247. .options-box>.right-box>.option-item>.guide-tip-box>.play-text {
  248. transform: translateX(25%);
  249. }
  250. .options-box>.right-box>.option-item>.guide-tip-box>.guide-cicle {
  251. width: 20px !important;
  252. height: 20px !important;
  253. }
  254. .options-box>.right-box>.option-item>.guide-tip-box>.guide-line {
  255. width: 5px !important;
  256. }
  257. .options-box>.right-box>.option-item>.tip-box {
  258. background: url(./img/tip-bg.png);
  259. background-size: 100% 100%;
  260. pointer-events: none;
  261. transition: all .5s;
  262. opacity: 0;
  263. position: absolute;
  264. left: 50%;
  265. transform: translateX(-50%);
  266. top: -40px;
  267. width: 80px;
  268. height: 37px;
  269. line-height: 30px;
  270. text-align: center;
  271. font-size: 14px;
  272. color: #fff;
  273. }
  274. .options-box>.right-box>.option-item {
  275. cursor: pointer;
  276. }
  277. .options-box>.left-box>.option-item>img {
  278. width: 45px;
  279. }
  280. .options-box>.left-box>.option-item>.el-image {
  281. width: 45px;
  282. }
  283. .options-box>.right-box>.option-item>img {
  284. width: 45px;
  285. }
  286. .options-box>.left-box {
  287. display: flex;
  288. }
  289. .options-box>.right-box {
  290. display: flex;
  291. }
  292. .el-image-viewer__img {
  293. /* transform: scale(0.8) rotate(0deg) !important; */
  294. height: 75vh;
  295. }
  296. .guide-box {
  297. width: 100%;
  298. height: 100%;
  299. position: absolute;
  300. left: 0;
  301. top: 0;
  302. background: rgba(0, 0, 0, 0.7);
  303. color: #ffe794;
  304. }
  305. .guide-box>.begin-btn {
  306. padding: 15px 40px;
  307. background: url(./img/beginBg.png);
  308. background-size: 100% 100%;
  309. position: absolute;
  310. bottom: 15vh;
  311. left: 50%;
  312. transform: translateX(-50%);
  313. display: flex;
  314. justify-content: center;
  315. align-items: center;
  316. font-size: 1.2em;
  317. letter-spacing: 5px;
  318. cursor: pointer;
  319. color: #cbb18e;
  320. }
  321. .progress-bar {
  322. width: 100%;
  323. height: 20px;
  324. background: #911212;
  325. position: absolute;
  326. left: 0;
  327. bottom: 0;
  328. bottom: constant(safe-area-inset-bottom);
  329. bottom: env(safe-area-inset-bottom);
  330. padding: 10px;
  331. display: flex;
  332. justify-content: center;
  333. align-items: center;
  334. }
  335. .progress-bar>.content-box {
  336. width: 100%;
  337. height: 5px;
  338. background: white;
  339. }
  340. .progress-bar>.content-box>.progress-bar-passed {
  341. background: #d6b970;
  342. height: 5px;
  343. transition: width 0.1s ease;
  344. position: relative;
  345. }
  346. .progress-bar>.content-box>.progress-bar-passed>.cicle-box {
  347. width: 15px;
  348. height: 15px;
  349. border-radius: 50px;
  350. border: 1px #d6b970 solid;
  351. background: white;
  352. position: absolute;
  353. right: 0;
  354. top: 0;
  355. transform: translate(50%, -25%);
  356. cursor: pointer;
  357. }
  358. @media screen and (max-width: 768px) {
  359. .page2-box>.info-box {
  360. max-width: 250px;
  361. /* min-width: 12vw; */
  362. position: absolute;
  363. top: 10px;
  364. left: 50%;
  365. transform: translateX(-50%);
  366. }
  367. .options-box>.left-box {
  368. flex-direction: column;
  369. }
  370. .options-box {
  371. align-items: end;
  372. }
  373. .options-box>.left-box>.option-item {
  374. width: 35px;
  375. }
  376. .options-box>.left-box>.option-item>img {
  377. width: 35px;
  378. }
  379. .options-box>.left-box>.option-item>.el-image {
  380. width: 35px;
  381. margin-top: 10px;
  382. }
  383. .options-box>.right-box>.option-item>img {
  384. width: 35px;
  385. }
  386. .options-box>.left-box>.option-item>.tip-box {
  387. display: none !important;
  388. }
  389. .options-box>.right-box>.option-item>.tip-box {
  390. display: none !important;
  391. }
  392. .el-image-viewer__img {
  393. /* transform: scale(0.8) rotate(0deg) !important; */
  394. height: auto;
  395. }
  396. .guide-box>.begin-btn {
  397. bottom: 50vh;
  398. }
  399. .options-box>.left-box>.option-item>.guide-tip-box {
  400. bottom: 50%;
  401. transform: translateY(50%);
  402. left: 110%;
  403. flex-direction: row-reverse;
  404. }
  405. .options-box>.left-box>.option-item>.guide-tip-box>.guide-line {
  406. height: auto !important;
  407. transform: rotate(90deg);
  408. margin: 0 10px;
  409. }
  410. .options-box>.left-box>.option-item>.guide-tip-box>.guide-line {
  411. width: 10px !important;
  412. }
  413. .options-box>.right-box>.option-item>.guide-tip-box {
  414. bottom: 50%;
  415. transform: translate(-110%, 50%);
  416. left: 0;
  417. flex-direction: row;
  418. }
  419. .options-box>.right-box>.option-item>.guide-tip-box>.guide-line {
  420. height: auto !important;
  421. transform: rotate(90deg);
  422. margin: 0 10px;
  423. }
  424. .options-box>.right-box>.option-item>.guide-tip-box>.guide-line {
  425. width: 10px !important;
  426. }
  427. }
  428. .preview-page{
  429. position: fixed;
  430. text-align: center;
  431. color:#fff;
  432. left: 50%;
  433. bottom:80px;
  434. height:30px;
  435. padding: 0 23px;
  436. border-radius:15px;
  437. line-height:30px;
  438. transform: translateX(-50%);
  439. z-index: 9999;
  440. }
  441. </style>
  442. </head>
  443. <body>
  444. <div id="app">
  445. <!-- 视频背景 -->
  446. <video @timeupdate="timeUpdate" id="bg-video" :src="`${baseUrl}/video/${curModel.name}.mp4`" muted loop
  447. x5-playsinline="true"
  448. playsinline="true"
  449. webkit-playsinline="true"
  450. x-webkit-airplay="true"
  451. x5-video-player-type="h5-page"
  452. preload="metadata"
  453. ></video>
  454. <audio id="bg-audio" :src="`${baseUrl}/audio/${curModel.name}.mp3`" loop></audio>
  455. <!-- 开始探索 -->
  456. <div @click="goCurIndex2" class="welcome-btn" v-if="curPage == 1">开始探索</div>
  457. <!-- 左侧简介 -->
  458. <div class="page2-box" v-else>
  459. <div class="info-box" v-show="!isClearing">
  460. <div class="info-title-box" @click="isShowDescBox = !isShowDescBox">
  461. <div class="text">
  462. <div class="scroll-wrap">
  463. <div class="scroll-item">
  464. {{curModel.name}}
  465. </div>
  466. </div>
  467. </div>
  468. <div class="line"></div><img src="./img/icon-down.png" alt="">
  469. </div>
  470. <div class="info-desc-box" :style="{opacity: isShowDescBox ? 1:0}">{{curModel.desc}}</div>
  471. </div>
  472. <!-- 下面功能按钮去 -->
  473. <div class="options-box " :class="{'guide-options-box': isGuideOpen}">
  474. <div class="left-box">
  475. <div class="option-item" @mousemove="hoverIndex = 1" @mouseleave="hoverIndex = -1"
  476. :style="{opacity: !isClearing ? 1:0,marginRight: '20px'}" @click="videoPlayChange()">
  477. <div class="tip-box" :style="{opacity: hoverIndex == 1 && !isGuideOpen ?1:0}">{{isPlayingVideo ?'暂停':'播放'}}
  478. </div>
  479. <div class="guide-tip-box" v-if="isGuideOpen && guideStep == 1">
  480. <div>播放/暂停</div>
  481. <img class="guide-line" style="height: 8vh" src="./img/guide-line.png" alt="" />
  482. <img class="guide-cicle" src="./img/guide-cicle.png" alt="" />
  483. </div>
  484. <img v-if="!isPlayingVideo" src="./img/icon-manyou-1.png" alt=""><img v-else src="./img/icon-manyou.png"
  485. alt="">
  486. </div>
  487. <div class="option-item" @mousemove="hoverIndex = 2 " @mouseleave="hoverIndex = -1"
  488. :style="{opacity: !isClearing ? 1:0}">
  489. <div class="tip-box" :style="{opacity: hoverIndex == 2 && !isGuideOpen ?1:0}">图片预览</div>
  490. <div class="guide-tip-box" v-if="isGuideOpen && guideStep == 1">
  491. <div>点击查看图片</div>
  492. <img class="guide-line" style="height: 4vh" src="./img/guide-line.png" alt="" />
  493. <img class="guide-cicle" src="./img/guide-cicle.png" alt="" />
  494. </div>
  495. <el-image @wheel="handleWheel" src="./img/icon-images.png" @click="openViewer"
  496. :preview-src-list="imagesList" :initial-zoom-num="0.5" alt="" @switch="onSwitch"
  497. @close="closePreview">
  498. <template #viewer>
  499. <div class="preview-page">{{imgCur}}/{{imagesList.length}}</div>
  500. </template>
  501. </el-image>
  502. </div>
  503. </div>
  504. <div class="right-box">
  505. <div class="option-item" @mousemove="hoverIndex = 3" @mouseleave="hoverIndex = -1" @click="clearingChange()">
  506. <div class="tip-box" :style="{opacity: hoverIndex == 3 && !isGuideOpen?1:0}">{{isClearing ? '取消':'清屏'}}
  507. </div>
  508. <div class="guide-tip-box" v-if="isGuideOpen && guideStep == 2">
  509. <div>点击清屏</div>
  510. <img class="guide-line" style="height: 8vh" src="./img/guide-line.png" alt="" />
  511. <img class="guide-cicle" src="./img/guide-cicle.png" alt="" />
  512. </div>
  513. <img v-if="!isClearing" src="./img/icon-qingping.png" alt=""><img v-else src="./img/icon-qingping-1.png"
  514. alt="">
  515. </div>
  516. </div>
  517. </div>
  518. <!-- 提示指引 -->
  519. <div v-show="isGuideOpen" class="guide-box">
  520. <div class="begin-btn" @click="guideStep == 2 ? (isGuideOpen = false) : (guideStep ++) ">
  521. {{ guideStep != 2 ? "下一步" : "我知道了" }}
  522. </div>
  523. </div>
  524. <!-- 进度条 -->
  525. <div class="progress-bar">
  526. <div class="content-box" id="progress-track">
  527. <!-- <div class="progress-bar-passed" :style="{width: `${curModel.progress}%`}"></div>" ></div> -->
  528. <div class="progress-bar-passed" :style="{width:`${curProgressValue}%`}">
  529. <div class="cicle-box" id="progress-thumb" @mousedown="startDrag" @touchstart="startDrag"></div>
  530. </div>
  531. </div>
  532. </div>
  533. </div>
  534. </div>
  535. <script src="./staticData/data.js"></script>
  536. <script>
  537. var app = Vue.createApp({
  538. data() {
  539. return {
  540. dataAll: dataAll,
  541. baseUrl: './staticData/data',
  542. curModel: null,
  543. curPage: 1,
  544. isShowDescBox: false,
  545. isPlayingVideo: true,
  546. isClearing: false,
  547. imagesList: [],
  548. hoverIndex: 0,
  549. guideStep: 1,
  550. isGuideOpen: true,
  551. curProgressValue: 0, // 当前进度值
  552. dragPosition: '', // 拖动位置(百分比)
  553. isDragging: false, // 是否正在拖动
  554. imgCur: 1,
  555. };
  556. },
  557. mounted() {
  558. const m = this.handleQueryParams().m
  559. const res = this.dataAll.list.filter((item) => {
  560. return item.id == m || item.name == m
  561. })
  562. this.curModel = res[0]
  563. // 初始化大图列表
  564. this.imagesList = res[0].images.map((item) => {
  565. return `${this.baseUrl}/images/${res[0].name}/${item}`
  566. })
  567. if (localStorage.getItem("isGuided") == "true") {
  568. this.isGuideOpen = false;
  569. this.guideStep = null;
  570. } else {
  571. this.isGuideOpen = true;
  572. this.guideStep = 1;
  573. localStorage.setItem("isGuided", "true");
  574. }
  575. document.addEventListener('WeixinJSBridgeReady', function () {
  576. const video = document.getElementById('bg-video');
  577. video.play();
  578. video.pause();
  579. }, false);
  580. },
  581. created() { },
  582. beforeDestroy() {
  583. },
  584. watch: {
  585. },
  586. methods: {
  587. onSwitch(idx) {
  588. this.imgCur = idx + 1
  589. },
  590. closePreview() {
  591. this.imgCur = 1
  592. },
  593. handleQueryParams() {
  594. var queryParams = {};
  595. console.log(window.location.href)
  596. if (!window.location.href.includes('?')) {
  597. alert('请输入参数')
  598. return {}
  599. }
  600. window.location.href.split('?')[1].split('&').forEach(function (item) {
  601. var parts = item.split('=');
  602. queryParams[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);
  603. });
  604. return queryParams;
  605. },
  606. goCurIndex2() {
  607. this.curPage = 2;
  608. const audioDom = document.getElementById('bg-audio');
  609. const videoDom = document.getElementById('bg-video');
  610. if (audioDom && videoDom) {
  611. audioDom.play()
  612. videoDom.play()
  613. }
  614. setTimeout(() => {
  615. this.isShowDescBox = true
  616. setTimeout(() => {
  617. this.isShowDescBox = false
  618. }, 3000)
  619. }, 200)
  620. },
  621. videoPlayChange() {
  622. const videoDom = document.getElementById('bg-video')
  623. const audioDom = document.getElementById('bg-audio')
  624. if (!videoDom.paused && !videoDom.ended && videoDom.readyState > 2) {
  625. videoDom.pause()
  626. audioDom.pause()
  627. this.isPlayingVideo = false
  628. } else {
  629. videoDom.play()
  630. audioDom.play()
  631. this.isPlayingVideo = true
  632. }
  633. },
  634. clearingChange() {
  635. this.isClearing = !this.isClearing
  636. },
  637. openViewer() {
  638. },
  639. handleWheel() {
  640. },
  641. timeUpdate(event) {
  642. this.curProgressValue = event.target.currentTime / event.target.duration * 100
  643. },
  644. getRelativePosition(event) {
  645. // const track = document.querySelector('#progress-track');
  646. // console.log('有没有',track)
  647. const trackRect = document.querySelector('#progress-track').getBoundingClientRect();
  648. let pos;
  649. if (event.type.includes('touch')) {
  650. pos = event.touches[0].clientX - trackRect.left;
  651. } else {
  652. pos = event.clientX - trackRect.left;
  653. }
  654. return Math.min(Math.max(pos / trackRect.width * 100, 0), 100);
  655. },
  656. startDrag(event) {
  657. console.log('被拖动了')
  658. this.isDragging = true
  659. this.curProgressValue = this.getRelativePosition(event);
  660. document.addEventListener('mousemove', this.moveDrag);
  661. document.addEventListener('touchmove', this.moveDrag);
  662. document.addEventListener('mouseup', this.stopDrag);
  663. document.addEventListener('touchend', this.stopDrag);
  664. },
  665. moveDrag(event) {
  666. if (!this.isDragging) return;
  667. this.curProgressValue = this.getRelativePosition(event);
  668. this.updateProgress();
  669. },
  670. stopDrag() {
  671. this.isDragging = false;
  672. document.removeEventListener('mousemove', this.moveDrag);
  673. document.removeEventListener('touchmove', this.moveDrag);
  674. document.removeEventListener('mouseup', this.stopDrag);
  675. document.removeEventListener('touchend', this.stopDrag);
  676. },
  677. updateProgress() {
  678. this.curProgressValue = Math.round(this.curProgressValue)
  679. const videoDom = document.getElementById('bg-video')
  680. // const audioDom = document.getElementById('bg-audio')
  681. // videoDom.pause()
  682. // audioDom.pause()
  683. // this.isPlayingVideo = false
  684. const progressTrack = document.getElementById('progress-track')
  685. if (videoDom && progressTrack) {
  686. let clickProgress = this.curProgressValue / 100
  687. videoDom.currentTime = videoDom.duration * clickProgress;
  688. }
  689. }
  690. },
  691. }).use(ElementPlus).mount('#app');
  692. </script>
  693. </body>
  694. </html>