浏览代码

fix: 热点添加fodderId

jinx 6 月之前
父节点
当前提交
11d8a0eb7d

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

@@ -4,7 +4,8 @@ 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.41:8002/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=
 VUE_APP_DEBBUG_FLAG=0112-02

+ 26 - 11
packages/qjkankan-editor/src/framework/EditorHead.vue

@@ -324,6 +324,10 @@ export default {
       //     }
       //   });
       // }
+      if (this.baseInfo && this.baseInfo.workHotList && this.baseInfo.workHotList.length > 0) {
+        this.lockHotspotResourceTree(this.baseInfo.workHotList);
+      }
+
       //开场校验
       if (this.baseInfo?.workCoverType?.isShowCover === 1) {
         if (this.baseInfo.workCoverType.coverSelect === "videoAndImg") {
@@ -360,29 +364,40 @@ export default {
     /**
      * 给热点的资源引用上锁
      */
-    lockHotspotResourceTree(sceneIndex, hotspots) {
+    // lockHotspotResourceTree(sceneIndex, hotspots) {
+    lockHotspotResourceTree(hotspots) {
       hotspots.forEach((item, index) => {
-        const target = this.info.scenes[sceneIndex].someData.hotspots[index];
+        // const target = this.info.scenes[sceneIndex].someData.hotspots[index];
         let fodderId = [];
-
         switch (item.hotspotType) {
           case "image":
-            fodderId = target.image.reduce((p, c) => p.concat(c["id"]), []).map((i) => i);
-            target.fodderId = fodderId;
+            // fodderId = target.image.reduce((p, c) => p.concat(c["id"]), []).map((i) => i);
+            // target.fodderId = fodderId;
+            fodderId = item.image.reduce((p, c) => p.concat(c["id"]), []).map((i) => i);
+            item.fodderId = fodderId;
             break;
           case "audio":
-            target.fodderId = [target.audio.id].map((i) => i);
+            // target.fodderId = [target.audio.id].map((i) => i);
+            item.fodderId = [item.audio.id].map((i) => i);
             break;
           case "imageText":
-            fodderId = target.imageTextInfo.imageList.reduce((p, c) => p.concat(c["id"]), []).map((i) => i);
-            target.imageTextInfo.audio.id && fodderId.push(target.imageTextInfo.audio.id);
-            target.fodderId = fodderId;
+            // fodderId = target.imageTextInfo.imageList.reduce((p, c) => p.concat(c["id"]), []).map((i) => i);
+            // target.imageTextInfo.audio.id && fodderId.push(target.imageTextInfo.audio.id);
+            // target.fodderId = fodderId;
+            fodderId = item.imageTextInfo.imageList.reduce((p, c) => p.concat(c["id"]), []).map((i) => i);
+            item.imageTextInfo.audio.id && fodderId.push(item.imageTextInfo.audio.id);
+            item.fodderId = fodderId;
             break;
           case "video":
-            target.fodderId = [target.video.id];
+            // target.fodderId = [target.video.id];
+            item.fodderId = [item.video.id];
+            break;
+          case "scene":
+            item.fodderId = [item.scene.fodderId].map((i) => i);
             break;
           default:
-            target.fodderId = [];
+            // target.fodderId = [];
+            item.fodderId = [];
             break;
         }
       });

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

@@ -4,7 +4,8 @@ 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.41:8002/qjkankan/'
+# VUE_APP_PROXY_URL='http://192.168.0.41:8002/qjkankan/'
+VUE_APP_PROXY_URL='http://192.168.0.17:8002/qjkankan/'
 # 接口请求地址
 VUE_APP_APIS_URL=https://test.4dkankan.com/
 VUE_APP_DEBBUG_FLAG=0516-03