| | |
| | | pageMenu.trackerWidth = 27.5 |
| | | pageMenu.setTrackerHeight(11, cornerRadius:0) |
| | | pageMenu.trackerFollowingMode = .always |
| | | pageMenu.contentInset = UIEdgeInsets(top: 0, left: 19.5, bottom: 15, right: 19.5) |
| | | pageMenu.contentInset = UIEdgeInsets(top: 0, left: 10.5, bottom: 15, right: 19.5) |
| | | pageMenu.setItems(["简介","章节","相关推荐"], selectedItemIndex: 0) |
| | | pageMenu.backgroundColor = UIColor(hexString: "#F6F6F6") |
| | | pageMenu.tracker.image = UIImage(named: "icon_unline") |
| | |
| | | tableView!.delegate = self |
| | | tableView!.dataSource = self |
| | | tableView!.showsVerticalScrollIndicator = false |
| | | if #available(iOS 15.0, *) { |
| | | if #available(iOS 16.0, *) { |
| | | tableView!.sectionHeaderTopPadding = 0 |
| | | } |
| | | tableView!.backgroundColor = UIColor(hexString: "#f6f6f6") |
| | |
| | | make.height.equalTo(84) |
| | | } |
| | | |
| | | if courseDetailModel?.chargeType == .payment{ |
| | | if courseDetailModel?.chargeType == .payment || courseDetailModel?.chargeType == .free{ |
| | | let giftBtn = QMUIButton(type: .custom) |
| | | giftBtn.imagePosition = .left |
| | | giftBtn.spacingBetweenImageAndTitle = 7.5 |
| | |
| | | |
| | | @objc func handleAction(_ btn:QMUIButton){ |
| | | |
| | | if let m = courseDetailModel{ |
| | | if m.chargeType == .free || (m.chargeType == .vipFree && UserViewModel.getAvatarInfo().checkVip()) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | guard m.list.count != 0 else { |
| | | alertError(msg: "该课程暂未添加章节");return |
| | | } |
| | | let vc = CourseDetialVideoVC(items: m.list, selectIndex: IndexPath(row: 0, section: 0)) |
| | | push(vc: vc);return |
| | | } |
| | | if let m = courseDetailModel{ |
| | | guard m.list.count > 0 else {alert(msg: "当前课程未配置章节");return} |
| | | |
| | | let vc = PaymentOrderVC(courseItemModel: m, type: .course,showType:.horizontal) |
| | | push(vc: vc) |
| | | if m.chargeType == .free || (m.chargeType == .vipFree && m.isVip == .yes) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | let vc = CourseDetialVideoVC(items: m.list, selectIndex: IndexPath(row: 0, section: 0)) |
| | | push(vc: vc) |
| | | }else{ |
| | | let vc = PaymentOrderVC(courseItemModel: m, type: .course, giftToOther: false, showType: .horizontal) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | } |
| | | |