浏览代码

修复回放样式问题

黄琪勇 11 月之前
父节点
当前提交
7ce679cd2b

+ 1 - 0
src/page-instrument/view-evaluat-report/component/share-top/index.module.less

@@ -340,6 +340,7 @@
         position: relative;
         border-radius: 16px;
         box-shadow: 4px -3px 6px 0px #B2E8FF;
+        overflow: hidden;
 
         .audioBga {
             width: 100%;

+ 6 - 6
src/page-instrument/view-evaluat-report/component/share-top/index.tsx

@@ -98,15 +98,15 @@ export default defineComponent({
 						const canvasDom = document.querySelector("#audioVisualizer") as HTMLCanvasElement
 						const { pauseVisualDraw, playVisualDraw } = audioVisualDraw(audioDom, canvasDom)
 						shareData._plrl.on('play', () => {
-							lottieDom.value.play()
-							lottieDom1.value.play()
-							lottieDom2.value.play()
+							lottieDom.value?.play()
+							lottieDom1.value?.play()
+							lottieDom2.value?.play()
 							playVisualDraw()
 						});
 						shareData._plrl.on('pause', () => {
-							lottieDom.value.pause()
-							lottieDom1.value.pause()
-							lottieDom2.value.pause()
+							lottieDom.value?.pause()
+							lottieDom1.value?.pause()
+							lottieDom2.value?.pause()
 							pauseVisualDraw()
 						});
 					}, 300); // 弹窗动画是0.25秒 这里用定时器 确保canvas 能获取到宽高