| | |
| | | let count = datas?.courseList.count ?? 0 |
| | | if count == 0{ |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_EmptyCCell", for: indexPath) as! EmptyCCell |
| | | cell.btn_call.isHidden = false |
| | | cell.label_hint.text = "你还没有购买课程" |
| | | return cell |
| | | }else{ |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_HomeRelaxBanner_2_1_CCell", for: indexPath) as! HomeRelaxBanner_2_1_CCell |
| | |
| | | return cell |
| | | } |
| | | }else{ |
| | | let count = datas?.freeCourseList.count ?? 0 |
| | | if count == 0{ |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_EmptyCCell", for: indexPath) as! EmptyCCell |
| | | cell.btn_call.isHidden = true |
| | | cell.label_hint.text = "暂无推荐" |
| | | return cell |
| | | } |
| | | |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_HomeRelaxBanner_2_1_CCell", for: indexPath) as! HomeRelaxBanner_2_1_CCell |
| | | cell.setCourseModel(datas!.freeCourseList[indexPath.row]) |
| | | cell.view_price.isHidden = true |
| | |
| | | } |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { |
| | | |
| | | if section == 0{ |
| | | let count = datas?.courseList.count ?? 0 |
| | | if count > 0{return count} |
| | | return 1 |
| | | }else { |
| | | return datas?.freeCourseList.count ?? 0 |
| | | let count = datas?.freeCourseList.count ?? 0 |
| | | if count > 0{return count} |
| | | return 1 |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { |
| | | |
| | | let count = datas?.courseList.count ?? 0 |
| | | |
| | | if indexPath.section == 0 && count == 0{ |
| | | return CGSize(width: JQ_ScreenW, height: 279) |
| | | } |
| | | var count = 0 |
| | | if indexPath.section == 0{ |
| | | count = datas?.courseList.count ?? 0 |
| | | }else{ |
| | | count = datas?.freeCourseList.count ?? 0 |
| | | } |
| | | |
| | | let w = (JQ_ScreenW - 18 * 3) / 2 |
| | | return CGSize(width: w, height: w * 1.319) |
| | | |
| | | if count == 0{ |
| | | return CGSize(width: JQ_ScreenW, height: 279) |
| | | }else{ |
| | | let w = (JQ_ScreenW - 18 * 3) / 2 |
| | | return CGSize(width: w, height: w * 1.319) |
| | | } |
| | | } |
| | | } |
| | | |