Browse Source

feat: save

gemercheung 1 year ago
parent
commit
a3d7914f22

+ 42 - 0
packages/qjkankan-kankan-view/src/components/Camera/index.vue

@@ -0,0 +1,42 @@
+<template>
+  <Teleport to=".scene" v-if="isShowCamIcon">
+    <i
+      @click="closeCamera"
+      class="iconfont ui-kankan-icon icon tip-h-center tip-v-bottom icon-close camera-close"
+    ></i>
+  </Teleport>
+</template>
+<script setup>
+import { ref } from "vue";
+import { useApp, getApp } from "@/app";
+const isShowCamIcon = ref(false);
+
+const closeCamera = () => {
+  getApp().Camera.monitor.edit.cancel();
+  isShowCamIcon.value = false;
+};
+
+useApp().then((app) => {
+  app.Camera.on("SecurityCamera.watch", (data) => {
+    isShowCamIcon.value = true;
+  });
+});
+</script>
+
+<style>
+.camera-close {
+  width: 48px;
+  height: 48px;
+  font-size: 20px;
+  background: rgba(0, 0, 0, 0.32);
+  border-radius: 50%;
+  position: fixed;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  top: 20px;
+  right: 20px;
+  z-index: 4000;
+  cursor: pointer;
+}
+</style>

+ 11 - 5
packages/qjkankan-kankan-view/src/pages/SPG.vue

@@ -8,10 +8,12 @@
       <UiTags />
       <Information />
       <BottomControl />
+      <Camera />
     </div>
     <!-- </template> -->
   </div>
   <DesignOption />
+
 </template>
 
 <script setup>
@@ -22,6 +24,9 @@ import Information from "@/components/Information";
 import BottomControl from "@/components/Controls/BottomControl";
 import Password from "@/components/shared/Password.vue";
 import LoadingLogo from "@/components/shared/Loading.vue";
+
+import Camera from "@/components/Camera/index.vue";
+
 import { createApp } from "@/app";
 import { listenMessage } from "@/utils/messageHandler";
 import { Dialog } from "@/global_components";
@@ -34,11 +39,8 @@ const { t } = useI18n({ useScope: "global" });
 
 onMounted(async () => {
   if (browser.isMobile()) {
-    window.location.href = window.location.href.replace(
-      "spg.html",
-      "smg.html"
-    );
-    console.warn('重跳后::',window.location.href);
+    window.location.href = window.location.href.replace("spg.html", "smg.html");
+    console.warn("重跳后::", window.location.href);
     return;
   }
 });
@@ -261,6 +263,10 @@ onMounted(() => {
   app.store.on("flooruser", (floor) =>
     store.commit("scene/loadFloorData", floor)
   ); //4.7以后新楼层方式
+
+  app.Camera.on("SecurityCamera.watch", (data) => {
+    console.error("SecurityCamera.watch", data);
+  });
   app.render();
 });
 </script>