//
|
// CourseInfoScheduleVC.swift
|
// WanPai
|
//
|
// Created by 无故事王国 on 2023/6/25.
|
//
|
|
import UIKit
|
import JQTools
|
|
class CourseInfoScheduleVC: BaseVC {
|
|
private var cellW:Double!
|
private var cellH:Double!
|
|
private let weeks = ["一","二","三","四","五","六","日"]
|
|
@IBOutlet weak var weekCollectionView: UICollectionView!
|
|
override func viewDidLoad() {
|
super.viewDidLoad()
|
|
}
|
|
override func setUI() {
|
weekCollectionView.register(UINib(nibName: "CourseDatetimeCCell", bundle: nil), forCellWithReuseIdentifier: "_CourseDatetimeCCell")
|
weekCollectionView.delegate = self
|
weekCollectionView.dataSource = self
|
weekCollectionView.isScrollEnabled = false
|
|
cellW = (JQ_ScreenW - 22 - 114 - 60) / 7
|
cellH = cellW * 1.785
|
}
|
}
|
|
extension CourseInfoScheduleVC:UICollectionViewDelegate{
|
|
}
|
|
extension CourseInfoScheduleVC:UICollectionViewDataSource{
|
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
return weeks.count
|
}
|
|
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
let cell = weekCollectionView.dequeueReusableCell(withReuseIdentifier: "_CourseDatetimeCCell", for: indexPath) as! CourseDatetimeCCell
|
cell.label_week.jq_cornerRadius = cellW / 2
|
cell.label_week.jq_masksToBounds = true
|
cell.label_week.text = weeks[indexPath.row]
|
cell.jq_masksToBounds = false
|
return cell
|
}
|
}
|
|
extension CourseInfoScheduleVC:UICollectionViewDelegateFlowLayout{
|
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
|
return 19
|
}
|
|
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
return CGSize(width: cellW, height: cellH)
|
}
|
}
|