| | |
| | | collectionView.dataSource = self |
| | | collectionView.showsVerticalScrollIndicator = false |
| | | collectionView.backgroundColor = .clear |
| | | collectionView.register(UINib(nibName: "HomeRelaxBannerCCell", bundle: nil), forCellWithReuseIdentifier: "_HomeRelaxBannerCCell") |
| | | collectionView.register(UINib(nibName: "HomeRelaxBanner_2_1_CCell", bundle: nil), forCellWithReuseIdentifier: "_HomeRelaxBanner_2_1_CCell") |
| | | collectionView.contentInset = UIEdgeInsets(top: 0, left: 29.5 , bottom: 0, right: 29.5) |
| | | |
| | | view.addSubview(collectionView) |
| | |
| | | } |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_HomeRelaxBannerCCell", for: indexPath) as! HomeRelaxBannerCCell |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_HomeRelaxBanner_2_1_CCell", for: indexPath) as! HomeRelaxBanner_2_1_CCell |
| | | let m = viewModel.dataSource.value[indexPath.row] |
| | | cell.setCourseModel(m) |
| | | |
| | | if viewModel.type.value == .payment{ |
| | | cell.image_free.isHidden = true |
| | | cell.img_vip.isHidden = true |
| | | cell.view_price.isHidden = true |
| | | } |
| | | |
| | | return cell |
| | | } |
| | | |