jinx vor 6 Monaten
Ursprung
Commit
c18050a81e

+ 2 - 2
packages/qjkankan-editor/.env.testdev

@@ -3,8 +3,8 @@ VUE_APP_MAIN_COLOR=''
 VUE_APP_STATIC_DIR=static
 VUE_APP_CDN=https://ossxiaoan.4dage.com
 VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
-# VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
-VUE_APP_PROXY_URL='http://192.168.0.73:8002/qjkankan/'
+VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
+# VUE_APP_PROXY_URL='http://192.168.0.73:8002/qjkankan/'
 # VUE_APP_PROXY_URL='http://192.168.0.17:8002/qjkankan/'
 VUE_APP_ORIGIN=
 VUE_APP_URL_FILL=

+ 18 - 2
packages/qjkankan-editor/src/api/index.js

@@ -35,7 +35,24 @@ export function getUserInfo(ok, no) {
 export function getPanoInfo(data, ok, no) {
   return http.get(`${ossUrl}/720yun_fd_manage/${data || number()}/someData.json?_=${Math.random()}`, {}, ok, no);
 }
-
+/**
+ * 获取全景列表
+ * @param {*} workId
+ * @param {*} ok
+ * @param {*} no
+ */
+export function getSceneList(workId, ok, no) {
+  return http.get(`/work/edit/navigation/scene/list?workId=${workId}`, {}, ok, no);
+}
+/**
+ * 获取作品自定义logo
+ * @param {*} workId
+ * @param {*} ok
+ * @param {*} no
+ */
+export function getWorkLogo(data, ok, no) {
+  return http.postJson(`/manage/logo/getLogo`, data, ok, no);
+}
 /**
  * 获取四维看看场景信息
  * @param {*} data
@@ -43,7 +60,6 @@ export function getPanoInfo(data, ok, no) {
  * @param {*} no
  */
 export function getSceneInfomation(data, ok, no) {
-  debugger;
   return http.get(`/api/scene/getInfo?num=${data.id}&_=${Math.random()}`, {}, ok, no);
 }
 

+ 30 - 41
packages/qjkankan-editor/src/views/material/popup/share.vue

@@ -1,9 +1,6 @@
 <template>
   <popup v-if="show">
-    <div
-      class="ui-message ui-message-confirm message-material"
-      style="width: 500px"
-    >
+    <div class="ui-message ui-message-confirm message-material" style="width: 500px">
       <div class="ui-message-header header-material">
         <span>{{ share }}</span>
         <span @click="$emit('close')">
@@ -14,14 +11,7 @@
         <ul>
           <li>
             <span>{{ work_link }}</span>
-            <input
-              :title="item.share + `&vr=${defaultscenesCode}&lang=${$lang}`"
-              class="ui-input"
-              disabled
-              type="text"
-              maxlength="15"
-              :value="item.share + `&vr=${defaultscenesCode}&lang=${$lang}`"
-            />
+            <input :title="path + `?id=${item.id}&lang=${$lang}`" class="ui-input" disabled type="text" maxlength="15" :value="path + `?id=${item.id}&lang=${$lang}`" />
           </li>
           <li>
             <span>{{ work_qrCode }} </span>
@@ -29,9 +19,7 @@
             <div
               class="qrcode"
               :style="{
-                backgroundImage: `url(${
-                  currentQRcode || require('@/assets/svg/loading.svg')
-                })`,
+                backgroundImage: `url(${currentQRcode || require('@/assets/svg/loading.svg')})`,
               }"
             />
           </li>
@@ -39,17 +27,10 @@
       </div>
 
       <div class="ui-message-footer footer-material">
-        <button
-          @click="downloadImg(item)"
-          class="ui-button"
-          :class="currentQRcode.length === 0 ? 'disable' : ''"
-        >
+        <button @click="downloadImg(item)" class="ui-button" :class="currentQRcode.length === 0 ? 'disable' : ''">
           {{ download_qrCode }}
         </button>
-        <button
-          @click="copy(item.share + `&vr=${defaultscenesCode}&lang=${$lang}`)"
-          class="ui-button submit"
-        >
+        <button @click="copy(path + `?id=${item.id}&lang=${$lang}`)" class="ui-button submit">
           {{ copy_link }}
         </button>
       </div>
@@ -59,7 +40,7 @@
 
 <script>
 import Popup from "@/components/shared/popup";
