index.vue 2.4 KB

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