| | |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_HomeRelaxBanner_2_CCell", for: indexPath) as! HomeRelaxBanner_2_CCell |
| | | let model = viewModel.dataSource.value!.list[indexPath.row] |
| | | cell.setMeditationModel(model,showType: showType) |
| | | cell.label_title.font = .systemFont(ofSize: 18, weight: .bold) |
| | | cell.cons_maxSubTitle.constant = 16 |
| | | return cell |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let m = viewModel.dataSource.value!.list[indexPath.row] |
| | | let item = viewModel.dataSource.value!.list[indexPath.row] |
| | | |
| | | let isVip = UserViewModel.getAvatarInfo().checkVip() |
| | | Services.getMeditationDetail(id: item.id).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | if let m = data.data{ |
| | | let isVip = m.isVip == .yes |
| | | if m.chargeType == .free || (isVip && m.chargeType == .vipFree) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | let vc = HomeItemDetailVC(model: m) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | return |
| | | } |
| | | |
| | | if m.chargeType == .free || (m.chargeType == .vipFree && isVip) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | let detailVC = HomeItemDetailVC(id: m.id) |
| | | jq_push(vc: detailVC) |
| | | }else{ |
| | | if m.chargeType == .vipFree{ |
| | | let vc = VIPCenterVC() |
| | | jq_push(vc: vc) |
| | | }else{ |
| | | let vc = PaymentOrderVC(museItemModel: m,type: .muse,showType: showType) |
| | | jq_push(vc: vc) |
| | | if m.chargeType == .payment && m.isBuy == .no{ |
| | | guard sceneDelegate!.checkisLoginState() else{return} |
| | | let vc = PaymentOrderVC(museItemModel: m,type: .muse,showType: weakSelf.showType) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | return |
| | | } |
| | | |
| | | if m.chargeType == .vipFree{ |
| | | let vc = VIPCenterVC() |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | return |
| | | } |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // let isVip = UserViewModel.getAvatarInfo().checkVip() |
| | | // |
| | | // if m.chargeType == .free || (m.chargeType == .vipFree && isVip) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | // let detailVC = HomeItemDetailVC(id: m.id) |
| | | // jq_push(vc: detailVC) |
| | | // }else{ |
| | | // if m.chargeType == .vipFree{ |
| | | // let vc = VIPCenterVC() |
| | | // jq_push(vc: vc) |
| | | // }else{ |
| | | // guard sceneDelegate!.checkisLoginState() else{return} |
| | | // let vc = PaymentOrderVC(museItemModel: m,type: .muse,showType: showType) |
| | | // jq_push(vc: vc) |
| | | // } |
| | | // } |
| | | } |
| | | } |