Bläddra i källkod

Merge branch 'release/1.8.0'

gemercheung 1 år sedan
förälder
incheckning
d20c89783e

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

@@ -7,6 +7,6 @@ VUE_APP_PROXY_URL_ROOT='https://www.4dkankan.com'
 VUE_APP_PROXY_URL='https://www.4dkankan.com/qjkankan/'
 VUE_APP_ORIGIN=
 VUE_APP_URL_FILL=/qjkankan
-VUE_APP_DEBBUG_FLAG=0418
+VUE_APP_DEBBUG_FLAG=0425
 VUE_APP_DEBBUG_NOTIFY=0
 VUE_APP_MEGA_LIST_URL='https://uat-laser.4dkankan.com/laser/init/list'

+ 15 - 0
packages/qjkankan-editor/src/api/index.js

@@ -1028,3 +1028,18 @@ export function getQrCode(data, ok, no) {
 export function getCamWorksList(data, ok, no) {
   return http.postJson(`${URL_FILL}/manage/work/sceneWorkList`, data, ok, no);
 }
+
+/**
+ * 检查作品id
+ * @param {*} data
+ * @param {*} ok
+ * @param {*} no
+ */
+export function exchangeId(data, ok, no) {
+  return http.postJson(
+    `${URL_FILL}/web/common/getIdInfo`,
+    data,
+    ok,
+    no
+  );
+}

+ 1 - 1
packages/qjkankan-editor/src/mixins/debuggerHelper.js

@@ -1,6 +1,6 @@
 import Vue from "vue";
 export const debuggerHelper = (show = true) => {
-  const version = "1.7.0--" + process.env.VUE_APP_DEBBUG_FLAG;
+  const version = "1.8.0--" + process.env.VUE_APP_DEBBUG_FLAG;
   if (show) {
     // log.setColors({
     var css = "background: #28b561; color:#fff;font-size:14px;padding:5px;";

+ 61 - 2
packages/qjkankan-editor/src/pages/Edit.vue

@@ -5,9 +5,10 @@
 </template>
 <script>
 import AppLayout from "@/framework/EditorAppLayout.vue";
-import { ref, reactive, defineComponent } from "vue-demi";
 import { mapGetters } from "vuex";
-
+import browser from "@/utils/browser";
+import { exchangeId, checkWork, getPanoInfo, checkLogin } from "@/api";
+import { LoginDetector, OnlineDetector } from "@/utils/starter";
 export default {
   components: {
     AppLayout,
@@ -23,9 +24,64 @@ export default {
       }
     },
   },
+  async beforeMount() {
+    const id = browser.urlQueryValue('id');
+    const lang = browser.urlQueryValue("lang") || 'zh'
+    const token = browser.urlQueryValue('token');
+    const res = await exchangeId({
+      id: id
+    })
+
+    if (token) {
+      localStorage.setItem('token', token)
+    }
+
+
+    const { id: resID, num, calcStatus } = res.data
+    const isCam = String(num).length > 0
+    let urlRes = `./edit.html?id=${resID}&lang=${lang}#/base`
+    if (isCam) {
+      urlRes = `./edit.html?id=${resID}&lang=${lang}&from=cam#/base`
+    }
+    if (calcStatus === 0) {
+      this.$alert({
+        content: this.$i18n.t('material.works.calcing'),
+      });
+      return
+    }
+    console.log('res', urlRes)
+    location.replace(urlRes);
+  //检验是不是该用户作品
+  checkWork({
+      val: 1,
+    }).then((res) => {
+      if (res.data) {
+        checkLogin().then((response) => {
+          if (response.code == 3005) {
+            this.$store.commit("UpdateIsShowState", false);
+            this.$bus.emit("canLoad", false);
+            return this.$alert({ content: "当前无操作权限" });
+          } else {
+            this.$bus.emit("canLoad", true);
+            LoginDetector.valid();
+          }
+        });
+      } else {
+        return this.$alert({ content: "该作品已被删除" });
+      }
+    });
+
+    getPanoInfo().then(() => {
+      this.$store.commit("UpdateIsShowState", true);
+      OnlineDetector.valid();
+    });
+
+  },
   mounted() {
     document.title = this.$i18n.t("gather.editpage_name");
     window.store = this.$store;
+
+  
     window.addEventListener(
       "beforeunload",
       (e) => {
@@ -54,6 +110,7 @@ body,
   position: relative;
   z-index: 0;
 }
+
 body {
   margin: 0;
   color: #fff;
@@ -63,11 +120,13 @@ body {
   user-select: none;
   font-family: OpenSans, sans-serif;
 }
+
 ul {
   list-style: none;
   margin: 0;
   padding: 0;
 }
+
 img {
   border: 0;
   outline: 0;

+ 27 - 26
packages/qjkankan-editor/src/router/editorRouter.js

@@ -38,33 +38,34 @@ OnlineDetector.register(
   (detector) => new Promise((resolve) => detector.resolve(resolve))
 );
 
-//检验是不是该用户作品
+// setTimeout(() => {
+//   //检验是不是该用户作品
+//   checkWork({
+//     val: 1,
+//   }).then((res) => {
+//     if (res.data) {
+//       checkLogin().then((response) => {
+//         if (response.code == 3005) {
+//           store.commit("UpdateIsShowState", false);
+//           vue.$bus.emit("canLoad", false);
+//           return vue.$alert({ content: "当前无操作权限" });
+//         } else {
+//           vue.$bus.emit("canLoad", true);
+//           LoginDetector.valid();
+//         }
+//       });
+//     } else {
+//       return vue.$alert({ content: "该作品已被删除" });
+//     }
+//   });
 
-checkWork({
-  val: 1,
-}).then((res) => {
-  if (res.data) {
-    checkLogin().then((response) => {
-      if (response.code == 3005) {
-        store.commit("UpdateIsShowState", false);
-        vue.$bus.emit("canLoad", false);
-        return vue.$alert({ content: "当前无操作权限" });
-      } else {
-        vue.$bus.emit("canLoad", true);
-        LoginDetector.valid();
-      }
-    });
-  } else {
-    return vue.$alert({ content: "该作品已被删除" });
-  }
-});
-
-getPanoInfo().then(() => {
-  store.commit("UpdateIsShowState", true);
-  // if(response&&response.status == 1){
-  // }
-  OnlineDetector.valid();
-});
+//   getPanoInfo().then(() => {
+//     store.commit("UpdateIsShowState", true);
+//     // if(response&&response.status == 1){
+//     // }
+//     OnlineDetector.valid();
+//   });
+// }, 2000);
 
 const router = new Router({
   routes: routes,

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

@@ -8,4 +8,4 @@ VUE_APP_URL_FILL=/qjkankan
 
 # 接口请求地址
 VUE_APP_APIS_URL=https://www.4dkankan.com/
-VUE_APP_DEBBUG_FLAG=0418
+VUE_APP_DEBBUG_FLAG=0425

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

@@ -7,7 +7,7 @@ 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=20240402
+VUE_APP_DEBBUG_FLAG=20240412
 VUE_APP_DEBBUG_NOTIFY=0
 VUE_APP_DEBBUG_V4=0
 VUE_APP_DEBBUG_V4_URL="http://192.168.0.186:8081"

+ 15 - 0
packages/qjkankan-view/src/apis/index.js

@@ -61,3 +61,18 @@ export function checkWork(ok, no) {
     no
   );
 }
+
+/**
+ * 检查作品id
+ * @param {*} data
+ * @param {*} ok
+ * @param {*} no
+ */
+export function exchangeId(data, ok, no) {
+  return http.post(
+    `${URL_FILL}/web/common/getIdInfo`,
+    data,
+    ok,
+    no
+  );
+}

+ 38 - 23
packages/qjkankan-view/src/components/assembly/Share.vue

@@ -33,30 +33,37 @@ const copy$ = ref(null);
 
 const show = computed(() => store.getters["functions/showShareUrl"]);
 
-let share_url = browser.getURLParam("share_url");
-if (share_url) {
-  share_url = decodeURIComponent(share_url);
-} else {
-  share_url = location.href.split("#")[0];
-}
+const share_url = ref('')
 
 const copyLink = computed(() => {
-  return share_url.replace("&app", "");
+  return share_url.value.replace("&app", "");
 });
 
-const onOk = () => {};
+const onOk = () => { };
 
 const onNo = () => {
   store.commit("functions/setShareUrl", false);
 };
 
 onMounted(() => {
-  nextTick(()=>{
-  new ClipboardJS(copy$.value.$el).on("success",  (e)=> {
-    e.clearSelection();
-    onNo()
-    Dialog.toast({ content: t("toast.copySuccess"), type: "success" });
-  });
+  nextTick(() => {
+
+    share_url.value = browser.getURLParam("share_url");
+    if (share_url.value) {
+      share_url.value = decodeURIComponent(share_url);
+    } else {
+      setTimeout(() => {
+        share_url.value = location.href.split("#")[0];
+        console.log('share_url', share_url.value)
+      }, 1500)
+
+    }
+
+    new ClipboardJS(copy$.value.$el).on("success", (e) => {
+      e.clearSelection();
+      onNo()
+      Dialog.toast({ content: t("toast.copySuccess"), type: "success" });
+    });
   })
 });
 </script>
@@ -69,34 +76,39 @@ onMounted(() => {
   right: 0;
   bottom: 0;
   z-index: 99999;
-  > div {
+
+  >div {
     position: absolute;
     left: 50%;
     top: 50vh;
-    transform: translate(-50%,-50%);
+    transform: translate(-50%, -50%);
     width: 400px;
     height: 230px;
-    background: rgba(27,27,28,0.8);
-    box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.3);
+    background: rgba(27, 27, 28, 0.8);
+    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.3);
     border-radius: 4px;
     border: 1px solid #000000;
     backdrop-filter: blur(4px);
     padding: 26px;
+
     .tips {
       display: flex;
       align-items: center;
       justify-content: space-between;
+
       h4 {
         margin: 0;
         font-size: 18px;
         font-weight: normal;
       }
+
       i {
         font-size: 14px;
         cursor: pointer;
         color: #969799;
       }
     }
+
     .url {
       color: #fff;
       text-align: center;
@@ -106,21 +118,24 @@ onMounted(() => {
       border-radius: 0.07rem;
       line-height: 1.5;
       font-size: 16px;
-      background: rgba(26,27,29,0.8);
+      background: rgba(26, 27, 29, 0.8);
       overflow: hidden;
       text-overflow: ellipsis;
-      white-space:nowrap;
+      white-space: nowrap;
     }
+
     .btns {
       display: flex;
       justify-content: flex-end;
+
       button {
         font-size: 14px;
         width: 88px;
         margin-left: 10px;
       }
-      .ccc{
-        background: #313131!important;
+
+      .ccc {
+        background: #313131 !important;
         border-radius: 4px;
         border-color: transparent;
       }
@@ -130,7 +145,7 @@ onMounted(() => {
 
 @media screen and (max-width: 600px) {
   .url-share {
-    >div{
+    >div {
       width: 90%;
     }
   }

+ 2 - 1
packages/qjkankan-view/src/locales/en.json

@@ -30,7 +30,8 @@
         "passwordTips": "Please enter the access code",
         "passwordError": "Password incorrect",
         "phone": "Tel",
-        "workDelete": "The project has been deleted!"
+        "workDelete": "The project has been deleted!",
+        "calcing": "The scene is being calculated, please visit later"
     },
     "menu": {
         "autoRotate": "Auto-play",

+ 2 - 1
packages/qjkankan-view/src/locales/zh.json

@@ -30,7 +30,8 @@
         "confirm": "确定",
         "cancel": "取消",
         "tips": "提示",
-        "show": "显示"
+        "show": "显示",
+        "calcing": "场景计算中,请稍后访问"
     },
     "menu": {
         "introduce": "简介",

+ 22 - 8
packages/qjkankan-view/src/pages/show.vue

@@ -1,10 +1,7 @@
 <template>
   <template v-if="workEnable">
     <LoadingLogo />
-    <Opening
-      :coverData="coverInfo"
-      v-if="coverInfo.isShowCover && !hasPasswordLock"
-    />
+    <Opening :coverData="coverInfo" v-if="coverInfo.isShowCover && !hasPasswordLock" />
     <Password @pass="handlePass" />
     <Share />
     <div class="ui-view-layout" :class="{ show: show }">
@@ -31,9 +28,10 @@ import UiGather from "@/components/UIGather/";
 import LoadingLogo from "@/components/assembly/Loading";
 import Opening from "@/components/assembly/Opening";
 import { createApp } from "@/app";
+import { Dialog } from "@/global_components";
 
 import { ref, onMounted, computed, watch, nextTick, unref } from "vue";
-import { getPanoInfo, checkWork } from "@/apis";
+import { getPanoInfo, checkWork, exchangeId } from "@/apis";
 import { useStore } from "vuex";
 import config from "@/utils/config";
 import browser from "@/utils/browser";
@@ -68,6 +66,23 @@ onMounted(async () => {
     );
     return;
   }
+
+  const idRes = await exchangeId({
+    id: config.projectNum
+  })
+  const { id, num, calcStatus } = idRes.data
+  config.projectNum = id
+
+  if (calcStatus === 0) {
+
+    Dialog.alert({
+      title: t("common.tips"),
+      content: t('common.calcing'),
+      okText: t("common.confirm"),
+    });
+    return
+  }
+
   let res = await checkWork();
 
   if (!res.data) {
@@ -164,9 +179,8 @@ onMounted(async () => {
 
     const app = createApp({
       // xml: "%HTMLPATH%/static/template/tour.xml",
-      xml: `${process.env.VUE_APP_CDN}/720yun_fd_manage/${
-        config.projectNum
-      }/tour.xml?rnd=${Math.random()}`,
+      xml: `${process.env.VUE_APP_CDN}/720yun_fd_manage/${config.projectNum
+        }/tour.xml?rnd=${Math.random()}`,
       swf: "%HTMLPATH%/showviewer/lib/krpano/tour.swf",
       target: "pano",
       html5: "auto",

+ 16 - 1
packages/qjkankan-view/src/pages/showMobile.vue

@@ -39,7 +39,7 @@ import {
   watch,
   nextTick,
 } from "vue";
-import { getPanoInfo, checkWork } from "@/apis";
+import { getPanoInfo, checkWork, exchangeId } from "@/apis";
 import { useStore } from "vuex";
 import config from "@/utils/config";
 import browser from "@/utils/browser";
@@ -47,6 +47,7 @@ import { useApp } from "@/app";
 import { useWxShared } from "@/hooks/useWxshared";
 import { useAudio } from "@/hooks/useAudio";
 import { useI18n, getLocale } from "@/i18n";
+import { Dialog } from "@/global_components";
 const { t } = useI18n({ useScope: "global" });
 
 const { initWxShare } = useWxShared();
@@ -85,6 +86,20 @@ onMounted(async () => {
     );
     return;
   }
+  const idRes = await exchangeId({
+    id: config.projectNum
+  })
+  const { id, num, calcStatus } = idRes.data
+  config.projectNum = id
+
+  if (calcStatus === 0) {
+    Dialog.alert({
+      title: t("common.tips"),
+      content: t('common.calcing'),
+      okText: t("common.confirm"),
+    });
+    return
+  }
 
   let res = await checkWork();
   if (!res.data) {

+ 1 - 1
packages/qjkankan-view/src/utils/debuggerHelper.js

@@ -2,7 +2,7 @@
 import { useToast } from "vue-toastification";
 
 export const debuggerHelper = (show = true) => {
-  const version = "1.7.0--" + process.env.VUE_APP_DEBBUG_FLAG;
+  const version = "1.8.0--" + process.env.VUE_APP_DEBBUG_FLAG;
   if (show) {
     // log.setColors({
     var css = "background: #28b561; color:#fff;font-size:14px;padding:5px;";