UI
杨锴
2024-08-15 572899a6a72fb71c0a29ec5774de3b61ddd4bd7e
XQMuse/Root/Home/HomeVC.swift
@@ -27,7 +27,7 @@
                        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() {
@@ -120,9 +120,29 @@
//                        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
@@ -130,7 +150,8 @@
                        }
                        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
                        }
@@ -147,11 +168,13 @@
                        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
                        }
@@ -187,6 +210,8 @@
                        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)