| | |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | import RxSwift |
| | | |
| | | class CourseBooking_1_TCell: UITableViewCell { |
| | | |
| | | var indexPath:IndexPath! |
| | | |
| | | var studentAppointModel:StudentAppointModel!{ |
| | | didSet{ |
| | | label_title.text = studentAppointModel.coursePackageName |
| | | label_courseNum.text = "\(studentAppointModel.courseHours)课时" |
| | | label_address.text = studentAppointModel.storeNameAddr |
| | | label_datetime.text = studentAppointModel.timeFrame |
| | | label_status.text = studentAppointModel.status.strTitle |
| | | |
| | | btn_exercise.isHidden = studentAppointModel.status != .complete |
| | | btn_cancel.isHidden = studentAppointModel.status != .pedding |
| | | |
| | | switch studentAppointModel.status{ |
| | | case .pedding:label_status.textColor = UIColor(hexStr: "#FD7402") |
| | | default:label_status.textColor = UIColor(hexStr: "#3D3E45") |
| | | } |
| | | } |
| | | } |
| | | |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var label_courseNum: UILabel! |
| | | @IBOutlet weak var label_address: UILabel! |
| | | @IBOutlet weak var label_datetime: UILabel! |
| | | @IBOutlet weak var btn_exercise: UIButton! |
| | | @IBOutlet weak var label_status: UILabel! |
| | | @IBOutlet weak var btn_cancel: UIButton! |
| | | |
| | | private var disposeBag = DisposeBag() |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | selectionStyle = .none |
| | | } |
| | | |
| | | |
| | | @IBAction func exerciseAction(_ sender: UIButton) { |
| | | let vc = CourseExerciseSubListVC() |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | |
| | | @IBAction func cancelAction(_ sender: UIButton) { |
| | | CommonAlertView.show(title: "取消预约", content: "是否取消当前预约?") {[weak self] status in |
| | | guard let weakSelf = self else { return } |
| | | if status{ |
| | | Services.cancelCourse(courseStuRecordId: weakSelf.studentAppointModel.courseStuRecordId).subscribe(onNext: { data in |
| | | NotificationCenter.default.post(name: CourseBooking_Noti, object: weakSelf.indexPath) |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | } |
| | | } |
| | | } |