无故事王国
2023-09-20 2834569133090d46dd3f28a30100fa74661ef1e1
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
//
//  CourseBookingTCell.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/6/25.
//
 
import UIKit
 
class CourseBookingTCell: UITableViewCell {
 
    var weeklyCourseItemModel:WeeklyCourseItemModel!{
        didSet{
            label_title.text = weeklyCourseItemModel.name
            label_time.text = weeklyCourseItemModel.time.joined(separator: "|")
            label_info.text = weeklyCourseItemModel.intro
 
            if weeklyCourseItemModel.type == 1{
                btn_handle.setTitle("请假", for: .normal)
            }
 
            if weeklyCourseItemModel.type == 2{
                btn_handle.setTitle("购课", for: .normal)
            }
        }
    }
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_time: UILabel!
    @IBOutlet weak var label_info: UILabel!
    @IBOutlet weak var btn_handle: UIButton!
    
    var clickClouse:((WeeklyCourseItemModel)->Void)?
    
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
        backgroundColor = .clear
        contentView.backgroundColor = .clear
    }
 
    @IBAction func bookingAction(_ sender: UIButton) {
        clickClouse?(weeklyCourseItemModel)
 
    }
}