menu.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. <template>
  2. <div
  3. class="pinBottom-container"
  4. :class="{
  5. mobile: isMobile,
  6. }"
  7. >
  8. <div class="pinBottom center">
  9. <div id="view-controllers" />
  10. </div>
  11. <div class="pinBottom left">
  12. <div>
  13. <div class="viewContainer">
  14. <!-- <div
  15. id="previous"
  16. class="previous desktop-only ui-icon"
  17. style="display: none"
  18. >
  19. <a>
  20. <img
  21. rel="tooltip"
  22. title=""
  23. :src="require('@/assets/images/play.png')"
  24. data-original-title="播放"
  25. />
  26. </a>
  27. </div> -->
  28. <div
  29. id="play"
  30. class="ui-icon"
  31. rel="tooltip"
  32. data-original-title="播放"
  33. @click="onClickPlay"
  34. >
  35. <!-- 鼠标移入的显示 -->
  36. <!-- <div class="hoverTit">自动导览</div> -->
  37. <a>
  38. <img
  39. :src="require('@/assets/images/play.png')"
  40. >
  41. </a>
  42. </div>
  43. <div
  44. id="pause"
  45. class="ui-icon"
  46. style="display: none"
  47. >
  48. <!-- 鼠标移入的显示 -->
  49. <!-- <div class="hoverTit">自动导览</div> -->
  50. <a>
  51. <img
  52. rel="tooltip"
  53. title=""
  54. :src="require('@/assets/images/pause.png')"
  55. data-original-title="暂停"
  56. >
  57. </a>
  58. </div>
  59. <!-- <div
  60. id="next"
  61. class="next desktop-only ui-icon wide"
  62. style="display: none"
  63. >
  64. <a>
  65. <i
  66. rel="tooltip"
  67. title=""
  68. class="icon icon-dpad-right"
  69. data-original-title="下一个"
  70. ></i>
  71. </a>
  72. </div> -->
  73. <div
  74. id="gui-modes-map"
  75. class="ui-icon double active"
  76. >
  77. <div
  78. id="pullTab"
  79. data-original-title="导览"
  80. rel="tooltip"
  81. title="场景导览"
  82. >
  83. <!-- 鼠标移入的显示 -->
  84. <!-- <div class="hoverTit">导览列表</div> -->
  85. <img
  86. title=""
  87. class="icon icon-inside"
  88. src="@/assets/images/auto.png"
  89. :style="{
  90. opacity: isGuide ? '1' : '',
  91. }"
  92. >
  93. </div>
  94. <div
  95. id="gui-modes-inside"
  96. data-original-title="全景漫游"
  97. rel="tooltip"
  98. >
  99. <!-- 鼠标移入的显示 -->
  100. <!-- <div class="hoverTit">自由漫游</div> -->
  101. <img
  102. class="icon icon-inside"
  103. :src="require('@/assets/images/inside.png')"
  104. >
  105. </div>
  106. <div
  107. id="gui-modes-dollhouse"
  108. title="迷你模型"
  109. data-original-title="迷你模型"
  110. rel="tooltip"
  111. >
  112. <!-- 鼠标移入的显示 -->
  113. <!-- <div class="hoverTit">三维视觉</div> -->
  114. <img
  115. class="icon icon-inside"
  116. :src="require('@/assets/images/dollhouse.png')"
  117. >
  118. </div>
  119. <div
  120. id="gui-modes-floorplan"
  121. data-original-title="俯视图"
  122. rel="tooltip"
  123. title="顶部俯视"
  124. >
  125. <!-- 鼠标移入的显示 -->
  126. <!-- <div class="hoverTit">平面视觉</div> -->
  127. <img
  128. class="icon icon-inside"
  129. :src="require('@/assets/images/floor.png')"
  130. >
  131. </div>
  132. <!-- <div
  133. data-original-title="VR"
  134. id="vr"
  135. rel="tooltip"
  136. title=""
  137. style="display: none"
  138. >
  139. <img
  140. class="icon icon-inside"
  141. :src="require('@/assets/images/VR.png')"
  142. />
  143. </div> -->
  144. <!-- 没有这个元素会导致报错 -->
  145. <div
  146. id="hotList"
  147. style="display: none;"
  148. data-original-title="热点列表"
  149. rel="tooltip"
  150. title=""
  151. >
  152. <img
  153. class="icon icon-inside"
  154. :src="require('@/assets/images/hotlist.png')"
  155. >
  156. </div>
  157. <!-- <div
  158. data-original-title="消除外壳"
  159. id="gui-remove-face"
  160. rel="tooltip"
  161. title=""
  162. style="display: none; float: left"
  163. >
  164. <img
  165. class="icon icon-inside"
  166. :src="require('@/assets/images/face.jpg')"
  167. />
  168. </div> -->
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <div class="pinBottom right hideTarget">
  174. <div class="rightViewContainer clearfix">
  175. <div
  176. v-if="!isMobile"
  177. class="ui-icon my-floor"
  178. :class="{
  179. active: currentSceneCode === '1265'
  180. }"
  181. @click="ChangeFloor('1265')"
  182. >
  183. <a>
  184. <img
  185. src="@/assets/images/floor-1.png"
  186. alt=""
  187. draggable="false"
  188. >
  189. </a>
  190. </div>
  191. <div
  192. v-if="!isMobile"
  193. class="ui-icon my-floor"
  194. :class="{
  195. active: currentSceneCode === '1263'
  196. }"
  197. @click="ChangeFloor('1263')"
  198. >
  199. <a>
  200. <img
  201. src="@/assets/images/floor-2.png"
  202. alt=""
  203. draggable="false"
  204. >
  205. </a>
  206. </div>
  207. <div
  208. v-if="!isMobile"
  209. class="ui-icon my-floor"
  210. :class="{
  211. active: currentSceneCode === '1264'
  212. }"
  213. @click="ChangeFloor('1264')"
  214. >
  215. <a>
  216. <img
  217. src="@/assets/images/floor-3.png"
  218. alt=""
  219. draggable="false"
  220. >
  221. </a>
  222. </div>
  223. <div
  224. v-if="isMobile"
  225. class="floor-selector-wrap"
  226. :class="{
  227. expanded: isSelectingFloor,
  228. }"
  229. >
  230. <div
  231. class="ui-icon floor-mobile"
  232. :style="{
  233. opacity: (currentSceneCode === '1265' || isSelectingFloor) ? '1' : '0',
  234. right: !isSelectingFloor ? '0' : currentSceneCode === '1265' ? '0' : 'calc(44px + 12px)',
  235. }"
  236. @click="onClickFloorBtnMobile('1265')"
  237. >
  238. <a>
  239. <img
  240. :class="{
  241. active: currentSceneCode === '1265'
  242. }"
  243. src="@/assets/images/floor-1.png"
  244. alt=""
  245. draggable="false"
  246. >
  247. </a>
  248. </div>
  249. <div
  250. class="ui-icon floor-mobile"
  251. :style="{
  252. opacity: (currentSceneCode === '1263' || isSelectingFloor) ? '1' : '0',
  253. right: !isSelectingFloor ? '0' : currentSceneCode === '1265' ? 'calc(44px + 12px)' : currentSceneCode === '1263' ? '0' : 'calc(44px * 2 + 12px * 2)',
  254. }"
  255. @click="onClickFloorBtnMobile('1263')"
  256. >
  257. <a>
  258. <img
  259. :class="{
  260. active: currentSceneCode === '1263'
  261. }"
  262. src="@/assets/images/floor-2.png"
  263. alt=""
  264. draggable="false"
  265. >
  266. </a>
  267. </div>
  268. <div
  269. class="ui-icon floor-mobile"
  270. :style="{
  271. opacity: (currentSceneCode === '1264' || isSelectingFloor) ? '1' : '0',
  272. right: !isSelectingFloor ? '0' : currentSceneCode === '1265' ? 'calc(44px * 2 + 12px * 2)' : currentSceneCode === '1263' ? 'calc(44px * 2 + 12px * 2)' : '0',
  273. }"
  274. @click="onClickFloorBtnMobile('1264')"
  275. >
  276. <a>
  277. <img
  278. :class="{
  279. active: currentSceneCode === '1264'
  280. }"
  281. src="@/assets/images/floor-3.png"
  282. alt=""
  283. draggable="false"
  284. >
  285. </a>
  286. </div>
  287. </div>
  288. <!-- 音乐 -->
  289. <div
  290. id="volume"
  291. class="ui-icon wide"
  292. title="音乐"
  293. >
  294. <a>
  295. <img
  296. id="openMusic"
  297. style="display: block"
  298. src="../../assets/images/music-muted.png"
  299. alt=""
  300. title="打开音乐"
  301. @click="switchBGM(true)"
  302. >
  303. <img
  304. id="closeMusic"
  305. style="display: none"
  306. src="../../assets/images/music.png"
  307. alt=""
  308. title="关闭音乐"
  309. @click="switchBGM(false)"
  310. >
  311. </a>
  312. </div>
  313. <!-- 全屏 -->
  314. <div
  315. v-show="!isMobile"
  316. id="gui-fullscreen"
  317. class="ui-icon wide"
  318. data-placement="top"
  319. rel="tooltip"
  320. title="全屏"
  321. >
  322. <a>
  323. <img
  324. title="全屏"
  325. :src="require('@/assets/images/full.png')"
  326. >
  327. </a>
  328. </div>
  329. <!-- 取消全屏 -->
  330. <div
  331. id="gui-fullscreen-exit"
  332. class="ui-icon wide"
  333. data-placement="top"
  334. rel="tooltip"
  335. title="关闭全屏"
  336. style="display: none"
  337. >
  338. <a>
  339. <img
  340. title="关闭全屏"
  341. :src="require('@/assets/images/fullAc.png')"
  342. >
  343. </a>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </template>
  349. <script>
  350. export default {
  351. data() {
  352. return {
  353. isGuide: false,
  354. isSelectingFloor: false,
  355. floorBtnCollapseTimeoutId: null,
  356. mutationObserver: null,
  357. }
  358. },
  359. computed: {
  360. currentSceneCode() {
  361. return this.$route.query.m
  362. }
  363. },
  364. watch: {
  365. isSelectingFloor: {
  366. handler(vNew) {
  367. clearTimeout(this.floorBtnCollapseTimeoutId)
  368. if (vNew) {
  369. this.floorBtnCollapseTimeoutId = setTimeout(() => {
  370. this.isSelectingFloor = false
  371. }, 2000)
  372. }
  373. }
  374. }
  375. },
  376. mounted() {
  377. // 创建一个观察器实例并传入回调函数
  378. this.mutationObserver = new MutationObserver((mutationsList, observer) => {
  379. for (let mutation of mutationsList) {
  380. if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
  381. if (mutation.target.classList.contains('open')) {
  382. this.isGuide = true
  383. } else {
  384. this.isGuide = false
  385. }
  386. }
  387. }
  388. })
  389. // 选择需要观察变动的节点
  390. const targetNode = document.querySelector('.pinBottom.left')
  391. // 以上述配置开始观察目标节点
  392. this.mutationObserver.observe(targetNode, { attributes: true, childList: false, subtree: false })
  393. },
  394. beforeDistroy() {
  395. this.mutationObserver.disconnect()
  396. },
  397. methods: {
  398. switchBGM(flag) {
  399. if (flag) {
  400. window.manage.switchBgmState(true)
  401. document.querySelector("#openMusic").style.display = "none"
  402. document.querySelector("#closeMusic").style.display = "block"
  403. } else {
  404. window.manage.switchBgmState(false)
  405. document.querySelector("#openMusic").style.display = "block"
  406. document.querySelector("#closeMusic").style.display = "none"
  407. }
  408. },
  409. ChangeFloor(sceneCode) {
  410. if (this.currentSceneCode !== sceneCode) {
  411. const locationQuerySection = new URLSearchParams(location.href.split('?')[1])
  412. locationQuerySection.set('m', sceneCode)
  413. const newLocation = location.href.split('?')[0] + '?' + locationQuerySection.toString()
  414. location.assign(newLocation)
  415. location.reload(true)
  416. }
  417. },
  418. onClickFloorBtnMobile(floorCode) {
  419. if (!this.isSelectingFloor) {
  420. } else {
  421. this.ChangeFloor(floorCode)
  422. }
  423. this.isSelectingFloor = !this.isSelectingFloor
  424. },
  425. onClickPlay() {
  426. console.log('sadfsfdsdfsdfgdfg')
  427. }
  428. },
  429. }
  430. </script>
  431. <style lang="less" scoped>
  432. ::-webkit-scrollbar {
  433. width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
  434. }
  435. ::-webkit-scrollbar-thumb {
  436. // box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2);
  437. background: #edd3b0;
  438. border-color: #edd3b0;
  439. color: #edd3b0;
  440. outline: none;
  441. }
  442. // ------tooltip相关--------------
  443. // #gui-modes-inside {
  444. // position: relative;
  445. // }
  446. // #gui-modes-dollhouse {
  447. // position: relative;
  448. // }
  449. // #gui-modes-floorplan {
  450. // position: relative;
  451. // }
  452. // .hoverTit {
  453. // pointer-events: none;
  454. // transition: all 0.5s;
  455. // opacity: 0;
  456. // position: absolute;
  457. // left: 50%;
  458. // transform: translateX(-50%);
  459. // top: -40px;
  460. // width: 80px;
  461. // height: 37px;
  462. // line-height: 30px;
  463. // text-align: center;
  464. // background: url("../../assets/img/hoverTit.png");
  465. // background-size: 100% 100%;
  466. // font-size: 14px;
  467. // color: #fff6d2;
  468. // }
  469. // #play:hover {
  470. // .hoverTit {
  471. // opacity: 1;
  472. // }
  473. // }
  474. // #pause:hover {
  475. // .hoverTit {
  476. // opacity: 1;
  477. // }
  478. // }
  479. // #gui-modes-map > div:hover {
  480. // .hoverTit {
  481. // opacity: 1;
  482. // }
  483. // }
  484. // -------end of tooltip相关--------------
  485. @width: 99px;
  486. @height: 125px;
  487. // ----------左下方菜单--------------
  488. .pinBottom.left {
  489. bottom: 30px;
  490. &.playing {
  491. bottom: 50px !important;
  492. }
  493. &.open {
  494. bottom: 170px !important;
  495. }
  496. &.open.playing {
  497. bottom: 190px !important
  498. }
  499. > div {
  500. > .viewContainer {
  501. flex-direction: row;
  502. margin-left: 50px;
  503. padding: 0;
  504. #play,
  505. #pause {
  506. margin-right: 30px;
  507. width: 99px;
  508. height: 125px;
  509. padding: 0;
  510. img {
  511. height: 100%;
  512. width: 100%;
  513. }
  514. }
  515. #gui-modes-map {
  516. > div {
  517. margin-right: 30px;
  518. width: @width;
  519. height: @height;
  520. padding: 0;
  521. > img {
  522. height: 100%;
  523. width: 100%;
  524. opacity: 0.7;
  525. display: block !important;
  526. }
  527. &.active {
  528. > img {
  529. opacity: 1;
  530. }
  531. }
  532. }
  533. }
  534. }
  535. }
  536. }
  537. // ----------end of 左下方菜单--------------
  538. // ----------右下方菜单---------------
  539. .pinBottom.right {
  540. bottom: 30px;
  541. &.playing {
  542. bottom: 50px !important;
  543. }
  544. &.open {
  545. bottom: 170px !important;
  546. }
  547. &.open.playing {
  548. bottom: 190px !important
  549. }
  550. .rightViewContainer {
  551. display: flex !important;
  552. align-items: center !important;
  553. margin-right: 54px;
  554. padding-bottom: 20px;
  555. .ui-icon {
  556. width: 88px;
  557. height: 91px;
  558. margin-left: 30px;
  559. margin-right: initial;
  560. background: none;
  561. border: none;
  562. padding: 0 !important;
  563. > a {
  564. width: 100% !important;
  565. height: 100% !important;
  566. > img {
  567. width: 100%;
  568. height: 100%;
  569. }
  570. }
  571. }
  572. .ui-icon.my-floor {
  573. opacity: 0.7;
  574. }
  575. .ui-icon.my-floor.active {
  576. opacity: 1;
  577. }
  578. }
  579. }
  580. // ----------end of 右下方菜单---------------
  581. // -------------移动端特殊样式---------------
  582. .mobile {
  583. .pinBottom.left {
  584. left: 0;
  585. bottom: 0;
  586. &.playing {
  587. bottom: 20px !important;
  588. }
  589. &.open {
  590. bottom: 158px !important;
  591. }
  592. &.open.playing {
  593. bottom: 178px !important
  594. }
  595. > div {
  596. > .viewContainer {
  597. flex-direction: column;
  598. margin-left: 20px;
  599. margin-bottom: 25px;
  600. #play,
  601. #pause {
  602. margin-top: 15px;
  603. margin-right: 0;
  604. width: 45px;
  605. height: 60px;
  606. img {
  607. }
  608. }
  609. #gui-modes-map {
  610. > div {
  611. margin-top: 15px;
  612. margin-right: 0;
  613. width: 45px;
  614. height: 60px;
  615. > img {
  616. }
  617. &.active {
  618. > img {
  619. }
  620. }
  621. }
  622. }
  623. }
  624. }
  625. }
  626. .pinBottom.right {
  627. position: fixed;
  628. top: 130px;
  629. bottom: initial;
  630. .rightViewContainer {
  631. margin-right: 14px;
  632. padding-bottom: 0;
  633. flex-direction: column;
  634. align-items: flex-end !important;
  635. > .floor-selector-wrap {
  636. height: 44px;
  637. width: 44px;
  638. position: relative;
  639. margin-bottom: 10.5px;
  640. > .floor-mobile {
  641. position: absolute;
  642. top: 0;
  643. right: 0;
  644. opacity: 0;
  645. transition: all 0.5s;
  646. }
  647. &.expanded {
  648. width: calc(44px * 3 + 12px * 2);
  649. }
  650. }
  651. .ui-icon {
  652. width: 44px;
  653. height: 44px;
  654. margin-bottom: 10.5px;
  655. margin-left: initial;
  656. > a {
  657. > img {
  658. }
  659. }
  660. }
  661. }
  662. }
  663. }
  664. // -------------end of 移动端特殊样式---------------
  665. </style>