杨锴
2024-11-04 f4c46a585290d8136819673dfff2df9ea5c5a330
XQMuse/Root/Home/HomeVC.swift
@@ -141,6 +141,9 @@
                        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
@@ -169,11 +172,11 @@
                        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.viewModel.homeBottomMenuItems = items
                                    self.tableView.reloadRows(at: [IndexPath(row: 4, section: 0)], with: .none)
                        }).disposed(by: disposeBag)
                        Services.getTopdayMedita().subscribe(onNext: { data in
@@ -198,7 +201,7 @@
                                                self.viewModel.meditationList = m
                                                for v in self.viewModel.meditationList{
                for v in self.viewModel.meditationList{
                    if v.clientMeditationCategoryVO?.categoryName.isEmpty ?? true{continue}
                                                            self.titleItems.append(TitleItem(title: v.clientMeditationCategoryVO?.categoryName ?? "", subTitle: v.clientMeditationCategoryVO?.description ?? "",hasMore:true))
                                                }
@@ -265,7 +268,7 @@
            //私人定制
                                    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{
            // 新手冥想指南
@@ -278,18 +281,18 @@
                                    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)
                cell.setHomeTopMenuItem(viewModel.homeBottomMenuItems)
                                                return cell
                                    }else{
                                                let m = viewModel.meditationList[index]
                                                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
                                                }
                                    }