younger_times
2023-07-20 bb4b7bdc199b81dd7e3febcfdc9bd69f6f80d633
完善
14个文件已修改
366 ■■■■■ 已修改文件
WanPai/AppDelegate.swift 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Model/CommonModels.swift 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Network/Services.swift 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseInfoScheduleVC.swift 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseInfoVC.swift 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseInfoVC.xib 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseVC.swift 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/StudentExchangeVC.swift 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/StudentExchangeVC.xib 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/StudentReportVC.swift 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/StudentReportVC.xib 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Home/VC/HomeVC.swift 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/TCell/StudentInfo_3_TCell.swift 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/TCell/StudentInfo_3_TCell.xib 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/AppDelegate.swift
@@ -66,7 +66,6 @@
        homeNav.tabBarItem = UITabBarItem(title: "加入玩湃", image: UIImage(named: "tabbar_home"), selectedImage: UIImage(named: "tabbar_home_s"))
        let clouseNav = BaseNav(rootViewController: CourseVC())
//        let clouseNav = BaseNav(rootViewController: CourseInfoVC())
        clouseNav.tabBarItem = UITabBarItem(title: "开始上课", image: UIImage(named: "tabbar_course"), selectedImage: UIImage(named: "tabbar_course_s"))
        let welfareVCNav = BaseNav(rootViewController: WelfareVC())
