fix
younger_times
2023-07-27 19a3cec9bbafe352d67a57ae9a1c4c601c73b6c0
fix
17个文件已修改
3个文件已添加
647 ■■■■ 已修改文件
WanPai/Assets.xcassets/Icons/icon_play.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/icon_play.imageset/icon_play@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/icon_play.imageset/icon_play@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Model/CommonModels.swift 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Network/Services.swift 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/CCell/StudentVideoCCell.swift 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/CCell/StudentVideoCCell.xib 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/TCell/CourseBookingTCell.swift 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/TCell/CourseBookingTCell.xib 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/TCell/CourseChargeTCell.swift 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/TCell/CourseChargeTCell.xib 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/TCell/StudentRemarkTCell.swift 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/TCell/StudentRemarkTCell.xib 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseInfoVC.swift 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseInfoVC.xib 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/StudentCourseDetailVC.swift 139 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/StudentRemarkListVC.swift 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/View/StudentCourseDetailHeadView.swift 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/View/StudentCourseDetailHeadView.xib 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/CoinStoreCenterVC.swift 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Assets.xcassets/Icons/icon_play.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "filename" : "icon_play@2x.png",
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "filename" : "icon_play@3x.png",
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}
WanPai/Assets.xcassets/Icons/icon_play.imageset/icon_play@2x.png
WanPai/Assets.xcassets/Icons/icon_play.imageset/icon_play@3x.png
WanPai/Model/CommonModels.swift
@@ -78,6 +78,12 @@
    var stuWeight:Double = 0
}
struct StudentSimpleProfileModel:HandyJSON{
    var stuId = 0
    var stuName = ""
    var stuImage = ""
}
struct StudentProfile2Model:HandyJSON{
    var stuAge:Int = 0
@@ -307,6 +313,10 @@
struct StartClouseListModel:HandyJSON{
    var courseId = 0
    var courseName = ""
    var deductedNums = 0
    var remainingNums = 0
    var totalNums = 0
    var periodOfValidity = ""
}
struct StartClouseVideoListModel:HandyJSON {
@@ -555,4 +565,32 @@
    var medalType:MedalType = .club
}
struct StudentCommentModel:HandyJSON{
    var comTime: String = ""
    var contents: String = ""
    var headImg: String = ""
    var imgs = [String]()
    var stuName: String = ""
}
struct CourseRecordModel:HandyJSON{
    var purchaseAmount:Double = 0
    var purchaseTime = ""
    var purchaseType = ""
}
struct WeeklyCourseModel:HandyJSON{
    var areaName: String = ""
    var courses = [WeeklyCourseItemModel]()
    var siteDistance: Double = 0
    var storeId: Int = 0
}
struct WeeklyCourseItemModel:HandyJSON{
    var courseID: Int = 0
    var courseName: String = ""
    var detail: String = ""
    var timeStr: String = ""
}
WanPai/Network/Services.swift
@@ -380,6 +380,37 @@
        return NetworkRequest.request(params: params, method: .post, progress: true)
    }
        /// 学员评语
    static func stuComment(stuId:Int)->Observable<BaseResponse<[StudentCommentModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/startCource/stuComment")
            .append(key: "stuId", value: stuId)
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 课时详情-记录列表
    static func recordDetails(stuId:Int,lessionId:Int,startTime:String?,type:Int?)->Observable<BaseResponse<[CourseRecordModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/startCource/recordDetails")
            .append(key: "stuId", value: stuId)
            .append(key: "lessionId", value: lessionId)
            .append(key: "startTime", value: startTime)
            .append(key: "type", value: type)
        return NetworkRequest.request(params: params, method: .post, progress: false)
    }
        /// 上课首页-课程列表
    static func weeksOfCourseDetails(stuId:Int,time:Date)->Observable<BaseResponse<[WeeklyCourseModel]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/account/api/startCource/weeksOfCourseDetails")
            .append(key: "stuId", value: stuId)
            .append(key: "time", value: time.jq_format("yyyy-MM-dd"))
            .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)
    }
}
// MARK: -- 探索玩湃
WanPai/Root/Course/CCell/StudentVideoCCell.swift
@@ -9,6 +9,16 @@
class StudentVideoCCell: UICollectionViewCell {
    @IBOutlet weak var img_cover: UIImageView!
    @IBOutlet weak var label_title: UILabel!
    var videoListModel:StartClouseVideoListModel!{
        didSet{
            img_cover.sd_setImage(with: URL(string: videoListModel.videoCoverImgUrl))
            label_title.text = videoListModel.videoName
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
WanPai/Root/Course/CCell/StudentVideoCCell.xib
@@ -37,6 +37,9 @@
                        <color key="textColor" red="0.17254901960784313" green="0.30980392156862746" blue="0.38823529411764707" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_play" translatesAutoresizingMaskIntoConstraints="NO" id="QFZ-qd-mTm">
                        <rect key="frame" x="149" y="5" width="30" height="30"/>
                    </imageView>
                </subviews>
            </view>
            <viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
@@ -44,15 +47,22 @@
                <constraint firstAttribute="trailing" secondItem="kLK-TI-Nc0" secondAttribute="trailing" constant="2" id="6DY-Ku-PQe"/>
                <constraint firstItem="kLK-TI-Nc0" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="2" id="LgG-rF-QfO"/>
                <constraint firstItem="jKQ-ka-UkG" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="iU0-rp-Nix"/>
                <constraint firstAttribute="trailing" secondItem="QFZ-qd-mTm" secondAttribute="trailing" constant="12" id="j8m-Ua-R66"/>
                <constraint firstItem="jKQ-ka-UkG" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="jeI-JD-tg0"/>
                <constraint firstAttribute="trailing" secondItem="jKQ-ka-UkG" secondAttribute="trailing" id="s36-Hu-sE3"/>
                <constraint firstItem="kLK-TI-Nc0" firstAttribute="top" secondItem="jKQ-ka-UkG" secondAttribute="bottom" constant="12" id="saj-wm-vK7"/>
                <constraint firstItem="QFZ-qd-mTm" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="5" id="wnC-dS-X79"/>
            </constraints>
            <size key="customSize" width="191" height="256"/>
            <connections>
                <outlet property="img_cover" destination="jKQ-ka-UkG" id="VWX-vG-VQH"/>
                <outlet property="label_title" destination="kLK-TI-Nc0" id="IkF-ia-0FF"/>
            </connections>
            <point key="canvasLocation" x="246.56488549618319" y="92.957746478873247"/>
        </collectionViewCell>
    </objects>
    <resources>
        <image name="icon_play" width="30" height="30"/>
        <systemColor name="systemGray6Color">
            <color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
        </systemColor>
WanPai/Root/Course/TCell/CourseBookingTCell.swift
@@ -9,10 +9,28 @@
class CourseBookingTCell: UITableViewCell {
    var weeklyCourseItemModel:WeeklyCourseItemModel!{
        didSet{
            label_title.text = weeklyCourseItemModel.courseName
            label_time.text = weeklyCourseItemModel.timeStr
            label_info.text = weeklyCourseItemModel.detail
        }
    }
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_time: UILabel!
    @IBOutlet weak var label_info: UILabel!
    var clickClouse:((WeeklyCourseItemModel)->Void)?
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
        backgroundColor = .clear
        contentView.backgroundColor = .clear
    }
    @IBAction func bookingAction(_ sender: UIButton) {
        clickClouse?(weeklyCourseItemModel)
    }
}
WanPai/Root/Course/TCell/CourseBookingTCell.xib
@@ -61,6 +61,9 @@
                                <real key="value" value="3"/>
                            </userDefinedRuntimeAttribute>
                        </userDefinedRuntimeAttributes>
                        <connections>
                            <action selector="bookingAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="Iyg-vB-cvj"/>
                        </connections>
                    </button>
                </subviews>
                <constraints>
@@ -74,6 +77,11 @@
                    <constraint firstItem="nxc-Xp-QTZ" firstAttribute="centerY" secondItem="uBt-D3-uxa" secondAttribute="centerY" id="u6a-AJ-52h"/>
                </constraints>
            </tableViewCellContentView>
            <connections>
                <outlet property="label_info" destination="trU-MW-rOB" id="apB-iN-WHi"/>
                <outlet property="label_time" destination="wnJ-m8-Cn6" id="Le5-1b-72V"/>
                <outlet property="label_title" destination="uBt-D3-uxa" id="EtQ-fq-UjT"/>
            </connections>
            <point key="canvasLocation" x="87.786259541984734" y="38.380281690140848"/>
        </tableViewCell>
    </objects>
WanPai/Root/Course/TCell/CourseChargeTCell.swift
@@ -6,9 +6,31 @@
//
import UIKit
import JQTools
class CourseChargeTCell: UITableViewCell {
    var courseRecordModel:CourseRecordModel!{
        didSet{
            label_typeName.text = courseRecordModel.purchaseType
            label_datetime.text = courseRecordModel.purchaseTime
            if courseRecordModel.purchaseAmount > 0{
                label_price.text = "+\(courseRecordModel.purchaseAmount.jq_formatFloat)"
                label_price.textColor = UIColor(hexStr: "#6CC366")
            }else{
                label_price.text = "-\(courseRecordModel.purchaseAmount.jq_formatFloat)"
                label_price.textColor = UIColor(hexStr: "#E32910")
            }
        }
    }
    @IBOutlet weak var label_typeName: UILabel!
    @IBOutlet weak var label_datetime: UILabel!
    @IBOutlet weak var label_price: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        selectionStyle = .none
WanPai/Root/Course/TCell/CourseChargeTCell.xib
@@ -60,6 +60,11 @@
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="label_datetime" destination="7pb-2c-ZKw" id="Ggq-Jn-9nX"/>
                <outlet property="label_price" destination="8SC-6j-uCI" id="ENa-hV-gC0"/>
                <outlet property="label_typeName" destination="3NN-QJ-dst" id="40m-r7-upU"/>
            </connections>
            <point key="canvasLocation" x="119.08396946564885" y="22.887323943661972"/>
        </tableViewCell>
    </objects>
WanPai/Root/Course/TCell/StudentRemarkTCell.swift
@@ -1,17 +1,35 @@
//
//  StudentRemarkTCell.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/6/27.
//
    //
    //  StudentRemarkTCell.swift
    //  WanPai
    //
    //  Created by 无故事王国 on 2023/6/27.
    //
import UIKit
import JQTools
import Lantern
class StudentRemarkTCell: UITableViewCell {
    private let cellW:Double = (JQ_ScreenW - 48.0) / 3.0
    var studentCommentModel:StudentCommentModel!{
        didSet{
            img_profile.sd_setImage(with: URL(string: studentCommentModel.headImg))
            label_name.text = studentCommentModel.stuName
            label_datetime.text = studentCommentModel.comTime
            label_content.attributedText = AttributedStringbuilder.build().add(string: studentCommentModel.contents, withFont: UIFont.systemFont(ofSize: 12), withColor: UIColor.black.withAlphaComponent(0.8), lineSpace: 5).mutableAttributedString
            let count = studentCommentModel.imgs.count
            cons_imgHei.constant = ceil(Double(count) / 3) * cellW + floor(Double(count) / 3) * 9
            collectionView.reloadData()
        }
    }
    private let cellW:Double = (JQ_ScreenW - 55.0) / 3.0
    @IBOutlet weak var collectionView: UICollectionView!
    @IBOutlet weak var img_profile: UIImageView!
    @IBOutlet weak var label_name: UILabel!
    @IBOutlet weak var label_datetime: UILabel!
    @IBOutlet weak var label_content: UILabel!
    @IBOutlet weak var cons_imgHei: NSLayoutConstraint!
    override func awakeFromNib() {
@@ -22,7 +40,7 @@
        collectionView.dataSource = self
        collectionView.isScrollEnabled = false
        collectionView.register(UINib(nibName: "CommonSingleImgCCell", bundle: nil), forCellWithReuseIdentifier: "_CommonSingleImgCCell")
        cons_imgHei.constant = ceil(9 / 3) * cellW + floor(9 / 3) * 9
        cons_imgHei.constant = 0
    }
}
@@ -34,11 +52,42 @@
    }
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 9
        return studentCommentModel.imgs.count
    }
}
extension StudentRemarkTCell:UICollectionViewDelegate{
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        let lantern = Lantern()
        lantern.numberOfItems = {[weak self] in
            return self?.studentCommentModel.imgs.count ?? 0
        }
        lantern.cellClassAtIndex = { _ in
            LanternImageCell.self
        }
        lantern.transitionAnimator = LanternZoomAnimator(previousView: { index -> UIView? in
            let cell = collectionView.cellForItem(at: IndexPath(item: index, section: indexPath.section)) as! CommonSingleImgCCell
            return cell.img
        })
            // UIPageIndicator样式的页码指示器
        lantern.pageIndicator = LanternDefaultPageIndicator()
        lantern.pageIndex = indexPath.item
        lantern.reloadCellAtIndex = { context in
            let lanternCell = context.cell as? CommonSingleImgCCell
            let cell = collectionView.cellForItem(at: IndexPath(item:context.index, section: indexPath.section)) as! CommonSingleImgCCell
            lanternCell?.img.image = cell.img.image
        }
            //不要使用push
        lantern.show()
    }
}
WanPai/Root/Course/TCell/StudentRemarkTCell.xib
@@ -4,7 +4,6 @@
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
        <capability name="System colors in document resources" minToolsVersion="11.0"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
