index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <Logo />
  3. <Tips />
  4. <div v-show="showUI">
  5. <Control />
  6. <Menu v-if="fdkkCurrentVersion == 'v4'" />
  7. <div @click="onIsShowList" v-else
  8. v-show="!((metadata.catalogRoot && metadata.catalogRoot.length == 1) && scenes.length == 1 && secondaryList.length == 1)"
  9. class="v3daolan" :class="{ active: isShowScenesList }">
  10. <img :src="require(`@/assets/images/icon/${isShowScenesList ? 'function_off@2x.png' : 'function_on@2x.png'}`)"
  11. alt="" />
  12. </div>
  13. <sceneList />
  14. <div class="btnmask"></div>
  15. </div>
  16. </template>
  17. <script setup>
  18. import Logo from "./logo";
  19. import Tips from "./tips";
  20. import sceneList from "./list";
  21. import Control from "./control";
  22. import Menu from "./menu";
  23. import { ref, onMounted, computed, watch, nextTick } from "vue";
  24. import { useStore } from "vuex";
  25. import { useApp, getApp } from "@/app";
  26. const store = useStore();
  27. const fdkkCurrentVersion = computed(() => store.getters["scene/fdkkCurrentVersion"]);
  28. const isShowScenesList = computed(() => store.getters["functions/isShowScenesList"]);
  29. const currentScene = computed(() => store.getters["scene/currentScene"]);
  30. const metadata = computed(() => store.getters["scene/metadata"]);
  31. const scenes = computed(() => store.getters["scene/list"]);
  32. const secondaryList = computed(() => store.getters["scene/secondaryList"]);
  33. const showUI = ref(false)
  34. const onIsShowList = (data) => {
  35. store.commit("functions/setShowScenesList", !isShowScenesList.value);
  36. };
  37. useApp().then((app) => {
  38. app.Scene.on("ready", () => {
  39. if (currentScene && currentScene.value.type == '4dkk' && !showUI.value) {
  40. showUI.value = true
  41. }
  42. })
  43. app.Scene.on("sceneReady", () => {
  44. showUI.value = true
  45. })
  46. })
  47. </script>
  48. <style lang="scss" scoped>
  49. .v3daolan {
  50. background: rgba(0, 0, 0, .3);
  51. border: 1px solid hsla(0, 0%, 100%, .2);
  52. position: fixed;
  53. bottom: 20px;
  54. left: 50%;
  55. transform: translateX(-50%);
  56. border-radius: 50%;
  57. pointer-events: auto;
  58. width: 36px;
  59. height: 36px;
  60. line-height: 36px;
  61. color: #fff;
  62. display: flex;
  63. align-items: center;
  64. justify-content: center;
  65. cursor: pointer;
  66. &.active {
  67. background: rgba(0, 0, 0, 0.5);
  68. }
  69. >img {
  70. width: 26px;
  71. height: 26px;
  72. }
  73. }
  74. .btnmask {
  75. width: 100%;
  76. position: fixed;
  77. bottom: 0;
  78. left: 0;
  79. right: 0;
  80. pointer-events: none;
  81. opacity: 0.3;
  82. height: 50px;
  83. background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 52%, #000000 100%);
  84. }
  85. </style>