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

优化歌单也支持封面在头部的模式

onecold 1 год назад
Родитель
Сommit
e949fad97c

+ 2 - 2
entry/src/main/ets/pages/NewIndex.ets

@@ -387,8 +387,8 @@ struct NewIndex {
         Column() {
           Row() {
             Text(this.isLogin ? this.userName : '未登录用户')
-              .fontSize(13)
-              .fontWeight(FontWeight.Bold)
+              .fontSize(14)
+              // .fontWeight(FontWeight.Bold)
               .fontColor(this.isDarkMode ? Color.White : Color.Black)
               .textAlign(TextAlign.Start)
               .maxLines(1)

+ 6 - 2
entry/src/main/ets/pages/UserCenter.ets

@@ -481,8 +481,9 @@ export struct UserCenter {
         Column() {
           Row() {
             Text(this.isLogin ? this.userName : '未登录用户')
-              .fontSize(17)
+              .fontSize(14)
               .fontWeight(FontWeight.Bold)
+              .padding(5)
               .fontColor(this.isDarkMode ? Color.White : Color.Black)
               .textAlign(TextAlign.Start)
               .maxLines(1)
@@ -496,15 +497,18 @@ export struct UserCenter {
             if (this.hasActiveSubscription) {
               Text(this.subscriptionName)
                 .fontSize(13)
+                .padding(5)
                 .fontColor(themeColorWithAlpha(this.themeColor, 0.8, false))
                 .textAlign(TextAlign.Start)
               Text('到期:' + this.subscriptionEndDate)
                 .fontSize(11)
+                .padding(8)
                 .fontColor(this.isDarkMode ? Color.White : Color.Gray)
                 .textAlign(TextAlign.Start)
             } else {
               Text('普通用户')
-                .fontSize(12)
+                .fontSize(13)
+                .padding(5)
                 .fontColor(this.isDarkMode ? Color.White : Color.Grey)
                 .textAlign(TextAlign.Start)
             }

+ 28 - 24
entry/src/main/ets/view/LocalMusic.ets

@@ -814,7 +814,7 @@ export struct LocalMusic {
     if (curPath === this.rootPath) {
       this.titleBarModel.setLeftIconMain($r('app.media.menu'))
     } else {
-
+      this.currentTitleName = Utility.getFileDirName(this.currentPath, this.rootPath)
       if (this.rootPath === Utility.getParentDirectory(curPath)) {
         this.titleBarModel.setLeftIconMain($r('app.media.left_back_white'))
       }
@@ -1998,6 +1998,33 @@ export struct LocalMusic {
               }else {
                 this.getListView()
               }
+              if(this.modeType==0){
+                Column() {
+                  Button('同步数据', { type: ButtonType.Capsule, stateEffect: true })
+                    .width(130)
+                    .height(50)
+                    .margin({ top: 100, bottom: 40 })
+                    .backgroundColor(this.themeColor)
+                    .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
+                    .onClick(() => {
+                      this.asyncCurrentPathData()
+                    })
+
+                }
+                .height(100)
+                .position({top:300})
+                .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%')
+              }
+
+
             }
             .layoutWeight(1)
             .height('100%')
@@ -2094,30 +2121,7 @@ export struct LocalMusic {
           .position(this.isShowCoverTitle()?{ bottom:78}
             :{ bottom:this.isPhoneLan()?130: 168 }) // 将 Row 固定在底部
 
-          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%')