| | |
| | | import UIKit |
| | | import JQTools |
| | | import QMUIKit |
| | | import SDWebImage |
| | | |
| | | class CourseVC: BaseVC { |
| | | |
| | |
| | | @IBOutlet weak var cons_imgHeight: NSLayoutConstraint! |
| | | private var imgSize = UIImage(named: "bg_home_2")?.size ?? .zero |
| | | |
| | | var startClouseHomeModel:StartClouseHomeModel? |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | SDWebImageDownloader.shared.downloadImage(with: URL(string: startClouseHomeModel?.imgs)) { [weak self] image, data, error, status in |
| | | if let image{ |
| | | self?.img_bg.image = image |
| | | let radio = image.size.width / image.size.height |
| | | self?.cons_imgHeight.constant = JQ_ScreenW * radio |
| | | } |
| | | } |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | scrollView.contentInset = UIEdgeInsets( top: JQ_ScreenW * 0.6794 - JQ_NavBarHeight - 20, left: 0, bottom: 0, right: 0) |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: { [weak self] data in |
| | | guard let weakSelf = self else { return } |
| | | Services.startCourseHome().subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | if model.isThere == 1{ |
| | | let courseInfoVC = CourseInfoVC() |
| | | courseInfoVC.startClouseHomeModel = model |
| | | let clouseNav = BaseNav(rootViewController: courseInfoVC) |
| | | clouseNav.tabBarItem = UITabBarItem(title: "开始上课", image: UIImage(named: "tabbar_course"), selectedImage: UIImage(named: "tabbar_course_s")) |
| | | self?.tabBarController?.viewControllers![1] = clouseNav |
| | | } |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: QMUIButton) { |
| | | let addstudentVC = AddStudentVC(type: .course) |