| | |
| | | import JQTools |
| | | import RxSwift |
| | | import MediaPlayer |
| | | import MJRefresh |
| | | |
| | | let SetBGMSuccess_Noti = Notification.Name.init("SetBGMSuccess_Noti") |
| | | |
| | |
| | | AudioPlayer.getSharedInstance().playSceneAt(audioFile) |
| | | } |
| | | } |
| | | |
| | | tableView.mj_header = MJRefreshNormalHeader(refreshingBlock: { |
| | | self.getData() |
| | | }) |
| | | |
| | | getData() |
| | | } |
| | |
| | | } |
| | | |
| | | private func getData(){ |
| | | tableView.mj_header?.endRefreshing() |
| | | |
| | | Services.getCategoryListByType(type: 1).subscribe(onNext: { data in |
| | | var items = [HomeTopMenuItem]() |
| | |
| | | self.viewModel.meditationList.removeAll() |
| | | self.viewModel.meditationList = m |
| | | 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)) |
| | | } |
| | | self.tableView.reloadData() |
| | |
| | | } |
| | | |
| | | @objc func searchAction(){ |
| | | let vc = SearchVC() |
| | | let vc = SearchVC(serchType: .muse) |
| | | push(vc: vc) |
| | | } |
| | | |
| | | @objc func settingvoiceAction(){ |
| | | // let vc = BackgroundVoiceVC() |
| | | // push(vc: vc) |
| | | |
| | | let nav = LoginNav(rootViewController: LoginVC()) |
| | | nav.modalPresentationStyle = .fullScreen |
| | | present(nav, animated: true) |
| | | let vc = BackgroundVoiceVC() |
| | | push(vc: vc) |
| | | } |
| | | |
| | | @objc func jumpMoreAction(_ sender:UIButton){ |
| | |
| | | |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | if indexPath.section == 0{ |
| | | //每日疗愈 |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_1_TCell") as! Home_Style_1_TCell |
| | | cell.model = viewModel.todyModel |
| | | return cell |
| | | }else if indexPath.section == 1{ |
| | | //私人定制 |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_4_TCell") as! Home_Style_4_TCell |
| | | cell.style = .style1 |
| | | cell.setModels(viewModel.privateTodyModels) |
| | | return cell |
| | | }else if indexPath.section == 2{ |
| | | // 新手冥想指南 |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_2_TCell") as! Home_Style_2_TCell |
| | | cell.imgView.image = UIImage(named: "bg_guide_home") |
| | | cell.view_shadow.isHidden = true |
| | | return cell |
| | | }else { |
| | |
| | | |
| | | extension HomeVC:UIScrollViewDelegate{ |
| | | func scrollViewDidScroll(_ scrollView: UIScrollView) { |
| | | let v = min(scrollView.contentOffset.y / JQ_NavBarHeight, 1) |
| | | navigationController?.navigationBar.standardAppearance.backgroundColor = .white.withAlphaComponent(v) |
| | | // let v = min(scrollView.contentOffset.y / JQ_NavBarHeight, 1) |
| | | // navigationController?.navigationBar.standardAppearance.backgroundColor = .white.withAlphaComponent(v) |
| | | navigationController?.navigationBar.standardAppearance.backgroundColor = .white |
| | | navigationController?.navigationBar.scrollEdgeAppearance?.backgroundColor = .white |
| | | } |
| | | } |