Commit 8050d6ac authored by Steven杜宇's avatar Steven杜宇

// fix

parent 90c1c835
...@@ -14,6 +14,7 @@ class YHNewProductCell: UITableViewCell { ...@@ -14,6 +14,7 @@ class YHNewProductCell: UITableViewCell {
lazy var imgView: UIImageView = { lazy var imgView: UIImageView = {
let v = UIImageView() let v = UIImageView()
v.contentMode = .scaleAspectFill
v.clipsToBounds = true v.clipsToBounds = true
return v return v
}() }()
...@@ -35,8 +36,10 @@ class YHNewProductCell: UITableViewCell { ...@@ -35,8 +36,10 @@ class YHNewProductCell: UITableViewCell {
self.selectionStyle = .none self.selectionStyle = .none
self.contentView.addSubview(self.imgView) self.contentView.addSubview(self.imgView)
self.imgView.snp.makeConstraints { make in self.imgView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview() make.left.equalTo(20)
make.height.equalTo(160) make.right.equalTo(-20)
make.top.equalToSuperview()
make.height.equalTo(YHSelectGoodsModel.fix_new_productRatio * (KScreenWidth-20.0*2))
make.bottom.equalTo(-12) make.bottom.equalTo(-12)
} }
} }
......
...@@ -35,6 +35,8 @@ class YHSelectGoodModel: SmartCodable { ...@@ -35,6 +35,8 @@ class YHSelectGoodModel: SmartCodable {
class YHSelectGoodsModel: SmartCodable { class YHSelectGoodsModel: SmartCodable {
static let fix_new_productRatio = 160.0/(KScreenWidth-20.0*2)
var id: String = "" var id: String = ""
var name: String = "" var name: String = ""
var products: [Int] = [] var products: [Int] = []
...@@ -66,7 +68,11 @@ class YHSelectGoodsModel: SmartCodable { ...@@ -66,7 +68,11 @@ class YHSelectGoodsModel: SmartCodable {
var currency: String = "" var currency: String = ""
var goodsCategoryType: Int = 0 // 产品的分类类型:0 默认普通,1 新品商品 var goodsCategoryType: Int = 0 // 产品的分类类型:0 默认普通,1 新品商品
// 新品图片宽高比
var ratio: CGFloat = YHSelectGoodsModel.fix_new_productRatio
required init() { required init() {
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment