index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <!-- <Logo /> -->
  3. <Tips />
  4. <!-- <Menu /> -->
  5. <div v-show="showUI && !vrStatus">
  6. <sceneList />
  7. <div
  8. class="btn-style"
  9. :class="{
  10. needBottomSpace: isShowScenesList
  11. }"
  12. >
  13. <!-- <div class="menu-icon">
  14. <div @click="onIsShowList"
  15. v-if="!((metadata.catalogRoot && metadata.catalogRoot.length == 1) && scenes.length == 1 && secondaryList.length == 1)">
  16. <img :src="require(`@/assets/images/icon/${isShowScenesList ? 'function_off@2x.png' : 'function_on@2x.png'}`)"
  17. alt="" />
  18. </div>
  19. </div> -->
  20. <Control />
  21. <!-- <ControlRight /> -->
  22. </div>
  23. </div>
  24. </template>
  25. <script setup>
  26. import Logo from "./logo";
  27. import Tips from "./tips";
  28. import sceneList from "./list";
  29. import Control from "./control_js";
  30. import ControlRight from "./control.right";
  31. import Menu from "./menu";
  32. import { ref, watch, computed, onMounted, nextTick } from "vue";
  33. import { useApp, getApp } from "@/app";
  34. import { useStore } from "vuex";
  35. const store = useStore();
  36. const showUI = ref(false)
  37. const isShowScenesList = computed(() => store.getters["functions/isShowScenesList"]);
  38. const showTours = computed(() => store.getters["fdkk/isShowToursList"]);
  39. const metadata = computed(() => store.getters["scene/metadata"]);
  40. const scenes = computed(() => store.getters["scene/list"]);
  41. const secondaryList = computed(() => store.getters["scene/secondaryList"]);
  42. const currentScene = computed(() => store.getters["scene/currentScene"]);
  43. const vrStatus = computed(() => store.getters["functions/vrStatus"]);
  44. const onIsShowList = (data) => {
  45. if (showTours.value) {
  46. store.commit('fdkk/setShowToursList', false)
  47. }
  48. store.commit("functions/setShowScenesList", !isShowScenesList.value);
  49. };
  50. watch(currentScene, () => {
  51. if (currentScene.value.type == '4dkk' && isShowScenesList.value) {
  52. let t = setTimeout(() => {
  53. clearTimeout(t)
  54. store.commit("functions/setShowScenesList", false);
  55. }, 1500);
  56. }
  57. })
  58. useApp().then((app) => {
  59. app.Scene.on("ready", (data) => {
  60. if (currentScene && (currentScene.value.type == '4dkk' || currentScene.value.type === 'pano') && !showUI.value) {
  61. showUI.value = true
  62. }
  63. })
  64. app.Scene.on("ready", () => {
  65. showUI.value = true
  66. })
  67. app.Scene.on("onExitVr", () => {
  68. store.commit("functions/setVrStatus", false);
  69. })
  70. })
  71. </script>
  72. <style lang="scss" scoped>
  73. .btn-style {
  74. display: flex;
  75. width: 96%;
  76. position: absolute;
  77. left: 2%;
  78. right: 2%;
  79. bottom: 38px;
  80. z-index: 9;
  81. .menu-icon {
  82. width: 36px;
  83. height: 36px;
  84. >div {
  85. width: 100%;
  86. height: 36px;
  87. background: rgba(0, 0, 0, 0.4);
  88. border-radius: 50%;
  89. border: 1px solid rgba(255, 255, 255, 0.2);
  90. backdrop-filter: blur(6px);
  91. display: flex;
  92. align-items: center;
  93. justify-content: center;
  94. >img {
  95. width: 24px;
  96. height: 24px;
  97. }
  98. }
  99. }
  100. }
  101. @media only screen and (min-width: 1234px){
  102. .btn-style {
  103. bottom: 69px;
  104. }
  105. .btn-style.needBottomSpace {
  106. bottom: 180px;
  107. }
  108. }
  109. </style>