@@ -93,10 +92,13 @@
                    <constraint firstItem="3lz-fy-AFT" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="14" id="wYi-Xy-q0S"/>
                </constraints>
            </tableViewCellContentView>
            <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
            <connections>
                <outlet property="collectionView" destination="FUt-hS-RCI" id="WNg-rS-H71"/>
                <outlet property="cons_imgHei" destination="srQ-wE-MVo" id="s4Q-TL-9og"/>
                <outlet property="img_profile" destination="tlQ-xi-7GI" id="Srb-gF-Kjd"/>
                <outlet property="label_content" destination="O3C-wY-L24" id="fUl-Ql-IUF"/>
                <outlet property="label_datetime" destination="8lp-yv-Zyh" id="UQe-Sk-3WL"/>
                <outlet property="label_name" destination="kdZ-BD-JCJ" id="Jsf-MY-gWE"/>
            </connections>
            <point key="canvasLocation" x="235.87786259541983" y="115.49295774647888"/>
        </tableViewCell>
WanPai/Root/Course/VC/CourseInfoVC.swift
@@ -33,12 +33,17 @@
    @IBOutlet weak var btn_record: UIButton!
    @IBOutlet weak var view_schedule: UIView!
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var cons_tableHei: NSLayoutConstraint!
    @IBOutlet weak var mentalCollectionView: UICollectionView!
    @IBOutlet weak var cons_mentalViewHei: NSLayoutConstraint!
    @IBOutlet weak var exerciseCollectionView: UICollectionView!
    @IBOutlet weak var label_weeklyScope: UILabel!
    @IBOutlet weak var label_totalNums: UILabel!
    @IBOutlet weak var label_deductedNums: UILabel!
    @IBOutlet weak var label_remainingNums: UILabel!
    var startClouseHomeModel:StartClouseHomeModel?
    var weeklyCourseModels = [WeeklyCourseModel]()
    private var currentDate = Date()
    private var mentals = [StudentMedalModel]()
