Przeglądaj źródła

list和button的按钮的按下效果
手机横屏播放界面的播放进度条可以自动隐藏

onecold 1 rok temu
rodzic
commit
7fc70899bd

+ 2 - 2
build-profile.json5

@@ -29,11 +29,11 @@
         "material": {
           "certpath": "C:\\Users\\xjy08\\.ohos\\config\\default_com.xgplayer.ttmusic.hm4_li00v0NJ2KHEZXa_MEhSBo4Q7SMa2KHpzKM8lnBZT1Y=.cer",
           "keyAlias": "debugKey",
-          "keyPassword": "0000001BE60CC62B8E573007038FACF6CFC47BFE4E4E984B54575F173B76B39D947CAD63C9FFE3D521CFDE",
+          "keyPassword": "0000001BE5088F74CCC800C1F2CEF5DCD982AE7AE7984831337F9CCCD8C734599789743D89FBC29546E9C4",
           "profile": "C:\\Users\\xjy08\\.ohos\\config\\default_com.xgplayer.ttmusic.hm4_li00v0NJ2KHEZXa_MEhSBo4Q7SMa2KHpzKM8lnBZT1Y=.p7b",
           "signAlg": "SHA256withECDSA",
           "storeFile": "C:\\Users\\xjy08\\.ohos\\config\\default_com.xgplayer.ttmusic.hm4_li00v0NJ2KHEZXa_MEhSBo4Q7SMa2KHpzKM8lnBZT1Y=.p12",
-          "storePassword": "0000001BD9A69C06F9FF60724E3E60B60A59A39DA090E83D4DDBCA419D296CBAB038F8AC930C36C897090C"
+          "storePassword": "0000001B6689846EA200E031FA14C8A95794CD40A51EBADEBA5B3617F62716BC770CDBA0118C8A2AAE8857"
         }
       }
     ]

+ 24 - 22
entry/src/main/ets/pages/NewIndex.ets