WanPai/Model/CommonModels.swift
@@ -68,6 +68,16 @@
    var weight:Double = 0
}
struct StudentProfile1Model:HandyJSON{
    var birthday = ""
    var isNot = 2 //1. 是默认 2. 不是默认
    var stuAge:Int = 0
    var stuHeight:Double = 0
    var stuId = 0
    var stuName:String = ""
    var stuWeight:Double = 0
}
struct CouponInfoModel:HandyJSON{
    ///有效时间
    var effectiveTime: String = ""
@@ -264,3 +274,40 @@
    var cash:Double = 0
    var playPaiCoin:Int = 0
}
struct StartClouseHomeModel:HandyJSON{
    var bmi: Int = 0
    var courseList = [StartClouseListModel]()
    var deductedNums: Int = 0
    var exerciseVideoList = [StartClouseVideoListModel]()
    var height: Int = 0
    var imgs: String?
    ///是否有学员信息 (1. 有学员信息 2.没有学员信息)
    var isThere: Int = 2
    var remainingNums: Int = 0
    var stuAge: Int = 0
    var stuId: Int = 0
    var stuImg: String?
    var stuName: String?
    var stuSex: GenderType = .man
    var totalNums: Int = 0
    var weight: Int = 0
}
struct StartClouseListModel:HandyJSON{
    var courseId = 0
    var courseName = ""
}
struct StartClouseVideoListModel:HandyJSON {
    var videoCoverImgUrl: String = ""
    var videoName: String = ""
    var videoUrl: String = ""
}
struct StartClouseReportModel:HandyJSON{
    var bmi:Double = 0
    var height:Int = 0
    var url = ""
    var weight:Int = 0
}
WanPai/Network/Services.swift
@@ -217,6 +217,42 @@
}
extension Services{
        /// 开始上课:学员列表
    static func startCourceStudentList()->Observable<BaseResponse<[StudentProfile1Model]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/startCource/listOfStu")
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 切换学员
    static func startCourseSwitch(id:Int)->Observable<BaseResponse<SimpleModel>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/startCource/switchStu")
            .append(key: "stuId", value: id)
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
        /// 上课首页
    static func startCourseHome()->Observable<BaseResponse<StartClouseHomeModel>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/startCource/queryStudentData")
            .append(key: "lat", value: locationTool.currentLocation?.coordinate.latitude.string)
            .append(key: "lon", value: locationTool.currentLocation?.coordinate.longitude.string)
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 获取学员测试报告
    static func queryPhysical(stuId:Int)->Observable<BaseResponse<StartClouseReportModel>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/startCource/queryPhysical")
            .append(key: "stuId", value: stuId)
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
}
// MARK: -- 预约场地
extension Services{
WanPai/Root/Course/VC/CourseInfoScheduleVC.swift
@@ -13,10 +13,32 @@
    private var cellW:Double!
    private var cellH:Double!
    private let weeks = ["一","二","三","四","五","六","日"]
    private var index:Int!
    private(set) var dates = [Date]()
    var currentSelectDate:Date?{
        didSet{
            weekCollectionView.reloadData()
        }
    }
    private var clouse:((Date)->Void)?
    @IBOutlet weak var weekCollectionView: UICollectionView!
    required init(index:Int,clouse:@escaping (Date)->Void) {
        super.init(nibName: nil, bundle: nil)
        self.index = index
        self.clouse = clouse
       let date = Date().adding(.weekday, value: index * 7)
        dates = date.jq_currentWeekDates
//       print("\(dates.first!.jq_format("yyyy-MM-dd"))<---->\(dates.last!.jq_format("yyyy-MM-dd"))")
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
@@ -27,6 +49,7 @@
        weekCollectionView.delegate = self
        weekCollectionView.dataSource = self
        weekCollectionView.isScrollEnabled = false
        weekCollectionView.layer.masksToBounds = false
        cellW = (JQ_ScreenW - 22 - 114 - 60) / 7
        cellH = cellW * 1.785
@@ -34,20 +57,38 @@
}
extension CourseInfoScheduleVC:UICollectionViewDelegate{
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        currentSelectDate = dates[indexPath.row]
        if let date =  currentSelectDate{
            clouse?(date)
        }
    }
}
extension CourseInfoScheduleVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return weeks.count
        return dates.count
    }
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = weekCollectionView.dequeueReusableCell(withReuseIdentifier: "_CourseDatetimeCCell", for: indexPath) as! CourseDatetimeCCell
        let date = dates[indexPath.row]
        cell.label_week.jq_cornerRadius = cellW / 2
        cell.label_week.jq_masksToBounds = true
        cell.label_week.text = weeks[indexPath.row]
        cell.jq_masksToBounds = false
        cell.label_week.text = date.jq_nowWeekDay().weekName
        cell.label_time.text = date.jq_format("MM-dd")
        cell.label_time.jq_masksToBounds = false
        cell.layer.masksToBounds = false
        cell.contentView.layer.masksToBounds = false
        if currentSelectDate?.year == date.year && currentSelectDate?.month == date.month && currentSelectDate?.day == date.day{
            cell.label_week.backgroundColor = Def_ThemeColor
            cell.label_week.textColor = .white
        }else{
            cell.label_week.backgroundColor = UIColor(hexStr: "#DCDDDE")
            cell.label_week.textColor = UIColor(hexStr: "#2C5064")
        }
        return cell
    }
}
WanPai/Root/Course/VC/CourseInfoVC.swift
@@ -22,16 +22,24 @@
    @IBOutlet weak var scrollView: CourseInfoScrollView!
    @IBOutlet weak var view_container: UIView!
    @IBOutlet weak var img_header: UIImageView!
    @IBOutlet weak var label_stu_name: UILabel!
    @IBOutlet weak var label_stu_hei: UILabel!
    @IBOutlet weak var label_stu_wei: UILabel!
    @IBOutlet weak var label_stu_BMI: UILabel!
    @IBOutlet weak var img_gender: UIImageView!
    @IBOutlet weak var label_age: UILabel!
    @IBOutlet weak var view_menu: UIView!
    @IBOutlet weak var cons_menuHeight: NSLayoutConstraint!
    @IBOutlet weak var btn_record: UIButton!
    @IBOutlet weak var view_schedule: UIView!
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var mentalCollectionView: UICollectionView!
    @IBOutlet weak var cons_mentalViewHei: NSLayoutConstraint!
    @IBOutlet weak var exerciseCollectionView: UICollectionView!
    @IBOutlet weak var label_weeklyScope: UILabel!
    var startClouseHomeModel:StartClouseHomeModel?
    private var currentDate = Date()
    private var mentals = [MentalInfo]()
