|
@@ -10,6 +10,23 @@ import UIKit
|
|
|
|
|
|
class ShoppingCartPayOrderItemCell: UITableViewCell {
|
|
|
|
|
|
+ var productMdl : ProductModel? {
|
|
|
+ didSet {
|
|
|
+ // 商品图片
|
|
|
+ iconImageView.kf.setImage(with: kURLImage(name: productMdl?.productImg ?? ""), placeholder: kImage(name: "pic_preload"))
|
|
|
+ // 商品名称
|
|
|
+ titleLabel.text = productMdl?.productName
|
|
|
+ // 预计配送时间
|
|
|
+ deliveryTime.text = "预计配送时间:次日达"
|
|
|
+ // 规格
|
|
|
+ sellScaleLabel.text = "规格:\(productMdl?.skuName ?? "")"
|
|
|
+ // 数量
|
|
|
+ sellNumberLabel.text = "x\(productMdl?.amount ?? 1)"
|
|
|
+ // 价格
|
|
|
+ sellPriceLabel.text = "¥\(productMdl?.skuPrice ?? 0)"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
override var frame: CGRect {
|
|
|
get {
|
|
|
return super.frame
|
|
@@ -49,10 +66,8 @@ class ShoppingCartPayOrderItemCell: UITableViewCell {
|
|
|
//MRAK: - 设置View
|
|
|
private func setupViews() {
|
|
|
self.selectionStyle = .none
|
|
|
- // cornerRadius = 4
|
|
|
- // masksToBounds = true
|
|
|
|
|
|
- addSubview(iconImagView)
|
|
|
+ addSubview(iconImageView)
|
|
|
addSubview(titleLabel)
|
|
|
addSubview(deliveryTime)
|
|
|
addSubview(sellScaleLabel)
|
|
@@ -62,13 +77,13 @@ class ShoppingCartPayOrderItemCell: UITableViewCell {
|
|
|
}
|
|
|
|
|
|
private func setupLayouts() {
|
|
|
- iconImagView.snp.makeConstraints { (make) in
|
|
|
+ iconImageView.snp.makeConstraints { (make) in
|
|
|
make.top.left.equalToSuperview().offset(14)
|
|
|
make.width.height.equalTo(92)
|
|
|
make.bottom.equalToSuperview().offset(-14)
|
|
|
}
|
|
|
titleLabel.snp.makeConstraints { (make) in
|
|
|
- make.left.equalTo(iconImagView.snp_right).offset(10)
|
|
|
+ make.left.equalTo(iconImageView.snp_right).offset(10)
|
|
|
make.top.equalTo(14)
|
|
|
make.right.equalTo(-26)
|
|
|
make.height.equalTo(20)
|
|
@@ -96,15 +111,13 @@ class ShoppingCartPayOrderItemCell: UITableViewCell {
|
|
|
|
|
|
}
|
|
|
|
|
|
- private lazy var iconImagView: UIImageView = {
|
|
|
- let iconImagView = UIImageView()
|
|
|
- iconImagView.image = kImage(name: "pic_preload")
|
|
|
- return iconImagView
|
|
|
+ private lazy var iconImageView: UIImageView = {
|
|
|
+ let iconImageView = UIImageView()
|
|
|
+ return iconImageView
|
|
|
}()
|
|
|
|
|
|
private lazy var titleLabel: UILabel = {
|
|
|
let titleLabel = UILabel()
|
|
|
- titleLabel.text = "妈妈冬装外套棉袄短款"
|
|
|
titleLabel.textColor = k333333Color
|
|
|
titleLabel.font = kBoldFont14
|
|
|
titleLabel.textAlignment = .left
|
|
@@ -123,7 +136,6 @@ class ShoppingCartPayOrderItemCell: UITableViewCell {
|
|
|
|
|
|
private lazy var sellScaleLabel: UILabel = {
|
|
|
let sellScaleLabel = UILabel()
|
|
|
- sellScaleLabel.text = "规格:3个装"
|
|
|
sellScaleLabel.textColor = k999999Color
|
|
|
sellScaleLabel.font = kRegularFont12
|
|
|
return sellScaleLabel
|
|
@@ -131,7 +143,6 @@ class ShoppingCartPayOrderItemCell: UITableViewCell {
|
|
|
|
|
|
private lazy var sellNumberLabel: UILabel = {
|
|
|
let sellNumberLabel = UILabel()
|
|
|
- sellNumberLabel.text = "x1"
|
|
|
sellNumberLabel.textColor = k999999Color
|
|
|
sellNumberLabel.font = kRegularFont12
|
|
|
return sellNumberLabel
|
|
@@ -139,7 +150,6 @@ class ShoppingCartPayOrderItemCell: UITableViewCell {
|
|
|
|
|
|
private lazy var sellPriceLabel: UILabel = {
|
|
|
let sellPriceLabel = UILabel()
|
|
|
- sellPriceLabel.text = "¥258"
|
|
|
sellPriceLabel.textColor = k333333Color
|
|
|
sellPriceLabel.font = kRegularFont14
|
|
|
sellPriceLabel.textAlignment = .left
|