Home.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div class="parent-body">
  3. <!-- 热点 -->
  4. <!-- <hot/> -->
  5. <!-- 热点弹出框 -->
  6. <popup />
  7. <!-- 加载初始页面 -->
  8. <div id="gui-thumb"></div>
  9. <!-- 场景canvs主容器 -->
  10. <div id="player"></div>
  11. <!-- 底部菜单 -->
  12. <div id="gui-parent">
  13. <!-- 进度条加载 -->
  14. <gui-loading />
  15. <div id="hot"></div>
  16. <!-- 三维 标签 -->
  17. <div class="widgets-doll-labels"></div>
  18. <div id="gui" style="display: none">
  19. <!-- 退出VR模式按钮 -->
  20. <div id="vrOff">
  21. <img id="vrOffImg" src="images/vrOffImg.png" alt="" />
  22. </div>
  23. <!-- 热点列表 -->
  24. <hotspot-list />
  25. <!-- 标题 -->
  26. <v-title />
  27. <!-- 底部菜单 -->
  28. <v-menu />
  29. <!-- 导览 -->
  30. <v-guide />
  31. <!-- logo -->
  32. <div
  33. id="myCompany"
  34. style="
  35. width: 100%;
  36. position: absolute;
  37. bottom: 0px;
  38. text-align: center;
  39. font-size: 14px;
  40. font-family: '微软雅黑';
  41. font-weight: 580;
  42. color: rgba(255, 255, 255, 0.8);
  43. "
  44. >
  45. <!-- 四维时代提供技术支持 -->
  46. </div>
  47. </div>
  48. <!-- vr -->
  49. <web-vr />
  50. <!-- loading -->
  51. <div id="gui-spinner">
  52. <div class="gui-spinner-icon"></div>
  53. </div>
  54. <!-- guimsg -->
  55. <guimsg />
  56. <!-- 错误提示 -->
  57. <v-error />
  58. <vr-con />
  59. <v-other />
  60. <div class="loading" v-if="0">
  61. <span>加载中...</span>
  62. </div>
  63. </div>
  64. <!-- 左上方logo -->
  65. <div class="leftTopLogo" v-show="!isMobile">
  66. <img class="leftTopLogo1" src="../assets/img/home/logo.png" alt="" />
  67. <div class="leftTopLogo2"></div>
  68. <div class="leftTopLogo3">
  69. <p>欢迎您的到来,您是第{{isVisNum}}位参观者!</p>
  70. <p>
  71. <img src="../assets/img/home/icon-liulan.png" alt="">
  72. <span>{{isVisNum}}</span>浏览量</p>
  73. </div>
  74. </div>
  75. </div>
  76. </template>
  77. <script>
  78. import popup from "@/views/popup";
  79. import guiLoading from "@/views/gui/loading";
  80. import hotspotList from "@/views/gui/hotspotlist";
  81. import vTitle from "@/views/gui/title";
  82. import vMenu from "@/views/gui/menu";
  83. import vGuide from "@/views/gui/guide";
  84. import webVr from "@/views/gui/webvr";
  85. import guimsg from "@/views/gui/guimsg";
  86. import vError from "@/views/gui/error";
  87. import vrCon from "@/views/gui/vrcon";
  88. import vOther from "@/views/gui/other";
  89. import { getVisitAPI,addVisitAPI } from "../utils/api";
  90. export default {
  91. name: "Home",
  92. components: {
  93. popup,
  94. guiLoading,
  95. hotspotList,
  96. vTitle,
  97. vMenu,
  98. vGuide,
  99. webVr,
  100. guimsg,
  101. vError,
  102. vrCon,
  103. vOther,
  104. },
  105. data() {
  106. return {
  107. hotspots: "",
  108. loading: true,
  109. // 访问量
  110. isVisNum:0
  111. };
  112. },
  113. methods: {
  114. getHotSpotList() {
  115. $.ajax({
  116. url:
  117. g_Prefix +
  118. "data/" +
  119. window.number +
  120. "/hot/js/data.js" +
  121. "?" +
  122. Math.random(),
  123. type: "get",
  124. dataType: "json",
  125. contentType: "application/json",
  126. success: (result) => {
  127. this.hotspots = result;
  128. },
  129. });
  130. },
  131. },
  132. mounted() {
  133. this.$nextTick(() => {
  134. window.evt = document.createEvent("HTMLEvents");
  135. window.evt.initEvent("loadfinish", false, false);
  136. window.addEventListener("loadfinish", () => {
  137. this.loading = false;
  138. // document.title = "珠海高新区中共党史学习教育园地线上展厅";
  139. this.getHotSpotList();
  140. window.player.on("openTips", () => {
  141. this.$showTips();
  142. });
  143. window.player.on("openHotspot", (data) => {
  144. this.$showHotspot({
  145. hotspot: this.hotspots[data],
  146. });
  147. });
  148. });
  149. });
  150. },
  151. async created() {
  152. await addVisitAPI()
  153. const res =await getVisitAPI()
  154. this.isVisNum=res.data.visitSum
  155. },
  156. };
  157. </script>
  158. <style lang="less" scoped>
  159. .parent-body {
  160. width: 100%;
  161. height: 100%;
  162. }
  163. .loading {
  164. position: fixed;
  165. left: 0;
  166. top: 0;
  167. width: 100%;
  168. height: 100%;
  169. z-index: 10000;
  170. background: #000;
  171. > span {
  172. position: absolute;
  173. top: 50%;
  174. left: 50%;
  175. transform: translate(-50%, -50%);
  176. color: #fff;
  177. font-size: 16px;
  178. display: inline-block;
  179. }
  180. }
  181. .leftTopLogo {
  182. pointer-events: none;
  183. position: fixed;
  184. // z-index: 9998;
  185. top: 20px;
  186. left: 20px;
  187. display: flex;
  188. .leftTopLogo1{
  189. // width: 90px;
  190. }
  191. .leftTopLogo2{
  192. margin: 0 15px;
  193. background: linear-gradient(rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 1),rgba(255, 255, 255, 0.15));
  194. width: 1px;
  195. height: 40px;
  196. }
  197. .leftTopLogo3{
  198. display: flex;
  199. flex-direction: column;
  200. justify-content: space-between;
  201. &>p{
  202. img{
  203. width: 20px;
  204. }
  205. &>span{
  206. font-weight: 700;
  207. position: relative;
  208. top: 1px;
  209. display: inline-block;
  210. margin: 0 10px;
  211. }
  212. }
  213. }
  214. }
  215. </style>