| | |
| | | didSet{ |
| | | if let m = searchStoreDetailModel{ |
| | | headView.searchStoreDetailModel = m |
| | | tableView.reloadData() |
| | | |
| | | DispatchQueue.main.async { |
| | | self.headView.cons_labelHeiCons.constant = String.jq_getHeight(text: m.storeInfo, width: self.view.width - 100, font: 14) |
| | | self.headView.layoutIfNeeded() |
| | | self.headView.layoutSubviews() |
| | | self.tableView.reloadData() |
| | | let height = self.headView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height |
| | | self.headView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: height) |
| | | self.tableView.tableHeaderView = self.headView |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | super.viewDidLoad() |
| | | title = "门店详情" |
| | | |
| | | DispatchQueue.main.async { |
| | | self.headView.layoutIfNeeded() |
| | | self.headView.layoutSubviews() |
| | | let height = self.headView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height |
| | | self.headView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: height) |
| | | self.tableView.tableHeaderView = self.headView |
| | | } |
| | | // DispatchQueue.main.async { |
| | | // self.headView.layoutIfNeeded() |
| | | // self.headView.layoutSubviews() |
| | | // let height = self.headView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height |
| | | // self.headView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: height) |
| | | // self.tableView.tableHeaderView = self.headView |
| | | // } |
| | | |
| | | Services.exploreStoreDetail(storeId: id).subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | self?.searchStoreDetailModel = model |
| | | |
| | | // DispatchQueue.main.async { |
| | | // self?.headView.layoutIfNeeded() |
| | | // self?.headView.layoutSubviews() |
| | | // let height = self!.headView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height |
| | | // self?.headView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: height) |
| | | // self?.tableView.tableHeaderView = self!.headView |
| | | // } |
| | | |
| | | // DispatchQueue.main.asyncAfter(deadline: .now()+1.5){ |
| | | // self?.tableView.tableHeaderView?.height = 500 |
| | | // } |