index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <div class="parent-body">
  3. <!-- 热点 -->
  4. <hot/>
  5. <!-- 热点弹出框 -->
  6. <popup/>
  7. <!-- 加载初始页面 -->
  8. <div id="gui-thumb"></div>
  9. <!-- cad -->
  10. <cad/>
  11. <!-- 主容器 -->
  12. <div id="player"></div>
  13. <div id="gui-parent">
  14. <!-- 进度条加载 -->
  15. <gui-loading/>
  16. <div id="gui" style="display: none;">
  17. <!-- 退出VR模式按钮 -->
  18. <div id="vrOff">
  19. <img id="vrOffImg" src="images/vrOffImg.png" alt="">
  20. </div>
  21. <!-- 热点列表 -->
  22. <hotspot-list/>
  23. <!-- 标题 -->
  24. <v-title/>
  25. <!-- 底部菜单 -->
  26. <v-menu @btnactive="handleActive"/>
  27. <!-- 导览 -->
  28. <v-guide/>
  29. <!-- logo -->
  30. <div id="myCompany"
  31. style="width:100%;position:absolute;bottom:20px;text-align:center;font-size:14px;font-family: '微软雅黑';font-weight:580;color: rgba(255, 255, 255, 0.8);">
  32. 四维时代提供技术支持
  33. </div>
  34. </div>
  35. <!-- vr -->
  36. <web-vr/>
  37. <!-- loading -->
  38. <div id="gui-spinner" style="display: none;">
  39. <div class="gui-spinner-icon"></div>
  40. </div>
  41. <!-- guimsg -->
  42. <guimsg/>
  43. <!-- 错误提示 -->
  44. <v-error/>
  45. <vr-con/>
  46. <v-other/>
  47. </div>
  48. <exhibition class="exhibition"/>
  49. <Danmaku
  50. class="danmaku"
  51. :quotes="danmu"
  52. :showIcon="require(`@/assets/images/icon/danmu_open_${theme}.png`)"
  53. :closeIcon="require('@/assets/images/icon/danmu_close.png')"
  54. :arrowIcon="require('@/assets/images/icon/danmu_top.png')"
  55. />
  56. <vpopup @close="handlepopClose" :cp="cp" v-if="cp"/>
  57. </div>
  58. </template>
  59. <script>
  60. import hot from './hot';
  61. import popup from './popup';
  62. import cad from './cad';
  63. import guiLoading from './gui/loading';
  64. import hotspotList from './gui/hotspotlist';
  65. import vTitle from './gui/title';
  66. import vMenu from './gui/menu';
  67. import vGuide from './gui/guide';
  68. import webVr from './gui/webvr';
  69. import guimsg from './gui/guimsg';
  70. import vError from './gui/error';
  71. import vrCon from './gui/vrcon';
  72. import vOther from './gui/other';
  73. import exhibition from '@/components/exhibition';
  74. import vpopup from './components/popup.vue'
  75. export default {
  76. name: 'Home',
  77. components: {
  78. hot,
  79. popup,
  80. cad,
  81. guiLoading,
  82. hotspotList,
  83. vTitle,
  84. vMenu,
  85. vGuide,
  86. webVr,
  87. guimsg,
  88. vError,
  89. vrCon,
  90. vOther,
  91. exhibition,
  92. vpopup
  93. },
  94. watch:{
  95. '$route.query.route':function (newVal) {
  96. this.page = newVal
  97. }
  98. },
  99. mounted(){
  100. this.$bus.$on('opendaolan',()=>{
  101. this.showExhibition = true
  102. })
  103. this.starLoad()
  104. },
  105. methods:{
  106. starLoad(){
  107. window.loadMainJs()
  108. window.loadMange()
  109. window.loadScene()
  110. },
  111. handleClose(){
  112. $('.cad').css('transform', 'translate(-150%,-50%)')
  113. this.showExhibition=false
  114. },
  115. handlepopClose(){
  116. this.cp = ''
  117. this.$bus.$emit('resetbtnactive')
  118. },
  119. handleActive(data){
  120. if (data=='question') {
  121. this.cp = 'question'
  122. }
  123. console.log(data)
  124. }
  125. },
  126. beforeDestroy(){
  127. window.hadLoad = true
  128. if (window.player) {
  129. window.player.sceneRenderer.suspend()
  130. window.player = ''
  131. $('.parent-body').remove()
  132. }
  133. },
  134. data(){
  135. return {
  136. danmu:[
  137. "很漂亮的线上展馆,支持!",
  138. "足不出户就能浏览参观,太棒了!",
  139. "期待能有机会到实体馆参观。",
  140. "请问英模在第几展区?",
  141. "向革命先烈们致敬。",
  142. "展馆的信息介绍很详细,干货满满!",
  143. "向人民解放军致敬"
  144. ],
  145. page: this.$route.query.route,
  146. showExhibition: false,
  147. cp:''
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="less" scoped>
  153. .parent-body{
  154. width: 100%;
  155. height: calc(100vh - 100px);
  156. margin-top: 100px;
  157. padding-top: 0;
  158. position: relative;
  159. overflow: hidden;
  160. }
  161. .danmaku{
  162. position: absolute;
  163. bottom: 10px;
  164. left: 34px;
  165. z-index: 99;
  166. width: 340px;
  167. }
  168. .exhibition{
  169. position: absolute;
  170. top: 50px;
  171. right: 0;
  172. z-index: 99;
  173. }
  174. </style>