bill 2 лет назад
Родитель
Сommit
d99f7b4246

+ 1 - 1
package.json

@@ -5,7 +5,7 @@
   "type": "module",
   "scripts": {
     "dev": "vite --host 0.0.0.0",
-    "build": "vue-tsc && vite build",
+    "build": "vite build",
     "preview": "vite preview"
   },
   "dependencies": {

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
server/test/SS-t-P1d6CwREny2/attach/sceneStore


+ 0 - 26
src/components/show-hot-item/edit.vue

@@ -1,26 +0,0 @@
-<template>
-  <label-hot-item :data="data" :x="x" :y="y" no-use-default :permanent="false">
-    <div class="edit-hot">
-      <span @click="onEdit(data)" class="fun-ctrl">
-        <ui-icon type="edit" />
-        {{ $t('sys.update') }}
-      </span>
-    </div>
-  </label-hot-item>
-</template>
-
-<script setup lang="ts">
-import LabelHotItem from './index.vue'
-import { HotAtom } from '@/store'
-
-defineProps<{
-  data: HotAtom
-  onEdit: (data: HotAtom) => {}
-  x: number
-  y: number
-}>()
-</script>
-
-<style lang="sass" scoped>
-@import './style.scss'
-</style>

+ 0 - 166
src/components/show-hot-item/index.vue

@@ -1,166 +0,0 @@
-<template>
-  <component
-    :is="defaultTheme"
-    :data="data"
-    :showContent="showContent"
-    :x="x"
-    :y="y"
-    v-if="useDefault"
-    @click.stop="clickHandler"
-    @touchstart.stop
-    @mouseenter="isHover = true"
-    @mouseleave="isHover = false"
-  />
-  <div
-    v-else
-    class="hot-item"
-    :class="{ active }"
-    :style="style"
-    @mouseenter="isHover = true"
-    @mouseleave="isHover = false"
-    @click.stop="clickHandler"
-    @touchstart.stop
-  >
-    <!-- <template></template> -->
-    <img
-      :src="getResources(data.style.icon)"
-      @mousedown="(e) => emit('mousedown', e)"
-      @click="(e) => emit('click', e)"
-    />
-    <div @click.stop>
-      <ui-bubble
-        class="hot-bubble"
-        :class="{ pc: os.isPc || os.isHorizontal.value }"
-        :show="showContent && !~pullIndex"
-        :type="os.isPc ? 'left' : os.isHorizontal.value ? 'right' : 'top'"
-        level="center"
-      >
-        <template v-if="!$slots.content">
-          <h2>
-            {{ data.title }}
-            <ui-audio
-              v-if="data.type === 'AUDIO' && data.meta.length"
-              class="audio"
-              :src="getResources(data.meta[0].url)"
-              ref="audio"
-            />
-          </h2>
-          <div class="content" v-html="data.content"></div>
-
-          <FilesMange
-            :hot="data"
-            v-if="data.type !== 'AUDIO'"
-            @pull="(index) => (pullIndex = index)"
-            in-full
-          />
-          <slot :data="data" />
-        </template>
-        <slot v-else name="content" />
-      </ui-bubble>
-      <PullHot
-        v-if="!!~pullIndex"
-        :info="data"
-        @close="pullIndex = -1"
-        :metaIndex="pullIndex"
-      />
-    </div>
-  </div>
-</template>
-
-<script setup lang="ts">
-import { computed, watch, ref, watchEffect } from "vue";
-import { HotAtom } from "@/store";
-import { getResources } from "@/store/app";
-import FilesMange from "./metas-mange.vue";
-import PullHot from "./pull-hot.vue";
-import { useSDK, disabledMap, customMap } from "@/hook";
-import { os } from "@/utils";
-
-const props = withDefaults(
-  defineProps<{
-    data: HotAtom;
-    active?: boolean;
-    x: number;
-    y: number;
-    defaultTheme?: any;
-    noUseDefault?: boolean;
-    permanent?: boolean;
-    forceHide?: boolean;
-    isShowContent?: () => boolean;
-  }>(),
-  {
-    forceHide: false,
-  }
-);
-
-const emit = defineEmits<{
-  (e: "mousedown", ev: MouseEvent);
-  (e: "click", ev: MouseEvent);
-}>();
-
-const isHover = ref(false);
-const pullIndex = ref(-1);
-const laser = useSDK();
-const audio = ref();
-const showContent = computed(
-  () =>
-    !disabledMap.hotInfo &&
-    (props.active || (os.isPc && !os.isTablet && isHover.value)) &&
-    !customMap.magnifier &&
-    !props.forceHide
-);
-
-const useDefault = computed(
-  () => !props.noUseDefault && props.data.type === "TEXT" && !props.data.content
-);
-
-const style = computed(() => ({
-  left: props.x + "px",
-  top: props.y + "px",
-}));
-const inClose = ref(false);
-
-const clickHandler = async () => {
-  if (props.isShowContent && !props.isShowContent()) {
-    return;
-  }
-  if (laser.carry.store.share.showHot !== props.data) {
-    laser.carry.store.share.showHot = props.data;
-    if (!props.permanent) {
-      const handler = () => {
-        if (os.isPc && !os.isTablet) {
-          laser.carry.store.share.showHot = null;
-        }
-      };
-
-      const stopWatch = watch(
-        () => laser.carry.store.share.showHot,
-        () => {
-          stopWatch();
-          laser.scene.el.removeEventListener(
-            os.isPc && !os.isTablet ? "click" : "touchstart",
-            handler
-          );
-        }
-      );
-      laser.scene.el.addEventListener(
-        os.isPc && !os.isTablet ? "click" : "touchstart",
-        handler
-      );
-    }
-  } else {
-    laser.carry.store.share.showHot = null;
-    inClose.value = true;
-    setTimeout(() => (isHover.value = false));
-  }
-};
-watchEffect(() => {
-  if (audio.value) {
-    audio.value.play();
-  }
-});
-</script>
-
-<style lang="sass" scoped>
-@import './style.scss'
-</style>

+ 0 - 59
src/components/show-hot-item/metas-mange.vue

@@ -1,59 +0,0 @@
-<template>
-  <div class="mates" v-if="hot.type !== 'TEXT' && hot.type !== 'AUDIO'">
-    <ui-slide
-      v-if="hot.meta"
-      :items="hot.meta"
-      :showCtrl="hot.meta.length > 1"
-      :currentIndex="index"
-      @change="(i) => emit('change', i)"
-      :showInfos="hot.meta.length > 1 && !hideInfo"
-    >
-      <template v-slot="{ raw, index }">
-        <div
-          class="meta-item"
-          :class="{ full: inFull }"
-          @click="inFull && emit('pull', index)"
-        >
-          <img :src="getResources(raw.url)" v-if="hot.type === 'IMAGE'" />
-          <video
-            v-else-if="hot.type === 'VIDEO'"
-            class="video"
-            autoplay
-            controls
-            playsinline
-            webkit-playsinline
-          >
-            <source :src="getResources(raw.url)" type="video/mp4" />
-          </video>
-          <div class="iframe" v-else-if="hot.type === 'WEB'">
-            <iframe :src="getResources(raw.url)"> </iframe>
-          </div>
-        </div>
-      </template>
-      <template v-slot:attach="{ active }">
-        <div class="file-mange">
-          <slot name="icons" :active="active" />
-        </div>
-      </template>
-    </ui-slide>
-  </div>
-</template>
-<script setup lang="ts">
-import { HotAtom } from "@/store";
-import { getResources } from "@/store/app";
-
-defineProps<{
-  hot: HotAtom;
-  inFull?: boolean;
-  index?: number;
-  hideInfo?: boolean;
-}>();
-const emit = defineEmits<{
-  (e: "pull", index: number): void;
-  (e: "change", i: number): void;
-}>();
-</script>
-
-<style lang="sass" scoped>
-@import './style.scss'
-</style>

+ 0 - 71
src/components/show-hot-item/pull-hot.vue

@@ -1,71 +0,0 @@
-<template>
-  <teleport to="body">
-    <span class="close" @click="emit('close')" :class="{ pc: os.isPc && !os.isTablet }">
-      <ui-icon type="close" ctrl />
-    </span>
-
-    <div class="pull-hot" :class="{ pc: os.isPc && !os.isTablet }">
-      <div class="hot-layer">
-        <!-- <h3>{{ info.title }}</h3> -->
-        <div class="pull-meta">
-          <!-- <div class="content" v-html="info.content"></div> -->
-          <template v-for="meta in info.meta" v-if="info.type !== 'IMAGE'">
-            <video
-              v-if="info.type === 'VIDEO'"
-              controls
-              autoplay
-              playsinline
-              webkit-playsinline
-            >
-              <source :src="meta.url" />
-            </video>
-            <iframe v-else-if="info.type === 'WEB'" :src="meta.url"> </iframe>
-          </template>
-
-          <ui-slide
-            v-else
-            class="full-slide"
-            :items="info.meta"
-            :showCtrl="info.meta.length > 1"
-            :currentIndex="metaIndex"
-            :showInfos="info.meta.length > 1"
-          >
-            <template v-slot="{ raw }">
-              <div
-                class="full-img"
-                :class="{
-                  pc: os.isPc || os.isHorizontal.value,
-                  tablet: os.isTablet,
-                  horizontal: os.isHorizontal.value,
-                }"
-              >
-                <img :src="raw.url" />
-              </div>
-            </template>
-          </ui-slide>
-        </div>
-      </div>
-    </div>
-  </teleport>
-</template>
-
-<script setup lang="ts">
-import { HotAtom } from "@/store";
-import { os } from "@/utils";
-
-defineProps<{
-  info: HotAtom;
-  metaIndex: number;
-}>();
-const emit = defineEmits<{ (m: "close"): void }>();
-</script>
-
-<style lang="sass" scoped>
-@import './style.scss'
-</style>
-
-<style lang="scss">
-.full-slide {
-  height: 100%;
-}
-</style>

