|
@@ -834,6 +834,11 @@ export struct LocalMusic {
|
|
|
if (cachedValue !== undefined) {
|
|
if (cachedValue !== undefined) {
|
|
|
// this.videoLocalList = cachedValue;
|
|
// this.videoLocalList = cachedValue;
|
|
|
Logger.info('onecold 有缓存 cachedValue = ' + cachedValue)
|
|
Logger.info('onecold 有缓存 cachedValue = ' + cachedValue)
|
|
|
|
|
+ if(this.currentPath !=this.rootPath){//第一个封面赋值给currentTitleCover
|
|
|
|
|
+ if(cachedValue[0].pixelMapPath){
|
|
|
|
|
+ this.currentTitleCover = cachedValue[0].pixelMapPath
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
this.updateListData(cachedValue)
|
|
this.updateListData(cachedValue)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -904,10 +909,16 @@ export struct LocalMusic {
|
|
|
this.updateListData(this.videoLocalList)
|
|
this.updateListData(this.videoLocalList)
|
|
|
|
|
|
|
|
if (ArrayUtil.isNotEmpty(files)) {
|
|
if (ArrayUtil.isNotEmpty(files)) {
|
|
|
|
|
+ if(this.currentPath !=this.rootPath){
|
|
|
|
|
+ if(files[0].pixelMapPath){
|
|
|
|
|
+ this.currentTitleCover = files[0].pixelMapPath//第一个封面赋值给currentTitleCover
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// 缓存结果
|
|
// 缓存结果
|
|
|
this.addCache(curPath, this.videoLocalList);
|
|
this.addCache(curPath, this.videoLocalList);
|
|
|
await this.saveCacheToStorage(); // 保存缓存至本地存储
|
|
await this.saveCacheToStorage(); // 保存缓存至本地存储
|
|
|
this.addStringCache(curPath + '_hash', currentHash);
|
|
this.addStringCache(curPath + '_hash', currentHash);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
console.info(`onecold gengxin 1: ${this.videoLocalList.length}`);
|
|
console.info(`onecold gengxin 1: ${this.videoLocalList.length}`);
|
|
@@ -2641,10 +2652,18 @@ export struct LocalMusic {
|
|
|
.visibility(this.isShowTitleBar?Visibility.Visible:Visibility.None)
|
|
.visibility(this.isShowTitleBar?Visibility.Visible:Visibility.None)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @State currentTitleName:string = ''
|
|
|
|
|
- @State currentTitleCover:string = ''
|
|
|
|
|
|
|
+ @State currentTitleName:string = ''//点击歌单,艺术家,专辑进去后的标题
|
|
|
|
|
+ @State currentTitleCover:string|ResourceStr = ''//点击歌单,艺术家,专辑进去后的封面
|
|
|
|
|
|
|
|
isShowCoverTitle(){
|
|
isShowCoverTitle(){
|
|
|
|
|
+ if(this.modeType==0){
|
|
|
|
|
+ if(this.isHistory||this.isFavMusic){
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.currentPath != this.rootPath&&!this.isGridMusic ) {
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return (this.modeType==2||this.modeType==3)&&this.isCanBack&&!this.isGridMusic
|
|
return (this.modeType==2||this.modeType==3)&&this.isCanBack&&!this.isGridMusic
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2664,6 +2683,7 @@ export struct LocalMusic {
|
|
|
Image($r('app.media.left_back_white'))
|
|
Image($r('app.media.left_back_white'))
|
|
|
.width(28)
|
|
.width(28)
|
|
|
.height(28)
|
|
.height(28)
|
|
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
.margin({ left: 12, right: 8 })
|
|
.margin({ left: 12, right: 8 })
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
animateTo({ duration: 555 }, () => {
|
|
animateTo({ duration: 555 }, () => {
|
|
@@ -2671,7 +2691,17 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
Blank().flexGrow(1)
|
|
Blank().flexGrow(1)
|
|
|
- Blank().width(32)
|
|
|
|
|
|
|
+ if(this.modeType==0){
|
|
|
|
|
+ Image($r('app.media.add'))
|
|
|
|
|
+ .width(25)
|
|
|
|
|
+ .height(25)
|
|
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
|
|
+ .margin({ left: 8, right: 15 })
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ this.showAddDialog()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
.height(48)
|
|
.height(48)
|
|
|
.width('100%')
|
|
.width('100%')
|
|
@@ -2683,7 +2713,7 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
Row() {
|
|
|
Column() {
|
|
Column() {
|
|
|
|
|
|
|
|
- Image(StrUtil.isEmpty(this.currentTitleCover) ? this.imageLabel : this.currentTitleCover)
|
|
|
|
|
|
|
+ Image(this.currentTitleCover)
|
|
|
.height(100)
|
|
.height(100)
|
|
|
.width(100)
|
|
.width(100)
|
|
|
.alt(this.imageLabel)
|
|
.alt(this.imageLabel)
|
|
@@ -2692,7 +2722,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
- .margin({left:25,top:10,bottom:10})
|
|
|
|
|
|
|
+ .margin({left:30,top:10,bottom:15})
|
|
|
|
|
|
|
|
Column() {
|
|
Column() {
|
|
|
Column() {
|
|
Column() {
|
|
@@ -2763,12 +2793,8 @@ export struct LocalMusic {
|
|
|
return ('rgba(255,255,255,0.2)')
|
|
return ('rgba(255,255,255,0.2)')
|
|
|
if(this.isDarkMode)
|
|
if(this.isDarkMode)
|
|
|
return $r('app.color.user_center_card_background')
|
|
return $r('app.color.user_center_card_background')
|
|
|
- if(StrUtil.isEmpty(this.currentTitleCover)){
|
|
|
|
|
- return this.imageLabel
|
|
|
|
|
- }else{
|
|
|
|
|
- return this.currentTitleCover
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
+ return this.currentTitleCover
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Builder
|
|
@Builder
|
|
@@ -3963,9 +3989,12 @@ export struct LocalMusic {
|
|
|
case CommonConstants.TYPE_IS_DIR:
|
|
case CommonConstants.TYPE_IS_DIR:
|
|
|
if (item.name === LocalMusic.STR_LOCK_VIDEO) {
|
|
if (item.name === LocalMusic.STR_LOCK_VIDEO) {
|
|
|
this.showVerifyDialog()
|
|
this.showVerifyDialog()
|
|
|
|
|
+ this.currentTitleName = '私密音频'
|
|
|
|
|
+ this.currentTitleCover = $r('app.media.ic_avatar5')
|
|
|
} else if (item.name === LocalMusic.STR_HISTORY_MUSIC) {
|
|
} else if (item.name === LocalMusic.STR_HISTORY_MUSIC) {
|
|
|
this.titleBarModel.setTitleName('最近播放')
|
|
this.titleBarModel.setTitleName('最近播放')
|
|
|
-
|
|
|
|
|
|
|
+ this.currentTitleCover = $r('app.media.ic_avatar2')
|
|
|
|
|
+ this.currentTitleName = '最近播放'
|
|
|
//加载动画效果
|
|
//加载动画效果
|
|
|
this.updateListData(this.historyList,true)
|
|
this.updateListData(this.historyList,true)
|
|
|
// this.videoLocalList = this.historyList
|
|
// this.videoLocalList = this.historyList
|
|
@@ -3977,6 +4006,8 @@ export struct LocalMusic {
|
|
|
this.titleBarModel.setLeftIconMain($r('app.media.left_back_white'))
|
|
this.titleBarModel.setLeftIconMain($r('app.media.left_back_white'))
|
|
|
} else if(item.name === LocalMusic.STR_FAC_VIDEO){
|
|
} else if(item.name === LocalMusic.STR_FAC_VIDEO){
|
|
|
this.titleBarModel.setTitleName('我的收藏')
|
|
this.titleBarModel.setTitleName('我的收藏')
|
|
|
|
|
+ this.currentTitleName = '我的收藏'
|
|
|
|
|
+ this.currentTitleCover = $r('app.media.ic_avatar1')
|
|
|
//加载动画效果
|
|
//加载动画效果
|
|
|
this.updateListData(this.favList)
|
|
this.updateListData(this.favList)
|
|
|
if(ArrayUtil.isEmpty(this.favList)){
|
|
if(ArrayUtil.isEmpty(this.favList)){
|
|
@@ -3985,9 +4016,12 @@ export struct LocalMusic {
|
|
|
this.isFavMusic = true
|
|
this.isFavMusic = true
|
|
|
this.titleBarModel.setLeftIconMain($r('app.media.left_back_white'))
|
|
this.titleBarModel.setLeftIconMain($r('app.media.left_back_white'))
|
|
|
}else {
|
|
}else {
|
|
|
|
|
+ this.currentTitleName = '歌单:'+item.name
|
|
|
this.currentPath = item.filePath
|
|
this.currentPath = item.filePath
|
|
|
|
|
+ this.currentTitleCover = $r('app.media.ic_avatar5')
|
|
|
this.getSortedFiles(this.currentPath)
|
|
this.getSortedFiles(this.currentPath)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
break;
|
|
break;
|
|
|
case CommonConstants.TYPE_IS_ARTIST:
|
|
case CommonConstants.TYPE_IS_ARTIST:
|
|
|
// 进入艺术家前安全保存当前滚动偏移量,支持列表和网格
|
|
// 进入艺术家前安全保存当前滚动偏移量,支持列表和网格
|