|
@@ -8,9 +8,13 @@
|
|
|
|
|
|
import UIKit
|
|
import UIKit
|
|
import SwiftyJSON
|
|
import SwiftyJSON
|
|
|
|
+import RxSwift
|
|
|
|
|
|
class ProductDetailProductLabelTableViewCell: UITableViewCell {
|
|
class ProductDetailProductLabelTableViewCell: UITableViewCell {
|
|
|
|
|
|
|
|
+
|
|
|
|
+ let disposeBag = DisposeBag()
|
|
|
|
+
|
|
class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailProductLabelTableViewCell {
|
|
class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailProductLabelTableViewCell {
|
|
let ID = "ProductDetailProductSkuTableViewCell"
|
|
let ID = "ProductDetailProductSkuTableViewCell"
|
|
tableView.register(ProductDetailProductLabelTableViewCell.self, forCellReuseIdentifier: ID)
|
|
tableView.register(ProductDetailProductLabelTableViewCell.self, forCellReuseIdentifier: ID)
|
|
@@ -69,12 +73,28 @@ class ProductDetailProductLabelTableViewCell: UITableViewCell {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- lazy var bgView : UIView = {
|
|
|
|
- let bgView = UIView()
|
|
|
|
|
|
+ lazy var bgView : UIButton = {
|
|
|
|
+ let bgView = UIButton(type: UIButton.ButtonType.custom)
|
|
|
|
+ bgView.rx.tap.subscribe(onNext: {
|
|
|
|
+ [weak self] (data) in
|
|
|
|
+ if !(self?.productDetailModel?.report?.isEmpty ?? true) {
|
|
|
|
+ let vc = BrowsePicturesViewController.init(images: (self?.productDetailModel?.report)!, index: 0)
|
|
|
|
+ self?.responderViewController()?.navigationController?.pushViewController(vc, animated: true)
|
|
|
|
+ }
|
|
|
|
+ }).disposed(by: disposeBag)
|
|
return bgView
|
|
return bgView
|
|
}()
|
|
}()
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ //查找所在的ViewController
|
|
|
|
+ func responderViewController() -> UIViewController? {
|
|
|
|
+ for view in sequence(first: self.superview, next: { $0?.superview }) {
|
|
|
|
+ if let responder = view?.next {
|
|
|
|
+ if responder.isKind(of: UIViewController.self){
|
|
|
|
+ return responder as? UIViewController
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
|
|
private lazy var iconCollectionView: UICollectionView = {
|
|
private lazy var iconCollectionView: UICollectionView = {
|
|
let iconCollectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: iconCollectionViewLayout)
|
|
let iconCollectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: iconCollectionViewLayout)
|
|
@@ -100,14 +120,16 @@ class ProductDetailProductLabelTableViewCell: UITableViewCell {
|
|
lazy var iconImageView : UIImageView = {
|
|
lazy var iconImageView : UIImageView = {
|
|
let iconImageView = UIImageView()
|
|
let iconImageView = UIImageView()
|
|
iconImageView.image = kImage(name: "common_jiancebaogao")
|
|
iconImageView.image = kImage(name: "common_jiancebaogao")
|
|
|
|
+ iconImageView.isUserInteractionEnabled = false
|
|
return iconImageView
|
|
return iconImageView
|
|
}()
|
|
}()
|
|
|
|
|
|
lazy var titleLabel: UILabel = {
|
|
lazy var titleLabel: UILabel = {
|
|
let titleLabel = UILabel()
|
|
let titleLabel = UILabel()
|
|
- titleLabel.text = "检测机构"
|
|
|
|
|
|
+ titleLabel.text = "检测报告"
|
|
titleLabel.textColor = k333333Color
|
|
titleLabel.textColor = k333333Color
|
|
titleLabel.font = kRegularFont13
|
|
titleLabel.font = kRegularFont13
|
|
|
|
+ titleLabel.isUserInteractionEnabled = false
|
|
return titleLabel
|
|
return titleLabel
|
|
}()
|
|
}()
|
|
|
|
|