Commit 10668bdcadd40a2b78e84925cb0102e54f397287
1 parent
c7ed30f2
Exists in
parentassistant
调整样式
Showing
11 changed files
with
333 additions
and
305 deletions
 
Show diff stats
ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj
| @@ -444,11 +444,10 @@ | @@ -444,11 +444,10 @@ | ||
| 444 | 599364E6204E62E700C8B371 /* Grow */ = { | 444 | 599364E6204E62E700C8B371 /* Grow */ = { | 
| 445 | isa = PBXGroup; | 445 | isa = PBXGroup; | 
| 446 | children = ( | 446 | children = ( | 
| 447 | - ADC9AB70207C558600348EF1 /* Model */, | ||
| 448 | ADC9AB71207C55CE00348EF1 /* GrowViewController.swift */, | 447 | ADC9AB71207C55CE00348EF1 /* GrowViewController.swift */, | 
| 449 | - 599364E7204E62E700C8B371 /* ReportViewController.swift */, | ||
| 450 | - AD65FB7920637F110052415B /* MoralViewController.swift */, | ||
| 451 | - ADAEA3972064960300A47D2C /* SceneDetailViewController.swift */, | 448 | + ADC9AB86207C8EB400348EF1 /* Program */, | 
| 449 | + ADC9AB85207C8EA700348EF1 /* Report */, | ||
| 450 | + ADC9AB70207C558600348EF1 /* Model */, | ||
| 452 | BF3B829E2050CC7E002078EA /* View */, | 451 | BF3B829E2050CC7E002078EA /* View */, | 
| 453 | ); | 452 | ); | 
| 454 | path = Grow; | 453 | path = Grow; | 
| @@ -498,6 +497,23 @@ | @@ -498,6 +497,23 @@ | ||
| 498 | path = Model; | 497 | path = Model; | 
| 499 | sourceTree = "<group>"; | 498 | sourceTree = "<group>"; | 
| 500 | }; | 499 | }; | 
| 500 | + ADC9AB85207C8EA700348EF1 /* Report */ = { | ||
| 501 | + isa = PBXGroup; | ||
| 502 | + children = ( | ||
| 503 | + 599364E7204E62E700C8B371 /* ReportViewController.swift */, | ||
| 504 | + AD65FB7920637F110052415B /* MoralViewController.swift */, | ||
| 505 | + ADAEA3972064960300A47D2C /* SceneDetailViewController.swift */, | ||
| 506 | + ); | ||
| 507 | + path = Report; | ||
| 508 | + sourceTree = "<group>"; | ||
| 509 | + }; | ||
| 510 | + ADC9AB86207C8EB400348EF1 /* Program */ = { | ||
| 511 | + isa = PBXGroup; | ||
| 512 | + children = ( | ||
| 513 | + ); | ||
| 514 | + path = Program; | ||
| 515 | + sourceTree = "<group>"; | ||
| 516 | + }; | ||
| 501 | B605235D289EDBCA5C5AF2C5 /* Frameworks */ = { | 517 | B605235D289EDBCA5C5AF2C5 /* Frameworks */ = { | 
| 502 | isa = PBXGroup; | 518 | isa = PBXGroup; | 
| 503 | children = ( | 519 | children = ( | 
ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift
| @@ -38,13 +38,13 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -38,13 +38,13 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
| 38 | lazy var titleLine = {()->CALayer in | 38 | lazy var titleLine = {()->CALayer in | 
| 39 | let lineLay = CALayer.init() | 39 | let lineLay = CALayer.init() | 
| 40 | lineLay.frame.size = CGSize.init(width: 50, height: 2) | 40 | lineLay.frame.size = CGSize.init(width: 50, height: 2) | 
| 41 | - lineLay.backgroundColor = UIColor.gray.cgColor | 41 | + lineLay.backgroundColor = UIColor.blue.cgColor | 
| 42 | return lineLay | 42 | return lineLay | 
| 43 | }() | 43 | }() | 
| 44 | 44 | ||
| 45 | override func viewDidLoad() { | 45 | override func viewDidLoad() { | 
| 46 | super.viewDidLoad() | 46 | super.viewDidLoad() | 
| 47 | - | 47 | + navigationBarHeight = self.navigationController?.navigationBar.frame.height | 
| 48 | titleArr = ["应用","报告"] | 48 | titleArr = ["应用","报告"] | 
| 49 | //设置导航栏标题 | 49 | //设置导航栏标题 | 
| 50 | self.navigationItem.titleView = titleView | 50 | self.navigationItem.titleView = titleView | 
| @@ -54,8 +54,8 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -54,8 +54,8 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
| 54 | setChildViewContent() | 54 | setChildViewContent() | 
| 55 | 55 | ||
| 56 | //左按钮 | 56 | //左按钮 | 
| 57 | - let leftView = UIButton.init(frame: CGRect.init(x: 0, y: 0, width: 50, height: 44)) | ||
| 58 | - let titleLab = UILabel.init(frame: CGRect.init(x: 0, y: 0, width: 40, height: 44)) | 57 | + let leftView = UIButton.init(frame: CGRect.init(x: 0, y: 0, width: 60, height: 44)) | 
| 58 | + let titleLab = UILabel.init(frame: CGRect.init(x: 0, y: 0, width: 50, height: 44)) | ||
| 59 | if AccountManager.shared.isOnline() { | 59 | if AccountManager.shared.isOnline() { | 
| 60 | if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { | 60 | if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { | 
| 61 | titleLab.text = "未绑定" | 61 | titleLab.text = "未绑定" | 
| @@ -69,7 +69,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -69,7 +69,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
| 69 | titleLab.textAlignment = .center | 69 | titleLab.textAlignment = .center | 
| 70 | leftView.addSubview(titleLab) | 70 | leftView.addSubview(titleLab) | 
| 71 | 71 | ||
| 72 | - let imageView = UIImageView.init(frame: CGRect.init(x: 40, y: 11, width: 10, height: 22)) | 72 | + let imageView = UIImageView.init(frame: CGRect.init(x: 50, y: 11, width: 10, height: 22)) | 
| 73 | imageView.image = UIImage.init(named: "report_pull") | 73 | imageView.image = UIImage.init(named: "report_pull") | 
| 74 | imageView.contentMode = .scaleAspectFit | 74 | imageView.contentMode = .scaleAspectFit | 
| 75 | leftView.addSubview(imageView) | 75 | leftView.addSubview(imageView) | 
| @@ -95,11 +95,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -95,11 +95,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
| 95 | let rightBtn = UIBarButtonItem.init(customView: rightView) | 95 | let rightBtn = UIBarButtonItem.init(customView: rightView) | 
| 96 | self.navigationItem.rightBarButtonItem = rightBtn | 96 | self.navigationItem.rightBarButtonItem = rightBtn | 
| 97 | 97 | ||
| 98 | - setupNavigationBar() | ||
| 99 | - } | ||
| 100 | - | ||
| 101 | - // MARK: - 设置顶部按钮 | ||
| 102 | - func setupNavigationBar(){ | 98 | + //设置顶部样式 | 
| 103 | self.configTheme() | 99 | self.configTheme() | 
| 104 | } | 100 | } | 
| 105 | 101 | ||
| @@ -112,7 +108,6 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -112,7 +108,6 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
| 112 | } | 108 | } | 
| 113 | //设置第一个控制器数据 | 109 | //设置第一个控制器数据 | 
| 114 | let childVC = self.childViewControllers.first | 110 | let childVC = self.childViewControllers.first | 
| 115 | - childVC?.view.frame = self.view.bounds | ||
| 116 | self.contentScrollView.addSubview((childVC?.view)!) | 111 | self.contentScrollView.addSubview((childVC?.view)!) | 
| 117 | //设置scrollview滑动范围 | 112 | //设置scrollview滑动范围 | 
| 118 | contentScrollView.contentSize = CGSize.init(width: getScreenWidth()*CGFloat(titleArr.count), height: 0) | 113 | contentScrollView.contentSize = CGSize.init(width: getScreenWidth()*CGFloat(titleArr.count), height: 0) | 
| @@ -134,7 +129,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -134,7 +129,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
| 134 | btn.frame.size = CGSize.init(width: 40, height: ZJBNavH) | 129 | btn.frame.size = CGSize.init(width: 40, height: ZJBNavH) | 
| 135 | 130 | ||
| 136 | let widht = getScreenWidth() | 131 | let widht = getScreenWidth() | 
| 137 | - btn.center = CGPoint.init(x: widht/4*(1+CGFloat(i))-16, y: CGFloat(ZJBNavH/2)) | 132 | + btn.center = CGPoint.init(x: widht/4*(1+CGFloat(i))-26, y: CGFloat(ZJBNavH/2)) | 
| 138 | btnWidthArr.append(btn.frame.size.width) | 133 | btnWidthArr.append(btn.frame.size.width) | 
| 139 | 134 | ||
| 140 | titleBtnArr.append(btn) | 135 | titleBtnArr.append(btn) | 
ParentAssistant/ParentAssistant/Classes/controllers/Grow/MoralViewController.swift
| @@ -1,106 +0,0 @@ | @@ -1,106 +0,0 @@ | ||
| 1 | -// | ||
| 2 | -// MoralViewController.swift | ||
| 3 | -// ParentAssistant | ||
| 4 | -// | ||
| 5 | -// Created by Cao yang on 2018/3/22. | ||
| 6 | -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -import UIKit | ||
| 10 | - | ||
| 11 | -class MoralViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { | ||
| 12 | - | ||
| 13 | - @IBOutlet weak var tableView: UITableView! | ||
| 14 | - var data = [String:JSON]() | ||
| 15 | - override func viewDidLoad() { | ||
| 16 | - super.viewDidLoad() | ||
| 17 | - self.title = "德育报告" | ||
| 18 | - tableView.delegate = self | ||
| 19 | - tableView.dataSource = self | ||
| 20 | - | ||
| 21 | - | ||
| 22 | - downLoadDataFromNet() | ||
| 23 | - } | ||
| 24 | - | ||
| 25 | - private func downLoadDataFromNet(){ | ||
| 26 | - | ||
| 27 | - | ||
| 28 | - let params = ["screenId":1,"startDate":"2018-03-08","endDate":"2018-04-08","classId":"70","schoolId":1] as [String : Any] | ||
| 29 | - | ||
| 30 | - HTTPServer.shared.getEvaluationSceneAnalysis(parameters: params as [String : AnyObject]) { (backData, error) in | ||
| 31 | - | ||
| 32 | - if error == nil && JSON.fromString(backData)!["status"].intValue == 1 { | ||
| 33 | - | ||
| 34 | - self.data = JSON.fromString(backData)!["data"].dictionaryValue | ||
| 35 | - | ||
| 36 | - if !self.data.isEmpty{ | ||
| 37 | - print(self.data) | ||
| 38 | - } | ||
| 39 | - } | ||
| 40 | - } | ||
| 41 | - } | ||
| 42 | - | ||
| 43 | - | ||
| 44 | - | ||
| 45 | - func numberOfSections(in tableView: UITableView) -> Int { | ||
| 46 | - return 3 | ||
| 47 | - } | ||
| 48 | - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
| 49 | - | ||
| 50 | - if section == 2 { | ||
| 51 | - return 3 | ||
| 52 | - }else{ | ||
| 53 | - return 1 | ||
| 54 | - } | ||
| 55 | - } | ||
| 56 | - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
| 57 | - switch indexPath.section { | ||
| 58 | - case 0: | ||
| 59 | - return 240 | ||
| 60 | - case 1: | ||
| 61 | - return 240 | ||
| 62 | - case 2: | ||
| 63 | - return 70 | ||
| 64 | - default: | ||
| 65 | - return 0 | ||
| 66 | - } | ||
| 67 | - } | ||
| 68 | - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
| 69 | - var cell = UITableViewCell.init() | ||
| 70 | - switch indexPath.section { | ||
| 71 | - case 0: | ||
| 72 | - cell = tableView.dequeueReusableCell(withIdentifier: "moralDetail", for: indexPath) | ||
| 73 | - return cell | ||
| 74 | - case 1: | ||
| 75 | - cell = tableView.dequeueReusableCell(withIdentifier: "educationDetail", for: indexPath) | ||
| 76 | - return cell | ||
| 77 | - case 2: | ||
| 78 | - cell = tableView.dequeueReusableCell(withIdentifier: "behaviorDetail", for: indexPath) | ||
| 79 | - return cell | ||
| 80 | - default: | ||
| 81 | - return cell | ||
| 82 | - } | ||
| 83 | - } | ||
| 84 | - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
| 85 | - if indexPath.section == 2 { | ||
| 86 | - let scene = Story.instantiateViewControllerWithIdentifier("SceneDetailViewController", storyName: "Main") as! SceneDetailViewController | ||
| 87 | - self.navigationController?.pushViewController(scene, animated: true) | ||
| 88 | - } | ||
| 89 | - } | ||
| 90 | - override func didReceiveMemoryWarning() { | ||
| 91 | - super.didReceiveMemoryWarning() | ||
| 92 | - // Dispose of any resources that can be recreated. | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | - | ||
| 96 | - /* | ||
| 97 | - // MARK: - Navigation | ||
| 98 | - | ||
| 99 | - // In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 100 | - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | ||
| 101 | - // Get the new view controller using segue.destinationViewController. | ||
| 102 | - // Pass the selected object to the new view controller. | ||
| 103 | - } | ||
| 104 | - */ | ||
| 105 | - | ||
| 106 | -} | 
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/MoralViewController.swift
0 → 100644
| @@ -0,0 +1,117 @@ | @@ -0,0 +1,117 @@ | ||
| 1 | +// | ||
| 2 | +// MoralViewController.swift | ||
| 3 | +// ParentAssistant | ||
| 4 | +// | ||
| 5 | +// Created by Cao yang on 2018/3/22. | ||
| 6 | +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +import UIKit | ||
| 10 | + | ||
| 11 | +class MoralViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { | ||
| 12 | + | ||
| 13 | + lazy var tableView = {()->UITableView in | ||
| 14 | + | ||
| 15 | + let table = UITableView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: screenHeight-navigationBarHeight!-statusBarHeight-10)) | ||
| 16 | + table.backgroundColor = UIColor.init(red: 235/255, green: 235/255, blue: 241/255, alpha: 1) | ||
| 17 | + table.delegate = self | ||
| 18 | + table.dataSource = self | ||
| 19 | + table.register(UINib.init(nibName: "MoralDetailCell", bundle: nil), forCellReuseIdentifier: "moralDetail") | ||
| 20 | + table.register(UINib.init(nibName: "EducationDetailCell", bundle: nil), forCellReuseIdentifier: "educationDetail") | ||
| 21 | + table.register(UINib.init(nibName: "BehaviorDetailCell", bundle: nil), forCellReuseIdentifier: "behaviorDetail") | ||
| 22 | + return table | ||
| 23 | + }() | ||
| 24 | + | ||
| 25 | + var data = [String:JSON]() | ||
| 26 | + | ||
| 27 | + override func viewDidLoad() { | ||
| 28 | + super.viewDidLoad() | ||
| 29 | + self.title = "德育报告" | ||
| 30 | + self.view.backgroundColor = backGroundColor | ||
| 31 | + self.view.addSubview(self.tableView) | ||
| 32 | + | ||
| 33 | + | ||
| 34 | + downLoadDataFromNet() | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + private func downLoadDataFromNet(){ | ||
| 38 | + | ||
| 39 | + let params = ["screenId":1,"startDate":"2018-03-08","endDate":"2018-04-08","classId":"70","schoolId":1] as [String : Any] | ||
| 40 | + HTTPServer.shared.getEvaluationSceneAnalysis(parameters: params as [String : AnyObject]) { (backData, error) in | ||
| 41 | + | ||
| 42 | + if error == nil && JSON.fromString(backData)!["status"].intValue == 1 { | ||
| 43 | + | ||
| 44 | + self.data = JSON.fromString(backData)!["data"].dictionaryValue | ||
| 45 | + | ||
| 46 | + if !self.data.isEmpty{ | ||
| 47 | + print(self.data) | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + | ||
| 55 | + func numberOfSections(in tableView: UITableView) -> Int { | ||
| 56 | + return 3 | ||
| 57 | + } | ||
| 58 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
| 59 | + | ||
| 60 | + if section == 2 { | ||
| 61 | + return 3 | ||
| 62 | + }else{ | ||
| 63 | + return 1 | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
| 67 | + switch indexPath.section { | ||
| 68 | + case 0: | ||
| 69 | + return 240 | ||
| 70 | + case 1: | ||
| 71 | + return 240 | ||
| 72 | + case 2: | ||
| 73 | + return 70 | ||
| 74 | + default: | ||
| 75 | + return 0 | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
| 79 | + var cell = UITableViewCell.init() | ||
| 80 | + switch indexPath.section { | ||
| 81 | + case 0: | ||
| 82 | + cell = tableView.dequeueReusableCell(withIdentifier: "moralDetail", for: indexPath) as! MoralDetailCell | ||
| 83 | + return cell | ||
| 84 | + case 1: | ||
| 85 | + cell = tableView.dequeueReusableCell(withIdentifier: "educationDetail", for: indexPath) as! EducationDetailCell | ||
| 86 | + return cell | ||
| 87 | + case 2: | ||
| 88 | + cell = tableView.dequeueReusableCell(withIdentifier: "behaviorDetail", for: indexPath) as! BehaviorDetailCell | ||
| 89 | + return cell | ||
| 90 | + default: | ||
| 91 | + return cell | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
| 95 | + if indexPath.section == 2 { | ||
| 96 | + | ||
| 97 | + let scene = SceneDetailViewController() | ||
| 98 | + self.navigationController?.pushViewController(scene, animated: true) | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + override func didReceiveMemoryWarning() { | ||
| 102 | + super.didReceiveMemoryWarning() | ||
| 103 | + // Dispose of any resources that can be recreated. | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + | ||
| 107 | + /* | ||
| 108 | + // MARK: - Navigation | ||
| 109 | + | ||
| 110 | + // In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 111 | + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | ||
| 112 | + // Get the new view controller using segue.destinationViewController. | ||
| 113 | + // Pass the selected object to the new view controller. | ||
| 114 | + } | ||
| 115 | + */ | ||
| 116 | + | ||
| 117 | +} | 
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift
0 → 100644
| @@ -0,0 +1,97 @@ | @@ -0,0 +1,97 @@ | ||
| 1 | +// | ||
| 2 | +// ReportViewController.swift | ||
| 3 | +// ParentAssistant | ||
| 4 | +// | ||
| 5 | +// Created by 葛建军 on 2018/3/5. | ||
| 6 | +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +import UIKit | ||
| 10 | + | ||
| 11 | +class ReportViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { | ||
| 12 | + | ||
| 13 | + //膜板 | ||
| 14 | + var keyWindow = UIWindow() | ||
| 15 | + var backBotton = UIButton() | ||
| 16 | + //日历 | ||
| 17 | + var calendar = CalendarView() | ||
| 18 | + | ||
| 19 | + lazy var reportTable = {()-> UITableView in | ||
| 20 | + let table = UITableView.init(frame: CGRect.init(x: 0, y: 60, width: screenWidth, height: screenHeight-navigationBarHeight!-statusBarHeight-(self.tabBarController?.tabBar.frame.height)!-60)) | ||
| 21 | + table.delegate = self | ||
| 22 | + table.dataSource = self | ||
| 23 | + table.backgroundColor = backGroundColor | ||
| 24 | + table.register(UINib.init(nibName: "MoralTableViewCell", bundle: nil), forCellReuseIdentifier: "MoralTableViewCell") | ||
| 25 | + table.register(UINib.init(nibName: "GrowSubjectCell", bundle: nil), forCellReuseIdentifier: "GrowSubjectCell") | ||
| 26 | + return table | ||
| 27 | + }() | ||
| 28 | + override func viewDidLoad() { | ||
| 29 | + super.viewDidLoad() | ||
| 30 | + | ||
| 31 | + self.view.addSubview(self.reportTable) | ||
| 32 | + | ||
| 33 | + setupDateView() | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + // MARK: - 设置日期View | ||
| 38 | + func setupDateView(){ | ||
| 39 | + | ||
| 40 | + let headView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: 60)) | ||
| 41 | + self.view.addSubview(headView) | ||
| 42 | + //添加手势 | ||
| 43 | + let recognizer = UISwipeGestureRecognizer.init(target: self, action: #selector(showView)) | ||
| 44 | + recognizer.direction = UISwipeGestureRecognizerDirection.down | ||
| 45 | + headView.addGestureRecognizer(recognizer) | ||
| 46 | + | ||
| 47 | + calendar = CalendarView.init(frame: CGRect.init(x: 0, y: 30, width: screenWidth, height: 260)) | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + @objc func showView(){ | ||
| 51 | + keyWindow = UIApplication.shared.keyWindow! | ||
| 52 | + let backBtn = UIButton.init(frame: CGRect.init(x: 0, y: calendar.frame.origin.y+260+22, width: screenWidth, height: screenHeight)) | ||
| 53 | + backBtn.backgroundColor = UIColor.black | ||
| 54 | + backBtn.alpha = 0.4 | ||
| 55 | + | ||
| 56 | + backBtn.addTarget(self, action: #selector(closeView(btn:)), for: UIControlEvents.allEvents) | ||
| 57 | + reportTable.isUserInteractionEnabled = false | ||
| 58 | + | ||
| 59 | + keyWindow.addSubview(backBtn) | ||
| 60 | + keyWindow.addSubview(calendar) | ||
| 61 | + calendar.isHidden = false | ||
| 62 | + } | ||
| 63 | + @objc func closeView(btn:UIButton) { | ||
| 64 | + | ||
| 65 | + reportTable.isUserInteractionEnabled = true | ||
| 66 | + UIView.animate(withDuration: 0.3) { | ||
| 67 | + btn.removeFromSuperview() | ||
| 68 | + self.calendar.isHidden = true | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + override func didReceiveMemoryWarning() { | ||
| 72 | + super.didReceiveMemoryWarning() | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
| 76 | + return 5 | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
| 80 | + | ||
| 81 | + if indexPath.row == 0 { | ||
| 82 | + let cell = tableView.dequeueReusableCell(withIdentifier: "MoralTableViewCell", for: indexPath) as! MoralTableViewCell | ||
| 83 | + return cell | ||
| 84 | + }else{ | ||
| 85 | + let cell = tableView.dequeueReusableCell(withIdentifier: "GrowSubjectCell", for: indexPath) as! GrowSubjectCell | ||
| 86 | + return cell | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
| 90 | + return 280 | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
| 94 | + let vc = MoralViewController() | ||
| 95 | + self.navigationController?.pushViewController(vc, animated: true) | ||
| 96 | + } | ||
| 97 | +} | 
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/SceneDetailViewController.swift
0 → 100644
| @@ -0,0 +1,87 @@ | @@ -0,0 +1,87 @@ | ||
| 1 | +// | ||
| 2 | +// SceneDetailViewController.swift | ||
| 3 | +// ParentAssistant | ||
| 4 | +// | ||
| 5 | +// Created by Cao yang on 2018/3/22. | ||
| 6 | +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +import UIKit | ||
| 10 | + | ||
| 11 | +class SceneDetailViewController: UIViewController,UITableViewDataSource,UITableViewDelegate { | ||
| 12 | + | ||
| 13 | + lazy var sceneTableView = {()->UITableView in | ||
| 14 | + let table = UITableView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: screenHeight-navigationBarHeight!-statusBarHeight-10)) | ||
| 15 | + table.backgroundColor = backGroundColor | ||
| 16 | + table.delegate = self | ||
| 17 | + table.dataSource = self | ||
| 18 | + table.register(UINib.init(nibName: "SceneTopCell", bundle: nil), forCellReuseIdentifier: "cultureCell") | ||
| 19 | + table.register(UINib.init(nibName: "SceneMiddleCell", bundle: nil), forCellReuseIdentifier: "scoreCell") | ||
| 20 | + table.register(UINib.init(nibName: "SceneDownCell", bundle: nil), forCellReuseIdentifier: "disciplineCell") | ||
| 21 | + | ||
| 22 | + return table | ||
| 23 | + }() | ||
| 24 | + | ||
| 25 | + override func viewDidLoad() { | ||
| 26 | + super.viewDidLoad() | ||
| 27 | + self.title = "场景详情" | ||
| 28 | + self.view.backgroundColor = backGroundColor | ||
| 29 | + self.view.addSubview(self.sceneTableView) | ||
| 30 | + | ||
| 31 | + } | ||
| 32 | + func numberOfSections(in tableView: UITableView) -> Int { | ||
| 33 | + return 3 | ||
| 34 | + } | ||
| 35 | + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
| 36 | + if section == 2 { | ||
| 37 | + return 5 | ||
| 38 | + } | ||
| 39 | + return 1 | ||
| 40 | + } | ||
| 41 | + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
| 42 | + | ||
| 43 | + switch indexPath.section { | ||
| 44 | + case 0: | ||
| 45 | + return 240 | ||
| 46 | + case 1: | ||
| 47 | + return 250 | ||
| 48 | + case 2: | ||
| 49 | + return 70 | ||
| 50 | + default: | ||
| 51 | + return 0 | ||
| 52 | + } | ||
| 53 | + } | ||
| 54 | + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
| 55 | + var cell = UITableViewCell.init() | ||
| 56 | + switch indexPath.section { | ||
| 57 | + case 0: | ||
| 58 | + cell = tableView.dequeueReusableCell(withIdentifier: "cultureCell", for: indexPath) as! SceneTopCell | ||
| 59 | + return cell | ||
| 60 | + case 1: | ||
| 61 | + cell = tableView.dequeueReusableCell(withIdentifier: "scoreCell", for: indexPath) as! SceneMiddleCell | ||
| 62 | + return cell | ||
| 63 | + case 2: | ||
| 64 | + cell = tableView.dequeueReusableCell(withIdentifier: "disciplineCell", for: indexPath) as! SceneDownCell | ||
| 65 | + return cell | ||
| 66 | + default: | ||
| 67 | + return cell | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + override func didReceiveMemoryWarning() { | ||
| 72 | + super.didReceiveMemoryWarning() | ||
| 73 | + // Dispose of any resources that can be recreated. | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + | ||
| 77 | + /* | ||
| 78 | + // MARK: - Navigation | ||
| 79 | + | ||
| 80 | + // In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 81 | + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | ||
| 82 | + // Get the new view controller using segue.destinationViewController. | ||
| 83 | + // Pass the selected object to the new view controller. | ||
| 84 | + } | ||
| 85 | + */ | ||
| 86 | + | ||
| 87 | +} | 
ParentAssistant/ParentAssistant/Classes/controllers/Grow/ReportViewController.swift
| @@ -1,104 +0,0 @@ | @@ -1,104 +0,0 @@ | ||
| 1 | -// | ||
| 2 | -// ReportViewController.swift | ||
| 3 | -// ParentAssistant | ||
| 4 | -// | ||
| 5 | -// Created by 葛建军 on 2018/3/5. | ||
| 6 | -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -import UIKit | ||
| 10 | - | ||
| 11 | -class ReportViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { | ||
| 12 | - | ||
| 13 | - var reportTable: UITableView! | ||
| 14 | - | ||
| 15 | - //膜板 | ||
| 16 | - var keyWindow = UIWindow() | ||
| 17 | - var backBotton = UIButton() | ||
| 18 | - //日历 | ||
| 19 | - var calendar = CalendarView() | ||
| 20 | - | ||
| 21 | - override func viewDidLoad() { | ||
| 22 | - super.viewDidLoad() | ||
| 23 | - setupDateView() | ||
| 24 | - } | ||
| 25 | - | ||
| 26 | - // MARK: - 设置日期页面 | ||
| 27 | - func setupDateView(){ | ||
| 28 | - | ||
| 29 | - let headView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: screenWidth, height: 60)) | ||
| 30 | - self.view.addSubview(headView) | ||
| 31 | - | ||
| 32 | - //添加手势 | ||
| 33 | - let recognizer = UISwipeGestureRecognizer.init(target: self, action: #selector(showView)) | ||
| 34 | - recognizer.direction = UISwipeGestureRecognizerDirection.down | ||
| 35 | - headView.addGestureRecognizer(recognizer) | ||
| 36 | - | ||
| 37 | - calendar = CalendarView.init(frame: CGRect.init(x: 0, y: 30, width: screenWidth, height: 260)) | ||
| 38 | - | ||
| 39 | - self.reportTable = UITableView.init(frame: CGRect.init(x: 0, y: 60, width: screenWidth, height: screenHeight-60)) | ||
| 40 | - self.view.addSubview(self.reportTable) | ||
| 41 | - self.reportTable.delegate = self | ||
| 42 | - self.reportTable.dataSource = self | ||
| 43 | - | ||
| 44 | - self.reportTable.register(UINib.init(nibName: "MoralTableViewCell", bundle: nil), forCellReuseIdentifier: "MoralTableViewCell") | ||
| 45 | - self.reportTable.register(UINib.init(nibName: "GrowSubjectCell", bundle: nil), forCellReuseIdentifier: "GrowSubjectCell") | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - @objc func showView(){ | ||
| 49 | - keyWindow = UIApplication.shared.keyWindow! | ||
| 50 | - let backBtn = UIButton.init(frame: CGRect.init(x: 0, y: calendar.frame.origin.y+260+22, width: screenWidth, height: screenHeight)) | ||
| 51 | - backBtn.backgroundColor = UIColor.black | ||
| 52 | - backBtn.alpha = 0.4 | ||
| 53 | - | ||
| 54 | - backBtn.addTarget(self, action: #selector(closeView(btn:)), for: UIControlEvents.allEvents) | ||
| 55 | - reportTable.isUserInteractionEnabled = false | ||
| 56 | - | ||
| 57 | - keyWindow.addSubview(backBtn) | ||
| 58 | - keyWindow.addSubview(calendar) | ||
| 59 | - calendar.isHidden = false | ||
| 60 | - } | ||
| 61 | - @objc func closeView(btn:UIButton) { | ||
| 62 | - | ||
| 63 | - reportTable.isUserInteractionEnabled = true | ||
| 64 | - UIView.animate(withDuration: 0.3) { | ||
| 65 | - btn.removeFromSuperview() | ||
| 66 | - self.calendar.isHidden = true | ||
| 67 | - } | ||
| 68 | - } | ||
| 69 | - override func viewWillAppear(_ animated: Bool) { | ||
| 70 | - super.viewWillAppear(animated) | ||
| 71 | - } | ||
| 72 | - override func viewWillDisappear(_ animated: Bool) { | ||
| 73 | - super.viewWillDisappear(animated) | ||
| 74 | - } | ||
| 75 | - override func viewDidLayoutSubviews() { | ||
| 76 | - super.viewDidLayoutSubviews() | ||
| 77 | - | ||
| 78 | - } | ||
| 79 | - override func didReceiveMemoryWarning() { | ||
| 80 | - super.didReceiveMemoryWarning() | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
| 84 | - return 5 | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
| 88 | - | ||
| 89 | - if indexPath.row == 0 { | ||
| 90 | - let cell = tableView.dequeueReusableCell(withIdentifier: "MoralTableViewCell", for: indexPath) as! MoralTableViewCell | ||
| 91 | - return cell | ||
| 92 | - }else{ | ||
| 93 | - let cell = tableView.dequeueReusableCell(withIdentifier: "GrowSubjectCell", for: indexPath) as! GrowSubjectCell | ||
| 94 | - return cell | ||
| 95 | - } | ||
| 96 | - } | ||
| 97 | - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
| 98 | - return 280 | ||
| 99 | - } | ||
| 100 | - | ||
| 101 | - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
| 102 | - | ||
| 103 | - } | ||
| 104 | -} | 
ParentAssistant/ParentAssistant/Classes/controllers/Grow/SceneDetailViewController.swift
| @@ -1,76 +0,0 @@ | @@ -1,76 +0,0 @@ | ||
| 1 | -// | ||
| 2 | -// SceneDetailViewController.swift | ||
| 3 | -// ParentAssistant | ||
| 4 | -// | ||
| 5 | -// Created by Cao yang on 2018/3/22. | ||
| 6 | -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -import UIKit | ||
| 10 | - | ||
| 11 | -class SceneDetailViewController: UIViewController,UITableViewDataSource,UITableViewDelegate { | ||
| 12 | - | ||
| 13 | - @IBOutlet weak var sceneTableView: UITableView! | ||
| 14 | - override func viewDidLoad() { | ||
| 15 | - super.viewDidLoad() | ||
| 16 | - self.title = "场景详情" | ||
| 17 | - sceneTableView.delegate = self | ||
| 18 | - sceneTableView.dataSource = self | ||
| 19 | - // Do any additional setup after loading the view. | ||
| 20 | - } | ||
| 21 | - func numberOfSections(in tableView: UITableView) -> Int { | ||
| 22 | - return 3 | ||
| 23 | - } | ||
| 24 | - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | ||
| 25 | - if section == 2 { | ||
| 26 | - return 5 | ||
| 27 | - } | ||
| 28 | - return 1 | ||
| 29 | - } | ||
| 30 | - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
| 31 | - | ||
| 32 | - switch indexPath.section { | ||
| 33 | - case 0: | ||
| 34 | - return 240 | ||
| 35 | - case 1: | ||
| 36 | - return 250 | ||
| 37 | - case 2: | ||
| 38 | - return 70 | ||
| 39 | - default: | ||
| 40 | - return 0 | ||
| 41 | - } | ||
| 42 | - } | ||
| 43 | - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
| 44 | - var cell = UITableViewCell.init() | ||
| 45 | - switch indexPath.section { | ||
| 46 | - case 0: | ||
| 47 | - cell = tableView.dequeueReusableCell(withIdentifier: "cultureCell", for: indexPath) as! SceneTopCell | ||
| 48 | - return cell | ||
| 49 | - case 1: | ||
| 50 | - cell = tableView.dequeueReusableCell(withIdentifier: "scoreCell", for: indexPath) as! SceneMiddleCell | ||
| 51 | - return cell | ||
| 52 | - case 2: | ||
| 53 | - cell = tableView.dequeueReusableCell(withIdentifier: "disciplineCell", for: indexPath) as! SceneDownCell | ||
| 54 | - return cell | ||
| 55 | - default: | ||
| 56 | - return cell | ||
| 57 | - } | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - override func didReceiveMemoryWarning() { | ||
| 61 | - super.didReceiveMemoryWarning() | ||
| 62 | - // Dispose of any resources that can be recreated. | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - | ||
| 66 | - /* | ||
| 67 | - // MARK: - Navigation | ||
| 68 | - | ||
| 69 | - // In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 70 | - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | ||
| 71 | - // Get the new view controller using segue.destinationViewController. | ||
| 72 | - // Pass the selected object to the new view controller. | ||
| 73 | - } | ||
| 74 | - */ | ||
| 75 | - | ||
| 76 | -} | 
ParentAssistant/ParentAssistant/Classes/util/Macro.swift
| @@ -12,9 +12,11 @@ import UIKit | @@ -12,9 +12,11 @@ import UIKit | ||
| 12 | //MARK: -------------------------- 全局常量 ----------------------------- | 12 | //MARK: -------------------------- 全局常量 ----------------------------- | 
| 13 | 13 | ||
| 14 | let appDelegate = UIApplication.shared.delegate as! AppDelegate | 14 | let appDelegate = UIApplication.shared.delegate as! AppDelegate | 
| 15 | - | 15 | +let statusBarHeight = UIApplication.shared.statusBarFrame.height | 
| 16 | +var navigationBarHeight : CGFloat? | ||
| 16 | let screenWidth = UIScreen.main.bounds.size.width | 17 | let screenWidth = UIScreen.main.bounds.size.width | 
| 17 | let screenHeight = UIScreen.main.bounds.size.height | 18 | let screenHeight = UIScreen.main.bounds.size.height | 
| 19 | +let backGroundColor = UIColor.init(red: 235/255, green: 235/255, blue: 241/255, alpha: 1) | ||
| 18 | 20 | ||
| 19 | //MARK: -------------------------- 接口地址 ---------------------------- | 21 | //MARK: -------------------------- 接口地址 ---------------------------- | 
| 20 | let appsecret="sincere:3a530f39f99411b454e667d69693c127" | 22 | let appsecret="sincere:3a530f39f99411b454e667d69693c127" | 
ParentAssistant/ParentAssistant/Classes/util/utils.swift
| @@ -574,10 +574,10 @@ extension UIViewController{ | @@ -574,10 +574,10 @@ extension UIViewController{ | ||
| 574 | func configTheme(){ | 574 | func configTheme(){ | 
| 575 | self.navigationItem.title=self.navigationController?.title | 575 | self.navigationItem.title=self.navigationController?.title | 
| 576 | self.navigationController?.navigationBar.barTintColor=Theme.topBarColor() | 576 | self.navigationController?.navigationBar.barTintColor=Theme.topBarColor() | 
| 577 | - self.navigationController?.navigationBar.tintColor=UIColor.white | 577 | + self.navigationController?.navigationBar.tintColor=UIColor.black | 
| 578 | self.navigationController?.navigationBar.isTranslucent=false | 578 | self.navigationController?.navigationBar.isTranslucent=false | 
| 579 | let textAttributes = NSMutableDictionary(capacity:1) | 579 | let textAttributes = NSMutableDictionary(capacity:1) | 
| 580 | - textAttributes.setObject(UIColor.white, forKey: NSAttributedStringKey.foregroundColor as NSCopying) | 580 | + textAttributes.setObject(UIColor.black, forKey: NSAttributedStringKey.foregroundColor as NSCopying) | 
| 581 | self.navigationController?.navigationBar.titleTextAttributes=textAttributes as! [AnyHashable: Any] as? [NSAttributedStringKey : Any] | 581 | self.navigationController?.navigationBar.titleTextAttributes=textAttributes as! [AnyHashable: Any] as? [NSAttributedStringKey : Any] | 
| 582 | } | 582 | } | 
| 583 | ///套上UINavigationController | 583 | ///套上UINavigationController |