Răsfoiți Sursa

修复启动播放的加载不了媒体库等列表的bug
更换些资源

onecold 1 an în urmă
părinte
comite
307f1a1fce

+ 53 - 31
entry/src/main/ets/view/LocalMusic.ets

@@ -668,6 +668,10 @@ export struct LocalMusic {
           this.albumMap = e.data.data1;
 
           this.albumList = e.data.data2
+          //查询完毕在启动是否自动播放
+          if(this.isStartAutoPlay){
+            this.startPlayOrResumePlay()
+          }
           break;
 
       }
@@ -734,9 +738,7 @@ export struct LocalMusic {
         this.videoUrl = this.currentSong.filePath
         this.name = this.currentSong.name
         this.cover = this.currentSong.pixelMapPath
-        if(this.isStartAutoPlay){
-          this.startPlayOrResumePlay()
-        }
+
 
       } else {
         this.name = '空空如也'
@@ -1039,6 +1041,7 @@ export struct LocalMusic {
     let dataBean = new BubbleBean()
     dataBean.data = ["首页", "媒体库", "艺术家", "专辑", "同步数据"]
     dataBean.color = this.themeColor
+    dataBean.modeType = this.modeType
     dataBean.imageRes =
       [$r('app.media.home_press'), $r('app.media.kp_music'), $r('app.media.music_menu'), $r('app.media.llq'),
         $r('app.media.refresh')]
@@ -1089,13 +1092,7 @@ export struct LocalMusic {
           this.titleBarModel.setTitleName(Utility.resourceToString(this.context, $r('app.string.album')))
           break
         case 4: //同步数据
-          workerInstance.postMessage({
-            code: 1,
-            data1: this.context,
-            data2: this.rootPath,
-            data3: this.lockPath,
-            data4: PreferencesUtil.getStringSync('COVER_API', ''),
-          });
+          this.asyncCurrentPathData()
           break
       }
 
@@ -2046,27 +2043,30 @@ export struct LocalMusic {
           })
           .position({ bottom:this.isPhoneLan()?130: 168 }) // 将 Row 固定在底部
 
-          // Column() {
-          //   Button('导入音乐', { type: ButtonType.Capsule, stateEffect: true })
-          //     .width('50%')
-          //     .height(55)
-          //     .margin({ top: 50, bottom: 40 })
-          //     .backgroundColor(this.themeColor)
-          //
-          //     .onClick(() => {
-          //       this.showSheelDialog()
-          //     })
-          //
-          // }
-          // .height('100%')
-          // .justifyContent(FlexAlign.Center)
-          // .opacity(this.isZero ? 1 : 0)
-          // .visibility(this.isZero && this.modeType === 0 ? Visibility.None : Visibility.None)
-          // .animation({
-          //   duration: 666,
-          //   curve: 'ease-in-out' // 可选动画曲线
-          // })
-          // .width('100%')
+          if(this.modeType==0){
+            Column() {
+              Button('同步数据', { type: ButtonType.Capsule, stateEffect: true })
+                .width(130)
+                .height(50)
+                .margin({ top: 50, bottom: 40 })
+                .backgroundColor(this.themeColor)
+
+                .onClick(() => {
+                  this.asyncCurrentPathData()
+                })
+
+            }
+            .height('60%')
+            .justifyContent(FlexAlign.Center)
+            .opacity(this.isZero ? 1 : 0)
+            .visibility(this.isZero&&!this.isFavMusic&&!this.isHistory
+              && this.modeType === 0 ? Visibility.Visible : Visibility.None)
+            .animation({
+              duration: 666,
+              curve: 'ease-in-out' // 可选动画曲线
+            })
+            .width('100%')
+          }
         }
         .width('100%')
         .height('100%')
@@ -2092,6 +2092,18 @@ export struct LocalMusic {
 
   }
 
