menu.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <div class="pinBottom-container" @touchstart.stop @keydown.stop>
  3. <div class="pinBottom center">
  4. <div id="view-controllers"></div>
  5. </div>
  6. <div class="pinBottom left">
  7. <div v-if="isMobile" id="myClickBox" style="">
  8. <div id="go" />
  9. <div id="back" />
  10. </div>
  11. <div>
  12. <div class="viewContainer">
  13. <div id="previous" class="previous desktop-only ui-icon" style="display: none">
  14. <a>
  15. <img rel="tooltip" title="" :src="require('@/assets/images/play.png')" width="24" height="24" data-original-title="播放" />
  16. </a>
  17. </div>
  18. <div id="play" class="ui-icon" rel="tooltip" data-original-title="播放">
  19. <!-- 鼠标移入的显示 -->
  20. <div class="hoverTit">自动导览</div>
  21. <a>
  22. <img :src="require('@/assets/image/icon/tour-play.png')" width="24" height="24" />
  23. </a>
  24. </div>
  25. <div id="pause" class="ui-icon" style="display: none">
  26. <!-- 鼠标移入的显示 -->
  27. <div class="hoverTit">自动导览</div>
  28. <a>
  29. <img rel="tooltip" title="" :src="require('@/assets/image/icon/tour-pause.png')" width="24" height="24" data-original-title="暂停" />
  30. </a>
  31. </div>
  32. <div id="next" class="next desktop-only ui-icon wide" style="display: none">
  33. <a>
  34. <i rel="tooltip" title="" class="icon icon-dpad-right" data-original-title="下一个"></i>
  35. </a>
  36. </div>
  37. <div id="gui-modes-map" class="ui-icon double active">
  38. <div data-original-title="导览" @click="isGuide = !isGuide" id="pullTab" rel="tooltip" title="场景导览">
  39. <!-- 鼠标移入的显示 -->
  40. <div class="hoverTit">导览列表</div>
  41. <img title="" class="icon icon-inside" :src="require(`@/assets/image/icon/icon_point${!isGuide ? '_active' : '_normal'}.png`)" />
  42. </div>
  43. <!-- 热点列表 -->
  44. <div v-show="!hideTools" id="myHotList" @click="openInd = 1">
  45. <!-- 鼠标移入的显示 -->
  46. <div class="hoverTit">热点列表</div>
  47. <img :src="require(`@/assets/image/icon/icon_detail${openInd == 1 ? '_active' : '_normal'}.png`)" alt="" />
  48. </div>
  49. <div title="迷你漫游" data-original-title="迷你模型" id="gui-modes-dollhouse" rel="tooltip">
  50. <!-- 鼠标移入的显示 -->
  51. <div class="hoverTit">三维视觉</div>
  52. <img class="icon icon-inside" :src="require('@/assets/image/icon/icon_dollhouse_normal.png')" />
  53. <img class="icon icon-inside active" :src="require('@/assets/image/icon/icon_dollhouse_active.png')" />
  54. </div>
  55. <div data-original-title="俯视图" id="gui-modes-floorplan" rel="tooltip" title="顶部俯视">
  56. <!-- 鼠标移入的显示 -->
  57. <div class="hoverTit">平面视觉</div>
  58. <img class="icon icon-inside" :src="require('@/assets/image/icon/icon_floor_normal.png')" />
  59. <img class="active icon icon-inside active" :src="require('@/assets/image/icon/icon_floor_active.png')" />
  60. </div>
  61. <div @click="onFullScreen" rel="tooltip" title="顶部俯视" id="gui-modes-floorplan" data-original-title="俯视图">
  62. <!-- 鼠标移入的显示 -->
  63. <div class="hoverTit" v-if="!isFullscreen">全屏</div>
  64. <div class="hoverTit" v-else>退出全屏</div>
  65. <img class="icon icon-inside" :src="require(`@/assets/image/icon/icon_screen${isFullscreen ? '_active' : '_normal'}.png`)" />
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. <div v-show="!hideTools" class="pinBottom right hideTarget"></div>
  72. <!-- <div class="openBox" :class="{ openBoxAc: openInd }">
  73. <HotList v-if="openInd === 1" @close="openInd = 0" />
  74. <Share v-show="openInd === 2" @close="openInd = 0" :openInd="openInd" />
  75. </div> -->
  76. <!-- 手动触发导览 -->
  77. <transition name="slide" appear>
  78. <HotList v-if="openInd === 1" @close="openInd = 0" />
  79. </transition>
  80. </div>
  81. </template>
  82. <script>
  83. import HotList from "./components/hotList.vue";
  84. import Share from "./components/share.vue";
  85. export default {
  86. components: { HotList, Share },
  87. props: {
  88. hideTools: Boolean,
  89. },
  90. data() {
  91. return {
  92. isGuide: true,
  93. musicState: false,
  94. // vr---热点列表---分享
  95. openInd: 0,
  96. isFullscreen: false,
  97. };
  98. },
  99. watch: {},
  100. computed: {},
  101. mounted() {
  102. let events = ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"];
  103. events.forEach((item, index) => {
  104. window.addEventListener(item, () => {
  105. this.isFullscreen = !this.isFullscreen;
  106. });
  107. });
  108. },
  109. methods: {
  110. onFullScreen() {
  111. let element = document.documentElement;
  112. if (this.isFullscreen) {
  113. if (document.exitFullscreen) {
  114. document.exitFullscreen();
  115. } else if (document.webkitCancelFullScreen) {
  116. document.webkitCancelFullScreen();
  117. } else if (document.mozCancelFullScreen) {
  118. document.mozCancelFullScreen();
  119. } else if (document.msExitFullscreen) {
  120. document.msExitFullscreen();
  121. }
  122. } else {
  123. if (element.requestFullscreen) {
  124. element.requestFullscreen();
  125. } else if (element.webkitRequestFullScreen) {
  126. element.webkitRequestFullScreen();
  127. } else if (element.mozRequestFullScreen) {
  128. element.mozRequestFullScreen();
  129. } else if (element.msRequestFullscreen) {
  130. element.msRequestFullscreen();
  131. }
  132. }
  133. // 改变当前全屏状态
  134. },
  135. switchBGM(flag) {
  136. this.musicState = flag;
  137. if (flag) {
  138. window.manage.switchBgmState(true);
  139. document.querySelector("#openMusic").style.display = "none";
  140. document.querySelector("#closeMusic").style.display = "block";
  141. // 手动停止自动导览
  142. window.player.director.stopTour();
  143. } else {
  144. window.manage.switchBgmState(false);
  145. document.querySelector("#openMusic").style.display = "block";
  146. document.querySelector("#closeMusic").style.display = "none";
  147. }
  148. },
  149. // 点击vr
  150. openVR() {
  151. window.open("https://www.720yun.com/t/acvkiwdegqb?scene_id=34882556");
  152. },
  153. // 点击回到首页
  154. toHomeFu() {
  155. this.switchBGM(false);
  156. this.$emit("toHome");
  157. },
  158. },
  159. };
  160. </script>
  161. <style lang="less" scoped>
  162. ::-webkit-scrollbar {
  163. width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
  164. }
  165. ::-webkit-scrollbar-thumb {
  166. // box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2);
  167. background: #edd3b0;
  168. border-color: #edd3b0;
  169. color: #edd3b0;
  170. outline: none;
  171. }
  172. // 鼠标移入显示的文字和图片
  173. #gui-modes-inside {
  174. position: relative;
  175. }
  176. #gui-modes-dollhouse {
  177. position: relative;
  178. }
  179. #gui-modes-floorplan {
  180. position: relative;
  181. }
  182. .hoverTit {
  183. pointer-events: none;
  184. transition: all 0.5s;
  185. opacity: 0;
  186. position: absolute;
  187. left: 50%;
  188. transform: translateX(-50%);
  189. top: -40px;
  190. width: 80px;
  191. height: 37px;
  192. line-height: 30px;
  193. text-align: center;
  194. background: url("../../assets/image/img_tip.png");
  195. background-size: 100% 100%;
  196. font-size: 14px;
  197. color: #fff;
  198. }
  199. #play:hover {
  200. .hoverTit {
  201. opacity: 1;
  202. }
  203. }
  204. #pause:hover {
  205. .hoverTit {
  206. opacity: 1;
  207. }
  208. }
  209. #gui-modes-map > div:hover {
  210. .hoverTit {
  211. opacity: 1;
  212. }
  213. }
  214. #volume {
  215. margin-right: 16px;
  216. }
  217. #volume,
  218. #gui-fullscreen,
  219. #gui-fullscreen-exit {
  220. position: relative;
  221. .hoverTit {
  222. width: 70px;
  223. }
  224. &:hover {
  225. .hoverTit {
  226. opacity: 1;
  227. }
  228. }
  229. }
  230. // 右侧菜单栏
  231. @wh: 44px;
  232. @margin: 0px;
  233. #play,
  234. #pause {
  235. margin-right: @margin;
  236. img {
  237. width: @wh;
  238. height: @wh;
  239. }
  240. }
  241. .rightViewContainer {
  242. display: flex !important;
  243. align-items: center !important;
  244. }
  245. #gui-modes-map {
  246. > div {
  247. margin-right: @margin;
  248. > img {
  249. width: @wh;
  250. height: @wh;
  251. display: block !important;
  252. }
  253. .active {
  254. display: none !important;
  255. }
  256. }
  257. .active {
  258. > img {
  259. display: none !important;
  260. }
  261. .active {
  262. display: block !important;
  263. }
  264. }
  265. }
  266. .pinBottom.right .ui-icon {
  267. background: none;
  268. }
  269. #gui-fullscreen img {
  270. width: 44px;
  271. }
  272. #volume {
  273. width: 44px;
  274. }
  275. #gui-fullscreen-exit img {
  276. width: 44px !important;
  277. }
  278. .bgandshare {
  279. background: none !important;
  280. // margin-right: 20px!important;
  281. > div {
  282. width: 100%;
  283. cursor: pointer;
  284. img {
  285. width: 100%;
  286. }
  287. }
  288. }
  289. .toHomeBox {
  290. margin-right: 20px;
  291. cursor: pointer;
  292. position: relative;
  293. width: 44px;
  294. img {
  295. width: 44px;
  296. }
  297. &:hover {
  298. .hoverTit {
  299. opacity: 1;
  300. }
  301. }
  302. }
  303. .pinBottom-container {
  304. #myHotList {
  305. position: relative;
  306. float: left;
  307. width: 70px;
  308. display: flex;
  309. justify-content: center;
  310. align-items: center;
  311. cursor: pointer;
  312. }
  313. .openBox {
  314. opacity: 0;
  315. pointer-events: none;
  316. transition: all 0.3s;
  317. position: fixed;
  318. z-index: 9999;
  319. top: 0;
  320. left: 0;
  321. width: 100%;
  322. height: 100%;
  323. // background-color: rgba(255, 255, 255, 0.6);
  324. backdrop-filter: blur(10px);
  325. }
  326. .openBoxAc {
  327. opacity: 1;
  328. pointer-events: auto;
  329. }
  330. }
  331. // 移动端
  332. @media screen and (max-width: 1000px) {
  333. .hoverTit {
  334. opacity: 0 !important;
  335. }
  336. .viewContainer {
  337. & > div {
  338. img {
  339. width: 33px !important;
  340. height: 33px !important;
  341. }
  342. }
  343. }
  344. .pinBottom-container #myHotList {
  345. width: 50px;
  346. margin-bottom: 15px;
  347. }
  348. .pinBottom-container {
  349. .pinBottom.right.hideTarget {
  350. position: fixed;
  351. top: 200px;
  352. right: 10px;
  353. .rightViewContainer {
  354. flex-direction: column;
  355. & > div,
  356. #volume {
  357. width: 50px !important;
  358. text-align: right;
  359. margin-right: 0;
  360. margin-bottom: 10px;
  361. & > div {
  362. display: flex;
  363. justify-content: flex-end;
  364. }
  365. img {
  366. width: 33px;
  367. height: 33px;
  368. }
  369. }
  370. }
  371. }
  372. }
  373. }
  374. #myClickBox {
  375. display: flex;
  376. flex-direction: column;
  377. position: fixed;
  378. z-index: 999;
  379. left: 50%;
  380. bottom: 38px;
  381. width: 146px;
  382. height: 146px;
  383. transform: translateX(-50%);
  384. background: url("../../assets/img/m_btn.png") no-repeat center / contain;
  385. transition: 0.2s bottom linear;
  386. > div {
  387. flex: 1;
  388. }
  389. }
  390. .pinBottom.open #myClickBox {
  391. bottom: calc(118px + 20px);
  392. }
  393. /* 进入的起点、离开的终点 */
  394. .slide-enter,
  395. .slide-leave-to {
  396. transform: translateX(100%);
  397. }
  398. .slide-enter-active,
  399. .slide-leave-active {
  400. transition: 0.5s linear;
  401. }
  402. /* 进入的终点、离开的起点 */
  403. .hello-enter-to,
  404. .slide-leave {
  405. transform: translateX(0);
  406. }
  407. </style>