bill 8 달 전
부모
커밋
c2e06650f9
1개의 변경된 파일16개의 추가작업 그리고 4개의 파일을 삭제
  1. 16 4
      src/view/pano/pano.vue

+ 16 - 4
src/view/pano/pano.vue

@@ -8,7 +8,7 @@
         size="large"
         type="primary"
         style="margin-right: 20px; width: 100px"
-        @click="photo"
+        @click="photo(0)"
       >
         屏幕拍照
       </el-button>
@@ -158,22 +158,34 @@ const copyGis = async () => {
 
 let prevBigImages: string | string[];
 let prevBigTexs: Texture[];
-const photo = async () => {
+const photo = async (ndx = 0) => {
   loading.value = true;
   const bigImages = getPointPano(
     point.value,
     // [SceneType.CLUNT, SceneType.MESH].includes(point.value.sceneType),
-    true,
+    ndx === 0,
     false
   );
   if (
     inRevise(panoUrls.value, bigImages) &&
     (!prevBigTexs || inRevise(prevBigImages, bigImages))
   ) {
+    let cBigTexs;
+    try {
+      cBigTexs = await pano.getTexs(bigImages);
+    } catch {
+      if (ndx === 0) {
+        return await photo(++ndx);
+      } else {
+        ElMessage.error("下载失败,资源不存在");
+        return;
+      }
+    }
+
     if (prevBigTexs) {
       prevBigTexs.forEach((tex) => tex.dispose());
     }
-    prevBigTexs = await pano.getTexs(bigImages);
+    prevBigTexs = cBigTexs;
     prevBigImages = bigImages;
     pano.changeEnv(prevBigTexs);
     pano.redraw();