younger_times
2023-06-14 177ae5f9f619bd39e2d505709d8c5b419e7867ee
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
//
//  ActivityListVC.swift
//  WanPai
//
//  Created by 杨锴 on 2023/6/13.
//
 
import UIKit
import QMUIKit
 
class ActivityListVC: BaseVC {
    @IBOutlet weak var view_top: UIView!
    @IBOutlet weak var tf_search: QMUITextField!
    @IBOutlet weak var btn_holdCity: QMUIButton!
    @IBOutlet weak var btn_joinCondition: QMUIButton!
    @IBOutlet weak var btn_hotFilter: QMUIButton!
    @IBOutlet weak var tableView: UITableView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "赛事活动列表"
    }
    
    override func setUI() {
        tableView.delegate = self
        tableView.dataSource = self
        tableView.register(UINib(nibName: "ActivityInfoTCell", bundle: nil), forCellReuseIdentifier: "_ActivityInfoTCell")
        
        btn_holdCity.imagePosition = .right
        btn_holdCity.spacingBetweenImageAndTitle = 5
        
        btn_joinCondition.imagePosition = .right
        btn_joinCondition.spacingBetweenImageAndTitle = 5
        
        btn_hotFilter.imagePosition = .right
        btn_hotFilter.spacingBetweenImageAndTitle = 5
    }
    
    @IBAction func searchAction(_ sender: Any) {
        
    }
    
    @IBAction func holdCityAction(_ sender: QMUIButton) {
        guard !btn_holdCity.isSelected else {return}
        btn_holdCity.isSelected = true
        CityChooseSubTypeView.show(inView: self.view, afterView: view_top) { text in
            
        } closeClouse: {
            self.btn_holdCity.isSelected = false
        }
    }
    
    @IBAction func signupConditionAction(_ sender: QMUIButton) {
        guard !sender.isSelected else {return}
        sender.isSelected = true
        CourseSubTypeView.show(inView: self.view, afterView: btn_joinCondition, items: ["全部用户参与","仅限年度会员参与","仅限学员参与"]) { str in
            sender.isSelected = false
            
        } closeClouse: {
            sender.isSelected = false
        }
    }
    
    @IBAction func signupAction(_ sender: UIButton) {
        let vc = ActivitySignupListVC()
        push(vc: vc)
    }
    
    
}
 
extension ActivityListVC:UITableViewDelegate{
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let vc = ActivityDetailVC()
        push(vc: vc)
    }
}
 
extension ActivityListVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "_ActivityInfoTCell") as! ActivityInfoTCell
        return cell
    }
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 5
    }
}