Răsfoiți Sursa

feat(webdav):优化文件夹进入逻辑并调整UI交互

chendeben 9 luni în urmă
părinte
comite
7b21cffa5e

+ 5 - 0
entry/src/main/ets/common/util/WebdavManager.ets

@@ -418,8 +418,13 @@ export class WebdavManager {
       return;
     }
 
+    Logger.info(TAG, `准备进入文件夹: ${folder.fileName}`);
+    Logger.info(TAG, `当前路径: ${this.currentPath}`);
+    Logger.info(TAG, `目标路径: ${folder.href}`);
+
     // 保存当前路径到历史记录
     this.pathHistory.push(this.currentPath);
+    Logger.info(TAG, `路径历史: ${JSON.stringify(this.pathHistory)}`);
 
     // 加载文件夹内容
     await this.loadFilesInfoFromWebdav(folder.href);

+ 21 - 28
entry/src/main/ets/pages/WebDavMainPage.ets

@@ -258,8 +258,9 @@ export struct WebDavMainPage {
 
       // 跳转到播放器页面
       router.pushUrl({
-        url: 'pages/MainIndex',
+        url: 'pages/NewIndex',
         params: {
+          videoList: videoItems,
           playIndex: index,
           fromWebDAV: true
         }
@@ -533,24 +534,20 @@ export struct WebDavMainPage {
       .alignItems(HorizontalAlign.Start)
       .layoutWeight(1)
 
-      // 进入按钮
-      Button({ type: ButtonType.Circle }) {
-        Image($r('app.media.ic_play'))
-          .width(20)
-          .height(20)
-          .fillColor(Color.White)
-          .rotate({ angle: 180 }) // 旋转箭头
-      }
-      .width(36)
-      .height(36)
-      .backgroundColor(this.themeColor)
-      .onClick(() => {
-        this.enterFolder(folder);
-      })
+      // 右箭头图标
+      Image($r('app.media.ic_play'))
+        .width(20)
+        .height(20)
+        .fillColor($r('app.color.index_tab_font_color'))
+        .opacity(0.4)
+        .rotate({ angle: 180 })
     }
     .width('100%')
     .padding(12)
     .backgroundColor($r('app.color.start_window_background'))
+    .onClick(() => {
+      this.enterFolder(folder);
+    })
   }
 
   // 歌曲列表项
@@ -590,23 +587,19 @@ export struct WebDavMainPage {
       .alignItems(HorizontalAlign.Start)
       .layoutWeight(1)
 
-      // 播放按钮
-      Button({ type: ButtonType.Circle }) {
-        Image($r('app.media.ic_play'))
-          .width(20)
-          .height(20)
-          .fillColor(Color.White)
-      }
-      .width(36)
-      .height(36)
-      .backgroundColor(this.themeColor)
-      .onClick(() => {
-        this.playSong(song, index);
-      })
+      // 播放图标
+      Image($r('app.media.ic_play'))
+        .width(20)
+        .height(20)
+        .fillColor($r('app.color.index_tab_font_color'))
+        .opacity(0.4)
     }
     .width('100%')
     .padding(12)
     .backgroundColor($r('app.color.start_window_background'))
+    .onClick(() => {
+      this.playSong(song, index);
+    })
   }
 }