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

// fix

parent 90c1c835
......@@ -14,6 +14,7 @@ class YHNewProductCell: UITableViewCell {
lazy var imgView: UIImageView = {
let v = UIImageView()
v.contentMode = .scaleAspectFill
v.clipsToBounds = true
return v
}()
......@@ -35,8 +36,10 @@ class YHNewProductCell: UITableViewCell {
self.selectionStyle = .none
self.contentView.addSubview(self.imgView)
self.imgView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(160)
make.left.equalTo(20)
make.right.equalTo(-20)
make.top.equalToSuperview()
make.height.equalTo(YHSelectGoodsModel.fix_new_productRatio * (KScreenWidth-20.0*2))
make.bottom.equalTo(-12)
}
}
......
......@@ -35,6 +35,8 @@ class YHSelectGoodModel: SmartCodable {
class YHSelectGoodsModel: SmartCodable {
static let fix_new_productRatio = 160.0/(KScreenWidth-20.0*2)
var id: String = ""
var name: String = ""
var products: [Int] = []
......@@ -66,7 +68,11 @@ class YHSelectGoodsModel: SmartCodable {
var currency: String = ""
var goodsCategoryType: Int = 0 // 产品的分类类型:0 默认普通,1 新品商品
// 新品图片宽高比
var ratio: CGFloat = YHSelectGoodsModel.fix_new_productRatio
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