From a1ac0f1634ff0bd8f04259fc4cf7ebabd8c8c82d Mon Sep 17 00:00:00 2001 From: 无故事王国 <841720330@qq.com> Date: 星期二, 10 十月 2023 16:40:52 +0800 Subject: [PATCH] 修复BUG --- WanPai/Root/Search/VC/CustomerSubListVC.swift | 29 +++++++++++++++++++++++------ 1 files changed, 23 insertions(+), 6 deletions(-) diff --git a/WanPai/Root/Search/VC/CustomerSubListVC.swift b/WanPai/Root/Search/VC/CustomerSubListVC.swift index e2826af..ef2557e 100644 --- a/WanPai/Root/Search/VC/CustomerSubListVC.swift +++ b/WanPai/Root/Search/VC/CustomerSubListVC.swift @@ -51,10 +51,19 @@ 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) @@ -73,8 +82,16 @@ 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) } } -- Gitblit v1.7.1