@@ -51,7 +59,6 @@
        // item
        pageMenu.spacing = 27.0
        pageMenu.permutationWay = .scrollAdaptContent
        pageMenu.setItems(["荷兰足球队","全科体育课"], selectedItemIndex: 0)
        // 字体
        pageMenu.selectedItemTitleFont = UIFont.systemFont(ofSize: 18, weight: .medium)
@@ -88,20 +95,33 @@
    override func viewDidLoad() {
        super.viewDidLoad()
        label_stu_hei.attributedText = setAttribute(t1: "0", t2: "cm")
        label_stu_wei.attributedText = setAttribute(t1: "0", t2: "kg")
        label_stu_BMI.attributedText = setAttribute(t1: "0.0", t2: "正常")
        if let m = startClouseHomeModel{
            img_header.sd_setImage(with: URL(string: m.stuImg))
            label_stu_name.text = m.stuName
            img_gender.image = m.stuSex == .man ? UIImage(named: "icon_man") : UIImage(named: "icon_woman")
            label_age.text = "/\(m.stuAge)岁"
            label_stu_hei.attributedText = setAttribute(t1: "\(m.height)", t2: "cm")
            label_stu_wei.attributedText = setAttribute(t1: "\(m.weight)", t2: "kg")
            label_stu_BMI.attributedText = setAttribute(t1: "\(m.bmi)", t2: "正常")
            if m.courseList.count > 0{
                pageMenu.frame = CGRect(origin: .zero, size: CGSize(width: JQ_ScreenW, height: 25))
                pageMenu.delegate = self
                view_menu.addSubview(pageMenu)
                cons_menuHeight.constant = 25
                pageMenu.setItems(m.courseList.map({$0.courseName}), selectedItemIndex: 0)
            }
        }
    }
    override func setUI() {
        cons_menuHeight.constant = 0
        scrollView.contentInset = UIEdgeInsets( top: JQ_ScreenW * 0.6794 - JQ_NavBarHeight, left: 0, bottom: 0, right: 0)
        scrollView.delegate = self
        scrollView.bringSubviewToFront(img_header)
        pageMenu.frame = CGRect(origin: .zero, size: CGSize(width: JQ_ScreenW, height: 25))
        pageMenu.delegate = self
        view_menu.addSubview(pageMenu)
        scrollView.bounces = false
        scrollView.contentInsetAdjustmentBehavior = .never
@@ -174,12 +194,14 @@
    }
    @IBAction func reportAction(_ sender: UIButton) {
        let vc = StudentReportVC()
        guard startClouseHomeModel != nil else {return}
        let vc = StudentReportVC(stuId: startClouseHomeModel!.stuId)
        push(vc: vc)
    }
    @IBAction func detailAction(_ sender: UIButton) {
        guard (startClouseHomeModel?.courseList.count ?? 0) > 0 else {return}
        let vc = StudentCourseDetailVC()
        push(vc: vc)
    }
