| | |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | import EmptyDataSet_Swift |
| | | |
| | | class CourseMenuVC: BaseVC { |
| | | |
| | |
| | | make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(18) |
| | | make.bottom.equalTo(tableView) |
| | | } |
| | | |
| | | collectionView.emptyDataSetSource = self |
| | | collectionView.emptyDataSetDelegate = self |
| | | // collectionView.emptyDataSetView { v in |
| | | // let v = UIView() |
| | | // v.backgroundColor = .red |
| | | // |
| | | // return |
| | | // } |
| | | } |
| | | |
| | | func setTitleItem(_ items:[TitleItem],defaultSelectIndex:Int = 0){ |
| | |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let model = viewModel.dataSource.value!.list[indexPath.row] |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | |
| | | if model.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: model.id) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { |
| | |
| | | return CGSize(width: w, height: w * 1.313) |
| | | } |
| | | } |
| | | |
| | | extension CourseMenuVC:EmptyDataSetSource{ |
| | | func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? { |
| | | return UIImage(named: "icon_empty") |
| | | } |
| | | |
| | | func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? { |
| | | return AttributedStringbuilder.build().add(string: "暂无数据", withFont: .systemFont(ofSize: 12, weight: .medium), withColor: .gray).mutableAttributedString |
| | | } |
| | | |
| | | func verticalOffset(forEmptyDataSet scrollView: UIScrollView) -> CGFloat { |
| | | return 300 |
| | | } |
| | | |
| | | func spaceHeight(forEmptyDataSet scrollView: UIScrollView) -> CGFloat { |
| | | return 200 |
| | | } |
| | | } |
| | | |
| | | extension CourseMenuVC:EmptyDataSetDelegate{ |
| | | |
| | | } |