Ver código fonte

Grid封面背景加空判断

onecold 1 ano atrás
pai
commit
977ac6d444
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      entry/src/main/ets/view/LocalMusic.ets

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

@@ -3808,7 +3808,7 @@ export struct LocalMusic {
         }
         }
         .width(this.getGridWight())
         .width(this.getGridWight())
         .borderRadius(12)
         .borderRadius(12)
-        .backgroundImage(item.pixelMapPath)
+        .backgroundImage(StrUtil.isEmpty(item.pixelMapPath)?$r('app.media.avatar'):item.pixelMapPath)
         .backgroundImageSize({ height: '100%', width: '100%' })
         .backgroundImageSize({ height: '100%', width: '100%' })
         .backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
         .backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
         .animation({ curve: Curve.Sharp, duration: 300 })
         .animation({ curve: Curve.Sharp, duration: 300 })