| | |
| | | super.viewDidLoad() |
| | | |
| | | if viewModel.type.value == .QA{ |
| | | let headView = UIView() |
| | | headView.backgroundColor = .jq_randomColor |
| | | headView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: JQ_ScreenW * 0.564) |
| | | tableView.tableHeaderView = headView |
| | | |
| | | Services.bannerList(position: .qusition).subscribe(onNext: {[weak self]data in |
| | | if let models = data.data,models.count > 0{ |
| | | let bannberView = CommonBannerView(frame: CGRect(x: 0, y: 0, width: JQ_ScreenW, height: JQ_ScreenW * 0.564)) |
| | | self?.tableView.tableHeaderView = bannberView |
| | | bannberView.setImages(images: models.map({$0.img}), type: .URL) { index in |
| | | |
| | | } |
| | | self?.tableView.reloadData() |
| | | } |
| | | }) { error in |
| | | |
| | | }.disposed(by: disposeBag) |
| | | } |
| | | |
| | | viewModel.configure(tableView,needMore: false) |
| | |
| | | extension CustomerSubListVC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | let vc = CustomerContentDetailVC(id: model.noticeId, type: viewModel.type.value) |
| | | push(vc: vc) |
| | | |
| | | var id = 0 |
| | | if viewModel.type.value == .notice{ |
| | | id = model.noticeId |
| | | }else{ |
| | | id = model.quesId |
| | | } |
| | | |
| | | let vc = CustomerContentDetailVC(id: id, type: viewModel.type.value) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | |