|
@@ -70,12 +70,13 @@ export struct WebDavMainPage {
|
|
|
|
|
|
|
|
@State visibleFoldersState: FileInfo[] = []; // 改为普通状态变量
|
|
@State visibleFoldersState: FileInfo[] = []; // 改为普通状态变量
|
|
|
|
|
|
|
|
- onSwitchAccount(){
|
|
|
|
|
|
|
+ async onSwitchAccount(){
|
|
|
console.log('onecold 切换账户:', this.selectedAccount.name);
|
|
console.log('onecold 切换账户:', this.selectedAccount.name);
|
|
|
this.songs = [];
|
|
this.songs = [];
|
|
|
|
|
+ this.visibleFoldersState = [];
|
|
|
this.updateListData(this.songs)
|
|
this.updateListData(this.songs)
|
|
|
this.isLoading = true;
|
|
this.isLoading = true;
|
|
|
- this.webdavManager.loadFilesInfoFromAccount(this.selectedAccount)
|
|
|
|
|
|
|
+ await this.webdavManager.loadFilesInfoFromAccount(this.selectedAccount)
|
|
|
.catch((error: Error) => {
|
|
.catch((error: Error) => {
|
|
|
Logger.error(TAG, '加载文件失败: ' + error.message);
|
|
Logger.error(TAG, '加载文件失败: ' + error.message);
|
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|
|
@@ -174,9 +175,9 @@ export struct WebDavMainPage {
|
|
|
// 更新可见文件夹列表
|
|
// 更新可见文件夹列表
|
|
|
this.updateVisibleFolders();
|
|
this.updateVisibleFolders();
|
|
|
|
|
|
|
|
- // promptAction.showToast({
|
|
|
|
|
- // message: '加载成功: ' + this.webDavFiles.filter(f => f.isDirectory).length + '个文件夹, ' + this.songs.length + '首歌曲'
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ promptAction.showToast({
|
|
|
|
|
+ message: '加载成功: ' + this.webDavFiles.filter(f => f.isDirectory).length + '个文件夹, ' + this.songs.length + '首歌曲'
|
|
|
|
|
+ });
|
|
|
break;
|
|
break;
|
|
|
case WebdavManagerStates.LoadFilesInfoFailed:
|
|
case WebdavManagerStates.LoadFilesInfoFailed:
|
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|
|
@@ -577,6 +578,9 @@ export struct WebDavMainPage {
|
|
|
ListItem() {
|
|
ListItem() {
|
|
|
this.buildFolderItem(folder)
|
|
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 })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 显示歌曲
|
|
// 显示歌曲
|
|
@@ -584,6 +588,9 @@ export struct WebDavMainPage {
|
|
|
ListItem() {
|
|
ListItem() {
|
|
|
this.buildSongItem(song, index)
|
|
this.buildSongItem(song, index)
|
|
|
}
|
|
}
|
|
|
|
|
+ .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 1.2, y: 1.2 }).animation({ duration: 600 }),
|
|
|
|
|
+ TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE })
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
@@ -639,7 +646,8 @@ export struct WebDavMainPage {
|
|
|
.reuseId('dir_item')
|
|
.reuseId('dir_item')
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.padding(12)
|
|
.padding(12)
|
|
|
- .backgroundColor($r('app.color.start_window_background'))
|
|
|
|
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
|
|
+ // .backgroundColor($r('app.color.start_window_background'))
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.8 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.8 })
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
this.enterFolder(folder);
|
|
this.enterFolder(folder);
|
|
@@ -658,7 +666,9 @@ export struct WebDavMainPage {
|
|
|
.width(48)
|
|
.width(48)
|
|
|
.height(48)
|
|
.height(48)
|
|
|
.borderRadius(4)
|
|
.borderRadius(4)
|
|
|
|
|
+ .fillColor(this.themeColor)
|
|
|
.objectFit(ImageFit.Cover)
|
|
.objectFit(ImageFit.Cover)
|
|
|
|
|
+ .margin({ left: 8 })
|
|
|
|
|
|
|
|
// 歌曲信息
|
|
// 歌曲信息
|
|
|
Column({ space: 4 }) {
|
|
Column({ space: 4 }) {
|
|
@@ -689,7 +699,7 @@ export struct WebDavMainPage {
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.padding(12)
|
|
.padding(12)
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.8 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.8 })
|
|
|
- .backgroundColor($r('app.color.start_window_background'))
|
|
|
|
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
this.playSong(song, index);
|
|
this.playSong(song, index);
|
|
|
})
|
|
})
|