Преглед изворни кода

网盘添加搜索,排序功能,添加网盘账号ui改为Menu

onecold пре 9 месеци
родитељ
комит
9ba0786590

+ 12 - 11
entry/src/main/ets/dialog/RemoteDriveAccountDialog.ets

@@ -35,14 +35,14 @@ export struct RemoteDriveAccountDialog {
   @Prop account: WebDavAccount;
   onConfirm?: (account: WebDavAccount) => void;
   onCancel?: () => void;
-  @State accountName: string = '新建WebDAV';
+  @State accountName: string = '我的网盘';
   @State host: string = '';
   @State port: number = -1;
   @State filepath: string = '/';
   @State username: string = '';
   @State password: string = '';
   @State enableHttps: boolean = false;
-  @State driveType: RemoteDriveType = RemoteDriveType.WebDav;
+  @Prop driveType: RemoteDriveType = RemoteDriveType.WebDav;
   @State shareName: string = '';
   @State domain: string = '';
   @State navidromeBasePath: string = '/rest';
@@ -62,9 +62,9 @@ export struct RemoteDriveAccountDialog {
   }
 
   aboutToAppear(): void {
+    console.info('heanup driveType = ' +this.driveType)
     // 初始化深色模式状态
     this.isDarkMode = this.currentMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK
-
     if(this.isEditMode){
       this.accountName = this.account.name;
       this.host = this.account.host;
@@ -87,7 +87,8 @@ export struct RemoteDriveAccountDialog {
         Logger.info('heanup RemoteDriveAccountDialog', `封面文件是否存在: ${ImagePickerUtil.imageExists(this.coverPath)}`);
       }
     } else {
-      this.applyTypeDefaults(this.driveType);
+      // this.applyTypeDefaults(this.driveType);
+      this.handleDriveTypeChange(this.driveType);
     }
   }
 
@@ -111,7 +112,7 @@ export struct RemoteDriveAccountDialog {
         .fontColor($r('app.color.index_tab_font_color'));
 
       // 类型选择 + 封面
-      this.buildTypeSelector();
+      // this.buildTypeSelector();
 
       // 账户封面选择
       Column({ space: 8 }) {
@@ -127,20 +128,20 @@ export struct RemoteDriveAccountDialog {
           Stack() {
             if (this.coverPath) {
               Image(this.coverPath)
-                .width(80)
-                .height(80)
+                .width(50)
+                .height(50)
                 .borderRadius(8)
                 .objectFit(ImageFit.Cover);
             } else {
               // 默认封面图标
               Column() {
                 Image($r('app.media.cloudDisk'))
-                  .width(40)
-                  .height(40)
+                  .width(30)
+                  .height(30)
                   .fillColor(this.isDarkMode ? Color.White : this.themeColor);
               }
-              .width(80)
-              .height(80)
+              .width(50)
+              .height(50)
               .backgroundColor(this.isDarkMode ? '#2C2C2E' : $r('app.color.input_background'))
               .borderRadius(8)
               .justifyContent(FlexAlign.Center);

+ 49 - 7
entry/src/main/ets/pages/NewIndex.ets

@@ -4,6 +4,7 @@ import { curves,
   ImmersiveMode,
   LengthMetrics,
   LevelMode,
+  MenuModifier,
   router, SegmentButton, SegmentButtonOptions, SymbolGlyphModifier } from '@kit.ArkUI';
 import mainViewModel, { MainViewModel } from '../viewmodel/MainViewModel';
 import ItemData from '../viewmodel/ItemData';
@@ -50,6 +51,7 @@ import { RemoteDriveManager } from '../common/util/RemoteDriveManager';
 import { RemoteDriveAccountDialog } from '../dialog/RemoteDriveAccountDialog';
 import ReqPermissionUtil from '../common/util/ReqPermissionUtil';
 import { getRemoteDriveAccountLabel, getRemoteDriveDisplayLabel, getRemoteDriveProtocolLabel } from '../common/util/RemoteDriveLabel';
+import { RemoteDriveType } from '../common/enums/RemoteDriveType';
 
 // import { FFmpeg, FFProgressMessageParser } from '@sj/ffmpeg';
 
@@ -1227,11 +1229,8 @@ struct NewIndex {
         .height(55)
       }
       .backgroundColor(Color.Transparent)
+      .bindMenu(this.AddMenuBuilder)
       .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.6 })
-      .onClick(() => {
-        console.info('heanup', '点击添加网盘账户')
-        this.showRemoteDriveAccountDialog(false)
-      })
     }
     // 显示所有网盘账户
     ForEach(this.webDavAccounts, (account: WebDavAccount,index:number) => {
@@ -1328,6 +1327,48 @@ struct NewIndex {
     }
   }
 
+  @Builder
+  AddMenuBuilder() {
+    Menu() {
+      MenuItem({
+        symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.smallcircle_filled_circle')),
+        content: $r('app.string.webdav')
+      })
+        .onClick(async () => {
+          this.showRemoteDriveAccountDialog(false,undefined,RemoteDriveType.WebDav)
+        })
+      MenuItem({
+        symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.smallcircle_filled_circle')),
+        content: $r('app.string.smb')
+      })
+        .onClick(async () => {
+          this.showRemoteDriveAccountDialog(false,undefined,RemoteDriveType.Smb)
+        })
+      MenuItem({
+        symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.smallcircle_filled_circle')),
+        content: $r('app.string.navidrome')
+      })
+        .onClick(async () => {
+          this.showRemoteDriveAccountDialog(false,undefined,RemoteDriveType.Navidrome)
+        })
+      // MenuItem({
+      //   symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.smallcircle_filled_circle')),
+      //   content: $r('app.string.ftp')
+      // })
+      //   .onClick(async () => {
+      //     this.showRemoteDriveAccountDialog(false,undefined,CommonConstants.TYPE_WEBDAV)
+      //   })
+      //
+      // MenuItem({
+      //   symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.smallcircle_filled_circle')),
+      //   content: $r('app.string.ftps')
+      // })
+      //   .onClick(async () => {
+      //     this.showRemoteDriveAccountDialog(false,undefined,CommonConstants.TYPE_WEBDAV)
+      //   })
+    }.attributeModifier(new MenuModifier())
+  }
+
   @Builder
   MenuBuilder(playlist: Playlist) {
     Menu(){
@@ -1620,12 +1661,12 @@ struct NewIndex {
    * 显示添加网盘账户对话框
    */
   @State addDavDialogId:number = 1
-  showRemoteDriveAccountDialog(isEditMode?: boolean,account?: WebDavAccount) {
+  showRemoteDriveAccountDialog(isEditMode?: boolean,account?: WebDavAccount,driveType?:number) {
 
     const node: FrameNode | null = this.getUIContext().getFrameNodeById("test_text") || null;
     this.getUIContext().getPromptAction().openCustomDialog({
       builder: () => {
-        this.webDavAccountBuilder(isEditMode,account)
+        this.webDavAccountBuilder(isEditMode,account,driveType)
       },
       levelMode: LevelMode.EMBEDDED, // 启用页面级弹出框
       levelUniqueId: node?.getUniqueId(), // 设置页面级弹出框所在页面的任意节点ID
@@ -1637,10 +1678,11 @@ struct NewIndex {
   }
 
   @Builder
-  webDavAccountBuilder(isEditMode?: boolean,account?: WebDavAccount) {
+  webDavAccountBuilder(isEditMode?: boolean,account?: WebDavAccount,driveType?:number) {
      RemoteDriveAccountDialog({
        isEditMode: isEditMode,
        account: account,
+       driveType: driveType,
        onCancel: () => {
          // 取消添加
          this.getUIContext().getPromptAction().closeCustomDialog(this.addDavDialogId)

+ 178 - 112
entry/src/main/ets/pages/WebDavMainPage.ets

@@ -12,7 +12,7 @@ import { FileInfo } from '../viewmodel/FileInfo';
 import { emitter } from '@kit.BasicServicesKit';
 import { EventConstants } from '../common/constants/EventConstants';
 import { LazyDataSource } from '../common/util/LazyDataSource';
-import { PreferencesUtil } from '@pura/harmony-utils';
+import { PreferencesUtil, StrUtil } from '@pura/harmony-utils';
 import { ButtonFancyModifier,
   MenuModifier,
   ShadowModifier, SymbolGlyphFancyModifier } from '../common/util/AttributeModifierUtil';
@@ -66,6 +66,8 @@ function decodeUrlEncodedString(encodedStr: string): string {
 @Entry
 @Component
 export struct WebDavMainPage {
+  @StorageProp('bottomSafeHeight') bottomSafeHeight: number = 0;
+  searchController: SearchController = new SearchController()
   @StorageProp('animationState') animationState: AnimationStatus= AnimationStatus.Running
   @State isNoJumpToHome: boolean = false //网盘播放不跳转首页
   @State isSearchMode: boolean = false
@@ -111,12 +113,11 @@ export struct WebDavMainPage {
   }
 
   updateListData(mList:Array<VideoItem>, noSort?: boolean){
-    this.songs = mList;
     if (!noSort) {
       this.sortType = PreferencesUtil.getNumberSync('webDavSortType', 0)
       this.doSortType(this.sortType)
     }
-    this.dataSource.pushArrayData(this.songs)
+    this.dataSource.pushArrayData(mList)
   }
 
   // 更新可见文件夹列表
@@ -529,7 +530,6 @@ export struct WebDavMainPage {
         .onClick(async () => {
           this.doSortType(0)
           PreferencesUtil.put("webDavSortType", 0)
-          this.updateListData(this.songs, true)
         })
       MenuItem({
         symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.text_and_arrow_down')),
@@ -538,53 +538,93 @@ export struct WebDavMainPage {
         .onClick(async () => {
           this.doSortType(1)
           PreferencesUtil.put("webDavSortType", 1)
-          this.updateListData(this.songs, true)
         })
       MenuItem({
         symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.clock')),
-        content: $r('app.string.sort_by_time')
+        content:'按时间升序'
       })
         .onClick(async () => {
           this.doSortType(2)
           PreferencesUtil.put("webDavSortType", 2)
-          this.updateListData(this.songs, true)
         })
 
       MenuItem({
         symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.timer')),
-        content: '按添加时间降序'
+        content: '按时间降序'
       })
         .onClick(async () => {
           this.doSortType(3)
           PreferencesUtil.put("webDavSortType", 3)
-          this.updateListData(this.songs, true)
+
+        })
+      MenuItem({
+        symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.clock')),
+        content:'按大小升序'
+      })
+        .onClick(async () => {
+          this.doSortType(4)
+          PreferencesUtil.put("webDavSortType", 4)
+        })
+
+      MenuItem({
+        symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.timer')),
+        content: '按大小降序'
+      })
+        .onClick(async () => {
+          this.doSortType(5)
+          PreferencesUtil.put("webDavSortType", 5)
+
         })
     }.attributeModifier(new MenuModifier())
   }
 
 
   doSortType(index: number) {
+    // 对歌曲列表进行排序
     switch (index) {
       case 0:
         Utility.doSortListAscending(this.songs,this.isShowFileName)
+        this.visibleFoldersState.sort((a, b) => {
+          return a.fileName.localeCompare(b.fileName);
+        });
         break;
       case 1:
         Utility.doSortListDescending(this.songs,this.isShowFileName)
+
+        this.visibleFoldersState.sort((a, b) => {
+          return b.fileName.localeCompare(a.fileName);
+        });
         break;
       case 2:
         this.songs.sort((a, b) => {
-          // If types are the same, sort by cTime in ascending order
           return a.cTime.localeCompare(b.cTime);
         });
+        this.visibleFoldersState.sort((a, b) => {
+          return a.time-b.time;
+        });
         break;
       case 3:
         this.songs.sort((a, b) => {
-          // If types are the same, sort by cTime in descending order
           return b.cTime.localeCompare(a.cTime);
         });
+        this.visibleFoldersState.sort((a, b) => {
+          return b.time-a.time;
+        });
+        break;
+      case 4:
+        this.songs.sort((a, b) => {
+          return a.videoSize - b.videoSize;
+        });
+        break;
+      case 5:
+        this.songs.sort((a, b) => {
+          return b.videoSize - a.videoSize;
+        });
         break;
-
     }
+
+    
+    this.updateListData(this.songs,true)
   }
 
 
@@ -625,10 +665,9 @@ export struct WebDavMainPage {
           //左侧搜索返回按钮
           Button({ type: ButtonType.Circle, stateEffect: true }) {
             SymbolGlyph($r('sys.symbol.chevron_left'))
-              .attributeModifier(new SymbolGlyphFancyModifier(25, '', ''))
+              .attributeModifier(new SymbolGlyphFancyModifier(24, '', ''))
           }
           .attributeModifier(new ButtonFancyModifier(40, 40))
-          .margin({bottom:5})
           .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
           .animation({ duration: 300, curve: Curve.Ease })
           .onClick(() => {
@@ -640,7 +679,37 @@ export struct WebDavMainPage {
 
         }
 
+        //搜索框
+        Search({ controller: this.searchController,value: this.searchText, placeholder: '搜索标题、艺术家...' })
+          .searchButton('搜索',{fontColor:this.themeColor})
+          .searchIcon({
+            src: $r('sys.media.ohos_ic_public_search_filled')
+          })
+          .cancelButton({
+            style: CancelButtonStyle.CONSTANT,
+            icon: {
+              src: $r('sys.media.ohos_ic_public_cancel_filled')
+            }
+          })
+          .layoutWeight(1)
+          .height(35)
+          .maxLength(20)
+          .backgroundColor(this.isDarkMode?Color.Black:'#F5F5F5')
+          .placeholderColor(Color.Grey)
+          .placeholderFont({ size: 14, weight: 400 })
+          .textFont({ size: 14, weight: 400 })
+          .onSubmit((value: string) => {
+            console.log('onecold onSubmit ='+value)
+            this.searchController.stopEditing()
+            this.onSearchInput(this.searchText);
 
+          })
+          .onChange((value: string) => {
+            console.log('onecold onChange ='+value)
+            this.onSearchInput(value);
+          })
+          .visibility(this.isSearchMode?Visibility.Visible:Visibility.None)
+          .animation({ duration: 300, curve: Curve.Ease })
 
 
         //搜索按钮
@@ -655,6 +724,7 @@ export struct WebDavMainPage {
           .attributeModifier(new ShadowModifier())
           .zIndex(0)
           .onClick(()=>{
+            this.filteredFolderList = [...this.visibleFoldersState]; // 显示所有文件夹
             this.isSearchMode = true
           })
           //排序按钮
@@ -695,9 +765,11 @@ export struct WebDavMainPage {
 
   //搜索功能的实现
   @State searchText: string = ''; // 用户输入内容
-  @State filteredList: Array<VideoItem> = []; // 过滤后的结果
+  @State filteredList: Array<VideoItem> = []; // 过滤后的歌曲结果
+  @State filteredFolderList: Array<FileInfo> = []; // 过滤后的文件夹结果
 
   // 实时搜索逻辑(带防抖)
+// 实时搜索逻辑(带防抖)
   private onSearchInput(value: string) {
     this.searchText = value.trim();
     let mSearchList: Array<VideoItem> = []
@@ -706,6 +778,7 @@ export struct WebDavMainPage {
     // 新增条件判断:空输入时显示所有数据
     if (this.searchText === '') {
       this.filteredList = [...mSearchList]; // 创建新数组以触发状态更新
+      this.filteredFolderList = [...this.visibleFoldersState]; // 显示所有文件夹
     } else {
       this.filteredList = mSearchList.filter((item: VideoItem) => {
         //支持模糊匹配和艺术家 专辑匹配
@@ -715,29 +788,93 @@ export struct WebDavMainPage {
         regex.test(item.artist?.toLowerCase()  ?? "") ||
         regex.test(item.album?.toLowerCase()  ?? "")
       });
+      
+      // 对文件夹进行过滤
+      this.filteredFolderList = this.visibleFoldersState.filter((folder: FileInfo) => {
+        const regex = new RegExp(this.searchText.toLowerCase().replace(/\s+/g, '.*'), 'i');
+        return regex.test(folder.fileName?.toLowerCase() ?? "") ||
+               regex.test(decodeUrlEncodedString(folder.fileName?.replace('/', '') ?? "").toLowerCase());
+      });
     }
 
     this.updateListData(this.filteredList);
-    // this.isSearchMode  = false; // 根据业务需求决定是否启用
   }
 
   build() {
-    Column() {
-      // 顶部安全区和标题栏
-      this.topTitleBar()
-
-      // 内容区域
+    Stack() {
       if (this.accounts.length === 0) {
         this.buildEmptyView();
       } else {
         this.buildContentView();
       }
+      Column() {
+        this.topTitleBar()
+        this.breaker()
+      }
+
     }
+    .alignContent(Alignment.Top)
     .width('100%')
     .height('100%')
-    .backgroundColor($r('app.color.start_window_background'))
   }
 
+  @Builder
+  breaker() {
+    // 加载按钮和面包屑导航
+    Column({ space: 8 }) {
+
+      // 面包屑导航
+      if (this.webdavManager.currentPath !== '') {
+        Row({ space: 8 }) {
+          Button({ type: ButtonType.Circle }) {
+            Image(this.webdavManager.canGoBack()?$r('app.media.back'):this.selectedAccount.coverPath)
+              .width(15)
+              .height(15)
+              .borderRadius(10)
+              .alt($r('app.media.cloudDisk'))
+              .fillColor(Color.White)
+          }
+          .width(20)
+          .height(20)
+          .margin({left:5})
+          .backgroundColor(this.themeColor)
+          .onClick(() => this.goBack())
+
+          Row({ space: 4 }) {
+            ForEach(this.breadcrumbs, (crumb: string, index: number) => {
+              Row() {
+                Text(crumb)
+                  .fontSize(15)
+                  .fontColor(this.themeColor)
+                  .maxLines(1)
+                  .textOverflow({ overflow: TextOverflow.Ellipsis })
+              }
+              .onClick(() => {
+                this.navigateToBreadcrumb(index);
+              })
+
+              // 添加分隔符(除了最后一个元素)
+              if (index < this.breadcrumbs.length - 1) {
+                Text('/')
+                  .fontSize(15)
+                  .fontColor($r('app.color.index_tab_font_color'))
+                  .opacity(0.6)
+              }
+            })
+          }
+          .layoutWeight(1)
+
+        }
+        .width('100%')
+        .padding({ left: 4, right: 4 })
+      }
+
+    }
+    .width('100%')
+    .padding({ left: 12, right: 12,top: 10,bottom: 5 })
+  }
+
+
   // 空状态视图
   @Builder
   buildEmptyView() {
@@ -755,6 +892,7 @@ export struct WebDavMainPage {
     }
     .justifyContent(FlexAlign.Center)
     .width('100%')
+    .padding({top: this.topSafeHeight+50})
     .layoutWeight(1)
   }
 
@@ -763,87 +901,6 @@ export struct WebDavMainPage {
   buildContentView() {
     Column() {
 
-
-      // 加载按钮和面包屑导航
-      Column({ space: 8 }) {
-
-
-        // 面包屑导航
-        if (this.webdavManager.currentPath !== '') {
-          Row({ space: 8 }) {
-            Button({ type: ButtonType.Circle }) {
-              Image(this.webdavManager.canGoBack()?$r('app.media.back'):this.selectedAccount.coverPath)
-                .width(15)
-                .height(15)
-                .borderRadius(10)
-                .alt($r('app.media.cloudDisk'))
-                .fillColor(Color.White)
-            }
-            .width(20)
-            .height(20)
-            .backgroundColor(this.themeColor)
-            .onClick(() => this.goBack())
-
-            Row({ space: 4 }) {
-              ForEach(this.breadcrumbs, (crumb: string, index: number) => {
-                Row() {
-                  Text(crumb)
-                    .fontSize(15)
-                    .fontColor(this.themeColor)
-                    .maxLines(1)
-                    .textOverflow({ overflow: TextOverflow.Ellipsis })
-                }
-                .onClick(() => {
-                  this.navigateToBreadcrumb(index);
-                })
-
-                // 添加分隔符(除了最后一个元素)
-                if (index < this.breadcrumbs.length - 1) {
-                  Text('/')
-                    .fontSize(15)
-                    .fontColor($r('app.color.index_tab_font_color'))
-                    .opacity(0.6)
-                }
-              })
-            }
-            .layoutWeight(1)
-
-          }
-          .width('100%')
-          .padding({ left: 4, right: 4 })
-        }
-
-        // 统计信息
-      // if (this.webDavFiles.length > 0) {
-      //     Row() {
-      //       Text(this.visibleFoldersState.length + ' 个文件夹, ' + this.songs.length + ' 首歌曲')
-      //         .fontSize(13)
-      //         .fontColor($r('app.color.index_tab_font_color'))
-      //         .opacity(0.6)
-      //         .layoutWeight(1)
-      //         .textAlign(TextAlign.Start)
-      //       Blank()
-      //       Button('一键创建歌单',{ type: ButtonType.Capsule, stateEffect: true })
-      //         .type(ButtonType.Normal)
-      //         .fontSize(12)
-      //         .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
-      //         .backgroundColor(this.themeColor)
-      //         .fontColor(Color.White)
-      //         .padding({ left: 12, right: 12, top: 6, bottom: 6 })
-      //         .borderRadius(16)
-      //         .visibility(this.songs.length > 0 ? Visibility.Visible : Visibility.None)
-      //         .onClick(() => {
-      //           Logger.info(TAG, 'heanup 点击一键创建歌单按钮');
-      //           this.createPlaylistFromCurrentWebDav();
-      //         })
-      //     }
-      //     .padding({ left: 4, right: 4 })
-      //   }
-      }
-      .width('100%')
-      .padding(12)
-      .margin({ top: 8 })
-
       // 加载状态
 
       Row() {
@@ -856,7 +913,7 @@ export struct WebDavMainPage {
           .fontColor($r('app.color.index_tab_font_color'))
           .margin({ left: 12 })
       }
-      .padding(20)
+      .padding({top: this.topSafeHeight + 180, bottom: 20, left: 20, right: 20})
       .visibility(this.isLoading?Visibility.Visible:Visibility.None)
       .opacity(this.isLoading ? 1 : 0)
       .animation({
@@ -869,14 +926,14 @@ export struct WebDavMainPage {
       if (this.webDavFiles.length > 0) {
         List({ space: 0 }) {
           // 显示文件夹 - 只显示当前目录下的直接子文件夹
-          ForEach(this.visibleFoldersState, (folder: FileInfo) => {
+          ForEach(this.isSearchMode ? this.filteredFolderList : this.visibleFoldersState, (folder: FileInfo) => {
             ListItem() {
               this.buildFolderItem(folder)
             }
             .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 1.2, y: 1.2 }).animation({ duration: 600 }),
               TransitionEffect.scale({ x: 0, y: 0 })))
             .clickEffect({ level: ClickEffectLevel.MIDDLE })
-          })
+          }, (folder: FileInfo) =>  folder.name+folder.fileName)
 
           // 显示歌曲
           LazyForEach(this.dataSource, (song: VideoItem, index: number) => {
@@ -886,10 +943,12 @@ export struct WebDavMainPage {
             .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 1.2, y: 1.2 }).animation({ duration: 600 }),
               TransitionEffect.scale({ x: 0, y: 0 })))
             .clickEffect({ level: ClickEffectLevel.MIDDLE })
-          })
+          }, (item: VideoItem) =>  item.filePath)
         }
+
+        .contentStartOffset(this.topSafeHeight + 80)
+        .contentEndOffset(this.bottomSafeHeight)
         .layoutWeight(1)
-        .divider({ strokeWidth: 1, color: this.isDarkMode ? '#333333' :'#EEEEEE' })
         .margin({ top: 4 })
       } else if (!this.isLoading) {
         Column() {
@@ -897,7 +956,7 @@ export struct WebDavMainPage {
             .fontSize(14)
             .fontColor($r('app.color.index_tab_font_color'))
             .opacity(0.6)
-          Text('点击"加载文件列表"按钮加载')
+          Text('点击"左侧菜单"网盘加载')
             .fontSize(12)
             .fontColor($r('app.color.index_tab_font_color'))
             .opacity(0.4)
@@ -908,6 +967,7 @@ export struct WebDavMainPage {
       }
     }
     .layoutWeight(1)
+
   }
 
   // 文件夹列表项
@@ -973,7 +1033,6 @@ export struct WebDavMainPage {
             .textOverflow({ overflow: this.isLongNameRoLL?TextOverflow.MARQUEE:TextOverflow.Ellipsis })//超长滚动
             .fontColor(this.currentSong?.filePath==song.filePath?this.themeColor:$r('app.color.index_tab_font_color'))
             .maxLines(1)
-            .margin({ right: 20 })
             .textOverflow({ overflow: TextOverflow.Ellipsis })
 
           Row(){
@@ -991,9 +1050,16 @@ export struct WebDavMainPage {
               .opacity(0.6)
               .maxLines(1)
               .textOverflow({ overflow: TextOverflow.Ellipsis })
+            Text(song.cTime)
+              .fontSize(13)
+              .fontColor(this.currentSong?.filePath==song.filePath?this.themeColor:
+                $r('app.color.index_tab_font_color'))
+              .opacity(0.6)
+              .maxLines(1)
+              .visibility(StrUtil.isNotEmpty(song.artist)?Visibility.None:Visibility.Visible)
+              .textOverflow({ overflow: TextOverflow.Ellipsis })
           }
-          .padding({ right: 20 })
-
+          .width('90%')
         }
         .alignItems(HorizontalAlign.Start)
         .layoutWeight(1)

+ 1 - 0
entry/src/main/ets/view/LocalMusic.ets

@@ -4644,6 +4644,7 @@ export struct LocalMusic {
             }
             .width('100%')
             .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.9 })
+
             .bindContextMenu(this.MenuBuilder(item, index, item.filePath), ResponseType.LongPress,
               {
                 preview: MenuPreviewMode.IMAGE,

+ 21 - 0
entry/src/main/resources/base/element/string.json

@@ -670,6 +670,27 @@
     {
       "name": "import_from_files",
       "value": "从文件管理器导入"
+    },
+    {
+      "name": "webdav",
+      "value": "WebDav"
+    },
+    {
+      "name": "smb",
+      "value": "SMB"
+    },
+    {
+      "name": "ftp",
+      "value": "FTP"
+    },
+    {
+      "name": "ftps",
+      "value": "FTPS"
+    },
+    {
+      "name": "navidrome",
+      "value": "Navidrome"
     }
+
   ]
 }