+ 0 - 243
src/components/show-hot-item/style.scss

@@ -1,243 +0,0 @@
-.hot-item {
-  position: absolute;
-  cursor: pointer;
-
-  > img {
-    width: 32px;
-    height: 32px;
-  }
-
-  .hot-bubble {
-    cursor: initial;
-
-    &.pc {
-      width: 400px;
-    }
-    &:not(.pc) {
-      width: 80vw;
-      --bottom-left: 40vw;
-    }
-
-    h2 {
-      font-size: 20px;
-      margin-bottom: 10px;
-      color: #ffffff;
-      position: relative;
-
-      .audio {
-        float: right;
-      }
-    }
-
-    .content {
-      font-size: 14px;
-      font-family: MicrosoftYaHei;
-      color: #999999;
-      line-height: 1.35em;
-      margin-bottom: 20px;
-      word-break: break-all;
-    }
-
-    .meta {
-      max-width: 100%;
-      border-radius: 4px;
-      margin-top: 20px;
-    }
-  }
-
-  &.active,
-  &:hover {
-    z-index: 3;
-  }
-}
-
-.mates {
-  width: 100%;
-  height: 100%;
-  max-height: 100%;
-  overflow-y: auto;
-
-  .meta-item {
-    width: 100%;
-    height: 100%;
-
-    &.full {
-      cursor: zoom-in;
-    }
-  }
-
-  .iframe {
-    width: 100%;
-    height: 100%;
-    position: relative;
-
-    &::after {
-      content: '';
-      position: absolute;
-      bottom: 0;
-      top: 0;
-      right: 0;
-      left: 0;
-      z-index: 2;
-    }
-  }
-
-  iframe,
-  video,
-  img {
-    width: 100%;
-    height: 203px;
-    object-fit: cover;
-  }
-  video,
-  img {
-    object-fit: cover;
-  }
-  iframe {
-    border: none;
-  }
-
-  .file-mange {
-    position: absolute;
-    top: 10px;
-    right: 10px;
-    span {
-      display: block;
-      width: 24px;
-      height: 24px;
-      background-color: rgba(0, 0, 0, 0.3);
-      font-size: 14px;
-      color: rgba(255, 255, 255, 0.7);
-      border-radius: 50%;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      cursor: pointer;
-
-      &:not(:last-child) {
-        margin-bottom: 10px;
-      }
-    }
-  }
-}
-
-.close {
-  right: 0;
-  top: 0;
-  height: 25px;
-  position: absolute;
-  font-size: 18px;
-  color: #fff;
-  cursor: pointer;
-  width: 50px;
-  height: 50px;
-  border-radius: 50%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  z-index: 99999;
-}
-
-.pull-hot {
-  position: absolute;
-  z-index: 9999;
-  display: flex;
-  align-items: center;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  background-color: rgba(0, 0, 0, 0.1);
-  backdrop-filter: blur(1px);
-
-  &:not(.pc) {
-    .hot-layer {
-      padding-top: 40px;
-    }
-  }
-
-  &.pc {
-    .hot-layer {
-      padding: 40px 20px 20px;
-    }
-  }
-
-  .hot-layer {
-    flex: 1;
-    background-color: rgba(0, 0, 0, 0.7);
-    color: #fff;
-    height: 100%;
-    position: relative;
-    display: flex;
-    flex-direction: column;
-
-    h3 {
-      font-size: 20px;
-      font-weight: 700;
-      letter-spacing: 1px;
-      margin-bottom: 10px;
-      word-break: break-all;
-    }
-
-    .pull-meta {
-      height: 100%;
-      width: 100%;
-      overflow-y: auto;
-      flex: 1;
-
-      .content {
-        margin-bottom: 10px;
-        font-size: 16px;
-        font-weight: 400;
-        line-height: 26px;
-        color: #ccc;
-        word-break: break-all;
-        letter-spacing: 1px;
-      }
-
-      iframe,
-      video,
-      img {
-        width: 100%;
-        height: 100%;
-        display: block;
-      }
-
-      video,
-      img {
-        object-fit: contain;
-      }
-
-      iframe {
-        border: none;
-        height: 100%;
-      }
-    }
-  }
-}
-
-.edit-hot {
-  margin-top: 20px;
-  text-align: right;
-
-  span {
-    font-size: 14px;
-    color: rgba(255, 255, 255, 0.7);
-    cursor: pointer;
-  }
-}
-
-.full-img {
-  height: 100%;
-  width: 100%;
-  position: relative;
-}
-
-.full-img img {
-  position: absolute;
-  width: 100%;
-  height: 100%;
-  object-fit: contain;
-  left: 0;
-  top: 0;
-}

