杨锴
2024-11-14 1cc03dff6006c235686f87fe0f80af2fde97abf4
XQMuse/Root/Me/VC/StudyListVC.swift
@@ -92,6 +92,8 @@
                                    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
@@ -103,6 +105,14 @@
                                                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
@@ -114,12 +124,15 @@
            }
            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
                        }
            }
}
@@ -153,14 +166,21 @@
            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)
        }
            }
}