|
@@ -25,6 +25,16 @@ interface PlaylistEventData {
|
|
|
|
|
|
|
|
const TAG = 'heanup WebDavMainPage';
|
|
const TAG = 'heanup WebDavMainPage';
|
|
|
|
|
|
|
|
|
|
+// URL解码函数
|
|
|
|
|
+function decodeUrlEncodedString(encodedStr: string): string {
|
|
|
|
|
+ try {
|
|
|
|
|
+ return decodeURIComponent(encodedStr);
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ // 如果解码失败,返回原始字符串
|
|
|
|
|
+ return encodedStr;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
@Preview
|
|
@Preview
|
|
|
@Entry
|
|
@Entry
|
|
|
@Component
|
|
@Component
|
|
@@ -34,10 +44,47 @@ export struct WebDavMainPage {
|
|
|
@State selectedAccount: WebDavAccount | null = null;
|
|
@State selectedAccount: WebDavAccount | null = null;
|
|
|
@State songs: Song[] = [];
|
|
@State songs: Song[] = [];
|
|
|
@State isLoading: boolean = false;
|
|
@State isLoading: boolean = false;
|
|
|
|
|
+ @State webDavFiles: FileInfo[] = []; // 直接在页面中保存文件列表副本
|
|
|
@StorageProp('themeColor') themeColor: string = CommonConstants.DEFAULT_THEME_COLOR;
|
|
@StorageProp('themeColor') themeColor: string = CommonConstants.DEFAULT_THEME_COLOR;
|
|
|
@StorageProp('isDarkMode') isDarkMode: boolean = false;
|
|
@StorageProp('isDarkMode') isDarkMode: boolean = false;
|
|
|
@State topRectHeight: number = 0; // 顶部安全区高度
|
|
@State topRectHeight: number = 0; // 顶部安全区高度
|
|
|
|
|
|
|
|
|
|
+ @State visibleFoldersState: FileInfo[] = []; // 改为普通状态变量
|
|
|
|
|
+
|
|
|
|
|
+ // 更新可见文件夹列表
|
|
|
|
|
+ private updateVisibleFolders(): void {
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 安全检查webDavFiles
|
|
|
|
|
+ if (!this.webDavFiles || !Array.isArray(this.webDavFiles)) {
|
|
|
|
|
+ this.visibleFoldersState = [];
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const allFolders = this.webDavFiles.filter(f => f.isDirectory);
|
|
|
|
|
+ const visible: FileInfo[] = [];
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < allFolders.length; i++) {
|
|
|
|
|
+ const folder = allFolders[i];
|
|
|
|
|
+
|
|
|
|
|
+ // 安全检查folder对象
|
|
|
|
|
+ if (!folder || typeof folder.fileName !== 'string') {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const shouldShow = this.isDirectChildOfCurrentPath(folder);
|
|
|
|
|
+
|
|
|
|
|
+ if (shouldShow) {
|
|
|
|
|
+ visible.push(folder);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.visibleFoldersState = visible;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ Logger.error(TAG, '更新文件夹列表失败:', error.toString());
|
|
|
|
|
+ this.visibleFoldersState = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 对话框控制器
|
|
// 对话框控制器
|
|
|
private accountDialogController: CustomDialogController | null = null;
|
|
private accountDialogController: CustomDialogController | null = null;
|
|
|
// 保存事件处理器引用,用于取消订阅
|
|
// 保存事件处理器引用,用于取消订阅
|
|
@@ -76,14 +123,18 @@ export struct WebDavMainPage {
|
|
|
|
|
|
|
|
// 处理WebDAV事件
|
|
// 处理WebDAV事件
|
|
|
private handleWebdavEvent(event: string): void {
|
|
private handleWebdavEvent(event: string): void {
|
|
|
- Logger.info(TAG, `收到WebDAV事件: ${event}`);
|
|
|
|
|
-
|
|
|
|
|
switch (event) {
|
|
switch (event) {
|
|
|
case WebdavManagerStates.LoadFilesInfoSucceed:
|
|
case WebdavManagerStates.LoadFilesInfoSucceed:
|
|
|
this.songs = this.webdavManager.webDavSongs;
|
|
this.songs = this.webdavManager.webDavSongs;
|
|
|
|
|
+ // 直接引用webdavManager的数组,避免@Observed序列化问题
|
|
|
|
|
+ this.webDavFiles = this.webdavManager.webDavFiles;
|
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|
|
|
|
|
+
|
|
|
|
|
+ // 更新可见文件夹列表
|
|
|
|
|
+ this.updateVisibleFolders();
|
|
|
|
|
+
|
|
|
promptAction.showToast({
|
|
promptAction.showToast({
|
|
|
- message: `加载成功: ${this.webdavManager.webDavFiles.filter(f => f.isDirectory).length}个文件夹, ${this.songs.length}首歌曲`
|
|
|
|
|
|
|
+ message: '加载成功: ' + this.webDavFiles.filter(f => f.isDirectory).length + '个文件夹, ' + this.songs.length + '首歌曲'
|
|
|
});
|
|
});
|
|
|
break;
|
|
break;
|
|
|
case WebdavManagerStates.LoadFilesInfoFailed:
|
|
case WebdavManagerStates.LoadFilesInfoFailed:
|
|
@@ -95,8 +146,6 @@ export struct WebDavMainPage {
|
|
|
case WebdavManagerStates.RemoveAccountSucceed:
|
|
case WebdavManagerStates.RemoveAccountSucceed:
|
|
|
this.loadAccounts();
|
|
this.loadAccounts();
|
|
|
break;
|
|
break;
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -109,41 +158,61 @@ export struct WebDavMainPage {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 加载文件列表
|
|
// 加载文件列表
|
|
|
- private async loadFiles(): Promise<void> {
|
|
|
|
|
|
|
+ private loadFiles(): void {
|
|
|
if (!this.selectedAccount) {
|
|
if (!this.selectedAccount) {
|
|
|
promptAction.showToast({ message: '请先选择账户' });
|
|
promptAction.showToast({ message: '请先选择账户' });
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.isLoading = true;
|
|
this.isLoading = true;
|
|
|
- try {
|
|
|
|
|
- await this.webdavManager.loadFilesInfoFromWebdav();
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- Logger.error(TAG, `加载文件失败: ${error}`);
|
|
|
|
|
- this.isLoading = false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.webdavManager.loadFilesInfoFromWebdav()
|
|
|
|
|
+ .catch((error: Error) => {
|
|
|
|
|
+ Logger.error(TAG, '加载文件失败: ' + error.message);
|
|
|
|
|
+ this.isLoading = false;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 进入文件夹
|
|
// 进入文件夹
|
|
|
- private async enterFolder(folder: FileInfo): Promise<void> {
|
|
|
|
|
|
|
+ private enterFolder(folder: FileInfo): void {
|
|
|
this.isLoading = true;
|
|
this.isLoading = true;
|
|
|
- try {
|
|
|
|
|
- await this.webdavManager.enterFolder(folder);
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- Logger.error(TAG, `进入文件夹失败: ${error}`);
|
|
|
|
|
- this.isLoading = false;
|
|
|
|
|
|
|
+ this.webdavManager.enterFolder(folder)
|
|
|
|
|
+ .catch((error: Error) => {
|
|
|
|
|
+ Logger.error(TAG, '进入文件夹失败: ' + error.message);
|
|
|
|
|
+ this.isLoading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 检查是否为当前目录的直接子项
|
|
|
|
|
+ private isDirectChildOfCurrentPath(folder: FileInfo): boolean {
|
|
|
|
|
+ const currentPath = this.webdavManager.currentPath || '';
|
|
|
|
|
+
|
|
|
|
|
+ // 如果在根目录(currentPath为空或'/'),显示所有第一级文件夹
|
|
|
|
|
+ if (currentPath === '' || currentPath === '/') {
|
|
|
|
|
+ // 根目录情况下,显示所有第一级文件夹(href格式为/foldername)
|
|
|
|
|
+ return folder.href.startsWith('/') &&
|
|
|
|
|
+ folder.href !== '/' &&
|
|
|
|
|
+ !folder.href.substring(1).includes('/');
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 非根目录情况,计算相对路径
|
|
|
|
|
+ let relativePath = folder.href;
|
|
|
|
|
+ if (currentPath !== '/') {
|
|
|
|
|
+ relativePath = folder.href.replace(currentPath, '');
|
|
|
|
|
+ }
|
|
|
|
|
+ relativePath = relativePath.replace(/^\//, '').replace(/\/$/, '');
|
|
|
|
|
+
|
|
|
|
|
+ // 只有相对路径不为空且不包含/时才认为是直接子项
|
|
|
|
|
+ return relativePath !== '' && !relativePath.includes('/');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 返回上级目录
|
|
// 返回上级目录
|
|
|
- private async goBack(): Promise<void> {
|
|
|
|
|
|
|
+ private goBack(): void {
|
|
|
this.isLoading = true;
|
|
this.isLoading = true;
|
|
|
- try {
|
|
|
|
|
- await this.webdavManager.goBack();
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- Logger.error(TAG, `返回失败: ${error}`);
|
|
|
|
|
- this.isLoading = false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.webdavManager.goBack()
|
|
|
|
|
+ .catch((error: Error) => {
|
|
|
|
|
+ Logger.error(TAG, '返回失败: ' + error.message);
|
|
|
|
|
+ this.isLoading = false;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 切换账户
|
|
// 切换账户
|
|
@@ -158,27 +227,26 @@ export struct WebDavMainPage {
|
|
|
builder: WebDavAccountDialog({
|
|
builder: WebDavAccountDialog({
|
|
|
isEditMode: false,
|
|
isEditMode: false,
|
|
|
account: new WebDavAccount(),
|
|
account: new WebDavAccount(),
|
|
|
- onConfirm: async (account: WebDavAccount) => {
|
|
|
|
|
- try {
|
|
|
|
|
- await this.webdavManager.insertAccount(
|
|
|
|
|
- account.name,
|
|
|
|
|
- account.host,
|
|
|
|
|
- account.localHost,
|
|
|
|
|
- account.isUseLocalHost,
|
|
|
|
|
- account.port,
|
|
|
|
|
- account.filepath,
|
|
|
|
|
- account.lyricFilePath,
|
|
|
|
|
- account.uploadFilePath,
|
|
|
|
|
- account.imageFilePath,
|
|
|
|
|
- account.account,
|
|
|
|
|
- account.password,
|
|
|
|
|
- account.enableHttps
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ onConfirm: (account: WebDavAccount) => {
|
|
|
|
|
+ this.webdavManager.insertAccount(
|
|
|
|
|
+ account.name,
|
|
|
|
|
+ account.host,
|
|
|
|
|
+ account.localHost,
|
|
|
|
|
+ account.isUseLocalHost,
|
|
|
|
|
+ account.port,
|
|
|
|
|
+ account.filepath,
|
|
|
|
|
+ account.lyricFilePath,
|
|
|
|
|
+ account.uploadFilePath,
|
|
|
|
|
+ account.imageFilePath,
|
|
|
|
|
+ account.account,
|
|
|
|
|
+ account.password,
|
|
|
|
|
+ account.enableHttps
|
|
|
|
|
+ ).then(() => {
|
|
|
promptAction.showToast({ message: '添加成功' });
|
|
promptAction.showToast({ message: '添加成功' });
|
|
|
- } catch (error) {
|
|
|
|
|
- Logger.error(TAG, `添加账户失败: ${error}`);
|
|
|
|
|
|
|
+ }).catch((error: Error) => {
|
|
|
|
|
+ Logger.error(TAG, '添加账户失败: ' + error.message);
|
|
|
promptAction.showToast({ message: '添加失败' });
|
|
promptAction.showToast({ message: '添加失败' });
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}),
|
|
}),
|
|
|
autoCancel: true,
|
|
autoCancel: true,
|
|
@@ -193,14 +261,14 @@ export struct WebDavMainPage {
|
|
|
builder: WebDavAccountDialog({
|
|
builder: WebDavAccountDialog({
|
|
|
isEditMode: true,
|
|
isEditMode: true,
|
|
|
account: account,
|
|
account: account,
|
|
|
- onConfirm: async (updatedAccount: WebDavAccount) => {
|
|
|
|
|
- try {
|
|
|
|
|
- await this.webdavManager.editAccount(updatedAccount);
|
|
|
|
|
- promptAction.showToast({ message: '更新成功' });
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- Logger.error(TAG, `更新账户失败: ${error}`);
|
|
|
|
|
- promptAction.showToast({ message: '更新失败' });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ onConfirm: (updatedAccount: WebDavAccount) => {
|
|
|
|
|
+ this.webdavManager.editAccount(updatedAccount)
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ promptAction.showToast({ message: '更新成功' });
|
|
|
|
|
+ }).catch((error: Error) => {
|
|
|
|
|
+ Logger.error(TAG, '更新账户失败: ' + error.message);
|
|
|
|
|
+ promptAction.showToast({ message: '更新失败' });
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}),
|
|
}),
|
|
|
autoCancel: true,
|
|
autoCancel: true,
|
|
@@ -230,7 +298,7 @@ export struct WebDavMainPage {
|
|
|
}).then((result) => {
|
|
}).then((result) => {
|
|
|
if (result.index >= 0 && result.index < this.accounts.length) {
|
|
if (result.index >= 0 && result.index < this.accounts.length) {
|
|
|
this.switchAccount(this.accounts[result.index]);
|
|
this.switchAccount(this.accounts[result.index]);
|
|
|
- promptAction.showToast({ message: `已切换到: ${this.accounts[result.index].name}` });
|
|
|
|
|
|
|
+ promptAction.showToast({ message: '已切换到: ' + this.accounts[result.index].name });
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -258,8 +326,8 @@ export struct WebDavMainPage {
|
|
|
private playSong(song: Song, index: number): void {
|
|
private playSong(song: Song, index: number): void {
|
|
|
try {
|
|
try {
|
|
|
Logger.info(TAG, `heanup === WebDAV playSong 方法被调用 ===`);
|
|
Logger.info(TAG, `heanup === WebDAV playSong 方法被调用 ===`);
|
|
|
- Logger.info(TAG, `heanup 播放指定歌曲: ${song.title}, 索引: ${index}`);
|
|
|
|
|
- Logger.info(TAG, `heanup 歌曲列表长度: ${this.songs.length}`);
|
|
|
|
|
|
|
+ Logger.info(TAG, 'heanup 播放指定歌曲: ' + song.title + ', 索引: ' + index);
|
|
|
|
|
+ Logger.info(TAG, 'heanup 歌曲列表长度: ' + this.songs.length);
|
|
|
|
|
|
|
|
// 将当前歌曲列表转换为VideoItem数组
|
|
// 将当前歌曲列表转换为VideoItem数组
|
|
|
const videoItems: VideoItem[] = [];
|
|
const videoItems: VideoItem[] = [];
|
|
@@ -271,26 +339,26 @@ export struct WebDavMainPage {
|
|
|
songFilePaths.push(item.filePath); // 使用filePath作为文件路径
|
|
songFilePaths.push(item.filePath); // 使用filePath作为文件路径
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Logger.info(TAG, `heanup 所有WebDAV歌曲文件路径: ${JSON.stringify(songFilePaths)}`);
|
|
|
|
|
|
|
+ Logger.info(TAG, 'heanup 所有WebDAV歌曲文件路径: ' + JSON.stringify(songFilePaths));
|
|
|
|
|
|
|
|
// 保存WebDAV歌曲数据到全局上下文
|
|
// 保存WebDAV歌曲数据到全局上下文
|
|
|
const globalContext = GlobalContext.getContext();
|
|
const globalContext = GlobalContext.getContext();
|
|
|
globalContext.setObject('videoItems', videoItems);
|
|
globalContext.setObject('videoItems', videoItems);
|
|
|
globalContext.setObject('currentPlayIndex', index);
|
|
globalContext.setObject('currentPlayIndex', index);
|
|
|
- Logger.info(TAG, `heanup 已将WebDAV歌曲列表保存到全局上下文,长度:${videoItems.length}`);
|
|
|
|
|
|
|
+ Logger.info(TAG, 'heanup 已将WebDAV歌曲列表保存到全局上下文,长度:' + videoItems.length);
|
|
|
|
|
|
|
|
// 发送播放事件,类似歌单播放的方式
|
|
// 发送播放事件,类似歌单播放的方式
|
|
|
const eventPlaylistPlay: emitter.InnerEvent = { eventId: EventConstants.EVENT_PLAYLIST_PLAY };
|
|
const eventPlaylistPlay: emitter.InnerEvent = { eventId: EventConstants.EVENT_PLAYLIST_PLAY };
|
|
|
const playlistData: PlaylistEventData = {
|
|
const playlistData: PlaylistEventData = {
|
|
|
playlistId: 'webdav-playlist', // 使用特殊的ID标识WebDAV播放列表
|
|
playlistId: 'webdav-playlist', // 使用特殊的ID标识WebDAV播放列表
|
|
|
- playlistName: `WebDAV - ${this.selectedAccount?.name || '未知账户'}`,
|
|
|
|
|
|
|
+ playlistName: 'WebDAV - ' + (this.selectedAccount?.name || '未知账户'),
|
|
|
songCount: this.songs.length,
|
|
songCount: this.songs.length,
|
|
|
startIndex: index,
|
|
startIndex: index,
|
|
|
songFilePaths: songFilePaths
|
|
songFilePaths: songFilePaths
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- Logger.info(TAG, `heanup 准备发送WebDAV播放事件,eventId: ${eventPlaylistPlay.eventId}`);
|
|
|
|
|
- Logger.info(TAG, `heanup 发送WebDAV播放事件数据: ${JSON.stringify(playlistData)}`);
|
|
|
|
|
|
|
+ Logger.info(TAG, 'heanup 准备发送WebDAV播放事件,eventId: ' + eventPlaylistPlay.eventId);
|
|
|
|
|
+ Logger.info(TAG, 'heanup 发送WebDAV播放事件数据: ' + JSON.stringify(playlistData));
|
|
|
|
|
|
|
|
const eventData: emitter.EventData = {
|
|
const eventData: emitter.EventData = {
|
|
|
data: playlistData
|
|
data: playlistData
|
|
@@ -305,12 +373,12 @@ export struct WebDavMainPage {
|
|
|
fromWebDAV: true
|
|
fromWebDAV: true
|
|
|
}
|
|
}
|
|
|
}).catch((error: Error) => {
|
|
}).catch((error: Error) => {
|
|
|
- Logger.error(TAG, `跳转首页失败: ${error.message}`);
|
|
|
|
|
|
|
+ Logger.error(TAG, '跳转首页失败: ' + error.message);
|
|
|
promptAction.showToast({ message: '跳转失败' });
|
|
promptAction.showToast({ message: '跳转失败' });
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
const err = error as Error;
|
|
const err = error as Error;
|
|
|
- Logger.error(TAG, `播放歌曲失败: ${err.message}`);
|
|
|
|
|
|
|
+ Logger.error(TAG, '播放歌曲失败: ' + err.message);
|
|
|
promptAction.showToast({ message: '播放失败' });
|
|
promptAction.showToast({ message: '播放失败' });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -480,8 +548,8 @@ export struct WebDavMainPage {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 统计信息
|
|
// 统计信息
|
|
|
- if (this.webdavManager.webDavFiles.length > 0) {
|
|
|
|
|
- Text(`${this.webdavManager.webDavFiles.filter(f => f.isDirectory).length} 个文件夹, ${this.songs.length} 首歌曲`)
|
|
|
|
|
|
|
+ if (this.webDavFiles.length > 0) {
|
|
|
|
|
+ Text(this.visibleFoldersState.length + ' 个文件夹, ' + this.songs.length + ' 首歌曲')
|
|
|
.fontSize(13)
|
|
.fontSize(13)
|
|
|
.fontColor($r('app.color.index_tab_font_color'))
|
|
.fontColor($r('app.color.index_tab_font_color'))
|
|
|
.opacity(0.6)
|
|
.opacity(0.6)
|
|
@@ -507,10 +575,10 @@ export struct WebDavMainPage {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 文件列表(文件夹 + 歌曲)
|
|
// 文件列表(文件夹 + 歌曲)
|
|
|
- if (this.webdavManager.webDavFiles.length > 0) {
|
|
|
|
|
|
|
+ if (this.webDavFiles.length > 0) {
|
|
|
List({ space: 0 }) {
|
|
List({ space: 0 }) {
|
|
|
- // 显示文件夹
|
|
|
|
|
- ForEach(this.webdavManager.webDavFiles.filter(f => f.isDirectory), (folder: FileInfo) => {
|
|
|
|
|
|
|
+ // 显示文件夹 - 只显示当前目录下的直接子文件夹
|
|
|
|
|
+ ForEach(this.visibleFoldersState, (folder: FileInfo) => {
|
|
|
ListItem() {
|
|
ListItem() {
|
|
|
this.buildFolderItem(folder)
|
|
this.buildFolderItem(folder)
|
|
|
}
|
|
}
|
|
@@ -548,19 +616,16 @@ export struct WebDavMainPage {
|
|
|
// 文件夹列表项
|
|
// 文件夹列表项
|
|
|
@Builder
|
|
@Builder
|
|
|
buildFolderItem(folder: FileInfo) {
|
|
buildFolderItem(folder: FileInfo) {
|
|
|
- Row({ space: 12 }) {
|
|
|
|
|
- // 文件夹图标
|
|
|
|
|
- Image($r('app.media.cloudDisk'))
|
|
|
|
|
- .width(48)
|
|
|
|
|
- .height(48)
|
|
|
|
|
|
|
+ Row({ space: 2 }) {
|
|
|
|
|
+ Image($r('app.media.folder'))
|
|
|
|
|
+ .width(32)
|
|
|
|
|
+ .height(32)
|
|
|
.fillColor(this.themeColor)
|
|
.fillColor(this.themeColor)
|
|
|
- .borderRadius(4)
|
|
|
|
|
- .padding(8)
|
|
|
|
|
- .backgroundColor($r('app.color.input_background'))
|
|
|
|
|
|
|
+ .margin({ left: 8, right: 6 })
|
|
|
|
|
|
|
|
// 文件夹信息
|
|
// 文件夹信息
|
|
|
Column({ space: 4 }) {
|
|
Column({ space: 4 }) {
|
|
|
- Text(folder.fileName.replace('/', ''))
|
|
|
|
|
|
|
+ Text(decodeUrlEncodedString(folder.fileName.replace('/', '')))
|
|
|
.fontSize(15)
|
|
.fontSize(15)
|
|
|
.fontColor($r('app.color.index_tab_font_color'))
|
|
.fontColor($r('app.color.index_tab_font_color'))
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
@@ -573,14 +638,6 @@ export struct WebDavMainPage {
|
|
|
}
|
|
}
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
|
-
|
|
|
|
|
- // 右箭头图标
|
|
|
|
|
- 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%')
|
|
.width('100%')
|
|
|
.padding(12)
|
|
.padding(12)
|
|
@@ -611,13 +668,13 @@ export struct WebDavMainPage {
|
|
|
|
|
|
|
|
// 歌曲信息
|
|
// 歌曲信息
|
|
|
Column({ space: 4 }) {
|
|
Column({ space: 4 }) {
|
|
|
- Text(song.title)
|
|
|
|
|
|
|
+ Text(decodeUrlEncodedString(song.title))
|
|
|
.fontSize(15)
|
|
.fontSize(15)
|
|
|
.fontColor($r('app.color.index_tab_font_color'))
|
|
.fontColor($r('app.color.index_tab_font_color'))
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
|
|
|
|
|
- Text(song.artist)
|
|
|
|
|
|
|
+ Text(decodeUrlEncodedString(song.artist))
|
|
|
.fontSize(13)
|
|
.fontSize(13)
|
|
|
.fontColor($r('app.color.index_tab_font_color'))
|
|
.fontColor($r('app.color.index_tab_font_color'))
|
|
|
.opacity(0.6)
|
|
.opacity(0.6)
|