Prechádzať zdrojové kódy

Merge branch 'master' into lhd

natasha 3 týždňov pred
rodič
commit
89b5b2b037

+ 4 - 5
src/views/book/courseware/preview/components/picture/PicturePreview.vue

@@ -81,7 +81,6 @@ export default {
         this.fileLen = val.file_list.length;
         if (this.fileLen > 0 && this.data.property.view_method === 'list') {
           const ele = this.$refs.pictureAreaBox;
-
           const sn_position = this.data.property.sn_position;
           const viewMemo = this.isEnable(this.data.property.view_memo);
           // 序号在左和右补齐序号高度,去掉padding(8*2)
@@ -92,6 +91,10 @@ export default {
             this.elementWidth = viewMemo ? ele.clientWidth * 0.8 : ele.clientWidth;
             this.elementHeight = ele.clientHeight;
           }
+          // 统一图片播放模式位置调整和预览初始高度
+          if (ele.clientHeight <= 0) {
+            this.elementHeight = this.data.min_height - 60;
+          }
 
           const mainEle = this.$refs.pictureArea;
           // 检查元素是否包含已知的类名
@@ -151,7 +154,6 @@ export default {
             }
           });
         }
-
         // 防抖:100ms 后恢复监听
         setTimeout(() => {
           this.isResizing = false;
@@ -161,9 +163,6 @@ export default {
     });
   },
   beforeDestroy() {
-    // Object.values(this.pictureObserversMap).forEach((observer) => {
-    //   observer.disconnect();
-    // });
     if (this.resizeObserver) {
       this.resizeObserver.disconnect();
     }