1
0
tangning 5 mesiacov pred
rodič
commit
0668b47363
1 zmenil súbory, kde vykonal 21 pridanie a 18 odobranie
  1. 21 18
      src/view/case/help.ts

+ 21 - 18
src/view/case/help.ts

@@ -198,25 +198,28 @@ export const getFuseImage = async (
       break;
     case FuseImageType.KANKAN:
       console.error("截图尺寸", width, height);
-      if(typeMap.sdk.store?.getValue('metadata')?.floorPlanUser) {
-        let num = typeMap.sdk.store?.getValue('metadata').num
-        newUrl = `/oss/scene_view_data/${num}/user/cad-style-3-${typeMap.sdk.Scene.floorId}.jpg`
-       // /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);
+      if(typeMap.sdk.Camera.mode == 'floorplan') {//判断户型图模式是否为平面图模式,如果是则获取平面图的截图进行裁剪处理
+        if(typeMap.sdk.store?.getValue('metadata')?.floorPlanUser) {
+          let num = typeMap.sdk.store?.getValue('metadata').num
+          newUrl = `/oss/scene_view_data/${num}/user/cad-style-3-${typeMap.sdk.Scene.floorId}.jpg`
+         // /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 {
-        alert("暂未获取到平面图,请前往三维场景制作");
-        // const result = await typeMap.sdk.Camera.screenshot(
-        //   [{ width: width, height: height, name: "2k", bgOpacity: 0 }],
-        //   false
-        // );
-        // blob = base64ToBlob(result[0].data);
+        const result = await typeMap.sdk.Camera.screenshot(
+          [{ width: width, height: height, name: "2k", bgOpacity: 0 }],
+          false
+        );
+        blob = base64ToBlob(result[0].data);
       }
      
       break;