Ver Fonte

播放页的封面问题

onecold há 7 meses atrás
pai
commit
bbcd47a759

+ 1 - 1
entry/src/main/ets/pages/NewIndex.ets

@@ -262,7 +262,7 @@ struct NewIndex {
     this.isShowPrecious = PreferencesUtil.getBooleanSync('isShowPrecious', false)
     this.isShowPrecious = PreferencesUtil.getBooleanSync('isShowPrecious', false)
     ReqPermissionUtil.reqPermissionsFromUser(ReqPermissionUtil.permissions, this.context);
     ReqPermissionUtil.reqPermissionsFromUser(ReqPermissionUtil.permissions, this.context);
     this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, false)
     this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, false)
-    this.initDefalutType()
+
     Utility.enableFullScreen()
     Utility.enableFullScreen()
     this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
     this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
     Utility.getAppName(getContext(this)).then((appName: string) => {
     Utility.getAppName(getContext(this)).then((appName: string) => {

+ 4 - 2
entry/src/main/ets/view/LocalMusic.ets

@@ -11110,7 +11110,8 @@ export struct LocalMusic {
   RectangleCoverView(){
   RectangleCoverView(){
 
 
     Stack({alignContent:Alignment.Center}){
     Stack({alignContent:Alignment.Center}){
-      Image(this.cover)
+      Image( StrUtil.isNotEmpty(this.cover)?
+        this.cover:$r('app.media.alt'))
         .height(this.isHiCar()?(px2vp(this.windowHeight)*0.43):
         .height(this.isHiCar()?(px2vp(this.windowHeight)*0.43):
           this.isCoverOpacity()?(px2vp(this.windowHeight)*0.54):'auto')
           this.isCoverOpacity()?(px2vp(this.windowHeight)*0.54):'auto')
         .width(this.isHiCar()||this.isCoverOpacity()?'auto':this.isBigScreen() ? '72%' : this.isCoverTopBig ? '100%' : '88%')
         .width(this.isHiCar()||this.isCoverOpacity()?'auto':this.isBigScreen() ? '72%' : this.isCoverTopBig ? '100%' : '88%')
@@ -11178,7 +11179,8 @@ export struct LocalMusic {
           type: ShadowType.BLUR,
           type: ShadowType.BLUR,
           color: 'on_primary'
           color: 'on_primary'
         })
         })
-      Image(this.cover)
+      Image( StrUtil.isNotEmpty(this.cover)?
+        this.cover:$r('app.media.alt'))
         .height(this.isHiCarSmall()?(this.isHiCarKuanBianPing()?140:px2vp(this.windowHeight)*0.38):
         .height(this.isHiCarSmall()?(this.isHiCarKuanBianPing()?140:px2vp(this.windowHeight)*0.38):
           (this.isCoverOpacity() ? (px2vp(this.windowHeight)*0.62) : this.isCoverRectangle ? 320 : 168))
           (this.isCoverOpacity() ? (px2vp(this.windowHeight)*0.62) : this.isCoverRectangle ? 320 : 168))
         .objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)
         .objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)