瀏覽代碼

fix: #trello(【模板】未加载时的封面显示更新,背景色#4b4b55,icon已更新切图)

Melody 5 年之前
父節點
當前提交
a1ad3c220a

+ 22 - 0
SuperShow/Assets.xcassets/Home/home_template_cover_placeholder.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "home_template_cover_placeholder@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "home_template_cover_placeholder@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二進制
SuperShow/Assets.xcassets/Home/home_template_cover_placeholder.imageset/home_template_cover_placeholder@2x.png


二進制
SuperShow/Assets.xcassets/Home/home_template_cover_placeholder.imageset/home_template_cover_placeholder@3x.png


+ 8 - 2
SuperShow/UI/Template/Views/WSSTemplateCollectionCell.swift

@@ -15,7 +15,13 @@ class WSSTemplateCollectionCell: WSSBaseCollectionCell {
     var model: WSSCommonTemplateModel? {
         didSet {
             if let m = model {
-                coverImageView.ojs_setImage(withUrl: m.cover)
+                coverImageView.backgroundColor = OJSColor(hexRGBValue: 0x4B4B55)
+                if m.cover == nil {
+                    coverImageView.contentMode = .scaleAspectFit
+                } else {
+                    coverImageView.contentMode = .scaleAspectFill
+                }
+                coverImageView.ojs_setImage(withUrl: m.cover, placeholder: R.image.home_template_cover_placeholder())
                 nameLabel.text = m.name
 
                 priceTagLabel.backgroundColor = OJSColor(hexRGBValue: 0x501EFF)
@@ -49,7 +55,7 @@ class WSSTemplateCollectionCell: WSSBaseCollectionCell {
                     priceTagLabel.isHidden = false
                     let priceStr = "限免"
                     priceTagLabel.text = priceStr
-                    priceTagLabel.backgroundColor = OJSColor(hexRGBValue: 0x3388ff)
+                    priceTagLabel.backgroundColor = OJSColor(hexRGBValue: 0x3388FF)
                 }
 
                 var stackWidth: CGFloat = 0.0