fix
杨锴
2024-08-19 d9a2bbdb9595037432c36766489110c4b9229ac0
XQMuse/Root/Course/VC/CourseVCTeacherSpecialVC.swift
@@ -9,22 +9,86 @@
import JQTools
class CourseVCTeacherSpecialVC: BaseVC {
            private var tableView:UITableView?
            private var headerView:VideoView!
    override func viewDidLoad() {
        super.viewDidLoad()
                        view.backgroundColor = .jq_randomColor
    }
    /*
    // MARK: - Navigation
            override func setUI() {
                        super.setUI()
                        tableView = UITableView(frame: .zero, style: .plain)
                        tableView!.contentInsetAdjustmentBehavior = .never
                        tableView!.separatorStyle = .none
                        tableView!.delegate = self
                        tableView!.dataSource = self
                        tableView?.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 20, right: 0)
                        tableView!.showsVerticalScrollIndicator = false
                        if #available(iOS 15.0, *) {
                                    tableView!.sectionHeaderTopPadding = 0
                        }
                        tableView!.backgroundColor = UIColor(hexString: "#f6f6f6")
                        tableView!.register(UINib(nibName: "CourseDetail_1_TCell", bundle: nil), forCellReuseIdentifier: "_CourseDetail_1_TCell")
                        tableView!.register(UINib(nibName: "CourseDetail_3_TCell", bundle: nil), forCellReuseIdentifier: "_CourseDetail_3_TCell")
    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */
                        view.addSubview(tableView!)
                        tableView!.snp.makeConstraints { make in
                                    make.edges.equalToSuperview()
                        }
                        DispatchQueue.main.async {
                                    self.headerView = VideoView()
                                    self.headerView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: JQ_ScreenW * 0.56)
                                    self.tableView!.tableHeaderView = self.headerView
                        }
            }
}
extension CourseVCTeacherSpecialVC:UITableViewDataSource{
            func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                     return 2
            }
            func numberOfSections(in tableView: UITableView) -> Int {
                        return 1
            }
            func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
                        if indexPath.row == 0 || indexPath.row == 1{
                                    return UITableView.automaticDimension
                        }
                        return 770.736
            }
            func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                        if indexPath.row == 0{
                                    let cell = tableView.dequeueReusableCell(withIdentifier: "_CourseDetail_1_TCell") as! CourseDetail_1_TCell
                                    cell.backgroundColor = UIColor(hexString: "#f6f6f6")
                                    cell.setContent(title: "导师简介", content: "")
                                    return cell
                        }
                        if indexPath.row == 1{
                                    let cell = tableView.dequeueReusableCell(withIdentifier: "_CourseDetail_3_TCell") as! CourseDetail_3_TCell
                                    cell.backgroundColor = UIColor(hexString: "#f6f6f6")
                                    return cell
                        }
                        var cell = tableView.dequeueReusableCell(withIdentifier: "cell")
                        if cell == nil{
                                    cell = UITableViewCell(style: .value1, reuseIdentifier: "cell")
                        }
                        return cell!
            }
            func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
                        return 73.5
            }
}
extension CourseVCTeacherSpecialVC:UITableViewDelegate{
}