Jelajahi Sumber

继续优化发现页和缓存管理

onecold 4 bulan lalu
induk
melakukan
948347502f

+ 3 - 0
entry/src/main/ets/common/constants/EventConstants.ets

@@ -64,6 +64,9 @@ export class EventConstants {
   // 发现页内部返回(搜索态/专辑详情态)
   // 发现页内部返回(搜索态/专辑详情态)
   static readonly EVENT_FIND_VIEW_BACK: number = 2008;
   static readonly EVENT_FIND_VIEW_BACK: number = 2008;
 
 
+  // 设置页返回首页时,按用户默认首页配置恢复目标页面
+  static readonly EVENT_SETTING_BACK_TO_HOME: number = 2009;
+
   /**
   /**
    * WebDAV 元数据同步事件
    * WebDAV 元数据同步事件
    */
    */

+ 2 - 27
entry/src/main/ets/pages/SettingPage.ets

@@ -884,9 +884,8 @@ export struct SettingPage {
         .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
         .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
         .animation({ duration: 300, curve: Curve.Ease })
         .animation({ duration: 300, curve: Curve.Ease })
         .onClick(() => {
         .onClick(() => {
-            this.getUIContext()?.animateTo({ duration: 555 }, () => {
-              this.mType =0
-            })
+            const eventData: emitter.EventData = {};
+            emitter.emit({ eventId: EventConstants.EVENT_SETTING_BACK_TO_HOME }, eventData);
         })
         })
         .attributeModifier(new ShadowModifier())
         .attributeModifier(new ShadowModifier())
         .zIndex(0)
         .zIndex(0)
@@ -2155,31 +2154,7 @@ export struct SettingPage {
               blurStyle: BlurStyle.Thin,
               blurStyle: BlurStyle.Thin,
               title: { title: '缓存管理' }
               title: { title: '缓存管理' }
             })
             })
-            Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
 
 
-            Row() {
-              SymbolGlyph($r('sys.symbol.trash'))
-                .fontSize(20)
-                .fontColor([this.themeColor])
-                .alignSelf(ItemAlign.Center)
-                .margin({ left: 15 })
-              Text('清除网盘缓存')
-                .margin({ left: 8 })
-                .fontSize(15)
-                .fontColor(Color.Gray)
-                .fontWeight(480)
-                .layoutWeight(1)
-              Text(this.isClearingCache ? '清理中…' : '立即清理')
-                .margin({ right: 18 })
-                .fontSize(13)
-                .fontColor(this.themeColor)
-            }
-            .height(55)
-            .clickEffect({ level: ClickEffectLevel.HEAVY })
-            .onClick(() => {
-              this.handleClearWebDavCache();
-            })
-            Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
             
             
             // WebDAV上传默认重复文件处理方式
             // WebDAV上传默认重复文件处理方式
             Row() {
             Row() {

+ 7 - 3
entry/src/main/ets/view/FindView.ets

@@ -2538,9 +2538,13 @@ export struct FindView {
         Column({ space: 6 }) {
         Column({ space: 6 }) {
           this.buildActionButtons()
           this.buildActionButtons()
           this.buildLocalRandomSection()
           this.buildLocalRandomSection()
-          this.buildFavoriteSection()
-          this.buildCloudMoodSection()
-          this.buildCloudSection()
+          if (this.favoriteSongsPool.length > 0 || this.favoriteSongs.length > 0) {
+            this.buildFavoriteSection()
+          }
+          if (this.remoteSongsPool.length > 0 || this.remoteSongs.length > 0 || this.cloudMoodSongs.length > 0) {
+            this.buildCloudMoodSection()
+            this.buildCloudSection()
+          }
           this.buildFeaturedAlbumSection()
           this.buildFeaturedAlbumSection()
           if (this.remoteSongsPool.length > 0 || this.cloudAlbumsPool.length > 0 || this.cloudAlbums.length > 0) {
           if (this.remoteSongsPool.length > 0 || this.cloudAlbumsPool.length > 0 || this.cloudAlbums.length > 0) {
             this.buildCloudAlbumSection()
             this.buildCloudAlbumSection()