@@ -286,29 +286,31 @@ async aboutToAppear() {
     List({space: 0, scroller: this.scroller}){
       ForEach(this.isShowSponsorship?mainViewModel.getDrawerData2():mainViewModel.getDrawerData(),(item: ItemData)=>{
         ListItem(){
-          Row() {
-            // 菜单图标
-            Image(item.img)
-              .height(22)
-              .alignSelf(ItemAlign.Center)
-              .margin({ left: 2 })
-            // 菜单标题
-            Text(item.title)
-              .margin({ left: 10, right: 20 })
-              .fontSize(15)
-              .fontColor($r('app.color.index_tab_font_color'))
-              .fontWeight(480)
-            Blank()
-            // 右侧箭头
-            Image($r('app.media.arrow_right'))
-              .width(22)
-              .height(22)
-              .margin({ left: 20, right: 0 })
-              .align(Alignment.Center)
+          Button({ type: ButtonType.Normal, stateEffect: true }) {
+            Row() {
+              // 菜单图标
+              Image(item.img)
+                .height(22)
+                .alignSelf(ItemAlign.Center)
+                .margin({ left: 2 })
+              // 菜单标题
+              Text(item.title)
+                .margin({ left: 10, right: 20 })
+                .fontSize(15)
+                .fontColor($r('app.color.index_tab_font_color'))
+                .fontWeight(480)
+              Blank()
+              // 右侧箭头
+              Image($r('app.media.arrow_right'))
+                .width(22)
+                .height(22)
+                .margin({ left: 20, right: 0 })
+                .align(Alignment.Center)
+            }
+            .width('100%')
+            .height(55)
           }
-          .width('100%')
-          .height(55)
-          .useEffect(true)
+          .backgroundColor(Color.Transparent)
           .onClick(async () => {
             // 根据 item.id 跳转或切换功能
             switch (item.id) {

+ 424 - 359
entry/src/main/ets/view/LocalMusic.ets

@@ -86,6 +86,7 @@ import { HSBColorPicker, HSBColorPickerLayout } from '@keke/color-picker'
 import { DEBUG } from 'BuildProfile';
 import { LrcParser } from '@sgaolei/lrc_parser';
 import app, { AppResponse } from '@system.app';
+import { Log } from '@tencent/wechat_open_sdk';
 
 const TAG = 'LocalMusic';
 
@@ -453,6 +454,24 @@ export struct LocalMusic {
     this.themeMode = PreferencesUtil.getNumberSync(SettingPage.THEME_MODE, 0)
     this.applyThemeMode(this.themeMode)
 
+    this.windowClass.on('windowSizeChange', (size) => {
+      LogUtil.info('onecold  windowSizeChange')
+      if(!this.isPhoneLan()){
+        LogUtil.info('onecold  windowSizeChange11')
+        this.startAutoHide()
+      }else{
+        LogUtil.info('onecold  windowSizeChange13')
+        this.isAutoHide = false
+      }
+
+    });
+
+  }
+
+  startAutoHide(){
+    setTimeout(() => {
+      this.isAutoHide = true
+    }, 4000)
   }
 
   applyThemeMode(mode: number) {
@@ -2893,7 +2912,7 @@ export struct LocalMusic {
     .layoutWeight(1)
     .scrollBar(BarState.Off)
     .supportAnimation(true)
-    // .cachedCount(5)
+    .cachedCount(10)
     .columnsTemplate('1fr '.repeat(this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_SM ? 2 : 4))
     .rowsGap(12)
     .visibility(this.isGridMusic?Visibility.Visible:Visibility.None)
@@ -4820,7 +4839,12 @@ export struct LocalMusic {
     })
     .backgroundBlurStyle(this.isPuraWP()&&this.currentSwiperIndex===0?BlurStyle.NONE:BlurStyle.BACKGROUND_ULTRA_THICK)
     .hitTestBehavior(HitTestMode.Transparent)
+    .backgroundBrightness({rate:this.isPuraWP()?0.1:0,lightUpDegree:-0.1})
     .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
+    .onClick( ()=>{
+      this.isAutoHide = false
+      this.startAutoHide()
+    })
   }
 
   @State progressValue: number = 0;
@@ -5446,10 +5470,12 @@ export struct LocalMusic {
           seekLineColor: "#80ffffff", // 滑动定位线颜色
           seekUIStyle: "listItem", // 滑动定位样式(seekLine传统样式,listItem类似抖音汽水音乐样式)
           onSeekAction: (position: number) => { // 滑动歌词触发seek定位回调
+            if(!this.isPlaying){
+              this.startPlayOrResumePlay()
+            }
             this.isSeekTo = true;
             this.mDestroyPage = false;
             this.showLoadIng();
-            // LogUtils.getInstance().LOGI("onecold-->seekValue start:" + position);
             this.seekTo(position + "");
             this.isSeekTo = false;
             return true
@@ -5480,76 +5506,95 @@ export struct LocalMusic {
         Row({ space: 33 }) {
 
 
-          //更多功能
-          Image($r('app.media.menu'))
-            .width(24)
-            .bindSheet($$this.isShowMoreView, this.PlayMoreSheet(), {
-              height: this.isCoverOpacity() ? '95%' : '93%',
-              preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
-              dragBar: true,
-              showClose: true,
-              blurStyle: BlurStyle.Thin,
-              backgroundColor: Color.Transparent,
-            })
-            .onClick(() => {
-              this.isShowMoreView = !this.isShowMoreView;
-            })
-
-          Image($r('app.media.ic_previous'))
-            .width(33)
-
-            .aspectRatio(CommonConstants.ASPECT_RATIO)
-            .onClick(async () => {
+          Button({type:ButtonType.Circle,stateEffect:true}){
+            //更多功能
+            Image($r('app.media.menu'))
+              .width(24)
+              .bindSheet($$this.isShowMoreView, this.PlayMoreSheet(), {
+                height: this.isCoverOpacity() ? '95%' : '93%',
+                preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
+                dragBar: true,
+                showClose: true,
+                blurStyle: BlurStyle.Thin,
+                backgroundColor: Color.Transparent,
+              })
+          }
+          .backgroundColor(Color.Transparent)
+          .onClick(() => {
+            this.isShowMoreView = !this.isShowMoreView;
+          })
 
-              this.playPrevious()
+          Button({type:ButtonType.Circle,stateEffect:true}){
+            Image($r('app.media.ic_previous'))
+              .width(33)
+              .aspectRatio(CommonConstants.ASPECT_RATIO)
+              .onClick(async () => {
+                this.playPrevious()
+              })
+          }
+          .backgroundColor(Color.Transparent)
 
-            })
         }
         .margin({ left: 33 })
 
-        Column() {
-          Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ?
-          $r('app.media.ic_public_play') : $r('app.media.ic_public_pause'))
-            .width(this.isPhoneLan()?48:60)
-            .aspectRatio(CommonConstants.ASPECT_RATIO)
-            .onClick(async () => {
-              this.playOrPause()
+        Button({type:ButtonType.Circle,stateEffect:true}){
+          Column() {
+            Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ?
+            $r('app.media.ic_public_play') : $r('app.media.ic_public_pause'))
+              .width(this.isPhoneLan()?48:60)
+              .aspectRatio(CommonConstants.ASPECT_RATIO)
+              .onClick(async () => {
+                this.playOrPause()
 
 
-            })
+              })
+          }
+
         }
+        .backgroundColor(Color.Transparent)
         .layoutWeight(1)
-        .margin({ left: 20, right: 20 })
+        .margin({ left: 33, right: 33 })
+
 
         Row({ space: 33 }) {
-          Image($r('app.media.ic_next'))
-            .width(33)
-            .aspectRatio(CommonConstants.ASPECT_RATIO)
-            .onClick(() => {
+          Button({ type: ButtonType.Capsule, stateEffect: true }) {
+            Image($r('app.media.ic_next'))
+              .width(33)
+              .aspectRatio(CommonConstants.ASPECT_RATIO)
+              .onClick(() => {
 
-              this.playNext();
+                this.playNext();
+
+              })
+          }
+          .backgroundColor(Color.Transparent)
+          .width(33)
+
+          Button({type:ButtonType.Circle,stateEffect:true}){
+            //添加或取消收藏
+            Image(Utility.getIsFav(this.favList,this.currentSong)?
+            $r('app.media.add_fac_light'):$r('app.media.add_fac'))
+              .width(24)
+              .aspectRatio(CommonConstants.ASPECT_RATIO)
+              .onClick(async () => {
+                if(this.currentSong){
+                  this.doFav(this.currentSong)
+                }
+              })
+          }
+          .backgroundColor(Color.Transparent)
+          .width(24)
 
-            })
-          //添加或取消收藏
-          Image(Utility.getIsFav(this.favList,this.currentSong)?$r('app.media.add_fac_light'):$r('app.media.add_fac'))
-            .width(24)
-            .aspectRatio(CommonConstants.ASPECT_RATIO)
-            .onClick(async () => {
-              if(this.currentSong){
-                this.doFav(this.currentSong)
-              }
-            })
         }
         .margin({ right: 33 })
 
       }
       .width('100%')
       .margin(10)
-
+      .justifyContent(FlexAlign.Center)
       //播放进度条
       this.playProgressView()
 
-      // .visibility(this.isHide?Visibility.Hidden:Visibility.Visible)
 
     }
     .position({ bottom:this.isCoverOpacity()?55: 80 }) // 将  固定在底部
@@ -5560,30 +5605,29 @@ export struct LocalMusic {
   @Builder
   playProgressView(){
     Row() {
-
-      Column() {
-        if (this.playType === 0) {
-          Image($r('app.media.loop'))
-            .width($r('app.float.control_image_width'))
-            .margin(10)
-            .aspectRatio(CommonConstants.ASPECT_RATIO)
-        } else if (this.playType === 1) {
-          Image($r('app.media.single'))
-            .width($r('app.float.control_image_width'))
-            .margin(10)
-            .aspectRatio(CommonConstants.ASPECT_RATIO)
-        } else if (this.playType === 2) {
-          Image($r('app.media.normal_play'))
-            .width($r('app.float.control_image_width'))
-            .margin(10)
-            .aspectRatio(CommonConstants.ASPECT_RATIO)
-        } else if (this.playType === 3) {
-          Image($r('app.media.random'))
-            .width($r('app.float.control_image_width'))
-            .margin(10)
-            .aspectRatio(CommonConstants.ASPECT_RATIO)
+      Button({type:ButtonType.Circle,stateEffect:true}){
+        Column() {
+          if (this.playType === 0) {
+            Image($r('app.media.loop'))
+              .width($r('app.float.control_image_width'))
+              .aspectRatio(CommonConstants.ASPECT_RATIO)
+          } else if (this.playType === 1) {
+            Image($r('app.media.single'))
+              .width($r('app.float.control_image_width'))
+              .aspectRatio(CommonConstants.ASPECT_RATIO)
+          } else if (this.playType === 2) {
+            Image($r('app.media.normal_play'))
+              .width($r('app.float.control_image_width'))
+              .aspectRatio(CommonConstants.ASPECT_RATIO)
+          } else if (this.playType === 3) {
+            Image($r('app.media.random'))
+              .width($r('app.float.control_image_width'))
+              .aspectRatio(CommonConstants.ASPECT_RATIO)
+          }
         }
       }
+      .backgroundColor(Color.Transparent)
+      .margin({ left:10,right:10 })
       .onClick(async () => {
         this.setLoopMode()
 
@@ -5633,22 +5677,26 @@ export struct LocalMusic {
 
 
       //播放列表
-      Image($r('app.media.playlist'))
-        .width($r('app.float.control_image_width'))
+      Button({type:ButtonType.Circle,stateEffect:true}){
+        Image($r('app.media.playlist'))
+          .width($r('app.float.control_image_width'))
+
+          .aspectRatio(CommonConstants.ASPECT_RATIO)
+          .bindSheet($$this.isShowSheetView, this.PlayListSheet(), {
+            height: '95%',
+            dragBar: true,
+            showClose: true,
+            preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
+            blurStyle: BlurStyle.Thin,
+            backgroundColor: Color.Transparent,
+            title: {
+              title: Utility.resourceToString(this.context, $r('app.string.current_play_list'))
+                + `(${this.songList.length}首)`
+            }
+          })
+      }
+        .backgroundColor(Color.Transparent)
         .margin({ right: 10, left: 20 })
-        .aspectRatio(CommonConstants.ASPECT_RATIO)
-        .bindSheet($$this.isShowSheetView, this.PlayListSheet(), {
-          height: '95%',
-          dragBar: true,
-          showClose: true,
-          preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
-          blurStyle: BlurStyle.Thin,
-          backgroundColor: Color.Transparent,
-          title: {
-            title: Utility.resourceToString(this.context, $r('app.string.current_play_list'))
-              + `(${this.songList.length}首)`
-          }
-        })
         .onClick(() => {
           this.isShowSheetView = !this.isShowSheetView;
           this.isFrontWhite = true
@@ -5656,9 +5704,14 @@ export struct LocalMusic {
 
     }
     .width(PlayConstants.PROGRESS_ROW_WIDTH)
-    .visibility(this.isPhoneLan()?Visibility.None:Visibility.Visible)
+    .height(this.isPhoneLan()?25:33)
+    .visibility(this.isPhoneLan()&&this.isAutoHide?Visibility.None:Visibility.Visible)
+    .animation({
+      duration: 666,
+      curve: 'ease-in-out' // 可选动画曲线
+    })
   }
-
+  @State isAutoHide: boolean = true//手机横屏自动隐藏播放进退条,点击屏幕可以显示,倒计时4秒后又自动隐藏
   @State isCoverRectangle: boolean = false
 
   @Builder
@@ -5756,7 +5809,7 @@ export struct LocalMusic {
       }
 
       .margin({
-        bottom: this.isCoverOpacity() || this.isCoverRectangle ? 110 : 0,
+        bottom: this.isCoverOpacity() || this.isCoverRectangle ? 120 : 0,
         top: this.isCoverOpacity() ? 0 : this.isCoverRectangle ? 40 : 30
       })
 
@@ -5893,11 +5946,11 @@ export struct LocalMusic {
               .width(60)
               .height(28)
               .fontSize(12)
-              .fontColor(this.currentLyricAlignMode === index ? '#FFFFFF' : '#007DFF')
-              .backgroundColor(this.currentLyricAlignMode === index ? '#007DFF' : '#FFFFFF')
+              .fontColor('#FFFFFF')
+              .backgroundColor(this.currentLyricAlignMode === index ? $r('app.color.title_bar_bg') :Color.Transparent)
               .border({
                 color: this.currentLyricAlignMode === index ? '#007DFF' : '#DDDDDD',
-                width: 1
+                width: 1.8
               })
               .onClick(() => {
                 this.setLyricAlignMode(index)
@@ -6498,284 +6551,287 @@ export struct LocalMusic {
       Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start }) {
 
         ForEach(this.moreItems, (more: MoreItem) => {
-          Row() {
-            if (more.id === 3) {
-              Image(more.image)
-                .width(24)
-                .height(24)
-                .margin({ left: 10, right: 10 })
-                .onClick(() => {
-                  this.isShowDetailMore = !this.isShowDetailMore;
-                })
-              Text(more.title)
-                .fontSize(16)
-                .fontColor(Color.White)
-                .onClick(() => {
-                  this.doMore(more.id)
-                })
-                .bindSheet($$this.isShowDetailMore, this.detailSheet(), {
-                  height: this.isCoverOpacity() ? '95%' : '65%',
-                  dragBar: true,
-                  preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
-                  showClose: true,
-                  blurStyle: BlurStyle.Thin,
-                  backgroundColor: Color.Transparent,
-                  title: { title: '歌曲信息' }
-                })
-                .onClick(() => {
-                  this.isShowDetailMore = !this.isShowDetailMore;
-                })
-            } else if (more.id === 15&&this.currentSong) { //编辑信息
-              Image(more.image)
-                .width(24)
-                .height(24)
-                .margin({ left: 10, right: 10 })
-                .onClick(() => {
-                  this.isShowEdit = !this.isShowEdit;
-                })
-              Text(more.title)
-                .fontSize(16)
-                .fontColor(Color.White)
-                .bindSheet($$this.isShowEdit, this.editSheet(this.currentSong), {
-                  height: this.isCoverOpacity() ? '95%' : '93%',
-                  dragBar: true,
-                  showClose: true,
-                  preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
-                  // blurStyle:BlurStyle.Thin,
-                  // backgroundColor:Color.Transparent,
-                  title: { title: '编辑信息' }
-                })
-                .onClick(() => {
-                  this.isShowEdit = !this.isShowEdit;
-                })
-            } else if (more.id === 5) { //定时关闭
-              Image(more.image)
-                .width(24)
-                .height(24)
-                .margin({ left: 10, right: 10 })
-                .onClick(() => {
-                  this.isShowTimeCloseMore = !this.isShowTimeCloseMore;
-                })
-              Text(more.title)
-                .fontSize(16)
-                .fontColor(Color.White)
-                .onClick(() => {
-                  this.doMore(more.id)
-                })
-                .bindSheet($$this.isShowTimeCloseMore, this.TimeCloseSheet(), {
-                  height: this.isCoverOpacity() ? '95%' : '78%',
-                  preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
-                  dragBar: true,
-                  showClose: true,
-                  title: { title: $r('app.string.time_close') }
-                })
-                .onClick(() => {
-                  this.isShowTimeCloseMore = !this.isShowTimeCloseMore;
-                })
-            } else if (more.id === 2) { //歌词设置
-              Image(more.image)
-                .width(24)
-                .height(24)
-                .margin({ left: 10, right: 10 })
-                .onClick(() => {
-                  this.isLyricSetting = !this.isLyricSetting;
-                  this.isShowMoreView = false
-                })
-              Text(more.title)
-                .fontSize(16)
-                .fontColor(Color.White)
-                .onClick(() => {
-                  this.isLyricSetting = !this.isLyricSetting;
-                  this.isShowMoreView = false
-                })
-            } else if (more.id === 11) { //跳过头尾
-              Image(more.image)
-                .width(24)
-                .height(24)
-                .margin({ left: 10, right: 10 })
-                .onClick(() => {
-                  this.isJumpSetting = !this.isJumpSetting;
-                })
-              Text(more.title)
-                .fontSize(16)
-                .fontColor(Color.White)
-                .bindSheet($$this.isJumpSetting, this.JumpTopEndSheet(), {
-                  height: this.isCoverOpacity() ? '95%' : '60%',
-                  dragBar: true,
-                  preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
-                  showClose: true,
-                  blurStyle: BlurStyle.Thin,
-                  backgroundColor: Color.Transparent,
-                  title: { title: '跳过头尾' }
-                })
-                .onClick(() => {
-                  this.isJumpSetting = !this.isJumpSetting;
-                })
-            } else if (more.id === 12) { //投播
-              AVCastPicker({
-                customPicker: (): void => this.TPImageBuilder(more),
-                onStateChange: (state) => {
-                  if (state == AVCastPickerState.STATE_APPEARING) {
-                    console.log(' The picker starts showing.');
-                  } else if (state == AVCastPickerState.STATE_DISAPPEARING) {
-                    console.log(' The picker finishes presenting.');
-                  }
-                },
-                pickerStyle: AVCastPickerStyle.STYLE_PANEL,
-                sessionType: 'video'
-              })
-                .id('AVCastPicker')
-                .width(46)
-            } else {
-              Image(more.image)
-                .width(24)
-                .height(24)
-                .margin({ left: 10, right: 10 })
-                .onClick(() => {
-
-                  this.doMore(more.id)
-                })
-              Text(more.title)
-                .fontSize(16)
-
-                .fontColor(Color.White)
-                .onClick(() => {
-                  this.doMore(more.id)
-                })
-              Select([//倍速
-                { value: '0.25x' },
-                { value: '0.5x' },
-                { value: '0.75x' },
-                { value: '1x' },
-                { value: '1.25x' },
-                { value: '1.5x' },
-                { value: '1.75x' },
-                { value: '2x' },
-                { value: '3x' }])
-                .font({ size: 16, weight: FontWeight.Medium })
-                .fontColor($r('sys.color.white'))
-                .margin({ left: 25 })
-                .visibility(more.id === 1 ? Visibility.Visible : Visibility.None)
-                .selected(CommonConstants.video_speed_list.indexOf(this.playSpeed))
-                .value(Utility.optimizedFormat(this.playSpeed))
-                .onSelect(async (_index: number, text?: string | undefined) => {
-                  let speed = parseFloat(text?.replace('x', '') || '1');
-                  if (!CommonConstants.video_speed_list.includes(speed)) {
-                    speed = 1;
-                  }
-                  this.playSpeed = speed
-                  this.mIjkMediaPlayer.setSpeed(this.playSpeed + 'f');
+          Button({ type: ButtonType.Capsule, stateEffect: true }) {
+            Row() {
+              if (more.id === 3) {
+                Image(more.image)
+                  .width(24)
+                  .height(24)
+                  .margin({ left: 10, right: 10 })
+                  .onClick(() => {
+                    this.isShowDetailMore = !this.isShowDetailMore;
+                  })
+                Text(more.title)
+                  .fontSize(16)
+                  .fontColor(Color.White)
+                  .onClick(() => {
+                    this.doMore(more.id)
+                  })
+                  .bindSheet($$this.isShowDetailMore, this.detailSheet(), {
+                    height: this.isCoverOpacity() ? '95%' : '65%',
+                    dragBar: true,
+                    preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
+                    showClose: true,
+                    blurStyle: BlurStyle.Thin,
+                    backgroundColor: Color.Transparent,
+                    title: { title: '歌曲信息' }
+                  })
+                  .onClick(() => {
+                    this.isShowDetailMore = !this.isShowDetailMore;
+                  })
+              } else if (more.id === 15&&this.currentSong) { //编辑信息
+                Image(more.image)
+                  .width(24)
+                  .height(24)
+                  .margin({ left: 10, right: 10 })
+                  .onClick(() => {
+                    this.isShowEdit = !this.isShowEdit;
+                  })
+                Text(more.title)
+                  .fontSize(16)
+                  .fontColor(Color.White)
+                  .bindSheet($$this.isShowEdit, this.editSheet(this.currentSong), {
+                    height: this.isCoverOpacity() ? '95%' : '93%',
+                    dragBar: true,
+                    showClose: true,
+                    preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
+                    // blurStyle:BlurStyle.Thin,
+                    // backgroundColor:Color.Transparent,
+                    title: { title: '编辑信息' }
+                  })
+                  .onClick(() => {
+                    this.isShowEdit = !this.isShowEdit;
+                  })
+              } else if (more.id === 5) { //定时关闭
+                Image(more.image)
+                  .width(24)
+                  .height(24)
+                  .margin({ left: 10, right: 10 })
+                  .onClick(() => {
+                    this.isShowTimeCloseMore = !this.isShowTimeCloseMore;
+                  })
+                Text(more.title)
+                  .fontSize(16)
+                  .fontColor(Color.White)
+                  .onClick(() => {
+                    this.doMore(more.id)
+                  })
+                  .bindSheet($$this.isShowTimeCloseMore, this.TimeCloseSheet(), {
+                    height: this.isCoverOpacity() ? '95%' : '78%',
+                    preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
+                    dragBar: true,
+                    showClose: true,
+                    title: { title: $r('app.string.time_close') }
+                  })
+                  .onClick(() => {
+                    this.isShowTimeCloseMore = !this.isShowTimeCloseMore;
+                  })
+              } else if (more.id === 2) { //歌词设置
+                Image(more.image)
+                  .width(24)
+                  .height(24)
+                  .margin({ left: 10, right: 10 })
+                  .onClick(() => {
+                    this.isLyricSetting = !this.isLyricSetting;
+                    this.isShowMoreView = false
+                  })
+                Text(more.title)
+                  .fontSize(16)
+                  .fontColor(Color.White)
+                  .onClick(() => {
+                    this.isLyricSetting = !this.isLyricSetting;
+                    this.isShowMoreView = false
+                  })
+              } else if (more.id === 11) { //跳过头尾
+                Image(more.image)
+                  .width(24)
+                  .height(24)
+                  .margin({ left: 10, right: 10 })
+                  .onClick(() => {
+                    this.isJumpSetting = !this.isJumpSetting;
+                  })
+                Text(more.title)
+                  .fontSize(16)
+                  .fontColor(Color.White)
+                  .bindSheet($$this.isJumpSetting, this.JumpTopEndSheet(), {
+                    height: this.isCoverOpacity() ? '95%' : '60%',
+                    dragBar: true,
+                    preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
+                    showClose: true,
+                    blurStyle: BlurStyle.Thin,
+                    backgroundColor: Color.Transparent,
+                    title: { title: '跳过头尾' }
+                  })
+                  .onClick(() => {
+                    this.isJumpSetting = !this.isJumpSetting;
+                  })
+              } else if (more.id === 12) { //投播
+                AVCastPicker({
+                  customPicker: (): void => this.TPImageBuilder(more),
+                  onStateChange: (state) => {
+                    if (state == AVCastPickerState.STATE_APPEARING) {
+                      console.log(' The picker starts showing.');
+                    } else if (state == AVCastPickerState.STATE_DISAPPEARING) {
+                      console.log(' The picker finishes presenting.');
+                    }
+                  },
+                  pickerStyle: AVCastPickerStyle.STYLE_PANEL,
+                  sessionType: 'video'
                 })
-              Slider({
-                value: this.volume,
-                min: 0,
-                max: 1,
-                step: 0.1,
-                style: SliderStyle.OutSet
-              })
-                .margin({ left: 18, right: 8 })
-                .blockColor(Color.Red)
-                .trackColor($r('app.color.speed_text_color'))
-                .selectedColor(Color.White)
-                .trackThickness(9)
-                .visibility(more.id === 9 ? Visibility.Visible : Visibility.None)
-                .onChange((value: number) => {
-                  this.volume = value;
-                  this.mIjkMediaPlayer.setVolume(this.volume.toString(), this.volume.toString());
+                  .id('AVCastPicker')
+                  .width(46)
+              } else {
+                Image(more.image)
+                  .width(24)
+                  .height(24)
+                  .margin({ left: 10, right: 10 })
+                  .onClick(() => {
+
+                    this.doMore(more.id)
+                  })
+                Text(more.title)
+                  .fontSize(16)
+
+                  .fontColor(Color.White)
+                  .onClick(() => {
+                    this.doMore(more.id)
+                  })
+                Select([//倍速
+                  { value: '0.25x' },
+                  { value: '0.5x' },
+                  { value: '0.75x' },
+                  { value: '1x' },
+                  { value: '1.25x' },
+                  { value: '1.5x' },
+                  { value: '1.75x' },
+                  { value: '2x' },
+                  { value: '3x' }])
+                  .font({ size: 16, weight: FontWeight.Medium })
+                  .fontColor($r('sys.color.white'))
+                  .margin({ left: 25 })
+                  .visibility(more.id === 1 ? Visibility.Visible : Visibility.None)
+                  .selected(CommonConstants.video_speed_list.indexOf(this.playSpeed))
+                  .value(Utility.optimizedFormat(this.playSpeed))
+                  .onSelect(async (_index: number, text?: string | undefined) => {
+                    let speed = parseFloat(text?.replace('x', '') || '1');
+                    if (!CommonConstants.video_speed_list.includes(speed)) {
+                      speed = 1;
+                    }
+                    this.playSpeed = speed
+                    this.mIjkMediaPlayer.setSpeed(this.playSpeed + 'f');
+                  })
+                Slider({
+                  value: this.volume,
+                  min: 0,
+                  max: 1,
+                  step: 0.1,
+                  style: SliderStyle.OutSet
                 })
-                .layoutWeight(1)
-              Blank()
-              Toggle({ type: ToggleType.Switch, isOn: this.isMusicMemoryPlay })
-                .selectedColor($r('app.color.title_bar_bg'))
-                .switchPointColor(Color.White)
-                .margin({ right: 15 })
-                .visibility(more.id == 6 ? Visibility.Visible : Visibility.None)
-                .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
-                  if (more.id == 6) {
-                    this.isMusicMemoryPlay = checked;
-                    PreferencesUtil.put(SettingPage.iS_MUSIC_MEMORY_PLAY, this.isMusicMemoryPlay)
-                    if (this.isMusicMemoryPlay) {
-                      ToastUtil.showToast('记忆播放已开启')
-                    } else {
-                      ToastUtil.showToast('记忆播放已关闭')
+                  .margin({ left: 18, right: 8 })
+                  .blockColor(Color.Red)
+                  .trackColor($r('app.color.speed_text_color'))
+                  .selectedColor(Color.White)
+                  .trackThickness(9)
+                  .visibility(more.id === 9 ? Visibility.Visible : Visibility.None)
+                  .onChange((value: number) => {
+                    this.volume = value;
+                    this.mIjkMediaPlayer.setVolume(this.volume.toString(), this.volume.toString());
+                  })
+                  .layoutWeight(1)
+                Blank()
+                Toggle({ type: ToggleType.Switch, isOn: this.isMusicMemoryPlay })
+                  .selectedColor($r('app.color.title_bar_bg'))
+                  .switchPointColor(Color.White)
+                  .margin({ right: 15 })
+                  .visibility(more.id == 6 ? Visibility.Visible : Visibility.None)
+                  .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
+                    if (more.id == 6) {
+                      this.isMusicMemoryPlay = checked;
+                      PreferencesUtil.put(SettingPage.iS_MUSIC_MEMORY_PLAY, this.isMusicMemoryPlay)
+                      if (this.isMusicMemoryPlay) {
+                        ToastUtil.showToast('记忆播放已开启')
+                      } else {
+                        ToastUtil.showToast('记忆播放已关闭')
+                      }
                     }
-                  }
 
-                })
-                .width(48)
-                .height(24);
-              Toggle({ type: ToggleType.Switch, isOn: this.isMusicBGCover })
-                .selectedColor($r('app.color.title_bar_bg'))
-                .switchPointColor(Color.White)
-                .margin({ right: 15 })
-                .visibility(more.id == 7 ? Visibility.Visible : Visibility.None)
-                .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
-                  if (more.id == 7) {
-                    this.isMusicBGCover = checked;
-
-                    PreferencesUtil.put(SettingPage.iS_MUSIC_BG_COVER, this.isMusicBGCover)
-                    if (this.isMusicBGCover) {
-                      ToastUtil.showToast('播放背景随音乐封面已开启')
-                    } else {
-                      ToastUtil.showToast('播放背景随音乐封面已关闭')
+                  })
+                  .width(48)
+                  .height(24);
+                Toggle({ type: ToggleType.Switch, isOn: this.isMusicBGCover })
+                  .selectedColor($r('app.color.title_bar_bg'))
+                  .switchPointColor(Color.White)
+                  .margin({ right: 15 })
+                  .visibility(more.id == 7 ? Visibility.Visible : Visibility.None)
+                  .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
+                    if (more.id == 7) {
+                      this.isMusicBGCover = checked;
+
+                      PreferencesUtil.put(SettingPage.iS_MUSIC_BG_COVER, this.isMusicBGCover)
+                      if (this.isMusicBGCover) {
+                        ToastUtil.showToast('播放背景随音乐封面已开启')
+                      } else {
+                        ToastUtil.showToast('播放背景随音乐封面已关闭')
+                      }
                     }
-                  }
 
-                })
-                .width(48)
-                .height(24);
-              Toggle({ type: ToggleType.Switch, isOn: this.isSavePlayMode })
-                .selectedColor($r('app.color.title_bar_bg'))
-                .switchPointColor(Color.White)
-                .margin({ right: 15 })
-                .visibility(more.id == 8 ? Visibility.Visible : Visibility.None)
-                .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
-                  if (more.id == 8) {
-                    this.isSavePlayMode = checked;
-                    PreferencesUtil.put(SettingPage.iS_SAVE_PLAY_MODE, this.isSavePlayMode)
-                    if (this.isSavePlayMode) {
-                      ToastUtil.showToast('保存播放模式已开启')
-                    } else {
-                      ToastUtil.showToast('保存播放模式已关闭')
+                  })
+                  .width(48)
+                  .height(24);
+                Toggle({ type: ToggleType.Switch, isOn: this.isSavePlayMode })
+                  .selectedColor($r('app.color.title_bar_bg'))
+                  .switchPointColor(Color.White)
+                  .margin({ right: 15 })
+                  .visibility(more.id == 8 ? Visibility.Visible : Visibility.None)
+                  .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
+                    if (more.id == 8) {
+                      this.isSavePlayMode = checked;
+                      PreferencesUtil.put(SettingPage.iS_SAVE_PLAY_MODE, this.isSavePlayMode)
+                      if (this.isSavePlayMode) {
+                        ToastUtil.showToast('保存播放模式已开启')
+                      } else {
+                        ToastUtil.showToast('保存播放模式已关闭')
+                      }
                     }
-                  }
 
-                })
-                .width(48)
-                .height(24);
-
-              Toggle({ type: ToggleType.Switch, isOn: this.isCoverRectangle })
-                .selectedColor($r('app.color.title_bar_bg'))
-                .switchPointColor(Color.White)
-                .margin({ right: 15 })
-                .visibility(more.id == 13 ? Visibility.Visible : Visibility.None)
-                .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
-                  if (more.id == 13) {
-                    this.isCoverRectangle = checked;
-                    PreferencesUtil.put(SettingPage.IS_COVER_RECTANGLE, this.isCoverRectangle)
-                    if (this.isCoverRectangle) {
-                      ToastUtil.showToast('封面方形已开启')
-                      this.animationRoFun()
-                    } else {
-                      ToastUtil.showToast('封面圆形已开启')
-                      this.animationRoFun()
+                  })
+                  .width(48)
+                  .height(24);
+
+                Toggle({ type: ToggleType.Switch, isOn: this.isCoverRectangle })
+                  .selectedColor($r('app.color.title_bar_bg'))
+                  .switchPointColor(Color.White)
+                  .margin({ right: 15 })
+                  .visibility(more.id == 13 ? Visibility.Visible : Visibility.None)
+                  .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
+                    if (more.id == 13) {
+                      this.isCoverRectangle = checked;
+                      PreferencesUtil.put(SettingPage.IS_COVER_RECTANGLE, this.isCoverRectangle)
+                      if (this.isCoverRectangle) {
+                        ToastUtil.showToast('封面方形已开启')
+                        this.animationRoFun()
+                      } else {
+                        ToastUtil.showToast('封面圆形已开启')
+                        this.animationRoFun()
+                      }
                     }
-                  }
 
-                })
-                .width(48)
-                .height(24);
+                  })
+                  .width(48)
+                  .height(24);
 
-            }
+              }
 
 
+            }
+            .width('100%')
+            .height(45)
+            .padding(15)
+            .backgroundColor(Color.Transparent)
+            .borderRadius(12)
+            .margin({ bottom: 6 })
           }
-          .width('100%')
-          .height(45)
-          .padding(15)
-          .backgroundColor(Color.Transparent) // 选中背景高亮
-          .borderRadius(12)
-          .margin({ bottom: 6 })
+          .backgroundColor(Color.Transparent)
 
         });
       }
@@ -8260,9 +8316,18 @@ export struct LocalMusic {
 
         // 随机选择一个未播放的歌曲索引
         let newIndex: number;
+        // 添加超时机制防止无限循环
+        let attempt = 0;
+        const maxAttempts = 100; // 根据需求调整
         do {
-          newIndex = RandomUtil.getRandomNumber(0, this.songList.length - 1);
-        } while (this.playedIndices.has(newIndex));
+          newIndex = RandomUtil.getRandomNumber(0,  this.songList.length  - 1);
+          attempt++;
+        } while (this.playedIndices.has(newIndex)  && attempt < maxAttempts);
+
+        if (attempt >= maxAttempts) {
+          // 处理无法找到新索引的情况(如随机选择或按顺序播放)
+          newIndex = Math.floor(Math.random()  * this.songList.length);
+        }
 
         this.curIndex = newIndex;
         this.playedIndices.add(newIndex);

+ 4 - 2
lib/src/main/ets/view/LyricView2.ets

@@ -264,13 +264,14 @@ export struct LyricView2 {
             }
         })
     }
-
+    // 普通歌词渲染(原有逻辑)
     @Builder
     NormalLyricLine(item: LyricLine, index: number) {
         Text(item.text)
             .fontSize(this.textSize)
             .opacity(this.calculateOpacityFactor(index, this.currentIndex))
             .blur(this.calculateBlurFactor(index, this.currentIndex))
+            .copyOption(CopyOptions.InApp)
             .textAlign(this.alignMode == 'center' ? TextAlign.Center : TextAlign.Start)
             .scale({
                 x: index == this.currentIndex ? this.controller.getHighlightScale() : 1,
@@ -282,7 +283,7 @@ export struct LyricView2 {
             .animation({ duration: this.animDuration, curve: Curve.FastOutSlowIn })
             .width(this.alignMode == 'center' ? '100%' : '76%')
     }
-
+    // 逐字歌词渲染
     @Builder
     WordByWordLyric(item: LyricLine, index: number) {
         Row({ space: 0 }) {
@@ -298,6 +299,7 @@ export struct LyricView2 {
                     .margin(0)
                     .opacity(this.calculateOpacityFactor(index, this.currentIndex))
                     .blur(this.calculateBlurFactor(index, this.currentIndex))
+                    .copyOption(CopyOptions.InApp)
                     .animation({
                         // 动画播放速度
                         tempo: 0.8,