@@ -114,6 +119,11 @@
                pageMenu.setItems(m.courseList.map({$0.courseName}), selectedItemIndex: 0)
            }
            exerciseCollectionView.reloadData()
            label_totalNums.text = "总课时数\( m.courseList.first?.totalNums ?? 0)"
            label_deductedNums.text = "已扣学时数\( m.courseList.first?.deductedNums ?? 0)"
            label_remainingNums.text = "剩余学时数\( m.courseList.first?.remainingNums ?? 0)"
            Services.studMedalList(studentId: m.stuId).subscribe(onNext: {[weak self] data in
                guard let weakSelf = self else { return }
@@ -124,6 +134,8 @@
                    weakSelf.cons_mentalViewHei.constant = he
                }
            }).disposed(by: disposeBag)
            getSelectDayData()
        }
    }
@@ -153,6 +165,11 @@
        tableView.delegate = self
        tableView.dataSource = self
        tableView.isScrollEnabled = false
        if #available(iOS 15.0, *) {
            tableView.sectionHeaderTopPadding = 0
        } else {
        }
        tableView.separatorStyle = .none
        tableView.register(UINib(nibName: "CourseBookingTCell", bundle: nil), forCellReuseIdentifier: "_CourseBookingTCell")
@@ -205,7 +222,11 @@
    @IBAction func detailAction(_ sender: UIButton) {
        guard (startClouseHomeModel?.courseList.count ?? 0) > 0 else {return}
        let vc = StudentCourseDetailVC()
        let index = pageMenu.selectedItemIndex
        let models = startClouseHomeModel!.courseList
        let studentModel = StudentSimpleProfileModel(stuId: startClouseHomeModel!.stuId, stuName: startClouseHomeModel!.stuName, stuImage: startClouseHomeModel!.stuImg)
        let vc = StudentCourseDetailVC(models: models,defaultIndex: index,studentModel: studentModel)
        push(vc: vc)
    }
