فهرست منبع

feat(live): download

gemercheung 3 سال پیش
والد
کامیت
0b8da321d4
3فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 2 0
      src/api/scene/model.ts
  2. 4 0
      src/views/scenes/downloadModal.vue
  3. 1 1
      src/views/scenes/list.vue

+ 2 - 0
src/api/scene/model.ts

@@ -53,6 +53,8 @@ export interface SceneLiveItem {
 
 export interface SceneProccessItem {
   precent?: number;
+  status?: number;
+  url?: string;
 }
 
 /**

+ 4 - 0
src/views/scenes/downloadModal.vue

@@ -106,6 +106,10 @@
           console.log('res', res);
           const percent = res.percent;
           downloadInfo.process = percent;
+          if (res.status === 1002) {
+            cancelDownload();
+            downloadInfo.status = '已完成';
+          }
         }, 2000);
       }
       function cancelDownload() {

+ 1 - 1
src/views/scenes/list.vue

@@ -199,7 +199,7 @@
 
       async function handleDownloadScene(record: Recordable) {
         await downloadSceneDataAPi({
-          sceneNum: record.sceneName,
+          sceneNum: record.num,
         });
         await openDownloadModal(true, record);
       }