From 45aebcb160b7a68ad79ad703466e287513f2ae22 Mon Sep 17 00:00:00 2001 From: 无故事王国 <841720330@qq.com> Date: 星期四, 14 九月 2023 18:20:34 +0800 Subject: [PATCH] 新增部分完善 --- WanPai/Root/Course/VC/CourseInfoVC.swift | 29 ++++++++++++++++++++--------- 1 files changed, 20 insertions(+), 9 deletions(-) diff --git a/WanPai/Root/Course/VC/CourseInfoVC.swift b/WanPai/Root/Course/VC/CourseInfoVC.swift index 61f69e0..ee4420d 100644 --- a/WanPai/Root/Course/VC/CourseInfoVC.swift +++ b/WanPai/Root/Course/VC/CourseInfoVC.swift @@ -13,12 +13,6 @@ class CourseInfoVC: BaseVC { -// private struct MentalInfo { -// var img:UIImage! -// var t1:String! -// var t2:String! -// } - @IBOutlet weak var scrollView: CourseInfoScrollView! @IBOutlet weak var view_container: UIView! @IBOutlet weak var img_header: UIImageView! @@ -101,6 +95,17 @@ return pageVC }() + private lazy var btn_dispatchCourse:UIButton = { + let btn = UIButton(type: .custom) + btn.setTitleColor(Def_ThemeColor, for: .normal) + + let attribute = AttributedStringbuilder.build().add(string: "未分配课时", withFont: UIFont.systemFont(ofSize: 14), withColor: Def_ThemeColor).underLine(color: Def_ThemeColor).mutableAttributedString + btn.setAttributedTitle(attribute, for: .normal) + + return btn + + }() + override func viewDidLoad() { super.viewDidLoad() @@ -116,12 +121,19 @@ 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.frame = CGRect(origin: .zero, size: CGSize(width: JQ_ScreenW - 100, height: 25)) pageMenu.delegate = self view_menu.addSubview(pageMenu) cons_menuHeight.constant = 25 pageMenu.setItems(m.courseList.map({$0.courseName}), selectedItemIndex: 0) } + + view_menu.addSubview(btn_dispatchCourse) + btn_dispatchCourse.snp.makeConstraints { make in + make.right.equalTo(-19) + make.centerY.equalToSuperview() + make.height.equalTo(25) + } exerciseCollectionView.reloadData() label_totalNums.text = "总课时数\( m.courseList.first?.totalNums ?? 0)" @@ -160,7 +172,7 @@ scrollView.contentInsetAdjustmentBehavior = .never let attribute = AttributedStringbuilder() - attribute.add(string: "预约记录", withFont: UIFont.systemFont(ofSize: 14), withColor: Def_ThemeColor) + attribute.add(string: "上课记录", withFont: UIFont.systemFont(ofSize: 14), withColor: Def_ThemeColor) attribute.underLine(color: Def_ThemeColor) btn_record.titleLabel?.attributedText = attribute.mutableAttributedString @@ -194,7 +206,6 @@ exerciseCollectionView.dataSource = self exerciseCollectionView.tag = 1001 exerciseCollectionView.register(UINib(nibName: "StudentVideoCCell", bundle: nil), forCellWithReuseIdentifier: "_StudentVideoCCell") - navigationItem.leftBarButtonItem = UIBarButtonItem(customView: leftBtn) -- Gitblit v1.7.1