@@ -217,8 +238,21 @@
    @IBAction func remarkAction(_ sender: UIButton) {
        let vc = StudentRemarkListVC()
        guard startClouseHomeModel != nil else {return}
        let vc = StudentRemarkListVC(stuId: startClouseHomeModel!.stuId)
        push(vc: vc)
    }
    private func getSelectDayData(){
        if let model = startClouseHomeModel{
            Services.weeksOfCourseDetails(stuId: model.stuId, time: currentDate).subscribe(onNext: {[weak self] data in
                if let models = data.data{
                    self?.weeklyCourseModels = models
                    self?.cons_tableHei.constant = Double(models.flatMap({$0.courses}).count) * 70 + 58 * Double(models.count)
                    self?.tableView.reloadData()
                }
            }).disposed(by: disposeBag)
        }
    }
    override var preferredStatusBarStyle: UIStatusBarStyle{
@@ -238,16 +272,90 @@
extension CourseInfoVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "_CourseBookingTCell") as! CourseBookingTCell
        cell.contentView.backgroundColor = UIColor(hexStr: "#F2F6F9")
        if indexPath.row == 0 && weeklyCourseModels[indexPath.section].courses.count == 1{
            cell.contentView.jq_addCorners(corner: [.allCorners], radius: 16,width: JQ_ScreenW - 48,height: 70)
        }else if indexPath.row == 0 && weeklyCourseModels[indexPath.section].courses.count != 1{
            cell.contentView.jq_addCorners(corner: [.topLeft,.topRight], radius: 16,width: JQ_ScreenW - 48,height: 70)
        }else if indexPath.row == weeklyCourseModels[indexPath.section].courses.count - 1{
            cell.contentView.jq_addCorners(corner: [.bottomLeft,.bottomRight], radius: 16,width: JQ_ScreenW - 48,height: 70)
        }else{
            cell.contentView.jq_addCorners(corner: [.allCorners], radius: 0,width: JQ_ScreenW - 48,height: 70)
        }
        cell.weeklyCourseItemModel = weeklyCourseModels[indexPath.section].courses[indexPath.row]
        cell.clickClouse = {m in
            print("--->")
        }
        return cell
    }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 1
        return weeklyCourseModels[section].courses.count
}
    func numberOfSections(in tableView: UITableView) -> Int {
        return weeklyCourseModels.count
    }
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 70
    }
    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        let m = weeklyCourseModels[section]
       var headerView  = tableView.dequeueReusableHeaderFooterView(withIdentifier: "header")
        if headerView == nil{
            headerView = UITableViewHeaderFooterView(reuseIdentifier: "header")
            let contentView = UIView()
            contentView.borderColor = UIColor(hexStr: "#E7E3E3")
            contentView.borderWidth = 1
            contentView.cornerRadius = 11
            headerView?.contentView.addSubview(contentView)
            contentView.snp.makeConstraints { make in
                make.center.equalToSuperview()
                make.left.right.equalToSuperview()
                make.height.equalTo(22)
            }
            let label_address = UILabel()
            label_address.tag = 1000
            label_address.text = "成都非遗玩湃全科体育公园   0.0km"
            label_address.font = UIFont.systemFont(ofSize: 10, weight: .medium)
            label_address.textColor = UIColor(hexStr: "#AFB4BC")
            contentView.addSubview(label_address)
            label_address.snp.makeConstraints { make in
                make.left.equalToSuperview().offset(12)
                make.centerY.equalToSuperview()
                make.right.equalTo(-50)
            }
            let btn_detial = QMUIButton(type: .custom)
            btn_detial.setTitle("位置详情", for: .normal)
            btn_detial.titleLabel?.font = UIFont.systemFont(ofSize: 10)
            btn_detial.setTitleColor(UIColor(hexStr: "#AFB4BC"), for: .normal)
            btn_detial.setImage(UIImage(named: "icon_pop"), for: .normal)
            btn_detial.imagePosition = .left
            btn_detial.spacingBetweenImageAndTitle = 3
            contentView.addSubview(btn_detial)
            btn_detial.snp.makeConstraints { make in
                make.right.equalTo(-10)
                make.centerY.equalToSuperview()
            }
        }
        if let label = headerView?.contentView.viewWithTag(1000) as? UILabel{
            label.text = String(format: "%@ %.1km", m.areaName,m.siteDistance)
        }
        headerView?.contentView.backgroundColor = .white
        return headerView
    }
    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return 58
    }
}
@@ -268,7 +376,12 @@
extension CourseInfoVC:UICollectionViewDataSource{
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return mentals.count
        if collectionView.tag == 1000{
            return mentals.count
        }else{
            return startClouseHomeModel?.exerciseVideoList.count ?? 0
        }
    }
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
@@ -279,7 +392,9 @@
            cell.t2.text = mentals[indexPath.row].medalType.title
            return cell
        } else{
            let model = startClouseHomeModel!.exerciseVideoList[indexPath.row]
            let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_StudentVideoCCell", for: indexPath) as! StudentVideoCCell
            cell.videoListModel = model
            return cell
        }
    }
