//
|
// MineCommoentReplyMeListVC.swift
|
// OKProject
|
//
|
// Created by 无故事王国 on 2022/5/9.
|
// Copyright © 2022 yangwang. All rights reserved.
|
//
|
|
import UIKit
|
|
class MineCommoentReplyMeListVC: YYTableViewController {
|
let viewModel = CommentViewReplyModel()
|
|
override func viewDidLoad() {
|
super.viewDidLoad()
|
|
viewModel.configure(tableView: tableView)
|
tableView.mj_header?.beginRefreshing()
|
}
|
|
//MARK: - UI
|
override func setupViews() {
|
super.setupViews()
|
view.backgroundColor = UIColor(hexString: "#F3F4F5")
|
tableView.separatorStyle = .none
|
tableView.delegate = self
|
tableView.dataSource = self
|
tableView.backgroundColor = .clear
|
tableView.register(cellName: "CommoentReplyTCell", identifier: "_CommoentReplyTCell")
|
}
|
|
//MARK: - Layouts
|
override func defineLayouts() {
|
super.defineLayouts()
|
tableView.snp.makeConstraints { (make) in
|
if #available(iOS 11.0, *) {
|
make.edges.equalTo(view.safeAreaLayoutGuide).inset(UIEdgeInsets(top: 3, left: 0, bottom: 0, right: 0))
|
} else {
|
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 3, left: 0, bottom: 0, right: 0))
|
}
|
}
|
}
|
|
}
|
|
|
// MARK: - UITableViewDelegate
|
extension MineCommoentReplyMeListVC:UITableViewDelegate{
|
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
return UITableView.automaticDimension
|
}
|
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
let model = viewModel.dataSource.value[indexPath.row]
|
if model.type == .sell{
|
let vc = CarDetailVC(type: .sell)
|
vc.id = model.orderId
|
yy_push(vc: vc)
|
}else if model.type == .rent{
|
let vc = CarDetailVC(type: .rent)
|
vc.id = model.orderId
|
yy_push(vc: vc)
|
}else if model.type == .job{
|
let vc = JobDetailVC()
|
vc.id = model.orderId
|
yy_push(vc: vc)
|
}
|
}
|
}
|
|
// MARK: - UITableViewDelegate
|
extension MineCommoentReplyMeListVC:UITableViewDataSource{
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
return viewModel.dataSource.value.count
|
}
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
let m = viewModel.dataSource.value[indexPath.row]
|
let cell = tableView.dequeueReusableCell(withIdentifier: "_CommoentReplyTCell", for: indexPath) as! CommoentReplyTCell
|
cell.replyStyle(true)
|
cell.backgroundColor = .clear
|
cell.setComment(m)
|
cell.contentL.numberOfLines = 3 //73703 【我的评论】评论内容过长,也要省略显示
|
return cell
|
}
|
}
|