@@ -297,16 +319,23 @@
extension CourseInfoVC:FFPageViewControllerDelegate{
    func pageViewController(_ pageViewController: FFPageViewController, currentPageChanged currentPage: Int) {
        let vc = pageViewController.currentController as! CourseInfoScheduleVC
        vc.currentSelectDate = currentDate
        let first = vc.dates.first?.jq_format("yyyy-MM.dd")
        let last = vc.dates.last?.jq_format("yyyy-MM.dd")
        label_weeklyScope.text = "\(first ?? "")-\(last ?? "")"
    }
    func totalPagesOfpageViewController(_ pageViewConteoller: FFPageViewController) -> UInt {
        return 10
        return 15
    }
    func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController {
        let vc = CourseInfoScheduleVC(index: page) { date in
            self.currentDate = date
        return CourseInfoScheduleVC()
        }
        return vc
    }
}
WanPai/Root/Course/VC/CourseInfoVC.xib
@@ -13,11 +13,16 @@
            <connections>
                <outlet property="btn_record" destination="j3F-fo-P15" id="jHU-5M-DEP"/>
                <outlet property="cons_mentalViewHei" destination="c8h-cI-ZAt" id="CFG-No-ehF"/>
                <outlet property="cons_menuHeight" destination="9fF-RM-zX9" id="NDK-LF-wq4"/>
                <outlet property="exerciseCollectionView" destination="Qhq-kQ-FkL" id="gHn-ry-ynm"/>
                <outlet property="img_gender" destination="clG-di-bFf" id="mTj-W7-Cfu"/>
                <outlet property="img_header" destination="r6S-MR-7fc" id="NTa-TN-Ldo"/>
                <outlet property="label_age" destination="2CP-x2-Qn7" id="4sC-30-khw"/>
                <outlet property="label_stu_BMI" destination="voj-Sv-4FE" id="YZ3-Yx-DOd"/>
                <outlet property="label_stu_hei" destination="nI1-6r-PsA" id="49A-ef-Qoz"/>
                <outlet property="label_stu_name" destination="egC-eg-thJ" id="rge-XQ-cx4"/>
                <outlet property="label_stu_wei" destination="sYK-SQ-NV2" id="34a-u8-UXG"/>
                <outlet property="label_weeklyScope" destination="N78-t5-4OO" id="mZG-Sv-baX"/>
                <outlet property="mentalCollectionView" destination="b9G-TL-PI1" id="sKR-Vx-ntA"/>
                <outlet property="scrollView" destination="fJF-28-SsM" id="jJu-L6-Dl1"/>
                <outlet property="tableView" destination="O0u-hX-kAR" id="SXs-52-gvZ"/>
WanPai/Root/Course/VC/CourseVC.swift
@@ -8,6 +8,7 @@
import UIKit
import JQTools
import QMUIKit
import SDWebImage
class CourseVC: BaseVC {
@@ -18,9 +19,17 @@
    @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() {
@@ -32,6 +41,22 @@
        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)
WanPai/Root/Course/VC/StudentExchangeVC.swift
@@ -6,14 +6,27 @@
//
import UIKit
import RxSwift
class StudentExchangeViewModel:RefreshModel<StudentProfile1Model>{
    override func api() -> (Observable<BaseResponse<[StudentProfile1Model]>>)? {
        return Services.startCourceStudentList()
    }
}
class StudentExchangeVC: BaseVC {
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var tableView: BaseTableView!
    private let viewModel = StudentExchangeViewModel()
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "切换学员"
        viewModel.configure(tableView,needMore: false)
        viewModel.beginRefresh()
    }
    override func setUI() {
@@ -21,6 +34,13 @@
        tableView.dataSource = self
        tableView.separatorStyle = .none
        tableView.register(UINib(nibName: "StudentInfo_3_TCell", bundle: nil), forCellReuseIdentifier: "_StudentInfo_3_TCell")
        tableView.jq_setEmptyView()
    }
    override func setRx() {
        NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: {noti in
            self.viewModel.beginRefresh()
        }).disposed(by: disposeBag)
    }
    @IBAction func addStudentAction(_ sender: UIButton) {
@@ -35,11 +55,13 @@
extension StudentExchangeVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let model = viewModel.dataSource.value[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentInfo_3_TCell") as! StudentInfo_3_TCell
        cell.studentProfile1Model = model
        return cell
    }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10
        return viewModel.dataSource.value.count
    }
}
WanPai/Root/Course/VC/StudentExchangeVC.xib
@@ -34,7 +34,7 @@
                        <action selector="addStudentAction:" destination="-1" eventType="touchUpInside" id="LcO-7a-uGU"/>
                    </connections>
                </button>
                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="zbO-vE-sYi">
                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="zbO-vE-sYi" customClass="BaseTableView" customModule="WanPai" customModuleProvider="target">
                    <rect key="frame" x="0.0" y="111" width="393" height="707"/>
                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                </tableView>