@@ -315,7 +430,12 @@
extension CourseInfoVC:SPPageMenuDelegate{
    func pageMenu(_ pageMenu: SPPageMenu, itemSelectedAt index: Int) {
        guard startClouseHomeModel != nil else {return}
        if let m = startClouseHomeModel?.courseList[index]{
            label_totalNums.text = "总课时数\( m.totalNums)"
            label_deductedNums.text = "已扣学时数\( m.deductedNums)"
            label_remainingNums.text = "剩余学时数\( m.remainingNums)"
        }
    }
}
@@ -335,9 +455,9 @@
    }
    func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController {
        let vc = CourseInfoScheduleVC(index: page) { date in
            self.currentDate = date
        let vc = CourseInfoScheduleVC(index: page) {[weak self] date in
            self?.currentDate = date
            self?.getSelectDayData()
        }
        return vc
    }
WanPai/Root/Course/VC/CourseInfoVC.xib
@@ -14,14 +14,18 @@
                <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="cons_tableHei" destination="Opj-Pl-2o1" id="N57-of-GoU"/>
                <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_deductedNums" destination="GWu-E2-1Xq" id="8Tw-Vg-Jpj"/>
                <outlet property="label_remainingNums" destination="rbY-7n-tGO" id="DNH-L4-9HU"/>
                <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_totalNums" destination="k7g-f1-MBA" id="KGg-PK-hC7"/>
                <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"/>
@@ -82,7 +86,7 @@
                            </userDefinedRuntimeAttributes>
                        </imageView>
                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dM8-7c-aXP">
                            <rect key="frame" x="0.0" y="0.0" width="393" height="1141.3333333333333"/>
                            <rect key="frame" x="0.0" y="0.0" width="393" height="1083.3333333333333"/>
                            <subviews>
                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="学员名" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="egC-eg-thJ">
                                    <rect key="frame" x="27" y="37" width="64.333333333333329" height="29"/>
@@ -424,16 +428,16 @@
                                    </constraints>
                                </view>
                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_star" translatesAutoresizingMaskIntoConstraints="NO" id="uha-8d-tRd">
                                    <rect key="frame" x="24" y="679.33333333333337" width="22" height="23"/>
                                    <rect key="frame" x="24" y="621.33333333333337" width="22" height="23"/>
                                </imageView>
                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="学员勋章" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ioo-oF-wME">
                                    <rect key="frame" x="52.999999999999993" y="681.33333333333337" width="65.333333333333314" height="19.333333333333371"/>
                                    <rect key="frame" x="52.999999999999993" y="623.33333333333337" width="65.333333333333314" height="19.333333333333371"/>
                                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                    <color key="textColor" red="0.17254901960784313" green="0.30980392156862746" blue="0.38823529411764707" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                    <nil key="highlightedColor"/>
                                </label>
                                <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="b9G-TL-PI1">
                                    <rect key="frame" x="0.0" y="732.33333333333337" width="393" height="50"/>
                                    <rect key="frame" x="0.0" y="674.33333333333337" width="393" height="50"/>
                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                                    <constraints>
                                        <constraint firstAttribute="height" constant="50" id="c8h-cI-ZAt"/>
@@ -446,7 +450,7 @@
                                    </collectionViewFlowLayout>
                                </collectionView>
                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Okg-Yc-buM">
                                    <rect key="frame" x="100" y="799.33333333333337" width="193" height="40"/>
                                    <rect key="frame" x="100" y="741.33333333333337" width="193" height="40"/>
                                    <color key="backgroundColor" name="FE6E0D"/>
                                    <constraints>
                                        <constraint firstAttribute="height" constant="40" id="rQm-Bd-Kpj"/>
@@ -464,78 +468,22 @@
                                        <action selector="remarkAction:" destination="-1" eventType="touchUpInside" id="4xM-eC-AIN"/>
                                    </connections>
                                </button>
                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="d1f-JQ-ZhT">
                                    <rect key="frame" x="24" y="555.33333333333337" width="345" height="22"/>
                                    <subviews>
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="位置详情" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yKf-MR-rbN">
                                            <rect key="frame" x="294" y="5" width="41" height="12"/>
                                            <constraints>
                                                <constraint firstAttribute="width" constant="41" id="MLu-k5-0Z5"/>
                                            </constraints>
                                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="10"/>
                                            <color key="textColor" red="0.68627450980392157" green="0.70588235294117641" blue="0.73725490196078436" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                            <nil key="highlightedColor"/>
                                        </label>
                                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_pop" translatesAutoresizingMaskIntoConstraints="NO" id="2E3-WS-4MJ">
                                            <rect key="frame" x="279" y="3.6666666666666288" width="12" height="15"/>
                                            <constraints>
                                                <constraint firstAttribute="width" constant="12" id="YBr-wi-R2T"/>
                                                <constraint firstAttribute="height" constant="15" id="fLZ-dh-ER3"/>
                                            </constraints>
                                        </imageView>
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="----    0km" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fey-ef-AY1">
                                            <rect key="frame" x="12" y="0.0" width="247" height="22"/>
                                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="10"/>
                                            <color key="textColor" red="0.68627450980000004" green="0.70588235290000001" blue="0.73725490199999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                            <nil key="highlightedColor"/>
                                        </label>
                                    </subviews>
                                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" estimatedSectionHeaderHeight="-1" sectionFooterHeight="18" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="O0u-hX-kAR">
                                    <rect key="frame" x="24" y="535.33333333333337" width="345" height="70"/>
                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                                    <constraints>
                                        <constraint firstAttribute="bottom" secondItem="fey-ef-AY1" secondAttribute="bottom" id="BOn-c7-8rv"/>
                                        <constraint firstItem="yKf-MR-rbN" firstAttribute="centerY" secondItem="2E3-WS-4MJ" secondAttribute="centerY" id="G6r-gs-i5h"/>
                                        <constraint firstItem="yKf-MR-rbN" firstAttribute="centerY" secondItem="d1f-JQ-ZhT" secondAttribute="centerY" id="GWM-JT-KpK"/>
                                        <constraint firstItem="fey-ef-AY1" firstAttribute="leading" secondItem="d1f-JQ-ZhT" secondAttribute="leading" constant="12" id="VIa-7Z-DH5"/>
                                        <constraint firstItem="2E3-WS-4MJ" firstAttribute="leading" secondItem="fey-ef-AY1" secondAttribute="trailing" constant="20" id="Y8l-CL-3q5"/>
                                        <constraint firstItem="yKf-MR-rbN" firstAttribute="leading" secondItem="2E3-WS-4MJ" secondAttribute="trailing" constant="3" id="pMr-mg-l4d"/>
                                        <constraint firstAttribute="trailing" secondItem="yKf-MR-rbN" secondAttribute="trailing" constant="10" id="pyC-ci-M85"/>
                                        <constraint firstAttribute="height" constant="22" id="yEv-mg-vw1"/>
                                        <constraint firstItem="fey-ef-AY1" firstAttribute="top" secondItem="d1f-JQ-ZhT" secondAttribute="top" id="zzC-TG-xE5"/>
                                    </constraints>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="color" keyPath="jq_xibBorderColor">
                                            <color key="value" red="0.90588235289999997" green="0.89019607840000003" blue="0.89019607840000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                        </userDefinedRuntimeAttribute>
                                        <userDefinedRuntimeAttribute type="number" keyPath="jq_xibCornerRadius">
                                            <real key="value" value="11"/>
                                        </userDefinedRuntimeAttribute>
                                        <userDefinedRuntimeAttribute type="number" keyPath="jq_xibBorderWidth">
                                            <real key="value" value="1"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                </view>
                                <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="O0u-hX-kAR">
                                    <rect key="frame" x="24" y="593.33333333333337" width="345" height="70"/>
                                    <color key="backgroundColor" red="0.94901960784313721" green="0.96470588235294119" blue="0.97647058823529409" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                    <constraints>
                                        <constraint firstAttribute="height" constant="70" id="Opj-Pl-2o1"/>
                                    </constraints>
                                    <userDefinedRuntimeAttributes>
                                        <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/>
                                        <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB">
                                            <real key="value" value="16"/>
                                        </userDefinedRuntimeAttribute>
                                    </userDefinedRuntimeAttributes>
                                </tableView>
                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tc8-tf-Jm4">
                                    <rect key="frame" x="19" y="876.33333333333337" width="355" height="1"/>
                                    <rect key="frame" x="19" y="818.33333333333337" width="355" height="1"/>
                                    <color key="backgroundColor" red="0.59215686274509804" green="0.59215686274509804" blue="0.59215686274509804" alpha="0.25" colorSpace="custom" customColorSpace="sRGB"/>
                                    <constraints>
                                        <constraint firstAttribute="height" constant="1" id="zCQ-gS-bAL"/>
                                    </constraints>
                                </view>
                                <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="wNl-09-jiS">
                                    <rect key="frame" x="22" y="877.33333333333337" width="349" height="264.00000000000011"/>
                                    <rect key="frame" x="22" y="819.33333333333337" width="349" height="264.00000000000011"/>
                                    <subviews>
                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KR4-hI-8vp">
                                            <rect key="frame" x="0.0" y="0.0" width="349" height="53"/>
@@ -613,10 +561,9 @@
                                <constraint firstItem="clG-di-bFf" firstAttribute="centerY" secondItem="s1y-gM-ejj" secondAttribute="centerY" id="1Ft-Ke-zUm"/>
                                <constraint firstItem="O0u-hX-kAR" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="24" id="1Ji-QN-QOy"/>
                                <constraint firstItem="UMv-8K-vwR" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" id="1ys-wG-FgK"/>
                                <constraint firstItem="d1f-JQ-ZhT" firstAttribute="top" secondItem="UMv-8K-vwR" secondAttribute="bottom" constant="20" id="25w-Dr-srZ"/>
                                <constraint firstItem="b9G-TL-PI1" firstAttribute="top" secondItem="uha-8d-tRd" secondAttribute="bottom" constant="30" id="2FH-SK-tdz"/>
                                <constraint firstItem="gbo-sZ-lm5" firstAttribute="top" secondItem="s1y-gM-ejj" secondAttribute="bottom" constant="30" id="2aL-ir-sF6"/>
                                <constraint firstAttribute="trailing" secondItem="d1f-JQ-ZhT" secondAttribute="trailing" constant="24" id="34X-Ld-MOc"/>
                                <constraint firstItem="O0u-hX-kAR" firstAttribute="top" secondItem="UMv-8K-vwR" secondAttribute="bottom" id="2uf-vy-jzM"/>
                                <constraint firstAttribute="trailing" secondItem="wNl-09-jiS" secondAttribute="trailing" constant="22" id="3SP-6t-93o"/>
                                <constraint firstItem="gbo-sZ-lm5" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="27" id="3e7-4s-VCK"/>
                                <constraint firstItem="egC-eg-thJ" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="27" id="71E-fS-Lee"/>
@@ -633,7 +580,6 @@
                                <constraint firstItem="ya3-wv-QBZ" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="19" id="PMv-Hz-gc1"/>
                                <constraint firstItem="ya3-wv-QBZ" firstAttribute="top" secondItem="gbo-sZ-lm5" secondAttribute="bottom" constant="30" id="PNy-jR-omb"/>
                                <constraint firstAttribute="trailing" secondItem="gbo-sZ-lm5" secondAttribute="trailing" id="Pa6-s7-4MW"/>
                                <constraint firstItem="d1f-JQ-ZhT" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="24" id="R6U-o2-s3g"/>
                                <constraint firstItem="s1y-gM-ejj" firstAttribute="leading" secondItem="dM8-7c-aXP" secondAttribute="leading" constant="27" id="Ufn-WT-UoH"/>
                                <constraint firstItem="N78-t5-4OO" firstAttribute="centerY" secondItem="Ojc-7l-9aZ" secondAttribute="centerY" id="Vnb-3K-Nwv"/>
                                <constraint firstAttribute="trailing" secondItem="UMv-8K-vwR" secondAttribute="trailing" id="WrZ-cU-Z6S"/>
@@ -642,7 +588,6 @@
                                <constraint firstItem="hpJ-2G-ATO" firstAttribute="top" secondItem="ya3-wv-QBZ" secondAttribute="bottom" constant="8" id="Z1K-Xb-rHf"/>
                                <constraint firstAttribute="trailing" secondItem="O0u-hX-kAR" secondAttribute="trailing" constant="24" id="Z25-yv-NZd"/>
                                <constraint firstItem="2CP-x2-Qn7" firstAttribute="leading" secondItem="clG-di-bFf" secondAttribute="trailing" constant="8" id="Zni-D2-L5L"/>
                                <constraint firstItem="O0u-hX-kAR" firstAttribute="top" secondItem="d1f-JQ-ZhT" secondAttribute="bottom" constant="16" id="a3n-CH-Jfc"/>
                                <constraint firstAttribute="trailing" secondItem="5q7-aC-rFo" secondAttribute="trailing" constant="22" id="aWd-uN-sy4"/>
                                <constraint firstItem="N78-t5-4OO" firstAttribute="top" secondItem="CR5-qX-86L" secondAttribute="bottom" constant="15" id="aqH-79-a7O"/>
                                <constraint firstItem="Tc8-tf-Jm4" firstAttribute="top" secondItem="Okg-Yc-buM" secondAttribute="bottom" constant="37" id="dTC-iD-v4t"/>
@@ -706,7 +651,6 @@
        <image name="icon_circle_mini" width="16" height="16"/>
        <image name="icon_man" width="16" height="16"/>
        <image name="icon_more" width="11" height="18"/>
        <image name="icon_pop" width="12" height="15"/>
        <image name="icon_star" width="22" height="23"/>
        <image name="icon_stu_weight" width="20" height="20"/>
        <image name="icon_student_hei" width="18" height="24"/>
WanPai/Root/Course/VC/StudentCourseDetailVC.swift
@@ -8,11 +8,32 @@
import UIKit
import JQTools
import QMUIKit
import SPPageMenu
import RxRelay
import RxSwift
class StudentCourseViewModel:RefreshModel<CourseRecordModel>{
    let stuId = BehaviorRelay<Int>(value: 0)
    let lessionId = BehaviorRelay<Int>(value: 0)
    let startTime = BehaviorRelay<Date?>(value: nil)
    let type = BehaviorRelay<Int?>(value: nil)
    override func api() -> (Observable<BaseResponse<[CourseRecordModel]>>)? {
        return Services.recordDetails(stuId: stuId.value, lessionId: lessionId.value, startTime: startTime.value?.jq_format("yyyy-MM"), type: type.value)
    }
}
class StudentCourseDetailVC: BaseVC {
    private lazy var tableView:UITableView = {
        let table = UITableView(frame: .zero, style: .plain)
    private var models = [StartClouseListModel]()
    private var studentModel:StudentSimpleProfileModel!
    private var defaultIndex = 0
    private lazy var tableView:BaseTableView = {
        let table = BaseTableView(frame: .zero, style: .plain)
        table.separatorStyle = .none
        table.delegate = self
        table.dataSource = self
@@ -23,16 +44,57 @@
        return table
    }()
    private let headView = StudentCourseDetailHeadView.jq_loadNibView()
    private var headView:StudentCourseDetailHeadView = {
        return StudentCourseDetailHeadView.jq_loadNibView()
    }()
    private let viewModel = StudentCourseViewModel()
    private lazy var sectionView:HeaderInSectionView = {
        let v = HeaderInSectionView()
        v.btn_filter.addTarget(self, action: #selector(fliterAction), for: .touchUpInside)
        v.btn_datetime.addTarget(self, action: #selector(datetimePickerAction), for: .touchUpInside)
        return v
    }()
    required init(models:[StartClouseListModel],defaultIndex:Int,studentModel:StudentSimpleProfileModel) {
        super.init(nibName: nil, bundle: nil)
        self.models = models
        self.defaultIndex = defaultIndex
        self.studentModel = studentModel
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "课时详情"
        headView.renewalClouse = { [weak self] () in
            let vc = CourseDetailApplyVC(detailModel: CourseDetailModel())
            self?.push(vc: vc)
            guard let weakSelf = self else { return }
            let model = weakSelf.models[weakSelf.headView.pageMenu.selectedItemIndex]
            Services.queryCourseInfo(id: model.courseId).subscribe(onNext: {[weak self] data in
                if let m = data.data{
                    let vc = CourseDetailApplyVC(detailModel: m)
                    self?.push(vc: vc)
                }
            }).disposed(by: weakSelf.disposeBag)
        }
        viewModel.startTime.accept(Date())
        viewModel.lessionId.accept(models[defaultIndex].courseId)
        viewModel.stuId.accept(studentModel.stuId)
        headView.pageMenu.setItems(models.map({$0.courseName}), selectedItemIndex: defaultIndex)
        headView.pageMenu.delegate = self
        headView.label_stuName.text = studentModel.stuName
        headView.img_stuProfile.sd_setImage(with: URL(string: studentModel.stuImage),placeholderImage: UIImage(named: "placeholder_1"))
        viewModel.beginRefresh()
    }
    override func setUI() {
@@ -41,13 +103,36 @@
            make.edges.equalToSuperview()
        }
        tableView.tableHeaderView = headView
        headView.snp.makeConstraints { make in
            make.width.equalToSuperview()
            make.height.greaterThanOrEqualTo(0)
        }
        tableView.jq_setEmptyView()
        viewModel.configure(tableView,needMore: false)
        headView.layoutIfNeeded()
    }
    @objc func fliterAction(){
        JQ_MenuView().show(self, tapView: sectionView.btn_filter, items: ["全部","增加","扣除"],tableHei: 160) {[weak self] index, str in
            if index == 0{
                self?.sectionView.btn_filter.setTitle("全部记录", for: .normal)
                self?.viewModel.type.accept(nil)
            }else{
                self?.sectionView.btn_filter.setTitle(str, for: .normal)
                self?.viewModel.type.accept(index)
            }
            self?.viewModel.beginRefresh()
        }
    }
    @objc func datetimePickerAction(){
        CommonDatePickerView.show(before: 3, after: 0, type: .YM) { [weak self] year, month, _ in
            let date = Date.jq_format(year: year, month: month, day: 2)
            self?.sectionView.btn_datetime.setTitle(date!.jq_format("yyyy年MM月>"), for: .normal)
            self?.viewModel.startTime.accept(date)
            self?.viewModel.beginRefresh()
        }
    }
}
@@ -57,12 +142,14 @@
extension StudentCourseDetailVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         let model = viewModel.dataSource.value[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "_CourseChargeTCell") as! CourseChargeTCell
        cell.courseRecordModel = model
        return cell
    }
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 50
        return viewModel.dataSource.value.count
    }
    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
@@ -70,14 +157,14 @@
    }
    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        let v = HeaderInSectionView()
        return v
        sectionView.btn_datetime.setTitle(viewModel.startTime.value?.jq_format("yyyy年MM月>"), for: .normal)
        return sectionView
    }
}
private class HeaderInSectionView:UIView{
    private lazy var btn_datetime:QMUIButton = {
    private(set) lazy var btn_datetime:QMUIButton = {
        let btn = QMUIButton(type: .custom)
        btn.setTitle(Date().jq_format("yyyy年M月>"), for: .normal)
        btn.setTitleColor(UIColor(hexStr: "#0048FF"), for: .normal)
@@ -85,7 +172,7 @@
        return btn
    }()
    private lazy var btn_filter:QMUIButton = {
    private(set) lazy var btn_filter:QMUIButton = {
        let btn = QMUIButton(type: .custom)
        btn.setTitleColor(UIColor(hexStr: "#414141"), for: .normal)
        btn.titleLabel?.font = UIFont.systemFont(ofSize: 16)
@@ -119,24 +206,24 @@
            make.height.equalTo(22)
            make.centerY.equalTo(btn_filter)
        }
        btn_filter.addTarget(self, action: #selector(fliterAction), for: .touchUpInside)
        btn_datetime.addTarget(self, action: #selector(datetimePickerAction), for: .touchUpInside)
    }
    @objc func fliterAction(){
        JQ_MenuView().show(self, tapView: btn_filter, items: ["1","2"],tableHei: 140) { index, str in
        }
    }
    @objc func datetimePickerAction(){
        CommonDatePickerView.show { year, month, day in
        }
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
extension StudentCourseDetailVC:SPPageMenuDelegate{
    func pageMenu(_ pageMenu: SPPageMenu, itemSelectedAt index: Int) {
        defaultIndex = index
        let model = models[index]
        headView.label_deductedNums.text = "\(model.deductedNums)"
        headView.label_totalNums.text = "\(model.totalNums)"
        headView.label_remainingNums.text = "\(model.remainingNums)"
        headView.label_datetime.text =  "有效期:\(model.periodOfValidity)"
        headView.label_deductedNums_1.text = "已扣课时数:\(model.deductedNums)"
        viewModel.lessionId.accept(model.courseId)
        viewModel.beginRefresh()
    }
}
WanPai/Root/Course/VC/StudentRemarkListVC.swift
@@ -6,11 +6,20 @@
//
import UIKit
import RxSwift
import RxRelay
class StudentRemarkViewModel:RefreshModel<StudentCommentModel>{
    let stuId = BehaviorRelay<Int>(value: 0)
    override func api() -> (Observable<BaseResponse<[StudentCommentModel]>>)? {
        return Services.stuComment(stuId: stuId.value)
    }
}
class StudentRemarkListVC: BaseVC {
    lazy private var tableView:UITableView = {
        let table = UITableView(frame: .zero, style: .plain)
    lazy private var tableView:BaseTableView = {
        let table = BaseTableView(frame: .zero, style: .plain)
        table.separatorStyle = .none
        table.delegate = self
        table.dataSource = self
@@ -18,9 +27,23 @@
        return table
    }()
    let viewModel = StudentRemarkViewModel()
   required init(stuId:Int) {
        super.init(nibName: nil, bundle: nil)
        viewModel.stuId.accept(stuId)
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "学员评语"
        viewModel.configure(tableView)
        viewModel.beginRefresh()
    }
    override func setUI() {
@@ -28,6 +51,7 @@
        tableView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        tableView.jq_setEmptyView()
    }
}
@@ -35,11 +59,13 @@
extension StudentRemarkListVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         return 10
        return viewModel.dataSource.value.count
    }
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let model = viewModel.dataSource.value[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "_StudentRemarkTCell") as! StudentRemarkTCell
        cell.studentCommentModel = model
        return cell
    }
}
WanPai/Root/Course/View/StudentCourseDetailHeadView.swift
@@ -13,9 +13,17 @@
    @IBOutlet weak var view_container: UIView!
    @IBOutlet weak var view_menu: UIView!
    @IBOutlet weak var label_totalNums: UILabel!
    @IBOutlet weak var label_deductedNums: UILabel!
    @IBOutlet weak var label_remainingNums: UILabel!
    @IBOutlet weak var label_datetime: UILabel!
    @IBOutlet weak var label_stuName: UILabel!
    @IBOutlet weak var img_stuProfile: UIImageView!
    @IBOutlet weak var label_deductedNums_1: UILabel!
    var renewalClouse:(()->Void)?
    private var pageMenu:SPPageMenu = {
    private(set) var pageMenu:SPPageMenu = {
        let pageMenu = SPPageMenu(frame: .zero, trackerStyle: .line)
        // 追踪线
        pageMenu.trackerWidth = 56
@@ -31,7 +39,6 @@
        // item
        pageMenu.spacing = 27.0
        pageMenu.permutationWay = .scrollAdaptContent
        pageMenu.setItems(["荷兰足球队","全科体育课"], selectedItemIndex: 0)
        // 字体
        pageMenu.selectedItemTitleFont = UIFont.systemFont(ofSize: 18, weight: .medium)
WanPai/Root/Course/View/StudentCourseDetailHeadView.xib
@@ -187,6 +187,13 @@
            </constraints>
            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
            <connections>
                <outlet property="img_stuProfile" destination="dYg-xp-cgE" id="tQX-fq-EKv"/>
                <outlet property="label_datetime" destination="wUX-EU-sza" id="8xl-B9-xob"/>
                <outlet property="label_deductedNums" destination="2MH-wg-za7" id="XcX-S4-4IQ"/>
                <outlet property="label_deductedNums_1" destination="Agy-Qd-l08" id="DPi-Ei-JfK"/>
                <outlet property="label_remainingNums" destination="jO2-AH-Mno" id="9rd-Fz-8EI"/>
                <outlet property="label_stuName" destination="ctC-Za-6Wl" id="CB4-4t-Skp"/>
                <outlet property="label_totalNums" destination="G2G-fo-yih" id="3nc-RK-Dja"/>
                <outlet property="view_container" destination="jGG-62-6wL" id="SS8-Us-8pf"/>
                <outlet property="view_menu" destination="MPS-5L-UiF" id="qAf-r5-7ba"/>
            </connections>
WanPai/Root/Welfare/VC/CoinStoreCenterVC.swift
@@ -42,6 +42,7 @@
        collect.contentInset = UIEdgeInsets(top: 0, left:0, bottom: 14, right: 0)
        collect.register(UINib(nibName: "CoinStoreCCell", bundle: nil), forCellWithReuseIdentifier: "_CoinStoreCCell")
        collect.register(UINib(nibName: "CoinStoreHeadView", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "_CoinStoreHeadView")
        collect.backgroundColor = .white
        return collect
    }()