|
@@ -13,23 +13,6 @@ class ProductSlidingTopBottomCollectionViewCell: UICollectionViewCell {
|
|
|
|
|
|
let disposeBag = DisposeBag()
|
|
|
|
|
|
- var productSearchModel: ProductSearchModel? {
|
|
|
- didSet {
|
|
|
- iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
|
|
|
- titleLabel.text = productSearchModel?.saleName
|
|
|
- sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
|
|
|
- sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)
|
|
|
- let attrString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
|
|
|
- attrString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
|
|
|
- markPriceLabel.attributedText = attrString
|
|
|
- if productSearchModel?.stock == 0 {
|
|
|
- self.plusButton.isHidden = true
|
|
|
- }else {
|
|
|
- self.plusButton.isHidden = false
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
typealias PlusClosure = (_ productSearchModel: ProductSearchModel?,_ indexPath:IndexPath?) -> Void
|
|
|
var plusClosure : PlusClosure?
|
|
|
|
|
@@ -155,4 +138,21 @@ class ProductSlidingTopBottomCollectionViewCell: UICollectionViewCell {
|
|
|
return plusButton
|
|
|
}()
|
|
|
|
|
|
+ var productSearchModel: ProductSearchModel? {
|
|
|
+ didSet {
|
|
|
+ iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
|
|
|
+ titleLabel.text = productSearchModel?.saleName
|
|
|
+ sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
|
|
|
+ sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)
|
|
|
+ let attrString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
|
|
|
+ attrString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
|
|
|
+ markPriceLabel.attributedText = attrString
|
|
|
+ if productSearchModel?.stock == 0 {
|
|
|
+ self.plusButton.isHidden = true
|
|
|
+ }else {
|
|
|
+ self.plusButton.isHidden = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|