gemercheung 2 years ago
parent
commit
6016652a0f

+ 1 - 1
packages/qjkankan-editor/.env.testprod

@@ -7,4 +7,4 @@ VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
 VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
 VUE_APP_ORIGIN=
 VUE_APP_URL_FILL=/qjkankan
-VUE_APP_DEBBUG_FLAG=0426-04
+VUE_APP_DEBBUG_FLAG=0426-05

+ 1 - 1
packages/qjkankan-view/.env.testprod

@@ -6,4 +6,4 @@ VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
 VUE_APP_URL_FILL=/qjkankan
 # 接口请求地址
 VUE_APP_APIS_URL=https://test.4dkankan.com/
-VUE_APP_DEBBUG_FLAG=0426-04
+VUE_APP_DEBBUG_FLAG=0426-05

+ 3 - 2
packages/qjkankan-view/src/components/assembly/Password.vue

@@ -30,7 +30,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted, computed, watch, nextTick } from "vue";
+import { ref, onMounted, computed, watch, nextTick, defineEmits } from "vue";
 import { useI18n, getLocale } from "@/i18n";
 import { useStore } from "vuex";
 import { getApp } from "@/app";
@@ -43,6 +43,7 @@ const password = ref("");
 const passwordkey = computed(() => store.getters["scene/password"]);
 const metadata = computed(() => store.getters["scene/metadata"]);
 const currentScene = computed(() => store.getters["scene/currentScene"]);
+const emit = defineEmits(["pass"]);
 const onOk = () => {
   let app = getApp();
 
@@ -52,6 +53,7 @@ const onOk = () => {
   }
   if (password.value === passwordkey.value) {
     show.value = false;
+    emit("pass");
     app.Scene.unlock();
   } else {
     error.value = t("common.passwordError");
@@ -66,7 +68,6 @@ watch(passwordkey, () => {
     show.value = true;
   } else {
     getApp().Scene.unlock();
-    this.$emit("pass");
   }
 });
 </script>

+ 4 - 1
packages/qjkankan-view/src/pages/show.vue

@@ -5,7 +5,7 @@
       :coverData="coverInfo"
       v-if="coverInfo.isShowCover && !hasPasswordLock"
     />
-    <Password @pass="hasPasswordLock = false" />
+    <Password @pass="handlePass" />
     <Share />
     <div class="ui-view-layout" :class="{ show: show }">
       <Pano />
@@ -232,6 +232,9 @@ onMounted(async () => {
     }
   });
 });
+const handlePass = () => {
+  hasPasswordLock.value = false;
+};
 </script>
 
 <style lang="scss" scoped>

+ 13 - 3
packages/qjkankan-view/src/pages/showMobile.vue

@@ -1,8 +1,11 @@
 <template>
   <LoadingLogo v-if="workEnable" />
   <template v-if="workEnable">
-    <Opening :coverData="coverInfo" v-if="coverInfo.isShowCover" />
-    <Password />
+    <Opening
+      :coverData="coverInfo"
+      v-if="coverInfo.isShowCover && !hasPasswordLock"
+    />
+    <Password @pass="handlePass" />
     <Share />
     <div class="ui-view-layout" :class="{ show: show }">
       <Pano />
@@ -27,7 +30,7 @@ import Opening from "@/components/assembly/OpeningMobile";
 import LoadingLogo from "@/components/assembly/Loading";
 import { createApp } from "@/app";
 
-import { ref, onMounted, computed, unref,watch, nextTick } from "vue";
+import { ref, onMounted, computed, unref, watch, nextTick } from "vue";
 import { getPanoInfo, checkWork } from "@/apis";
 import { useStore } from "vuex";
 import config from "@/utils/config";
@@ -50,6 +53,7 @@ const store = useStore();
 const show = ref(false);
 const workEnable = ref(true);
 const lang = getLocale();
+const hasPasswordLock = ref(false);
 
 const currentScene = computed(() => store.getters["scene/currentScene"]);
 const currentCatalogRoot = computed(
@@ -81,6 +85,9 @@ onMounted(async () => {
       "scene/setPassword",
       data.password === "" ? false : data.password
     );
+    if (data.password.length > 0) {
+      hasPasswordLock.value = true;
+    }
     store.commit("scene/setMetaData", data);
     document.title = data.name || t("common.no_title");
 
@@ -221,6 +228,9 @@ onMounted(async () => {
     }
   });
 });
+const handlePass = () => {
+  hasPasswordLock.value = false;
+};
 </script>
 
 <style lang="scss" scoped>