-import { getQrCode } from "@/api";
+import { getQrCode, getWorkLogo } from "@/api";
 import { i18n } from "@/lang";
 
 export default {
@@ -76,28 +57,38 @@ export default {
       copy_link: i18n.t("material.works.copy_link"),
       key: "",
       currentQRcode: "",
+      path: process.env.VUE_APP_PROXY_URL_ROOT + "/panorama/showMobile.html",
     };
   },
   computed: {
-    defaultscenesCode: function () {
-      if (this.item.firstScene) {
-        return this.item.firstScene.sceneCode || "";
-      } else {
-        return Array.from(this.item.scenes).length > 0
-          ? Array.from(this.item.scenes)[0].sceneCode
-          : "";
-      }
-    },
+    // defaultscenesCode: function () {
+    //   if (this.item.firstScene) {
+    //     return this.item.firstScene.sceneCode || "";
+    //   } else {
+    //     return Array.from(this.item.scenes).length > 0
+    //       ? Array.from(this.item.scenes)[0].sceneCode
+    //       : "";
+    //   }
+    // },
   },
   watch: {
     item: {
-      handler: function (val) {
+      handler: async function (val) {
         this.currentQRcode = "";
-        if (val.share) {
+        // if (val.share) {
+        if (val.id) {
           const shareLink =
-            val.share + `&vr=${this.defaultscenesCode}&lang=${this.$lang}`;
+            // val.share + `&vr=${this.defaultscenesCode}&lang=${this.$lang}`;
+            this.path + `?id=${val.id}&lang=${this.$lang}`;
           console.log("当前分享", shareLink);
-          const llogo = val.logo || "";
+          let llogo = "";
+          await getWorkLogo({ workId: val.id }).then((res) => {
+            if (res.data && res.data.logo) {
+              llogo = res.data.logo;
+            } else {
+              llogo = "";
+            }
+          });
           getQrCode({ logo: llogo, text: shareLink }).then((res) => {
             if (res.code === 0) {
               this.currentQRcode = res.data.img;
@@ -138,9 +129,7 @@ export default {
       textArea.select();
 
       try {
-        document.execCommand("copy")
-          ? this.$msg.success(this.$i18n.t("gather.scene_link_copy_tips"))
-          : this.$msg.error(this.$i18n.t("gather.scene_link_copy_failed"));
+        document.execCommand("copy") ? this.$msg.success(this.$i18n.t("gather.scene_link_copy_tips")) : this.$msg.error(this.$i18n.t("gather.scene_link_copy_failed"));
       } catch (err) {
         this.$msg.error(this.$i18n.t("gather.scene_link_copy_failed"));
       }

+ 31 - 11
packages/qjkankan-editor/src/views/material/works/list.vue

@@ -91,7 +91,7 @@ import { mapGetters } from "vuex";
 import { i18n } from "@/lang";
 import { $waiting } from "@/components/shared/loading";
 import { isUpgradeAdapter } from "@/utils/fixVersion";
-import { addWorks, getWorksList, delWorks, getPanoInfo, saveWorks, addWork } from "@/api";
+import { addWorks, getWorksList, delWorks, getPanoInfo, getSceneList, saveWorks, addWork } from "@/api";
 import { version } from "less";
 
 export default {
@@ -176,19 +176,29 @@ export default {
       false
     ),
     openShare(data) {
-      console.log(data);
-      getPanoInfo(data.id, (data) => {
-        if (data.scenes.length <= 0) {
-          return this.$msg.warning(this.$i18n.t("material.works.no_link"));
-        }
-        this.showShare = true;
-        this.shareItem = data;
-      });
+      this.showShare = true;
+      this.shareItem = { id: data.id };
+      // getSceneList(data.id, (res) => {
+      //   let data = res.data;
+      //   if ( data.panoList.length <= 0) {
+      //     return this.$msg.warning(this.$i18n.t("material.works.no_link"));
+      //   }
+      //   this.showShare = true;
+      //   this.shareItem = data;
+      // });
+      // getPanoInfo(data.id, (data) => {
+      //   if (data.scenes.length <= 0) {
+      //     return this.$msg.warning(this.$i18n.t("material.works.no_link"));
+      //   }
+      //   this.showShare = true;
+      //   this.shareItem = data;
+      // });
     },
 
     handlePreview(item) {
-      getPanoInfo(item.id, (data) => {
-        if (data.scenes.length <= 0) {
+      getSceneList(item.id, (res) => {
+        let data = res.data;
+        if (data.fdkkList.length <= 0 && data.panoList.length <= 0) {
           return this.$msg.warning(this.$i18n.t("material.works.no_link"));
         }
         this.showItem = {
@@ -197,6 +207,16 @@ export default {
         };
         this.showPreview = true;
       });
+      // getPanoInfo(item.id, (data) => {
+      //   if (data.scenes.length <= 0) {
+      //     return this.$msg.warning(this.$i18n.t("material.works.no_link"));
+      //   }
+      //   this.showItem = {
+      //     ...item,
+      //     ...data,
+      //   };
+      //   this.showPreview = true;
+      // });
     },
     add() {
       // 新建作品,弹窗让用户给作品选择素材。

+ 2 - 2
packages/qjkankan-view/.env.testdev

@@ -3,8 +3,8 @@ VUE_APP_CDN=https://ossxiaoan.4dage.com
 VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
 VUE_APP_RESOURCE_URL='https://test.4dkankan.com/panorama/'
 VUE_APP_URL_FILL=
-# VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
-VUE_APP_PROXY_URL='http://192.168.0.73:8002/qjkankan/'
+VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
+# VUE_APP_PROXY_URL='http://192.168.0.73:8002/qjkankan/'
 # VUE_APP_PROXY_URL='http://192.168.0.17:8002/qjkankan/'
 # 接口请求地址
 VUE_APP_APIS_URL=https://test.4dkankan.com/

+ 2 - 2
packages/qjkankan-view/src/components/UIGather/logo.vue

@@ -1,8 +1,8 @@
 <template>
-  <div class="logo" v-if="metadata.isLogo && fdkkCurrentVersion != 'V3'">
+  <div class="logo" v-if="metadata?.workLogo?.isLogo && fdkkCurrentVersion != 'V3'">
     <img
       :src="
-        metadata.logo ||
+        metadata?.workLogo?.logo ||
         require(`@/assets/images/default/logo_white_${local}.svg`)
       "
       alt=""