| | |
| | | |
| | | class HomeViewModel{ |
| | | var homeTopMenuItems = [HomeTopMenuItem]() |
| | | var homeBottomMenuItems = [HomeTopMenuItem]() |
| | | var todyModel:MeditationModel? |
| | | var privateTodyModels = [MeditationModel]() |
| | | var meditationList = [MeditationListModel]() |
| | |
| | | self.topMenuView.menu_collectionView.reloadData() |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Services.getCategoryListByType(type: 2).subscribe(onNext: { data in |
| | | var items = [HomeTopMenuItem]() |
| | | for v in data.data ?? []{ |
| | | let model = HomeTopMenuItem(id: v.id, title: v.categoryName, image: v.firstIconUrl, imageFrom: .url) |
| | | items.append(model) |
| | | } |
| | | self.viewModel.homeBottomMenuItems = items |
| | | self.tableView.reloadRows(at: [IndexPath(row: 3, section: 0)], with: .none) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Services.getTopdayMedita().subscribe(onNext: { data in |
| | | self.viewModel.todyModel = data.data?.clientMeditationVO |
| | | self.tableView.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none) |
| | |
| | | let index = indexPath.section - 3 |
| | | if index == 0 && indexPath.row != 0{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_5_TCell") as! Home_Style_5_TCell |
| | | cell.setHomeTopMenuItem(viewModel.homeBottomMenuItems) |
| | | return cell |
| | | }else{ |
| | | let m = viewModel.meditationList[index] |