WanPai/Root/Course/VC/StudentReportVC.swift
@@ -1,28 +1,65 @@
//
//  StudentReportVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/6/26.
//
    //
    //  StudentReportVC.swift
    //  WanPai
    //
    //  Created by 无故事王国 on 2023/6/26.
    //
import UIKit
import JQTools
import QMUIKit
import SDWebImage
class StudentReportVC: BaseVC {
    @IBOutlet weak var label_stu_hei: UILabel!
    @IBOutlet weak var label_stu_wei: UILabel!
    @IBOutlet weak var label_stu_BMI: UILabel!
    @IBOutlet weak var stackView: UIStackView!
    private let zoomImageView = QMUIZoomImageView()
    private var stuId:Int!
    init(stuId:Int){
        super.init(nibName: nil, bundle: nil)
        self.stuId = stuId
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "测试报告"
        Services.queryPhysical(stuId: stuId).subscribe(onNext: { [weak self] data in
            if let m = data.data{
                self?.label_stu_hei.attributedText = self?.setAttribute(t1: "\(m.height)", t2: "cm")
                self?.label_stu_wei.attributedText = self?.setAttribute(t1: "\(m.weight)", t2: "kg")
                self?.label_stu_BMI.attributedText = self?.setAttribute(t1: "\(m.bmi)", t2: "正常")
                SDWebImageDownloader.shared.downloadImage(with: URL(string: m.url)) {[weak self] image, data, error, status in
                    if let image{
                        self?.zoomImageView.image = image
                    }
                }
            }
        }).disposed(by: disposeBag)
    }
    override func setUI() {
        label_stu_hei.attributedText = setAttribute(t1: "0", t2: "cm")
        label_stu_wei.attributedText = setAttribute(t1: "0", t2: "kg")
        label_stu_BMI.attributedText = setAttribute(t1: "0.0", t2: "正常")
        view.addSubview(zoomImageView)
        zoomImageView.showEmpty(withText: "暂无报告")
        zoomImageView.snp.makeConstraints { make in
            make.top.equalTo(stackView.snp.bottom)
            make.left.right.bottom.equalToSuperview()
        }
    }
    private func setAttribute(t1:String,t2:String)->NSMutableAttributedString{
WanPai/Root/Course/VC/StudentReportVC.xib
@@ -14,6 +14,7 @@
                <outlet property="label_stu_BMI" destination="rV0-gP-6ge" id="cxE-C5-eev"/>
                <outlet property="label_stu_hei" destination="6WJ-aT-PRh" id="DLe-Fi-WUQ"/>
                <outlet property="label_stu_wei" destination="xwL-RR-Ccb" id="LHS-E5-yKQ"/>
                <outlet property="stackView" destination="Z7n-yb-GDw" id="zOs-T2-lqM"/>
                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
            </connections>
        </placeholder>
WanPai/Root/Home/VC/HomeVC.swift
@@ -76,6 +76,22 @@
            }
        }).disposed(by: disposeBag)
        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
                }else {
                    if let vc = (self?.tabBarController?.viewControllers?[1] as? BaseNav)?.topViewController as? CourseVC{
                        vc.startClouseHomeModel = model
                    }
                }
            }
        }).disposed(by: disposeBag)
    }
    override func setRx() {
WanPai/Root/Other/TCell/StudentInfo_3_TCell.swift
@@ -6,10 +6,39 @@
//
import UIKit
import JQTools
import RxRelay
import RxSwift
class StudentInfo_3_TCell: UITableViewCell {
    @IBOutlet weak var view_container: UIView!
    @IBOutlet weak var label_name: UILabel!
    @IBOutlet weak var label_age: UILabel!
    @IBOutlet weak var label_birthday: UILabel!
    @IBOutlet weak var label_height: UILabel!
    @IBOutlet weak var label_weight: UILabel!
    @IBOutlet weak var btn_isDefault: UIButton!
    private let disposeBag = DisposeBag()
    var studentProfile1Model:StudentProfile1Model!{
        didSet{
            label_name.text = studentProfile1Model.stuName
            label_age.text = "\(studentProfile1Model.stuAge)岁"
            label_birthday.text = studentProfile1Model.birthday
            label_height.text = "\(studentProfile1Model.stuHeight)cm"
            label_weight.text = "\(studentProfile1Model.stuWeight)kg"
            if studentProfile1Model.isNot == 1{
                let attribute = AttributedStringbuilder.build().add(string: "默认", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor.black.withAlphaComponent(0.47)).mutableAttributedString
                btn_isDefault.setAttributedTitle(attribute, for: .normal)
            }else{
                let attribute = AttributedStringbuilder.build().add(string: "设为默认", withFont: UIFont.systemFont(ofSize: 14), withColor: Def_ThemeColor).underLine(color: Def_ThemeColor).mutableAttributedString
                btn_isDefault.setAttributedTitle(attribute, for: .normal)
            }
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
@@ -17,4 +46,15 @@
        view_container.jq_borderColor = UIColor(hexStr: "#FD7902").withAlphaComponent(0.28)
        view_container.jq_borderWidth = 1
    }
    @IBAction func tobeDefaultAction(_ sender: UIButton) {
        guard studentProfile1Model.isNot == 2 else {return}
        Services.startCourseSwitch(id: studentProfile1Model.stuId).subscribe(onNext: { data in
            NotificationCenter.default.post(name: StudentUpdate_Nofi, object: nil)
        }).disposed(by: disposeBag)
    }
    @IBAction func editAction(_ sender: UIButton) {
    }
}
WanPai/Root/Other/TCell/StudentInfo_3_TCell.xib
@@ -118,6 +118,9 @@
                                <state key="normal" title="设为默认">
                                    <color key="titleColor" name="FE6E0D"/>
                                </state>
                                <connections>
                                    <action selector="tobeDefaultAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="yKS-YY-Bc5"/>
                                </connections>
                            </button>
                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hw9-K0-ybQ">
                                <rect key="frame" x="298" y="13" width="22" height="22"/>
@@ -126,6 +129,9 @@
                                </constraints>
                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                <state key="normal" image="btn_edit"/>
                                <connections>
                                    <action selector="editAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="ZwB-Iv-kPV"/>
                                </connections>
                            </button>
                        </subviews>
                        <color key="backgroundColor" red="1" green="0.90588235294117647" blue="0.80000000000000004" alpha="0.080000000000000002" colorSpace="custom" customColorSpace="sRGB"/>
@@ -174,6 +180,12 @@
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="btn_isDefault" destination="sXe-6J-TnF" id="SA6-yA-M8E"/>
                <outlet property="label_age" destination="oKg-Nf-08N" id="YGR-L4-CMh"/>
                <outlet property="label_birthday" destination="g56-ee-WwQ" id="TSH-C9-6vM"/>
                <outlet property="label_height" destination="4un-K1-9mb" id="wVK-CS-Pft"/>
                <outlet property="label_name" destination="WVD-uI-EZQ" id="7tX-sZ-1BC"/>
                <outlet property="label_weight" destination="aa0-aN-fVT" id="70q-YM-p2F"/>
                <outlet property="view_container" destination="wLj-UD-NtG" id="822-VA-MY1"/>
            </connections>
            <point key="canvasLocation" x="160.30534351145039" y="53.521126760563384"/>