| | |
| | | return v |
| | | }() |
| | | |
| | | var startClouseHomeModel:StartClouseHomeModel! |
| | | |
| | | |
| | | private lazy var label_student:UILabel = { |
| | | let label = UILabel() |
| | |
| | | return label |
| | | }() |
| | | |
| | | init(student:StartClouseHomeModel) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.startClouseHomeModel = student |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "预约课程" |
| | |
| | | pageViewController.delegate = self |
| | | edgesForExtendedLayout = .top |
| | | funcView.btn_datetime.addTarget(self, action: #selector(datetimeAction), for: .touchUpInside) |
| | | funcView.btn_search.addTarget(self, action: #selector(searchAction), for: .touchUpInside) |
| | | funcView.tf_search.delegate = self |
| | | |
| | | label_student.text = "当前学员:\(startClouseHomeModel.stuName)" |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | } |
| | | |
| | | @objc func datetimeAction(){ |
| | | JQ_MenuView().show(self, tapView: funcView.btn_datetime, items: ["全部","最近一周","最近一月","最近一年"],tableHei: 150) { index, str in |
| | | |
| | | JQ_MenuView().show(self, tapView: funcView.btn_datetime, items: ["全部","最近一周","最近一月","最近一年"],tableHei: 150) {[weak self] index, str in |
| | | let vc = self?.pageViewController.currentController as! CourseBookingSubListVC |
| | | vc.viewModel.timeType.accept(StudentAppointDateType(rawValue: index)!) |
| | | vc.viewModel.beginRefresh() |
| | | } |
| | | } |
| | | |
| | | @objc func searchAction(){ |
| | | funcView.tf_search.resignFirstResponder() |
| | | let vc = pageViewController.currentController as! CourseBookingSubListVC |
| | | vc.viewModel.search.accept(funcView.tf_search.text!) |
| | | vc.viewModel.beginRefresh() |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController { |
| | | let vc = CourseBookingSubListVC() |
| | | var vc:CourseBookingSubListVC! |
| | | switch page{ |
| | | case 1:vc = CourseBookingSubListVC(status: .pedding, studentId: startClouseHomeModel.stuId) |
| | | case 2:vc = CourseBookingSubListVC(status: .complete, studentId: startClouseHomeModel.stuId) |
| | | case 3:vc = CourseBookingSubListVC(status: .cancel, studentId: startClouseHomeModel.stuId) |
| | | default:vc = CourseBookingSubListVC(status: nil, studentId: startClouseHomeModel.stuId) |
| | | } |
| | | return vc |
| | | } |
| | | } |
| | | |
| | | extension CourseBookingListVC:QMUITextFieldDelegate{ |
| | | func textFieldShouldReturn(_ textField: UITextField) -> Bool { |
| | | textField.resignFirstResponder() |
| | | let vc = pageViewController.currentController as! CourseBookingSubListVC |
| | | vc.viewModel.search.accept(textField.text!) |
| | | vc.viewModel.beginRefresh() |
| | | return true |
| | | } |
| | | } |