From 47a58a1a7d967464e93410e04791aaa4756c1cbd Mon Sep 17 00:00:00 2001 From: younger_times <841720330@qq.com> Date: 星期二, 08 八月 2023 18:42:21 +0800 Subject: [PATCH] 提交 --- WanPai/Root/Course/VC/CourseVC.swift | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/WanPai/Root/Course/VC/CourseVC.swift b/WanPai/Root/Course/VC/CourseVC.swift index ec5b31e..76dc2c0 100644 --- a/WanPai/Root/Course/VC/CourseVC.swift +++ b/WanPai/Root/Course/VC/CourseVC.swift @@ -45,14 +45,20 @@ 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 - } + 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")!.withRenderingMode(.alwaysOriginal)) + self?.tabBarController?.viewControllers![1] = clouseNav + }else{ + let courseVC = CourseVC() + courseVC.startClouseHomeModel = model + let clouseNav = BaseNav(rootViewController: courseVC) + clouseNav.tabBarItem = UITabBarItem(title: "开始上课", image: UIImage(named: "tabbar_course"), selectedImage: UIImage(named: "tabbar_course_s")!.withRenderingMode(.alwaysOriginal)) + self?.tabBarController?.viewControllers![1] = clouseNav + } } }).disposed(by: weakSelf.disposeBag) }).disposed(by: disposeBag) -- Gitblit v1.7.1