Bläddra i källkod

实现点击播放条的封面一镜到底

onecold 9 månader sedan
förälder
incheckning
de2759fbad
1 ändrade filer med 6 tillägg och 11 borttagningar
  1. 6 11
      entry/src/main/ets/view/LocalMusic.ets

+ 6 - 11
entry/src/main/ets/view/LocalMusic.ets

@@ -1384,7 +1384,7 @@ export struct LocalMusic {
       }
       if(openItem){
         this.doPlay(openItem,0,false,true)
-        this.isShowPlay = true
+        this.setShowPlayPage()
       }
 
     }
@@ -3854,7 +3854,7 @@ export struct LocalMusic {
                 this.handleFileSelection(item, !isChecked);
               } else {
                 this.doPlay(item,index)
-                this.setShowPLayTrue()
+                this.setShowPlayPage()
 
               }
             })
@@ -6132,7 +6132,7 @@ export struct LocalMusic {
     .bindContentCover($$this.isShowPlay, this.MusicPlayBuilder(), {
       modalTransition: ModalTransition.NONE,
       onWillDisappear: () => {
-        this.isShowPlay = false
+        this.setShowPlayPage()
       },
       // backgroundColor: 'rgba(0, 0, 0, 0.9)',
     })
@@ -6218,7 +6218,7 @@ export struct LocalMusic {
     })
   }
 
-  setShowPLayTrue(){
+  setShowPlayPage(){
     this.getUIContext()?.animateTo({
       duration: 500,
       curve: Curve.Friction
@@ -6231,7 +6231,7 @@ export struct LocalMusic {
   showPlayerView() {
 
     if (ArrayUtil.isNotEmpty(this.songList)) {
-      this.setShowPLayTrue()
+      this.setShowPlayPage()
       let lyricPath = this.videoUrl.substring(0, this.videoUrl.lastIndexOf('.')) + '.lrc';
       this.initLyric(lyricPath);
       this.startAutoHide();
@@ -10010,12 +10010,7 @@ export struct LocalMusic {
       .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
       .visibility(this.isHide ? Visibility.Hidden : Visibility.Visible)
       .onClick(() => {
-        this.getUIContext()?.animateTo({
-          duration: 350,
-          curve: Curve.Friction
-        }, () => {
-          this.isShowPlay = !this.isShowPlay;
-        });
+        this.setShowPlayPage()
 
       })