| | |
| | | |
| | | |
| | | }else{ |
| | | let v1 = UIView() |
| | | let v1 = EmptyCCell.jq_loadNibView() |
| | | v1.tag = 10010 |
| | | v1.bounds = CGRect(x: 0, y: 0, width: 100, height: 100) |
| | | v1.center = CGPoint(x: v.center.x - 20, y: v.center.y - 150) |
| | | v1.bounds = CGRect(x: 0, y: 0, width: 265, height: 300) |
| | | v1.center = CGPoint(x: v.center.x, y: v.center.y - 100) |
| | | v.addSubview(v1) |
| | | |
| | | let image = UIImageView(image: UIImage(named: "icon_empty")) |
| | | image.contentMode = .scaleAspectFill |
| | | v1.addSubview(image) |
| | | image.snp.makeConstraints { make in |
| | | make.top.left.right.equalToSuperview() |
| | | } |
| | | |
| | | let label = UILabel(text: "暂未找到相关内容哦~") |
| | | label.font = .systemFont(ofSize: 14, weight: .medium) |
| | | label.textColor = .gray |
| | | v1.addSubview(label) |
| | | label.snp.makeConstraints { make in |
| | | make.centerX.equalTo(image) |
| | | make.top.equalTo(image.snp.bottom).offset(8) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | let model = viewModel.dataSource.value!.list[indexPath.row] |
| | | |
| | | if model.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | |
| | | if model.chargeType == .payment || model.chargeType == .vipFree{ |
| | | guard sceneDelegate!.checkisLoginState() else {return} |
| | | } |
| | | |
| | | Services.getCourseDetail(courseId: model.id).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | if m.isVip == .no && m.chargeType == .vipFree{ |
| | | let vc = VIPCenterVC() |
| | | self.push(vc: vc) |
| | | }else if m.courseType == .online{ |
| | | let vc = CourseDetialVC(courseModel: m) |
| | | self.push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: m.id) |
| | | self.push(vc: vc) |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: model.id) |
| | | push(vc: vc) |
| | |
| | | } |
| | | |
| | | extension CourseMenuVC:EmptyDataSetSource{ |
| | | //// func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? { |
| | | //// return UIImage(named: "icon_empty") |
| | | //// } |
| | | // |
| | | // func buttonBackgroundImage(forEmptyDataSet scrollView: UIScrollView, for state: UIControl.State) -> 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 0 |
| | | // } |
| | | // |
| | | // func spaceHeight(forEmptyDataSet scrollView: UIScrollView) -> CGFloat { |
| | | // return 0 |
| | | // } |
| | | |
| | | } |
| | | |
| | | extension CourseMenuVC:EmptyDataSetDelegate{ |