diff --git a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj index 09fd918..30a908d 100644 --- a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj +++ b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj @@ -444,11 +444,10 @@ 599364E6204E62E700C8B371 /* Grow */ = { isa = PBXGroup; children = ( - ADC9AB70207C558600348EF1 /* Model */, ADC9AB71207C55CE00348EF1 /* GrowViewController.swift */, - 599364E7204E62E700C8B371 /* ReportViewController.swift */, - AD65FB7920637F110052415B /* MoralViewController.swift */, - ADAEA3972064960300A47D2C /* SceneDetailViewController.swift */, + ADC9AB86207C8EB400348EF1 /* Program */, + ADC9AB85207C8EA700348EF1 /* Report */, + ADC9AB70207C558600348EF1 /* Model */, BF3B829E2050CC7E002078EA /* View */, ); path = Grow; @@ -498,6 +497,23 @@ path = Model; sourceTree = ""; }; + ADC9AB85207C8EA700348EF1 /* Report */ = { + isa = PBXGroup; + children = ( + 599364E7204E62E700C8B371 /* ReportViewController.swift */, + AD65FB7920637F110052415B /* MoralViewController.swift */, + ADAEA3972064960300A47D2C /* SceneDetailViewController.swift */, + ); + path = Report; + sourceTree = ""; + }; + ADC9AB86207C8EB400348EF1 /* Program */ = { + isa = PBXGroup; + children = ( + ); + path = Program; + sourceTree = ""; + }; B605235D289EDBCA5C5AF2C5 /* Frameworks */ = { isa = PBXGroup; children = ( diff --git a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate index 2d4f6fa..98be7db 100644 Binary files a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate and b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift index f5be527..2b7b7b3 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift @@ -38,13 +38,13 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { lazy var titleLine = {()->CALayer in let lineLay = CALayer.init() lineLay.frame.size = CGSize.init(width: 50, height: 2) - lineLay.backgroundColor = UIColor.gray.cgColor + lineLay.backgroundColor = UIColor.blue.cgColor return lineLay }() override func viewDidLoad() { super.viewDidLoad() - + navigationBarHeight = self.navigationController?.navigationBar.frame.height titleArr = ["应用","报告"] //设置导航栏标题 self.navigationItem.titleView = titleView @@ -54,8 +54,8 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { setChildViewContent() //左按钮 - let leftView = UIButton.init(frame: CGRect.init(x: 0, y: 0, width: 50, height: 44)) - let titleLab = UILabel.init(frame: CGRect.init(x: 0, y: 0, width: 40, height: 44)) + let leftView = UIButton.init(frame: CGRect.init(x: 0, y: 0, width: 60, height: 44)) + let titleLab = UILabel.init(frame: CGRect.init(x: 0, y: 0, width: 50, height: 44)) if AccountManager.shared.isOnline() { if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { titleLab.text = "未绑定" @@ -69,7 +69,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { titleLab.textAlignment = .center leftView.addSubview(titleLab) - let imageView = UIImageView.init(frame: CGRect.init(x: 40, y: 11, width: 10, height: 22)) + let imageView = UIImageView.init(frame: CGRect.init(x: 50, y: 11, width: 10, height: 22)) imageView.image = UIImage.init(named: "report_pull") imageView.contentMode = .scaleAspectFit leftView.addSubview(imageView) @@ -95,11 +95,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { let rightBtn = UIBarButtonItem.init(customView: rightView) self.navigationItem.rightBarButtonItem = rightBtn - setupNavigationBar() - } - - // MARK: - 设置顶部按钮 - func setupNavigationBar(){ + //设置顶部样式 self.configTheme() } @@ -112,7 +108,6 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { } //设置第一个控制器数据 let childVC = self.childViewControllers.first - childVC?.view.frame = self.view.bounds self.contentScrollView.addSubview((childVC?.view)!) //设置scrollview滑动范围 contentScrollView.contentSize = CGSize.init(width: getScreenWidth()*CGFloat(titleArr.count), height: 0) @@ -134,7 +129,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { btn.frame.size = CGSize.init(width: 40, height: ZJBNavH) let widht = getScreenWidth() - btn.center = CGPoint.init(x: widht/4*(1+CGFloat(i))-16, y: CGFloat(ZJBNavH/2)) + btn.center = CGPoint.init(x: widht/4*(1+CGFloat(i))-26, y: CGFloat(ZJBNavH/2)) btnWidthArr.append(btn.frame.size.width) titleBtnArr.append(btn) diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/MoralViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/MoralViewController.swift deleted file mode 100644 index 8936984..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/MoralViewController.swift +++ /dev/null @@ -1,106 +0,0 @@ -// -// MoralViewController.swift -// ParentAssistant -// -// Created by Cao yang on 2018/3/22. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class MoralViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { - - @IBOutlet weak var tableView: UITableView! - var data = [String:JSON]() - override func viewDidLoad() { - super.viewDidLoad() - self.title = "德育报告" - tableView.delegate = self - tableView.dataSource = self - - - downLoadDataFromNet() - } - - private func downLoadDataFromNet(){ - - - let params = ["screenId":1,"startDate":"2018-03-08","endDate":"2018-04-08","classId":"70","schoolId":1] as [String : Any] - - HTTPServer.shared.getEvaluationSceneAnalysis(parameters: params as [String : AnyObject]) { (backData, error) in - - if error == nil && JSON.fromString(backData)!["status"].intValue == 1 { - - self.data = JSON.fromString(backData)!["data"].dictionaryValue - - if !self.data.isEmpty{ - print(self.data) - } - } - } - } - - - - func numberOfSections(in tableView: UITableView) -> Int { - return 3 - } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - - if section == 2 { - return 3 - }else{ - return 1 - } - } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - switch indexPath.section { - case 0: - return 240 - case 1: - return 240 - case 2: - return 70 - default: - return 0 - } - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - var cell = UITableViewCell.init() - switch indexPath.section { - case 0: - cell = tableView.dequeueReusableCell(withIdentifier: "moralDetail", for: indexPath) - return cell - case 1: - cell = tableView.dequeueReusableCell(withIdentifier: "educationDetail", for: indexPath) - return cell - case 2: - cell = tableView.dequeueReusableCell(withIdentifier: "behaviorDetail", for: indexPath) - return cell - default: - return cell - } - } - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - if indexPath.section == 2 { - let scene = Story.instantiateViewControllerWithIdentifier("SceneDetailViewController", storyName: "Main") as! SceneDetailViewController - self.navigationController?.pushViewController(scene, animated: true) - } - } - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/MoralViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/MoralViewController.swift new file mode 100644 index 0000000..6f4c51f --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/MoralViewController.swift @@ -0,0 +1,117 @@ +// +// MoralViewController.swift +// ParentAssistant +// +// Created by Cao yang on 2018/3/22. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class MoralViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { + + lazy var tableView = {()->UITableView in + + let table = UITableView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: screenHeight-navigationBarHeight!-statusBarHeight-10)) + table.backgroundColor = UIColor.init(red: 235/255, green: 235/255, blue: 241/255, alpha: 1) + table.delegate = self + table.dataSource = self + table.register(UINib.init(nibName: "MoralDetailCell", bundle: nil), forCellReuseIdentifier: "moralDetail") + table.register(UINib.init(nibName: "EducationDetailCell", bundle: nil), forCellReuseIdentifier: "educationDetail") + table.register(UINib.init(nibName: "BehaviorDetailCell", bundle: nil), forCellReuseIdentifier: "behaviorDetail") + return table + }() + + var data = [String:JSON]() + + override func viewDidLoad() { + super.viewDidLoad() + self.title = "德育报告" + self.view.backgroundColor = backGroundColor + self.view.addSubview(self.tableView) + + + downLoadDataFromNet() + } + + private func downLoadDataFromNet(){ + + let params = ["screenId":1,"startDate":"2018-03-08","endDate":"2018-04-08","classId":"70","schoolId":1] as [String : Any] + HTTPServer.shared.getEvaluationSceneAnalysis(parameters: params as [String : AnyObject]) { (backData, error) in + + if error == nil && JSON.fromString(backData)!["status"].intValue == 1 { + + self.data = JSON.fromString(backData)!["data"].dictionaryValue + + if !self.data.isEmpty{ + print(self.data) + } + } + } + } + + + + func numberOfSections(in tableView: UITableView) -> Int { + return 3 + } + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + + if section == 2 { + return 3 + }else{ + return 1 + } + } + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + switch indexPath.section { + case 0: + return 240 + case 1: + return 240 + case 2: + return 70 + default: + return 0 + } + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + var cell = UITableViewCell.init() + switch indexPath.section { + case 0: + cell = tableView.dequeueReusableCell(withIdentifier: "moralDetail", for: indexPath) as! MoralDetailCell + return cell + case 1: + cell = tableView.dequeueReusableCell(withIdentifier: "educationDetail", for: indexPath) as! EducationDetailCell + return cell + case 2: + cell = tableView.dequeueReusableCell(withIdentifier: "behaviorDetail", for: indexPath) as! BehaviorDetailCell + return cell + default: + return cell + } + } + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + if indexPath.section == 2 { + + let scene = SceneDetailViewController() + self.navigationController?.pushViewController(scene, animated: true) + } + } + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift new file mode 100644 index 0000000..e20cae2 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift @@ -0,0 +1,97 @@ +// +// ReportViewController.swift +// ParentAssistant +// +// Created by 葛建军 on 2018/3/5. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class ReportViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { + + //膜板 + var keyWindow = UIWindow() + var backBotton = UIButton() + //日历 + var calendar = CalendarView() + + lazy var reportTable = {()-> UITableView in + let table = UITableView.init(frame: CGRect.init(x: 0, y: 60, width: screenWidth, height: screenHeight-navigationBarHeight!-statusBarHeight-(self.tabBarController?.tabBar.frame.height)!-60)) + table.delegate = self + table.dataSource = self + table.backgroundColor = backGroundColor + table.register(UINib.init(nibName: "MoralTableViewCell", bundle: nil), forCellReuseIdentifier: "MoralTableViewCell") + table.register(UINib.init(nibName: "GrowSubjectCell", bundle: nil), forCellReuseIdentifier: "GrowSubjectCell") + return table + }() + override func viewDidLoad() { + super.viewDidLoad() + + self.view.addSubview(self.reportTable) + + setupDateView() + } + + + // MARK: - 设置日期View + func setupDateView(){ + + let headView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: 60)) + self.view.addSubview(headView) + //添加手势 + let recognizer = UISwipeGestureRecognizer.init(target: self, action: #selector(showView)) + recognizer.direction = UISwipeGestureRecognizerDirection.down + headView.addGestureRecognizer(recognizer) + + calendar = CalendarView.init(frame: CGRect.init(x: 0, y: 30, width: screenWidth, height: 260)) + } + + @objc func showView(){ + keyWindow = UIApplication.shared.keyWindow! + let backBtn = UIButton.init(frame: CGRect.init(x: 0, y: calendar.frame.origin.y+260+22, width: screenWidth, height: screenHeight)) + backBtn.backgroundColor = UIColor.black + backBtn.alpha = 0.4 + + backBtn.addTarget(self, action: #selector(closeView(btn:)), for: UIControlEvents.allEvents) + reportTable.isUserInteractionEnabled = false + + keyWindow.addSubview(backBtn) + keyWindow.addSubview(calendar) + calendar.isHidden = false + } + @objc func closeView(btn:UIButton) { + + reportTable.isUserInteractionEnabled = true + UIView.animate(withDuration: 0.3) { + btn.removeFromSuperview() + self.calendar.isHidden = true + } + } + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 5 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + + if indexPath.row == 0 { + let cell = tableView.dequeueReusableCell(withIdentifier: "MoralTableViewCell", for: indexPath) as! MoralTableViewCell + return cell + }else{ + let cell = tableView.dequeueReusableCell(withIdentifier: "GrowSubjectCell", for: indexPath) as! GrowSubjectCell + return cell + } + } + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 280 + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let vc = MoralViewController() + self.navigationController?.pushViewController(vc, animated: true) + } +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/SceneDetailViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/SceneDetailViewController.swift new file mode 100644 index 0000000..bb65f98 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/SceneDetailViewController.swift @@ -0,0 +1,87 @@ +// +// SceneDetailViewController.swift +// ParentAssistant +// +// Created by Cao yang on 2018/3/22. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class SceneDetailViewController: UIViewController,UITableViewDataSource,UITableViewDelegate { + + lazy var sceneTableView = {()->UITableView in + let table = UITableView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: screenHeight-navigationBarHeight!-statusBarHeight-10)) + table.backgroundColor = backGroundColor + table.delegate = self + table.dataSource = self + table.register(UINib.init(nibName: "SceneTopCell", bundle: nil), forCellReuseIdentifier: "cultureCell") + table.register(UINib.init(nibName: "SceneMiddleCell", bundle: nil), forCellReuseIdentifier: "scoreCell") + table.register(UINib.init(nibName: "SceneDownCell", bundle: nil), forCellReuseIdentifier: "disciplineCell") + + return table + }() + + override func viewDidLoad() { + super.viewDidLoad() + self.title = "场景详情" + self.view.backgroundColor = backGroundColor + self.view.addSubview(self.sceneTableView) + + } + func numberOfSections(in tableView: UITableView) -> Int { + return 3 + } + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + if section == 2 { + return 5 + } + return 1 + } + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + + switch indexPath.section { + case 0: + return 240 + case 1: + return 250 + case 2: + return 70 + default: + return 0 + } + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + var cell = UITableViewCell.init() + switch indexPath.section { + case 0: + cell = tableView.dequeueReusableCell(withIdentifier: "cultureCell", for: indexPath) as! SceneTopCell + return cell + case 1: + cell = tableView.dequeueReusableCell(withIdentifier: "scoreCell", for: indexPath) as! SceneMiddleCell + return cell + case 2: + cell = tableView.dequeueReusableCell(withIdentifier: "disciplineCell", for: indexPath) as! SceneDownCell + return cell + default: + return cell + } + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/ReportViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/ReportViewController.swift deleted file mode 100644 index 5fa0077..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/ReportViewController.swift +++ /dev/null @@ -1,104 +0,0 @@ -// -// ReportViewController.swift -// ParentAssistant -// -// Created by 葛建军 on 2018/3/5. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class ReportViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { - - var reportTable: UITableView! - - //膜板 - var keyWindow = UIWindow() - var backBotton = UIButton() - //日历 - var calendar = CalendarView() - - override func viewDidLoad() { - super.viewDidLoad() - setupDateView() - } - - // MARK: - 设置日期页面 - func setupDateView(){ - - let headView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: 60)) - self.view.addSubview(headView) - - //添加手势 - let recognizer = UISwipeGestureRecognizer.init(target: self, action: #selector(showView)) - recognizer.direction = UISwipeGestureRecognizerDirection.down - headView.addGestureRecognizer(recognizer) - - calendar = CalendarView.init(frame: CGRect.init(x: 0, y: 30, width: screenWidth, height: 260)) - - self.reportTable = UITableView.init(frame: CGRect.init(x: 0, y: 60, width: screenWidth, height: screenHeight-60)) - self.view.addSubview(self.reportTable) - self.reportTable.delegate = self - self.reportTable.dataSource = self - - self.reportTable.register(UINib.init(nibName: "MoralTableViewCell", bundle: nil), forCellReuseIdentifier: "MoralTableViewCell") - self.reportTable.register(UINib.init(nibName: "GrowSubjectCell", bundle: nil), forCellReuseIdentifier: "GrowSubjectCell") - } - - @objc func showView(){ - keyWindow = UIApplication.shared.keyWindow! - let backBtn = UIButton.init(frame: CGRect.init(x: 0, y: calendar.frame.origin.y+260+22, width: screenWidth, height: screenHeight)) - backBtn.backgroundColor = UIColor.black - backBtn.alpha = 0.4 - - backBtn.addTarget(self, action: #selector(closeView(btn:)), for: UIControlEvents.allEvents) - reportTable.isUserInteractionEnabled = false - - keyWindow.addSubview(backBtn) - keyWindow.addSubview(calendar) - calendar.isHidden = false - } - @objc func closeView(btn:UIButton) { - - reportTable.isUserInteractionEnabled = true - UIView.animate(withDuration: 0.3) { - btn.removeFromSuperview() - self.calendar.isHidden = true - } - } - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - } - override func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - } - override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - - } - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 5 - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - - if indexPath.row == 0 { - let cell = tableView.dequeueReusableCell(withIdentifier: "MoralTableViewCell", for: indexPath) as! MoralTableViewCell - return cell - }else{ - let cell = tableView.dequeueReusableCell(withIdentifier: "GrowSubjectCell", for: indexPath) as! GrowSubjectCell - return cell - } - } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return 280 - } - - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - - } -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/SceneDetailViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/SceneDetailViewController.swift deleted file mode 100644 index c2d9fa5..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/SceneDetailViewController.swift +++ /dev/null @@ -1,76 +0,0 @@ -// -// SceneDetailViewController.swift -// ParentAssistant -// -// Created by Cao yang on 2018/3/22. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class SceneDetailViewController: UIViewController,UITableViewDataSource,UITableViewDelegate { - - @IBOutlet weak var sceneTableView: UITableView! - override func viewDidLoad() { - super.viewDidLoad() - self.title = "场景详情" - sceneTableView.delegate = self - sceneTableView.dataSource = self - // Do any additional setup after loading the view. - } - func numberOfSections(in tableView: UITableView) -> Int { - return 3 - } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - if section == 2 { - return 5 - } - return 1 - } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - - switch indexPath.section { - case 0: - return 240 - case 1: - return 250 - case 2: - return 70 - default: - return 0 - } - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - var cell = UITableViewCell.init() - switch indexPath.section { - case 0: - cell = tableView.dequeueReusableCell(withIdentifier: "cultureCell", for: indexPath) as! SceneTopCell - return cell - case 1: - cell = tableView.dequeueReusableCell(withIdentifier: "scoreCell", for: indexPath) as! SceneMiddleCell - return cell - case 2: - cell = tableView.dequeueReusableCell(withIdentifier: "disciplineCell", for: indexPath) as! SceneDownCell - return cell - default: - return cell - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - - /* - // MARK: - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - // Get the new view controller using segue.destinationViewController. - // Pass the selected object to the new view controller. - } - */ - -} diff --git a/ParentAssistant/ParentAssistant/Classes/util/Macro.swift b/ParentAssistant/ParentAssistant/Classes/util/Macro.swift index 2d21211..12bad73 100644 --- a/ParentAssistant/ParentAssistant/Classes/util/Macro.swift +++ b/ParentAssistant/ParentAssistant/Classes/util/Macro.swift @@ -12,9 +12,11 @@ import UIKit //MARK: -------------------------- 全局常量 ----------------------------- let appDelegate = UIApplication.shared.delegate as! AppDelegate - +let statusBarHeight = UIApplication.shared.statusBarFrame.height +var navigationBarHeight : CGFloat? let screenWidth = UIScreen.main.bounds.size.width let screenHeight = UIScreen.main.bounds.size.height +let backGroundColor = UIColor.init(red: 235/255, green: 235/255, blue: 241/255, alpha: 1) //MARK: -------------------------- 接口地址 ---------------------------- let appsecret="sincere:3a530f39f99411b454e667d69693c127" diff --git a/ParentAssistant/ParentAssistant/Classes/util/utils.swift b/ParentAssistant/ParentAssistant/Classes/util/utils.swift index 52b32f0..e287a4b 100644 --- a/ParentAssistant/ParentAssistant/Classes/util/utils.swift +++ b/ParentAssistant/ParentAssistant/Classes/util/utils.swift @@ -574,10 +574,10 @@ extension UIViewController{ func configTheme(){ self.navigationItem.title=self.navigationController?.title self.navigationController?.navigationBar.barTintColor=Theme.topBarColor() - self.navigationController?.navigationBar.tintColor=UIColor.white + self.navigationController?.navigationBar.tintColor=UIColor.black self.navigationController?.navigationBar.isTranslucent=false let textAttributes = NSMutableDictionary(capacity:1) - textAttributes.setObject(UIColor.white, forKey: NSAttributedStringKey.foregroundColor as NSCopying) + textAttributes.setObject(UIColor.black, forKey: NSAttributedStringKey.foregroundColor as NSCopying) self.navigationController?.navigationBar.titleTextAttributes=textAttributes as! [AnyHashable: Any] as? [NSAttributedStringKey : Any] } ///套上UINavigationController -- libgit2 0.21.0