| | |
| | | import UIKit |
| | | import SDWebImage |
| | | import JQTools |
| | | import QMUIKit |
| | | |
| | | let CancelActivitySingup_Noti = Notification.Name.init("CancelActivitySingup_Noti") |
| | | |
| | |
| | | @IBOutlet weak var label_introducion: UILabel! |
| | | @IBOutlet weak var img_enrollRequired: UIImageView! |
| | | @IBOutlet weak var cons_imgEnrollHei: NSLayoutConstraint! |
| | | @IBOutlet weak var btn_cancel: UIButton! |
| | | @IBOutlet weak var btn_cancel: QMUIButton! |
| | | @IBOutlet weak var tableView: UITableView! |
| | | @IBOutlet weak var cons_tableHei: NSLayoutConstraint! |
| | | @IBOutlet weak var label_matchStore: UILabel! |
| | |
| | | case .prepare: |
| | | let name = m.apply == 1 ? "取消":"已取消" |
| | | let color = m.apply == 1 ? Def_ThemeColor:UIColor(hexStr: "#C0C0C0") |
| | | btn_cancel.isEnabled = m.apply == 1 |
| | | btn_cancel.isUserInteractionEnabled = m.apply == 1 |
| | | btn_cancel.setTitle(name, for: .normal) |
| | | btn_cancel.backgroundColor = color |
| | | |
| | | if m.apply == 1{ |
| | | btn_cancel.setImage(UIImage(named: "btn_cancel"), for: .normal) |
| | | } |
| | | |
| | | case .ongoing: |
| | | let endTime = Date.jq_StringToTimeInterval(m.registerEndTime, "yyyy-MM-dd HH:mm") |
| | | let a = Date.jq_CalByDays(startDate: Date(), endDate: Date(timeIntervalSince1970: endTime)) |
| | | if Date.jq_CalByEnum(startDate: Date(), endDate: Date(timeIntervalSince1970: endTime)).minute > 0{ |
| | | let name = m.apply == 1 ? "取消":"已取消" |
| | | let color = m.apply == 1 ? Def_ThemeColor:UIColor(hexStr: "#C0C0C0") |
| | | btn_cancel.isEnabled = m.apply == 1 |
| | | btn_cancel.isUserInteractionEnabled = m.apply == 1 |
| | | btn_cancel.setTitle(name, for: .normal) |
| | | btn_cancel.backgroundColor = color |
| | | if m.apply == 1{ |
| | | btn_cancel.setImage(UIImage(named: "btn_cancel"), for: .normal) |
| | | } |
| | | }else{ |
| | | btn_cancel.setTitle("进行中", for: .normal) |
| | | btn_cancel.isEnabled = false |
| | | btn_cancel.isUserInteractionEnabled = false |
| | | btn_cancel.backgroundColor = UIColor(hexStr: "#C0C0C0") |
| | | } |
| | | |
| | | |
| | | case .over: |
| | | btn_cancel.setTitle("已结束", for: .normal) |
| | | btn_cancel.isEnabled = false |
| | | btn_cancel.isUserInteractionEnabled = false |
| | | btn_cancel.backgroundColor = UIColor(hexStr: "#C0C0C0") |
| | | case .cancel: |
| | | btn_cancel.setTitle("已取消", for: .normal) |
| | | btn_cancel.isEnabled = false |
| | | btn_cancel.isUserInteractionEnabled = false |
| | | btn_cancel.backgroundColor = UIColor(hexStr: "#C0C0C0") |
| | | default:break |
| | | } |
| | |
| | | } |
| | | |
| | | override func setUI() { |
| | | btn_cancel.imagePosition = .left |
| | | btn_cancel.spacingBetweenImageAndTitle = 12 |
| | | tableView.delegate = self |
| | | tableView.dataSource = self |
| | | tableView.separatorStyle = .none |