Browse Source

修改户型图江门最新版

tangning 2 months ago
parent
commit
74059c2532
2 changed files with 28 additions and 28 deletions
  1. 25 25
      src/view/case/help.ts
  2. 3 3
      vite.config.ts

+ 25 - 25
src/view/case/help.ts

@@ -198,36 +198,36 @@ export const getFuseImage = async (
       break;
     case FuseImageType.KANKAN:
       console.error("截图尺寸", width, height);
-      // if(typeMap.sdk.Camera.mode == 'floorplan') {//判断户型图模式是否为平面图模式,如果是则获取平面图的截图进行裁剪处理
-      //   if(typeMap.sdk.store?.getValue('metadata')?.floorPlanUser) {
-      //     let num = typeMap.sdk.store?.getValue('metadata').num
-      //     let floorId = typeMap.sdk.core.get('Player').model.currentFloor.floorIndex
-      //     let img = ''
-      //     if (typeMap.sdk.store.getValue('flooruser').type === 'image') {
-      //         img = `floor-upload-${floorId}.jpg`
-      //     } else {
-      //         img = `cad-style-3-${floorId}.jpg`
-      //     }
-      //     newUrl = `${getUrlSrc({type: 102})}/profile/scene_view_data/${num}/user/${img}?t=${Date.now()}`
-      //    // /oss/scene_view_data/YZL-jm-3EOpLfZxim9/user/cad-style-3.jpg
-      //    let newBlob = await urlToBlob(newUrl)
-      //    if(newBlob.type != 'text/html'){
-      //     blob = await imageCropper({
-      //       img: newBlob,
-      //       fixed: [width, height]
-      //      })
-      //    }
-      //    console.error("截图尺寸2", blob);
-      //   } else {
-      //     alert("暂未获取到平面图,请前往三维场景制作并保存");
-      //   }
-      // } else {
+      if(typeMap.sdk.Camera.mode == 'floorplan') {//判断户型图模式是否为平面图模式,如果是则获取平面图的截图进行裁剪处理
+        if(typeMap.sdk.store?.getValue('metadata')?.floorPlanUser) {
+          let num = typeMap.sdk.store?.getValue('metadata').num
+          let floorId = typeMap.sdk.core.get('Player').model.currentFloor.floorIndex
+          let img = ''
+          if (typeMap.sdk.store.getValue('flooruser').type === 'image') {
+              img = `floor-upload-${floorId}.jpg`
+          } else {
+              img = `cad-style-3-${floorId}.jpg`
+          }
+          newUrl = `${getUrlSrc({type: 102})}/profile/scene_view_data/${num}/user/${img}?t=${Date.now()}`
+         // /oss/scene_view_data/YZL-jm-3EOpLfZxim9/user/cad-style-3.jpg
+         let newBlob = await urlToBlob(newUrl)
+         if(newBlob.type != 'text/html'){
+          blob = await imageCropper({
+            img: newBlob,
+            fixed: [width, height]
+           })
+         }
+         console.error("截图尺寸2", blob);
+        } else {
+          alert("暂未获取到平面图,请前往三维场景制作并保存");
+        }
+      } else {
         const result = await typeMap.sdk.Camera.screenshot(
           [{ width: width, height: height, name: "2k", bgOpacity: 0 }],
           false
         );
         blob = base64ToBlob(result[0].data);
-      // }
+      }
      
       break;
       break;

+ 3 - 3
vite.config.ts

@@ -51,12 +51,12 @@ export default defineConfig({
     host: "0.0.0.0",
     proxy: {
       "/api": {
-        target: dev ? "http://192.168.0.25" : "mix3d.4dkankan.com",
+        target: dev ? "http://192.168.0.55:8808" : "mix3d.4dkankan.com",
         changeOrigin: true,
         rewrite: (path) => path.replace(new RegExp(`^/api`), ""),
       },
       "/fusion": {
-        target: dev ? "http://192.168.0.25" : "mix3d.4dkankan.com",
+        target: dev ? "http://192.168.0.55:8808" : "mix3d.4dkankan.com",
         changeOrigin: true,
         rewrite: (path) => path.replace(new RegExp(`^/api`), "/fusion"),
       },
@@ -75,7 +75,7 @@ export default defineConfig({
         rewrite: (path) => path.replace(new RegExp(`^/swkk`), ""),
       },
       "/service": {
-        target: dev ? "http://192.168.0.25" : "https://www.4dkankan.com",
+        target: dev ? "http://192.168.0.55" : "https://www.4dkankan.com",
         changeOrigin: true,
       },
       "/swss": {