Explorar o código

Grid封面背景加空判断

onecold hai 1 ano
pai
achega
977ac6d444
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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())
         .borderRadius(12)
-        .backgroundImage(item.pixelMapPath)
+        .backgroundImage(StrUtil.isEmpty(item.pixelMapPath)?$r('app.media.avatar'):item.pixelMapPath)
         .backgroundImageSize({ height: '100%', width: '100%' })
         .backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
         .animation({ curve: Curve.Sharp, duration: 300 })