Просмотр исходного кода

把播放控制条移动到NewIndex上

onecold 8 месяцев назад
Родитель
Сommit
d0526b98f7

+ 1 - 1
entry/src/main/ets/dialog/RemoteDriveAccountDialog.ets

@@ -277,7 +277,7 @@ export struct RemoteDriveAccountDialog {
             });
         }
         .alignItems(VerticalAlign.Center)
-        .visibility(Visibility.None)
+        .visibility(Visibility.Visible)
         // this.buildHelperText('可选,用于需要域/工作组认证的 SMB 服务器')
       }
 

+ 278 - 62
entry/src/main/ets/pages/NewIndex.ets

@@ -1,4 +1,6 @@
-import { AppUtil, ArrayUtil, DeviceUtil, DisplayUtil, LogUtil, PreferencesUtil, ToastUtil } from '@pura/harmony-utils';
+import { AppUtil, ArrayUtil, DeviceUtil, DisplayUtil, LogUtil, PreferencesUtil,
+  StrUtil,
+  ToastUtil } from '@pura/harmony-utils';
 import TitleBar from '../view/TitleBar';
 import { curves,
   ImmersiveMode,
@@ -54,6 +56,7 @@ import { getRemoteDriveAccountLabel, getRemoteDriveDisplayLabel, getRemoteDriveP
 import { RemoteDriveType } from '../common/enums/RemoteDriveType';
 import { NavidromePage } from '../view/NavidromePage';
 import { ServerLogUtil } from '../common/util/ServerLogUtil';
+import { PlayStatus } from '../common/PlayStatus';
 
 // import { FFmpeg, FFProgressMessageParser } from '@sj/ffmpeg';
 
@@ -67,6 +70,17 @@ const TAG = 'NewIndex'; // 日志标签
 @Entry
 @Component
 struct NewIndex {
+
+  @Provide isShowPlay: boolean = false;
+  @Provide CONTROL_PlayStatus: number = PlayStatus.INIT;
+  @Provide progressValue: number = 0;
+  @State isShowPrecious: boolean = false //播控条显示上一首按钮
+  @State bottomBarHeight: number = 68;
+  @StorageProp('bottomSafeHeight') bottomSafeHeight: number = 0;
+  @Provide cover: string | undefined = '';
+  // @Provide currentSong: VideoItem | undefined = undefined;
+  @StorageLink('currentSong') currentSong: VideoItem | undefined = undefined;
+  @Provide isMultiSelect: boolean = false;
   /** 页面上下文 */
   context = this.getUIContext().getHostContext() as common.UIAbilityContext
   @Provide currentSongListName:string = '' //当前歌单名称
@@ -251,6 +265,7 @@ struct NewIndex {
    */
 
   async aboutToAppear() {
+    this.isShowPrecious = PreferencesUtil.getBooleanSync('isShowPrecious', false)
     ReqPermissionUtil.reqPermissionsFromUser(ReqPermissionUtil.permissions, this.context);
     this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, false)
     this.idDefaultMediaKu = PreferencesUtil.getBooleanSync('idDefaultMediaKu', false)
@@ -373,76 +388,100 @@ struct NewIndex {
     }
   }
 
+  @Builder
+  ContentBuild() {
+    Stack() {
+      // 本地音乐内容区
+      LocalMusic()
+        .visibility(this.mType === 0 ? Visibility.Visible : Visibility.None)
+      // 网络内容区
+      UserCenter()
+        .visibility(this.mType === 1 ? Visibility.Visible : Visibility.None)
+      ScanFilePage()
+        .visibility(this.mType === 2 ? Visibility.Visible : Visibility.None)
+
+      ChartsCount({
+        isShowDrawer:this.isShowDrawer,
+        offsetX:this.offsetX
+      })
+        .visibility(this.mType === 3 ? Visibility.Visible : Visibility.None)
+
+      SettingPage()
+        .visibility(this.mType === 4 ? Visibility.Visible : Visibility.None)
+      AboutPage()
+        .visibility(this.mType === 5 ? Visibility.Visible : Visibility.None)
+
+      WebDavMainPage({
+        offsetX:this.offsetX,
+        isShowDrawer:this.isShowDrawer,
+        mType:this.mType,
+        selectedAccount:this.selectedAccount
+      })
+        .visibility(this.mType === 6 ? Visibility.Visible : Visibility.None)
+      if(this.mType === 7){
+        NavidromePage({
+          offsetX:this.offsetX,
+          isShowDrawer:this.isShowDrawer,
+          mType:this.mType,
+          selectedAccount:this.selectedAccount
+        })
+          .visibility(this.mType === 7 ? Visibility.Visible : Visibility.None)
+      }
+      // 抽屉打开时的遮罩层,用于拦截点击事件  这个只能正常尺寸的手机竖屏的才能生效
+      if (this.isShowDrawer&&this.isPhonePortrait()) {
+        Column()
+          .width('100%')
+          .height('100%')
+          .backgroundBlurStyle(BlurStyle.BACKGROUND_THIN)
+          .transition(TransitionEffect.OPACITY.animation({
+            curve: curves.springMotion(0, 1)
+          }))
+          .onClick(() => {
+            // 点击遮罩层关闭抽屉
+            this.getUIContext()?.animateTo({ duration: 555 }, () => {
+              this.isShowDrawer = false
+            })
+          })
+      }
+    }
+    .bindSheet($$this.isShowUpdateDialog, this.updateSheet(), {
+      height: '90%',
+      dragBar: true,
+      preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
+      showClose: true,
+      blurStyle: BlurStyle.Regular,
+      title: { title: '更新日志' }
+    })
+  }
+
+
+
   build() {
     SideBarContainer(SideBarContainerType.AUTO) {
       Column() {
         this.getLeftView()
       }
       .backgroundColor(Color.Transparent)
-      Column() {
+      Stack() {
+        this.ContentBuild()
         Stack() {
-          // 本地音乐内容区
-          LocalMusic()
-            .visibility(this.mType === 0 ? Visibility.Visible : Visibility.None)
-          // 网络内容区
-          UserCenter()
-            .visibility(this.mType === 1 ? Visibility.Visible : Visibility.None)
-          ScanFilePage()
-            .visibility(this.mType === 2 ? Visibility.Visible : Visibility.None)
-
-          ChartsCount({
-            isShowDrawer:this.isShowDrawer,
-            offsetX:this.offsetX
-          })
-            .visibility(this.mType === 3 ? Visibility.Visible : Visibility.None)
-
-          SettingPage()
-            .visibility(this.mType === 4 ? Visibility.Visible : Visibility.None)
-          AboutPage()
-            .visibility(this.mType === 5 ? Visibility.Visible : Visibility.None)
-
-          WebDavMainPage({
-            offsetX:this.offsetX,
-            isShowDrawer:this.isShowDrawer,
-            mType:this.mType,
-            selectedAccount:this.selectedAccount
-          })
-            .visibility(this.mType === 6 ? Visibility.Visible : Visibility.None)
-          if(this.mType === 7){
-            NavidromePage({
-              offsetX:this.offsetX,
-              isShowDrawer:this.isShowDrawer,
-              mType:this.mType,
-              selectedAccount:this.selectedAccount
-            })
-              .visibility(this.mType === 7 ? Visibility.Visible : Visibility.None)
-          }
-          // 抽屉打开时的遮罩层,用于拦截点击事件  这个只能正常尺寸的手机竖屏的才能生效
-          if (this.isShowDrawer&&this.isPhonePortrait()) {
-            Column()
-              .width('100%')
-              .height('100%')
-              .backgroundBlurStyle(BlurStyle.BACKGROUND_THIN)
-              .transition(TransitionEffect.OPACITY.animation({
-                curve: curves.springMotion(0, 1)
-              }))
-              .onClick(() => {
-                // 点击遮罩层关闭抽屉
-                this.getUIContext()?.animateTo({ duration: 555 }, () => {
-                  this.isShowDrawer = false
-                })
-              })
-          }
+          this.PlayController()
         }
-        .bindSheet($$this.isShowUpdateDialog, this.updateSheet(), {
-          height: '90%',
-          dragBar: true,
-          preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
-          showClose: true,
-          blurStyle: BlurStyle.Regular,
-          title: { title: '更新日志' }
-        })
+        .hitTestBehavior(HitTestMode.Transparent)
+        .width('90%')
+        .borderRadius(20)
+        .margin({ bottom:DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_2IN1
+          ? 30 :this.bottomSafeHeight })
+        .backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
+        .backgroundImage( this.cover)
+        .visibility(this.isMultiSelect ? Visibility.None : Visibility.Visible)
+        .backgroundImageSize( {  width: '100%' })
+        .opacity(0.9)
+        .clickEffect({ level: ClickEffectLevel.HEAVY })
       }
+      .alignContent(Alignment.Bottom)
+      .width('100%')
+      .height('100%')
 
       .gesture(SwipeGesture({ direction: SwipeDirection.Horizontal }).onAction((event: GestureEvent) => {
         if (event) {//手势返回
@@ -465,6 +504,181 @@ struct NewIndex {
 
   }
 
+  @Builder
+  centerName() {
+    Column() {
+      Text(this.currentSong?.name)
+        .fontSize(16)
+        .textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
+        .maxLines(1)
+        .fontColor(Color.White)
+        .fontWeight(FontWeight.Bolder);
+      Row() {
+        Text(this.currentSong?.artist)
+          .margin({ top: 2 })
+          .fontSize(13)
+          .textAlign(TextAlign.Start)
+          .maxLines(1)
+          .fontWeight(FontWeight.Bold)
+          .textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
+          .fontColor(Color.White)
+      }
+      .visibility(this.currentSong?.artist? Visibility.Visible:Visibility.None)
+    }
+    .alignItems(HorizontalAlign.Center)
+  }
+
+  @Builder
+  PlayController() {
+    Row() {
+      if(this.isHiCar()){
+        this.playConRigth()
+        Column(){
+          this.centerName()
+        }.layoutWeight(1)
+        .onClick(()=>{
+          this.getUIContext().getHostContext()!.eventHub.emit('showPlayerView');
+        })
+        this.playConLeft(false)
+
+      }else{
+        this.playConLeft()
+        this.playConRigth()
+      }
+
+
+    }
+    .width('100%')
+    .height(this.bottomBarHeight)
+    .hitTestBehavior(HitTestMode.Transparent)
+    .zIndex(1)
+    // .bindContentCover($$this.isShowPlay, this.MusicPlayBuilder(), {
+    //   modalTransition: ModalTransition.DEFAULT,
+    //   onWillDisappear: () => {
+    //     this.setShowPlayFalse()
+    //   },
+    // })
+    .padding({
+      left: 16,
+      right: 16
+    })
+
+
+  }
+
+  @Builder
+  playConLeft(isLeft: boolean = true) {
+    Row() {
+      Image( StrUtil.isNotEmpty(this.currentSong?.pixelMapPath)?
+        this.currentSong?.pixelMapPath:$r('app.media.music_red'))
+        .height(45)
+        .objectFit(ImageFit.Contain)
+        .alt( $r('app.media.music_red'))
+        .fillColor(this.themeColor)
+        .borderRadius(8)
+        .shadow({
+          radius: 10,
+          type: ShadowType.BLUR,
+          color: 'on_primary'
+        })
+        .geometryTransition('cover') // 绑定标识符
+        // .geometryTransition('cover', { follow: true }) // 绑定标识符
+      Column() {
+        Text(this.currentSong?.name)
+          .fontSize(16)
+          .textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
+          .maxLines(1)
+          .fontColor(Color.White)
+          .fontWeight(FontWeight.Bolder);
+        Row() {
+          Text(this.currentSong?.artist)
+            .margin({ top: 2 })
+            .fontSize(13)
+            .textAlign(TextAlign.Start)
+            .maxLines(1)
+            .fontWeight(FontWeight.Bold)
+            .textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
+            .fontColor(Color.White)
+        }
+        .visibility(this.currentSong?.artist? Visibility.Visible:Visibility.None)
+      }
+      .padding({left:8})
+      .alignItems(isLeft?HorizontalAlign.Start:HorizontalAlign.End)
+      .margin({ right: isLeft?22:10 })
+      .visibility(isLeft? Visibility.Visible:Visibility.None)
+    }
+    .padding({ right: 18 })
+    .layoutWeight(isLeft?1:0)
+    .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
+    .onClick(() => {
+      this.getUIContext().getHostContext()!.eventHub.emit('showPlayerView');
+    })
+  }
+
+
+  @Builder
+  playConRigth() {
+    Row() {
+
+      SymbolGlyph($r('sys.symbol.backward_end_fill'))
+        .fontSize(28)
+        .fontColor([this.themeColor])
+        .alignSelf(ItemAlign.Center)
+        .visibility(this.isShowPrecious? Visibility.Visible:Visibility.None)
+        .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
+        .margin({ left: 8, right: 14 })
+        .displayPriority(2)
+        .onClick(() => {
+          this.getUIContext().getHostContext()!.eventHub.emit('playPrevious');
+        })
+      //播放进度条
+      Stack() {
+        Progress({
+          value: Math.floor(this.progressValue),
+          type: ProgressType.Ring,
+
+        })
+          .color(this.themeColor)// 进度条前景色为灰色
+          .height(38)
+          .aspectRatio(CommonConstants.ASPECT_RATIO)
+        Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ? $r('app.media.hm_pause') : $r('app.media.hm_play2'))
+          .height(36)
+          .width(36)
+          .displayPriority(3)
+          .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
+          .fillColor(this.themeColor)
+          .onClick(() => {
+            this.getUIContext().getHostContext()!.eventHub.emit('playOrPause');
+          })
+      }
+
+
+      SymbolGlyph($r('sys.symbol.forward_end_fill'))
+        .fontSize(28)
+        .fontColor([this.themeColor])
+        .alignSelf(ItemAlign.Center)
+        .margin({
+          right: 14,
+          left: 14
+        })
+        .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
+        .displayPriority(2)
+        .onClick(() => {
+          this.getUIContext().getHostContext()!.eventHub.emit('playNext');
+        })
+
+      Image($r('app.media.hm_playlist'))
+        .height(26)
+        .width(26)
+        .displayPriority(1)
+        .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
+        .fillColor(this.themeColor)
+        .onClick(() => {
+          this.getUIContext().getHostContext()!.eventHub.emit('openPlayList');
+        })
+    }
+  }
+
 
 
   //是不是hicar的屏幕分辨率
@@ -1819,3 +2033,5 @@ interface HiCarAspectRatio {
   context: Context;
   playlistId: string;
 }
+
+

+ 1 - 0
entry/src/main/ets/pages/ScanFilePage.ets

@@ -19,6 +19,7 @@ import { DialogHelper } from '@pura/harmony-dialog'
 import { ButtonFancyModifier, ShadowModifier, SymbolGlyphFancyModifier } from '../common/util/AttributeModifierUtil'
 
 
+
 @Preview
 // @Entry
 @Component

+ 70 - 224
entry/src/main/ets/view/LocalMusic.ets

@@ -36,7 +36,7 @@ import { PopupPosition, XPopup } from '@chinalike/popup';
 import { common, ConfigurationConstant } from '@kit.AbilityKit';
 import { AnimationHelper, DialogAction, DialogHelper } from '@pura/harmony-dialog';
 import { fileIo, fileUri, picker } from '@kit.CoreFileKit';
-import { MessageEvents, util, worker, ErrorEvent } from '@kit.ArkTS';
+import { MessageEvents, util, worker, ErrorEvent, JSON } from '@kit.ArkTS';
 import { Verify } from './Verify';
 import { taskpool } from '@kit.ArkTS';
 import { RotatingCover } from './RotatingCover';
@@ -127,7 +127,6 @@ import {
 } from '@kit.UIDesignKit';
 import { GlobalAlphabetIndexerModifier } from '../Styels/GlobalStyles'
 import { getFirstLetter } from '../Constants';
-
 const TAG = 'LocalMusic';
 const HICAR_LOG_TAG = 'HiCarWindow';
 
@@ -879,10 +878,10 @@ export struct LocalMusic {
         break
     }
   }
-
+  // @Consume currentSong: VideoItem | undefined;
   @StorageLink('currentSong') currentSong: VideoItem | undefined = undefined;
   // @StorageLink('isPlay') isPlay: boolean = false;
-  @StorageLink('isShowPlay') isShowPlay: boolean = false;
+  @Consume isShowPlay: boolean ;
   @StorageLink('songList') songList: Array<VideoItem> = [];
   @State translateY: number = 0;
   @State isShowSheet: boolean = false;
@@ -964,7 +963,7 @@ export struct LocalMusic {
 
   // 多选机制
   @State selectedFiles: Array<VideoItem> = [];
-  @State isMultiSelect: boolean = false;
+  @Consume isMultiSelect: boolean;
   @State isAllSelected: boolean = false;
   @State appName: string = ''
   @State isHasDir: boolean = false
@@ -1063,6 +1062,7 @@ export struct LocalMusic {
   }
   // 组件生命周期
   aboutToAppear() {
+
     console.info('onecold aboutToAppear sdkApiVersion = '+deviceInfo.sdkApiVersion)
     if(ArrayUtil.isNotEmpty(this.videoLocalList)&&this.modeType==0){
       this.updateListData(this.videoLocalList)
@@ -1251,6 +1251,36 @@ export struct LocalMusic {
       }
     });
 
+    //NewIndex的博空调收到eventHub消息控制播放
+    this.getUIContext().getHostContext()!.eventHub.on('playOrPause', () => {
+      if (ArrayUtil.isNotEmpty(this.songList)) {
+        this.playOrPause();
+      } else {
+        ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
+      }
+    });
+    this.getUIContext().getHostContext()!.eventHub.on('playPrevious', () => {
+      if (ArrayUtil.isNotEmpty(this.songList)) {
+        this.playPrevious();
+      } else {
+        ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
+      }
+    });
+    this.getUIContext().getHostContext()!.eventHub.on('playNext', () => {
+      if (ArrayUtil.isNotEmpty(this.songList)) {
+        this.playNext();
+      } else {
+        ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
+      }
+
+    });
+    this.getUIContext().getHostContext()!.eventHub.on('showPlayerView', () => {
+      this.showPlayerView();
+    });
+    this.getUIContext().getHostContext()!.eventHub.on('openPlayList', () => {
+      this.openPlayList();
+    });
+
   }
   //载入媒体库,艺术家,专辑等缓存
   initLoadCache(){
@@ -3152,20 +3182,27 @@ export struct LocalMusic {
     Stack() {
       this.ContentBuild()
       Stack() {
-        this.PlayController()
+        Column()
+          .bindSheet($$this.isShowSheet, this.PlayListSheet(), {
+            height: '95%',
+            dragBar: true,
+            showClose: true,
+            blurStyle: BlurStyle.Thin,
+            preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
+            backgroundColor: this.isPlayListBgGrass ? Color.Transparent : $r('app.color.silvery'),
+            title: {
+              title: Utility.resourceToString(this.context, $r('app.string.current_play_list'))
+                + `(${this.songList.length}首)`
+            }
+          })
       }
-      .hitTestBehavior(HitTestMode.Transparent)
-      .opacity(this.barBottomOpacity)
-      .width('90%')
-      .borderRadius(20)
-      .margin({ bottom:DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_2IN1
-        ? 30 :this.bottomSafeHeight })
-      .backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
-      .backgroundImage( this.cover)
-      .visibility(this.isMultiSelect ? Visibility.None : Visibility.Visible)
-      .backgroundImageSize( {  width: '100%' })
-      .opacity(0.9)
-      .clickEffect({ level: ClickEffectLevel.HEAVY })
+      .bindContentCover($$this.isShowPlay, this.MusicPlayBuilder(), {
+        modalTransition: ModalTransition.ALPHA,
+        onWillDisappear: () => {
+          this.setShowPlayFalse()
+        },
+      })
+
 
     }
     .alignContent(Alignment.Bottom)
@@ -7133,116 +7170,10 @@ export struct LocalMusic {
     })
   }
 
-  @Builder
-  PlayController() {
-    Row() {
-      if(this.isHiCar()){
-        this.playConRigth()
-        Column(){
-          this.centerName()
-        }.layoutWeight(1)
-        .onClick(()=>{
-          this.showPlayerView()
-        })
-        this.playConLeft(false)
-
-      }else{
-        this.playConLeft()
-        this.playConRigth()
-      }
-
-
-    }
-    .width('100%')
-    .height(this.bottomBarHeight)
-    .hitTestBehavior(HitTestMode.Transparent)
-    .bindContentCover($$this.isShowPlay, this.MusicPlayBuilder(), {
-      modalTransition: ModalTransition.DEFAULT,
-      onWillDisappear: () => {
-        this.setShowPlayFalse()
-      },
-    })
-    .padding({
-      left: 16,
-      right: 16
-    })
-
-
-  }
 
   @State isFrontWhite: boolean = false
 
-  @Builder
-  centerName() {
-    Column() {
-      Text(this.currentSong?.name)
-        .fontSize(16)
-        .textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
-        .maxLines(1)
-        .fontColor(Color.White)
-        .fontWeight(FontWeight.Bolder);
-      Row() {
-        Text(this.currentSong?.artist)
-          .margin({ top: 2 })
-          .fontSize(13)
-          .textAlign(TextAlign.Start)
-          .maxLines(1)
-          .fontWeight(FontWeight.Bold)
-          .textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
-          .fontColor(Color.White)
-      }
-      .visibility(this.currentSong?.artist? Visibility.Visible:Visibility.None)
-    }
-    .alignItems(HorizontalAlign.Center)
-  }
-  @Builder
-  playConLeft(isLeft: boolean = true) {
-    Row() {
-      // RotatingCover({ songLabel: this.currentSong?.pixelMapPath })
-      Image( StrUtil.isNotEmpty(this.currentSong?.pixelMapPath)?
-        this.currentSong?.pixelMapPath:$r('app.media.music_red'))
-        .height(45)
-        .objectFit(ImageFit.Contain)
-        .alt( $r('app.media.music_red'))
-        .fillColor(this.themeColor)
-        .borderRadius(8)
-        .shadow({
-          radius: 10,
-          type: ShadowType.BLUR,
-          color: 'on_primary'
-        })
-        .geometryTransition('cover', { follow: true }) // 绑定标识符
-      Column() {
-        Text(this.currentSong?.name)
-          .fontSize(16)
-          .textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
-          .maxLines(1)
-          .fontColor(Color.White)
-          .fontWeight(FontWeight.Bolder);
-        Row() {
-          Text(this.currentSong?.artist)
-            .margin({ top: 2 })
-            .fontSize(13)
-            .textAlign(TextAlign.Start)
-            .maxLines(1)
-            .fontWeight(FontWeight.Bold)
-            .textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
-            .fontColor(Color.White)
-        }
-        .visibility(this.currentSong?.artist? Visibility.Visible:Visibility.None)
-      }
-      .padding({left:8})
-      .alignItems(isLeft?HorizontalAlign.Start:HorizontalAlign.End)
-      .margin({ right: isLeft?22:10 })
-      .visibility(isLeft? Visibility.Visible:Visibility.None)
-    }
-    .padding({ right: 18 })
-    .layoutWeight(isLeft?1:0)
-    .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
-    .onClick(() => {
-      this.showPlayerView()
-    })
-  }
+
 
   setShowPlayTrue(){
     this.getUIContext()?.animateTo({
@@ -7263,7 +7194,7 @@ export struct LocalMusic {
   }
   //打开播放页
   showPlayerView() {
-
+    console.info('onecold  showPlayerView  this.songList'+ JSON.stringify(this.songList))
     if (ArrayUtil.isNotEmpty(this.songList)) {
       this.setShowPlayTrue()
       let lyricPath = this.videoUrl.substring(0, this.videoUrl.lastIndexOf('.')) + '.lrc';
@@ -7273,105 +7204,19 @@ export struct LocalMusic {
       ToastUtil.showToast('当前播放列表为空,请先导入音乐。');
     }
   }
-  @Builder
-  playConRigth() {
-    Row() {
-
-      SymbolGlyph($r('sys.symbol.backward_end_fill'))
-        .fontSize(28)
-        .fontColor([this.themeColor])
-        .alignSelf(ItemAlign.Center)
-        .visibility(this.isShowPrecious? Visibility.Visible:Visibility.None)
-        .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
-        .margin({ left: 8, right: 14 })
-        .displayPriority(2)
-        .onClick(() => {
-          if (ArrayUtil.isNotEmpty(this.songList)) {
-            this.playPrevious()
-          } else {
-            ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
-          }
-
-
-        })
-      //播放进度条
-      Stack() {
-        Progress({
-          value: Math.floor(this.progressValue),
-          type: ProgressType.Ring,
-
-        })
-          .color(this.themeColor)// 进度条前景色为灰色
-          .height(38)
-          .aspectRatio(CommonConstants.ASPECT_RATIO)
-        Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ? $r('app.media.hm_pause') : $r('app.media.hm_play2'))
-          .height(36)
-          .width(36)
-          .displayPriority(3)
-          .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
-          .fillColor(this.themeColor)
-          .onClick(() => {
-            if (ArrayUtil.isNotEmpty(this.songList)) {
-              console.info('onecold playOrPause 4642')
-              this.playOrPause()
-            } else {
-              ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
-            }
-          })
-      }
-
-
-      SymbolGlyph($r('sys.symbol.forward_end_fill'))
-        .fontSize(28)
-        .fontColor([this.themeColor])
-        .alignSelf(ItemAlign.Center)
-        .margin({
-          right: 14,
-          left: 14
-        })
-        .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
-        .displayPriority(2)
-        .onClick(() => {
-          if (ArrayUtil.isNotEmpty(this.songList)) {
-            this.playNext()
-          } else {
-            ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
-          }
-
-        })
-
-      Image($r('app.media.hm_playlist'))
-        .height(26)
-        .width(26)
-        .displayPriority(1)
-        .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
-        .fillColor(this.themeColor)
-        .bindSheet($$this.isShowSheet, this.PlayListSheet(), {
-          height: '95%',
-          dragBar: true,
-          showClose: true,
-          blurStyle: BlurStyle.Thin,
-          preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
-          backgroundColor: this.isPlayListBgGrass ? Color.Transparent : $r('app.color.silvery'),
-          title: {
-            title: Utility.resourceToString(this.context, $r('app.string.current_play_list'))
-              + `(${this.songList.length}首)`
-          }
-        })
-        .onClick(() => {
-          if (ArrayUtil.isNotEmpty(this.songList)) {
-            this.isShowSheet = !this.isShowSheet;
-            this.isFrontWhite = false
-            LogUtil.info('onecold scrollToIndex = ' + this.curIndex)
 
-            this.scrollIndex()
 
-          } else {
-            ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
-          }
+  //打开播放列表
+  openPlayList(){
+    if (ArrayUtil.isNotEmpty(this.songList)) {
+      this.isShowSheet = !this.isShowSheet;
+      this.isFrontWhite = false
+      LogUtil.info('onecold scrollToIndex = ' + this.curIndex)
 
+      this.scrollIndex()
 
-        })
+    } else {
+      ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
     }
   }
 
@@ -9727,7 +9572,7 @@ export struct LocalMusic {
     })
   }
 
-  @State progressValue: number = 0;
+  @Consume progressValue: number ;
   @State currentTime: string = "00:00";
   @State totalTime: string = "00:00";
   @State loadingVisible: Visibility = Visibility.None;
@@ -9750,7 +9595,7 @@ export struct LocalMusic {
   private last: number = 0;
   @State videoParentAspectRatio: number = this.initAspectRatio;
   private mIjkMediaPlayer = IjkMediaPlayer.getInstance();
-  @State CONTROL_PlayStatus: number = PlayStatus.INIT;
+  @Consume CONTROL_PlayStatus: number ;
   @State PROGRESS_MAX_VALUE: number = 100;
   @State updateProgressTimer: number = 0;
   @State isHide: boolean = false; //是否因此播放器的按钮,默认是进入横屏模式隐藏,点击视频的时候显示
@@ -9802,7 +9647,7 @@ export struct LocalMusic {
   // @State isBgPlayOpen:boolean = true   //是否启用后台播放
   @State rotateAngle2: number = -9
   @StorageLink('imageColor') imageColor: string = 'rgba(0, 0, 2, 1.00)';
-  @State cover: string | undefined = '';
+  @Consume cover: string | undefined ;
   @State artist: string | undefined = ''
   // 1.初始化controller
   private lyricController: LyricController = new LyricController()
@@ -14675,6 +14520,7 @@ export struct LocalMusic {
 
   //上一个
   private async playPrevious() {
+
     if (!this.debounce()) {
       return;
     }