Przeglądaj źródła

修复艺术家和专辑 没有封面

onecold 4 miesięcy temu
rodzic
commit
135ca4d82a
1 zmienionych plików z 22 dodań i 5 usunięć
  1. 22 5
      entry/src/main/ets/view/LocalMusic.ets

+ 22 - 5
entry/src/main/ets/view/LocalMusic.ets

@@ -5971,11 +5971,28 @@ export struct LocalMusic {
   private DirItem(item: VideoItem, index?: number) {
     Button({ type: ButtonType.Capsule, stateEffect: true }) {
       Row() {
-        SymbolGlyph($r('sys.symbol.folder'))
-          .fontSize(this.twoFingerType==3?55:this.twoFingerType==2?50:45)
-          .fontColor([this.themeColor])
-          .alignSelf(ItemAlign.Center)
-          .margin({ left: 20 ,top:8,bottom:8})
+        if(this.modeType !== 0 && StrUtil.isNotEmpty(item.pixelMapPath)){
+          Image(this.getListImageSource(item, index ?? -1, this.coverThumbVersion))
+            .height(this.twoFingerType == 3 ? 55 : this.twoFingerType == 2 ? 50 : 40)
+            .width(this.twoFingerType == 3 ? 55 : this.twoFingerType == 2 ? 50 : 40)
+            .fillColor(this.themeColor)// .fontSize(33)
+            .alt($r('app.media.music_group'))
+            .borderRadius(this.isCoverRectangle?9:'100%')
+            .clip(true)
+            .shadow({
+              radius: 2,
+              type: ShadowType.BLUR,
+              color: 'on_primary'
+            })
+            .sourceSize({width:38, height:38})
+            .margin({ left: 20, top: 8, bottom: 8 })
+        }else{
+          SymbolGlyph($r('sys.symbol.folder'))
+            .fontSize(this.twoFingerType==3?55:this.twoFingerType==2?50:45)
+            .fontColor([this.themeColor])
+            .alignSelf(ItemAlign.Center)
+            .margin({ left: 20 ,top:8,bottom:8})
+        }
         Column() {
           Text(item.name.startsWith('.') ? item.name.replace(/\./g, '') : item.name)
             .fontSize(this.twoFingerType == 1 ? 12 : this.twoFingerType == 2 ? 15 : 18)