| | |
| | | titleItems.append(TitleItem(title: "新手冥想指南", subTitle: "Meditation guide")) |
| | | titleItems.append(TitleItem(title: "放松助眠", subTitle: "与内心的宁静与喜悦入睡",hasMore:true)) |
| | | titleItems.append(TitleItem(title: "放松助眠", subTitle: "与内心的宁静与喜悦入睡",hasMore:true)) |
| | | |
| | | titleItems.append(TitleItem(title: "放松助眠", subTitle: "与内心的宁静与喜悦入睡",hasMore:true)) |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | // present(nav, animated: true) |
| | | } |
| | | |
| | | @objc func jumpMoreAction(_ sender:UIButton){ |
| | | switch sender.tag { |
| | | case 201: |
| | | //跳转计划引导 |
| | | break |
| | | default: |
| | | let topTitle = titleItems[sender.tag - 200].title |
| | | let vc = HomeItemListVC(topTitle: topTitle, id: 0) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | extension HomeVC:UITableViewDelegate & UITableViewDataSource{ |
| | | |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | if indexPath.section == 2{ |
| | | let vc = HomeTyroGuideVC() |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | 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 |
| | |
| | | } |
| | | |
| | | if indexPath.section == 1{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_2_TCell") as! Home_Style_2_TCell |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_4_TCell") as! Home_Style_4_TCell |
| | | cell.style = .style1 |
| | | return cell |
| | | } |
| | | |
| | |
| | | |
| | | if indexPath.section == 4{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_4_TCell") as! Home_Style_4_TCell |
| | | cell.style = .style2 |
| | | return cell |
| | | } |
| | | |
| | | if indexPath.section == 5{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_4_TCell") as! Home_Style_4_TCell |
| | | cell.style = .style2 |
| | | return cell |
| | | } |
| | | |
| | |
| | | let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "_HomeHeaderView") as! HomeHeaderView |
| | | headerView.setTitle(titleItems[section].title, subTitle: titleItems[section].subTitle) |
| | | headerView.btn_more.isHidden = !titleItems[section].hasMore |
| | | headerView.btn_more.tag = section + 200 |
| | | headerView.btn_more.addTarget(self, action: #selector(jumpMoreAction(_:)), for: .touchUpInside) |
| | | |
| | | if section == 1{ |
| | | headerView.btn_more.setImage(UIImage(named: "btn_more"), for: .normal) |