Home.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <div
  3. class="parent-body"
  4. @click="musicPlay"
  5. @touchstart="musicPlay"
  6. >
  7. <!-- 热点弹出框 -->
  8. <popup />
  9. <!-- 加载初始页面——也并没有什么卵用 -->
  10. <div id="gui-thumb" />
  11. <!-- 场景canvs主容器 -->
  12. <div id="player" />
  13. <!-- <MiniMapDecorator
  14. class="mini-map-decorator"
  15. /> -->
  16. <button
  17. class="enlarge-btn"
  18. @click="onClickEnlarge"
  19. >
  20. <img
  21. class=""
  22. src="@/assets/images/enlarge.png"
  23. alt=""
  24. draggable="false"
  25. >
  26. </button>
  27. <!-- 底部菜单 -->
  28. <div
  29. id="gui-parent"
  30. >
  31. <!-- 进度条加载 -->
  32. <gui-loading />
  33. <div id="hot" />
  34. <div
  35. id="gui"
  36. style="display: none"
  37. >
  38. <!-- 退出VR模式按钮 -->
  39. <div id="vrOff">
  40. <img
  41. id="vrOffImg"
  42. src="@/assets/images/vrOffImg.png"
  43. alt=""
  44. >
  45. </div>
  46. <!-- 热点列表 -->
  47. <!-- <hotspot-list /> -->
  48. <!-- 通用样式的标题,代码里必须有,但其实没有显示 -->
  49. <v-title />
  50. <!-- 针对本项目需求的标题 -->
  51. <!-- 底部菜单 -->
  52. <v-menu class="v-menu" />
  53. <!-- 导览 -->
  54. <v-guide class="v-guide" />
  55. <!-- logo -->
  56. <div
  57. id="myCompany"
  58. style="
  59. width: 100%;
  60. position: absolute;
  61. bottom: 0px;
  62. text-align: center;
  63. font-size: 14px;
  64. font-family: '微软雅黑';
  65. font-weight: 580;
  66. color: rgba(255, 255, 255, 0.8);
  67. "
  68. >
  69. <!-- 四维时代提供技术支持 -->
  70. </div>
  71. </div>
  72. <!-- vr -->
  73. <web-vr />
  74. <!-- loading -->
  75. <!-- <div id="gui-spinner">
  76. <div class="gui-spinner-icon"></div>
  77. </div> -->
  78. <!-- guimsg -->
  79. <guimsg />
  80. <!-- 错误提示 -->
  81. <v-error />
  82. <vr-con />
  83. <v-other />
  84. </div>
  85. <router-view />
  86. </div>
  87. </template>
  88. <script>
  89. import popup from "@/views/popup"
  90. import guiLoading from "@/views/gui/loading"
  91. // import hotspotList from "@/views/gui/hotspotlist"
  92. import vTitle from "@/views/gui/title"
  93. import vMenu from "@/views/gui/menu"
  94. import vGuide from "@/views/gui/guide"
  95. import webVr from "@/views/gui/webvr"
  96. import guimsg from "@/views/gui/guimsg"
  97. import vError from "@/views/gui/error"
  98. import vrCon from "@/views/gui/vrcon"
  99. import vOther from "@/views/gui/other"
  100. // import MiniMapDecorator from "@/views/gui/MiniMapDecorator.vue"
  101. export default {
  102. name: "Home",
  103. components: {
  104. popup,
  105. guiLoading,
  106. // hotspotList,
  107. vTitle,
  108. vMenu,
  109. vGuide,
  110. webVr,
  111. guimsg,
  112. vError,
  113. vrCon,
  114. vOther
  115. // MiniMapDecorator,
  116. },
  117. data() {
  118. return {
  119. hotspots: "",
  120. // 控制背景音乐
  121. isMusicInitiallyPlayed: false,
  122. }
  123. },
  124. mounted() {
  125. },
  126. created() {
  127. // 移动端和pc端的切换
  128. if (
  129. window.navigator.userAgent.match(
  130. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  131. )
  132. ) {
  133. // 移动端
  134. if (window.location.href.includes("web")) {
  135. window.location.href = window.location.href.replace("web", "webM")
  136. setTimeout(() => {
  137. location.reload(true)
  138. }, 1000)
  139. }
  140. }
  141. },
  142. methods: {
  143. // 控制背景音乐播放
  144. musicPlay() {
  145. if (!this.isMusicInitiallyPlayed) window.manage.switchBgmState(true)
  146. this.isMusicInitiallyPlayed = true
  147. },
  148. onClickEnlarge() {
  149. this.$router.push({ name: 'BigMap' })
  150. },
  151. },
  152. }
  153. </script>
  154. <style lang="less" scoped>
  155. .mini-map-decorator {
  156. }
  157. .enlarge-btn {
  158. position: fixed;
  159. width: 12vw;
  160. height: 12vw;
  161. top: 45vw;
  162. right: 3.6vw;
  163. z-index: 999;
  164. > img {
  165. width: 100%;
  166. height: 100%;
  167. }
  168. }
  169. .parent-body {
  170. position: relative;
  171. width: 100%;
  172. height: 100%;
  173. > #gui-parent {
  174. > #gui {
  175. }
  176. }
  177. }
  178. /deep/#drawer {
  179. transition: all 0.3s;
  180. }
  181. // .mobile[view-mode='floor-plain'], .mobile[view-mode='doll-house'], .mobile[view-mode='transitioning'] {
  182. // .mini-map-decorator {
  183. // display: none;
  184. // }
  185. // }
  186. .hotspot-detail-open {
  187. .v-menu {
  188. display: none;
  189. }
  190. .v-guide {
  191. display: none;
  192. }
  193. }
  194. </style>