+ 2 - 1
src/dbo/local.ts

@@ -11,7 +11,8 @@ params.m = params.m || (window as any).num || "SS-t-4pMXagRDjk";
 export const baseURL = import.meta.env.VITE_API_BASE_URL ? `/${import.meta.env.VITE_API_BASE_URL}/${params.m}` : "";
 const spliceUrl = "---";
 setSpliceUrl(spliceUrl);
-setStaticPrefix("");
+setStaticPrefix(" ");
+// setStaticPrefix(baseURL);
 // baseURL
 
 export default (axiosInstance: AxiosStatic<Interfaces>) => {

+ 0 - 1
src/sdk/laser/index.ts

@@ -8,7 +8,6 @@ export const setStaticPrefix = (ver) => (staticPrefix = ver);
 
 export const laserFactory = (props: LaserSDKProps, store?: Store): LaserSDK => {
   console.log({
-
     dom: props.sceneEl,
     number: props.num,
     staticPrefix,

+ 31 - 4
src/store/sync.ts

@@ -13,6 +13,24 @@ import router, {writeRouteName} from "@/router";
 import { baseURL } from '@/dbo/local'
 
 const global = window as any
+
+global.getImageCallback = () => {
+  console.log("原始getImageCallback")
+
+}
+global.getSceneStoreCallback = () => {
+  console.log("原始getSceneStoreCallback")
+}
+global.setSceneStoreCallback = () => {
+  console.log("原始setSceneStoreCallback")
+}
+global.uploadImageCallback = () => {
+  console.log("原始uploadImageCallback")
+}
+global.downloadImageCallback = () => {
+  console.log("原始downloadImageCallback")
+}
+
 export const api = import.meta.env.DEV && !global.android
 // const api = import.meta.env.DEV
   ? {
@@ -37,9 +55,11 @@ export const api = import.meta.env.DEV && !global.android
         if (url.includes(baseURL)) {
           url = url.substring(baseURL.length)
         }
+        url = url.trim()
         const data = await axios.get(url,{responseType:'blob'})
-        console.error("getFile", url)
+        // console.error("getFile", url)
         const base64 = await blobToBase64(data.data)
+        // console.error("getFile", url, base64)
         return base64
       },
       async closePage() {
@@ -74,10 +94,17 @@ export const api = import.meta.env.DEV && !global.android
       })
     },
     getFile(fileUrl) {
+      fileUrl = fileUrl.trim()
       if (import.meta.env.DEV) {
         return new Promise<string>(resolve => {
-          global.getImageCallback = resolve
-          global.android.getImage(fileUrl)
+          global.getImageCallback = (base64) => {
+            console.error("getImageCallback返回" + base64)
+            console.error("getFile", fileUrl, base64)
+            resolve(base64)
+          }
+          console.log("获取", params.m + fileUrl)
+          global.android.getImage(params.m + fileUrl)
+          console.log(global, global.getImageCallback)
         })
       } else {
         return Promise.resolve(fileUrl)
@@ -175,4 +202,4 @@ loadStore()
   .catch((e) => {
     console.error(e)
     alert("场景数据加载失败")
-  })
+  })