tangning hai 5 meses
pai
achega
9936e2c25e
Modificáronse 2 ficheiros con 5 adicións e 4 borrados
  1. 2 2
      src/util/index.ts
  2. 3 2
      src/view/case/help.ts

+ 2 - 2
src/util/index.ts

@@ -219,13 +219,13 @@ export const urlToBlob = async (url: string) => {
     const blob = await response.blob(); // 转成 blob
     console.log('urlToBlob', blob);
     if(blob.type == 'text/html'){
-      throw "暂未获取到平面图,请前往三维场景制作";
+      throw "暂未获取到平面图,请前往三维场景制作并保存";
       return
     }
     return blob;
   } catch (error) {
     // 请求出错,说明图片不存在
-    alert("暂未获取到平面图,请前往三维场景制作");
+    alert("暂未获取到平面图,请前往三维场景制作并保存");
   }
 }
 export const base64ToBlob = (base64Data: string) => {

+ 3 - 2
src/view/case/help.ts

@@ -201,7 +201,8 @@ export const getFuseImage = async (
       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`
+          let floorId = typeMap.sdk.core.get('Player').model.currentFloor.floorIndex
+          newUrl = `/oss/scene_view_data/${num}/user/cad-style-3-${floorId}.jpg?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'){
@@ -212,7 +213,7 @@ export const getFuseImage = async (
          }
          console.error("截图尺寸2", blob);
         } else {
-          alert("暂未获取到平面图,请前往三维场景制作");
+          alert("暂未获取到平面图,请前往三维场景制作并保存");
         }
       } else {
         const result = await typeMap.sdk.Camera.screenshot(