| | |
| | | |
| | | NotificationCenter.default.rx.notification(PlantGuideQuit_Noti).take(until: self.rx.deallocated).subscribe(onNext: {data in |
| | | self.getData() |
| | | if UserDefaultSettingViewModel.getSetting()?.userFirstOpenTreeTask ?? true{ |
| | | self.navigationController?.tabBarController?.selectedIndex = 2 |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | NotificationCenter.default.rx.notification(LoginSuccess_Noti).take(until: self.rx.deallocated).subscribe(onNext: {data in |
| | |
| | | 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) |
| | | let model = HomeTopMenuItem(id: v.id, title: v.categoryName, image: v.secondIconUrl, imageFrom: .url) |
| | | items.append(model) |
| | | } |
| | | self.viewModel.homeBottomMenuItems = items |
| | | self.tableView.reloadRows(at: [IndexPath(row: 3, section: 0)], with: .none) |
| | | self.tableView.reloadRows(at: [IndexPath(row: 4, section: 0)], with: .none) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Services.getTopdayMedita().subscribe(onNext: { data in |
| | |
| | | //私人定制 |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_4_TCell") as! Home_Style_4_TCell |
| | | cell.style = .style1 |
| | | cell.setModels(viewModel.privateTodyModels) |
| | | cell.setModels(viewModel.privateTodyModels,showType: .horizontal) |
| | | return cell |
| | | }else if indexPath.section == 2{ |
| | | // 新手冥想指南 |
| | |
| | | if m.clientMeditationCategoryVO!.showType == .horizontal{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_4_TCell") as! Home_Style_4_TCell |
| | | cell.style = .style2 |
| | | cell.setModels(m.clientMeditationVOList) |
| | | cell.setModels(m.clientMeditationVOList,showType: .horizontal) |
| | | return cell |
| | | }else if m.clientMeditationCategoryVO!.showType == .vertical{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_3_TCell") as! Home_Style_3_TCell |
| | | cell.setModels(m.clientMeditationVOList) |
| | | cell.setModels(m.clientMeditationVOList,showType: .vertical) |
| | | return cell |
| | | } |
| | | } |