younger_times
2023-06-09 66e92e00d206dc19a4066b6f3f58f30e5c532646
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//
//  CourseDetailApplyVC.swift
//  WanPai
//
//  Created by 杨锴 on 2023/6/9.
//
 
import UIKit
import JQTools
import QMUIKit
 
class CourseDetailApplyVC: BaseVC {
 
    @IBOutlet weak var collectionView: UICollectionView!
    @IBOutlet weak var cons_collectHei: NSLayoutConstraint!
    @IBOutlet weak var btn_addStudent: QMUIButton!
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var cons_tableHei: NSLayoutConstraint!
    
    @IBOutlet weak var studentTableView: UITableView!
    var CellW:Double!
    var CellH:Double!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "课程详情"
    }
    
    override func setUI() {
        
        CellW = (JQ_ScreenW - 155) / 3.0
        CellH = CellW * 0.439
        
        cons_tableHei.constant = 76
        
        collectionView.delegate = self
        collectionView.dataSource = self
        collectionView.register(UINib(nibName: "Common_1_CCell", bundle: nil), forCellWithReuseIdentifier: "_Common_1_CCell")
        
        studentTableView.dataSource = self
        studentTableView.register(UINib(nibName: "StudentInfoTCell", bundle: nil), forCellReuseIdentifier: "_StudentInfoTCell")
        
        btn_addStudent.imagePosition = .right
        btn_addStudent.spacingBetweenImageAndTitle = 3
    }
}
 
extension CourseDetailApplyVC:UICollectionViewDelegate{
    
}
 
extension CourseDetailApplyVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
       let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_Common_1_CCell", for: indexPath) as! Common_1_CCell
        
        return cell
    }
    
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 3
    }
}
 
extension CourseDetailApplyVC:UICollectionViewDelegateFlowLayout{
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
        return 21
    }
    
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
        return 21
    }
    
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        return CGSize(width: CellW, height: CellH)
    }
}
 
extension CourseDetailApplyVC:UITableViewDataSource{
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 1
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfoTCell") as! StudentInfoTCell
        
        return cell
    }
    
}