+  asyncCurrentPathData(){
+    if(this.modeType==0){
+      workerInstance.postMessage({
+        code: 1,
+        data1: this.context,
+        data2: this.currentPath,
+        data3: this.lockPath,
+        data4: PreferencesUtil.getStringSync('COVER_API', ''),
+      });
+    }
+  }
+
   // 处理文件选择的函数
   handleFileSelection(item: VideoItem, checked: boolean) {
     if (checked) {
@@ -5187,6 +5199,15 @@ export struct LocalMusic {
   //是不是手机横屏
 
   isPhoneLan() {
+    // LogUtil.info('twocold this.currentHeightBreakpoint = '+this.currentHeightBreakpoint)
+    // LogUtil.info('twocold this.currentWidthBreakpoint = '+this.currentWidthBreakpoint)
+    if(DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
+      &&this.currentHeightBreakpoint == HeightBreakpoint.HEIGHT_SM
+      &&this.currentWidthBreakpoint==WidthBreakpoint.WIDTH_MD){//如果是手机横屏,返回false
+
+      return true
+    }
+
     if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
       && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
       if (DisplayUtil.getFoldStatus() === 0 ) {
@@ -9919,6 +9940,7 @@ function customPopupBuilder(dataBu: BubbleBean) {
                 right: 10,
                 left: 10
               })
+              .fontColor(dataBu.modeType ==index?dataBu.color:$r('app.color.index_tab_font_color'))
               .textAlign(TextAlign.Start)
               .width("100%")
           }

+ 1 - 0
entry/src/main/ets/viewmodel/BubbleBean.ets

@@ -4,4 +4,5 @@ export class BubbleBean {
   color:string='#000000'
   onItemClick?: (index:number) => void
   isCopy?:boolean
+  modeType?:number
 }

+ 1 - 1
entry/src/main/resources/base/media/hm_play.svg

@@ -1 +1 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750388475242" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4584" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M514 114.4c-220 0-398.8 178.9-398.8 398.8S294 912 514 912s398.8-178.9 398.8-398.8S733.4 114.4 514 114.4z m0 754.9c-196.5 0-356.1-159.6-356.1-356.1-0.6-196.5 159.6-356.1 356.1-356.1s356.1 159.6 356.1 356.1S710.5 869.3 514 869.3z" p-id="4585"></path><path d="M698.2 472.3L448.3 328.1c-14.9-8.6-32.7-8.6-47.6 0-15 8.7-23.9 24.1-23.9 41.4v288.3c0 17.3 8.9 32.8 23.9 41.4 7.5 4.3 15.7 6.5 23.8 6.5 8.2 0 16.3-2.1 23.8-6.4l249.9-144.2c15-8.6 23.9-24.1 23.9-41.5 0-17.2-8.9-32.7-23.9-41.3z m-21.3 45.9L427 662.3c-2 1.2-3.8 0.6-4.9 0-1.2-0.7-2.6-2-2.6-4.5V369.6c0-2.5 1.4-3.8 2.6-4.4 0.6-0.4 1.5-0.7 2.5-0.7 0.7 0 1.6 0.2 2.4 0.7l249.9 144.2c2.1 1.2 2.5 3.1 2.5 4.5 0 1.2-0.5 3.1-2.5 4.3z" p-id="4586"></path></svg>
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1752371375233" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11440" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M512 15.36c274.10432 0 496.64 222.53568 496.64 496.64s-222.53568 496.64-496.64 496.64-496.64-222.53568-496.64-496.64S237.89568 15.36 512 15.36z m0 61.44c-240.19968 0-435.2 195.01056-435.2 435.2 0 240.19456 195.00032 435.2 435.2 435.2 240.19456 0 435.2-195.00544 435.2-435.2 0-240.18944-195.01056-435.2-435.2-435.2z m175.70816 435.2l-282.38336 189.44V322.56l282.38336 189.44z" fill="#707070" p-id="11441"></path></svg>

BIN
entry/src/main/resources/base/media/ic_avatar1.png


BIN
entry/src/main/resources/base/media/ic_avatar10.png


BIN
entry/src/main/resources/base/media/ic_avatar2.png


BIN
entry/src/main/resources/base/media/ic_avatar4.png


BIN
entry/src/main/resources/base/media/ic_avatar5.png


BIN
entry/src/main/resources/base/media/ic_avatar8.png


BIN
entry/src/main/resources/base/media/ic_avatar9.png


+ 38 - 30
oh_modules/@pura/harmony-dialog/src/main/ets/component/ActionSheetDialogView.ets

@@ -83,21 +83,25 @@ export default struct ActionSheetDialogView {
       .width('100%')
       .margin({ bottom: 10 })
 
-      Text(this.options.cancelValue)
-        .fontSize(this.fontSize)
-        .fontColor($r('app.color.color_cancel'))
-        .fontWeight(FontWeight.Bold)
-        .align(Alignment.Center)
-        .textAlign(TextAlign.Center)
-        .width('100%')
-        .padding({ top: 20, bottom: 20, left: 10, right: 10 })
-        .backgroundColor(this.options.backgroundColor)
-        .borderRadius(this.options.cornerRadius)
-        .shadow(ShadowStyle.OUTER_DEFAULT_SM)
-        .width('100%')
-        .onClick(()=>{
-          DialogHelper.closeDialog(this.options.dialogId ?? "");
-        })
+      Button({ type: ButtonType.Capsule, stateEffect: true }) {
+        Text(this.options.cancelValue)
+          .fontSize(this.fontSize)
+          .fontColor($r('app.color.color_cancel'))
+          .fontWeight(FontWeight.Bold)
+          .align(Alignment.Center)
+          .textAlign(TextAlign.Center)
+          .width('100%')
+          .padding({ top: 20, bottom: 20, left: 10, right: 10 })
+          .backgroundColor(this.options.backgroundColor)
+          .borderRadius(this.options.cornerRadius)
+          .shadow(ShadowStyle.OUTER_DEFAULT_SM)
+      }
+      .backgroundColor(Color.Transparent)
+      .clickEffect({level:ClickEffectLevel.HEAVY})
+      .width('100%')
+      .onClick(()=>{
+        DialogHelper.closeDialog(this.options.dialogId ?? "");
+      })
     }
     .justifyContent(FlexAlign.Center)
     .alignItems(HorizontalAlign.Center)
@@ -109,20 +113,24 @@ export default struct ActionSheetDialogView {
 
   @Builder
   TextBuilder(value: ResourceStr, fontColor: ResourceColor, fontSize: number | string | Resource, index: number) {
-    Text(value)
-      .fontSize(fontSize)
-      .fontColor(fontColor)
-      .align(Alignment.Center)
-      .textAlign(TextAlign.Center)
-      .width('100%')
-      .padding({ top: 20, bottom: 20, left: 10, right: 10 })
-      .onClick(() => {
-        if (this.options.actionCancel){
-          DialogHelper.closeDialog(this.options.dialogId ?? "");
-        }
-        if (this.options.onAction) {
-          this.options.onAction(index, this.options.dialogId ?? "", "");
-        }
-      })
+    Button({ type: ButtonType.Capsule, stateEffect: true }) {
+      Text(value)
+        .fontSize(fontSize)
+        .fontColor(fontColor)
+        .align(Alignment.Center)
+        .textAlign(TextAlign.Center)
+        .width('100%')
+        .padding({ top: 20, bottom: 20, left: 10, right: 10 })
+    }
+    .backgroundColor(Color.Transparent)
+    .clickEffect({level:ClickEffectLevel.HEAVY})
+    .onClick(() => {
+      if (this.options.actionCancel){
+        DialogHelper.closeDialog(this.options.dialogId ?? "");
+      }
+      if (this.options.onAction) {
+        this.options.onAction(index, this.options.dialogId ?? "", "");
+      }
+    })
   }
 }