From 1ec3b7df1a7e8b97895fc9b2a5ba48d8e90a4043 Mon Sep 17 00:00:00 2001 From: Cao yang Date: Tue, 10 Apr 2018 11:08:46 +0800 Subject: [PATCH] 修改成长页面 --- ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj | 18 +++++++++++++++--- ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate | Bin 139143 -> 0 bytes ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/MoralViewController.swift | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/ReportViewController.swift | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/SceneDetailViewController.swift | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/BehaviorDetailCell.swift | 24 ++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/CalendarView.swift | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/EducationDetailCell.swift | 43 +++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/LineChartView.swift | 220 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/MoralDetailCell.swift | 32 ++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/MoralTableViewCell.swift | 30 ++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportDateCollectionViewCell.swift | 21 +++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportHeaderView.swift | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportHeaderView.xib | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneDownCell.swift | 30 ++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneMiddleCell.swift | 44 ++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneTopCell.swift | 28 ++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/TaskPresentationTableViewCell.swift | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/report/MoralViewController.swift | 105 --------------------------------------------------------------------------------------------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/ReportViewController.swift | 223 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/SceneDetailViewController.swift | 76 ---------------------------------------------------------------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/View/BehaviorDetailCell.swift | 24 ------------------------ ParentAssistant/ParentAssistant/Classes/controllers/report/View/CalendarView.swift | 72 ------------------------------------------------------------------------ ParentAssistant/ParentAssistant/Classes/controllers/report/View/EducationDetailCell.swift | 43 ------------------------------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/View/LineChartView.swift | 220 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/View/MoralDetailCell.swift | 32 -------------------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/View/MoralTableViewCell.swift | 30 ------------------------------ ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportDateCollectionViewCell.swift | 21 --------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.swift | 48 ------------------------------------------------ ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib | 61 ------------------------------------------------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneDownCell.swift | 30 ------------------------------ ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneMiddleCell.swift | 44 -------------------------------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneTopCell.swift | 28 ---------------------------- ParentAssistant/ParentAssistant/Classes/controllers/report/View/TaskPresentationTableViewCell.swift | 82 ---------------------------------------------------------------------------------- ParentAssistant/ParentAssistant/Classes/util/Macro.swift | 2 +- ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard | 38 ++++++++++++++++++++++++++++---------- 37 files changed, 1270 insertions(+), 1153 deletions(-) create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/MoralViewController.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/ReportViewController.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/SceneDetailViewController.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/BehaviorDetailCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/CalendarView.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/EducationDetailCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/LineChartView.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/MoralDetailCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/MoralTableViewCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportDateCollectionViewCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportHeaderView.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportHeaderView.xib create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneDownCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneMiddleCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneTopCell.swift create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/TaskPresentationTableViewCell.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/MoralViewController.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/ReportViewController.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/SceneDetailViewController.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/BehaviorDetailCell.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/CalendarView.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/EducationDetailCell.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/LineChartView.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/MoralDetailCell.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/MoralTableViewCell.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportDateCollectionViewCell.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneDownCell.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneMiddleCell.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneTopCell.swift delete mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/report/View/TaskPresentationTableViewCell.swift diff --git a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj index 70c9db8..6653502 100644 --- a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj +++ b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj @@ -42,6 +42,7 @@ AD65FB7A20637F110052415B /* MoralViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD65FB7920637F110052415B /* MoralViewController.swift */; }; ADAEA3982064960300A47D2C /* SceneDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAEA3972064960300A47D2C /* SceneDetailViewController.swift */; }; ADAEA39A2064C44900A47D2C /* LineChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADAEA3992064C44900A47D2C /* LineChartView.swift */; }; + ADC9AB72207C55CE00348EF1 /* GrowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADC9AB71207C55CE00348EF1 /* GrowViewController.swift */; }; ADE33B312062202300BEA6E6 /* Macro.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADE33B302062202300BEA6E6 /* Macro.swift */; }; ADF159612069E00000A9485D /* CalendarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADF159602069E00000A9485D /* CalendarView.swift */; }; BF388469205A4DE900A240EF /* StudentClassInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF388468205A4DE900A240EF /* StudentClassInfo.swift */; }; @@ -188,6 +189,7 @@ AD65FB7920637F110052415B /* MoralViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoralViewController.swift; sourceTree = ""; }; ADAEA3972064960300A47D2C /* SceneDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDetailViewController.swift; sourceTree = ""; }; ADAEA3992064C44900A47D2C /* LineChartView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineChartView.swift; sourceTree = ""; }; + ADC9AB71207C55CE00348EF1 /* GrowViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GrowViewController.swift; sourceTree = ""; }; ADE33B302062202300BEA6E6 /* Macro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Macro.swift; sourceTree = ""; }; ADF159602069E00000A9485D /* CalendarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarView.swift; sourceTree = ""; }; BF388468205A4DE900A240EF /* StudentClassInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentClassInfo.swift; sourceTree = ""; }; @@ -375,7 +377,7 @@ BFEAAAA5205117DA0072FAAF /* main */, 599364DA204E62E700C8B371 /* evaluation */, 599364E0204E62E700C8B371 /* Information */, - 599364E6204E62E700C8B371 /* report */, + 599364E6204E62E700C8B371 /* Grow */, 599364E2204E62E700C8B371 /* my */, 599364FD204E941900C8B371 /* userCenter */, ); @@ -425,15 +427,17 @@ path = View; sourceTree = ""; }; - 599364E6204E62E700C8B371 /* report */ = { + 599364E6204E62E700C8B371 /* Grow */ = { isa = PBXGroup; children = ( + ADC9AB70207C558600348EF1 /* Model */, + ADC9AB71207C55CE00348EF1 /* GrowViewController.swift */, 599364E7204E62E700C8B371 /* ReportViewController.swift */, AD65FB7920637F110052415B /* MoralViewController.swift */, ADAEA3972064960300A47D2C /* SceneDetailViewController.swift */, BF3B829E2050CC7E002078EA /* View */, ); - path = report; + path = Grow; sourceTree = ""; }; 599364F1204E632600C8B371 /* util */ = { @@ -473,6 +477,13 @@ path = userCenter; sourceTree = ""; }; + ADC9AB70207C558600348EF1 /* Model */ = { + isa = PBXGroup; + children = ( + ); + path = Model; + sourceTree = ""; + }; B605235D289EDBCA5C5AF2C5 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -952,6 +963,7 @@ BFEAAAA7205118370072FAAF /* TabBarController.swift in Sources */, BF67F3C020590A2F002FDC61 /* SwiftyJSON.swift in Sources */, 599364ED204E62E700C8B371 /* InformationViewController.swift in Sources */, + ADC9AB72207C55CE00348EF1 /* GrowViewController.swift in Sources */, 5980BF692061048A00F4A35E /* LZCityPickerView.m in Sources */, BF388482205F5BC800A240EF /* MessageManager.swift in Sources */, 5980BF682061048A00F4A35E /* LZCityPickerController.m in Sources */, diff --git a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate index 99fa620..e085fbc 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 new file mode 100644 index 0000000..fb1788b --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift @@ -0,0 +1,211 @@ +// +// GrowViewController.swift +// ParentAssistant +// +// Created by Cao yang on 2018/4/10. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class GrowViewController: UIViewController,UIScrollViewDelegate { + + var ZJBNavH = 44.0 + //MARK: - 标题数据 + //标题 + lazy var titleView = {() -> UIView in + let title = UIScrollView() + title.frame = CGRect(x:0,y:0,width:getScreenWidth(),height:44) + title.backgroundColor = Theme.topBarColor() + return title + }() + //MARK: - 内容数据 + //内容 + lazy var contentScrollView = {()->UIScrollView in + let scrollView = UIScrollView.init(frame: self.view.bounds) + scrollView.delegate = self + scrollView.isPagingEnabled = true + scrollView.showsHorizontalScrollIndicator = false + return scrollView + }() + //按钮数组 + var titleBtnArr = Array() + //titleLine初始位置 + var linePoint = CGPoint() + //按钮标题数据 + var titleArr = Array() + //按钮下面横线 + lazy var titleLine = {()->CALayer in + let lineLay = CALayer.init() + lineLay.frame.size = CGSize.init(width: 50, height: 2) + lineLay.backgroundColor = UIColor.gray.cgColor + return lineLay + }() + + override func viewDidLoad() { + super.viewDidLoad() + + titleArr = ["应用","报告"] + //设置导航栏标题 + self.navigationItem.titleView = titleView + self.view.addSubview(contentScrollView) + + setUpTitle() + 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)) + if AccountManager.shared.isOnline() { + if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { + titleLab.text = "未绑定" + }else{ + titleLab.text = AccountManager.shared.rawUserInfo!.contentData()["studentClass"][0]["studentName"].stringValue + } + }else{ + titleLab.text = "未登录" + } + titleLab.font = UIFont.systemFont(ofSize: 15) + titleLab.textAlignment = .center + leftView.addSubview(titleLab) + + let imageView = UIImageView.init(frame: CGRect.init(x: 40, y: 11, width: 10, height: 22)) + imageView.image = UIImage.init(named: "report_pull") + imageView.contentMode = .scaleAspectFit + leftView.addSubview(imageView) + +// leftView.addTarget(self, action: #selector(showView), for: UIControlEvents.touchDown) + + let leftBtn = UIBarButtonItem.init(customView: leftView) + self.navigationItem.leftBarButtonItem = leftBtn + //右按钮 + let rightView = UIButton.init(frame: CGRect.init(x: 0, y: 0, width: 50, height: 44)) + let titleRLab = UILabel.init(frame: CGRect.init(x: 0, y: 0, width: 40, height: 44)) + titleRLab.text = "筛选" + titleRLab.font = UIFont.systemFont(ofSize: 15) + titleRLab.textAlignment = .center + rightView.addSubview(titleRLab) + + let imageRView = UIImageView.init(frame: CGRect.init(x: 40, y: 11, width: 10, height: 22)) + imageRView.image = UIImage.init(named: "report_select") + imageRView.contentMode = .scaleAspectFit + rightView.addSubview(imageRView) + +// rightView.addTarget(self, action: #selector(showView), for: UIControlEvents.touchDown) + let rightBtn = UIBarButtonItem.init(customView: rightView) + self.navigationItem.rightBarButtonItem = rightBtn + + setupNavigationBar() + } + + // MARK: - 设置顶部按钮 + func setupNavigationBar(){ + self.configTheme() + } + + private func setChildViewContent(){ + + //添加子控制器 + for _ in 0..() + for i in 0..0 { + + let childVC = self.childViewControllers[btn.tag] + + if self.contentScrollView.subviews.contains(childVC.view){ + //已有view,直接移动 + //移动scrollview + contentScrollView.setContentOffset(CGPoint.init(x: index*getScreenWidth(), y: 0), animated: true) + }else{ + //新加view,刷新数据 + childVC.view.frame = CGRect.init(x: CGFloat(btn.tag)*getScreenWidth(), y: 0, width: getScreenWidth(),height: self.view.frame.size.height) + self.contentScrollView.addSubview(childVC.view) + //移动scrollview + contentScrollView.setContentOffset(CGPoint.init(x: index*getScreenWidth(), y: 0), animated: true) + } + } + } + //MARK: - ScrollView Delegate + func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { + + if scrollView == contentScrollView { + let offsetX = scrollView.contentOffset.x + let index = Int(offsetX/getScreenWidth()) + let btn = titleBtnArr[index] + + clickTitleAction(btn: btn) + + } + } + + 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/MoralViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/MoralViewController.swift new file mode 100644 index 0000000..8936984 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/MoralViewController.swift @@ -0,0 +1,106 @@ +// +// 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/ReportViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/ReportViewController.swift new file mode 100644 index 0000000..925e766 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/ReportViewController.swift @@ -0,0 +1,98 @@ +// +// ReportViewController.swift +// ParentAssistant +// +// Created by 葛建军 on 2018/3/5. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class ReportViewController: UIViewController { + + @IBOutlet weak 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)) + } + + @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() + } + + +} + +// MARK: - 作业报告列表 +extension ReportViewController: UITableViewDelegate,UITableViewDataSource{ + 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: "TaskPresentationTableViewCell", for: indexPath) as! TaskPresentationTableViewCell + return cell + } + } + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 280 + } + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/SceneDetailViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/SceneDetailViewController.swift new file mode 100644 index 0000000..c2d9fa5 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/SceneDetailViewController.swift @@ -0,0 +1,76 @@ +// +// 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/controllers/Grow/View/BehaviorDetailCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/BehaviorDetailCell.swift new file mode 100644 index 0000000..9f8fbae --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/BehaviorDetailCell.swift @@ -0,0 +1,24 @@ +// +// BehaviorDetailCell.swift +// ParentAssistant +// +// Created by Cao yang on 2018/3/23. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class BehaviorDetailCell: UITableViewCell { + + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/CalendarView.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/CalendarView.swift new file mode 100644 index 0000000..2192eea --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/CalendarView.swift @@ -0,0 +1,72 @@ +// +// CalendarView.swift +// ParentAssistant +// +// Created by Cao yang on 2018/3/27. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class CalendarView: UIView,UICollectionViewDelegate,UICollectionViewDataSource { + + + var weekLab = ["日","一","二","三","四","五","六"] + + override init(frame: CGRect) { + super.init(frame: frame) + self.drawCalendarView(frame: frame) + } + + func drawCalendarView(frame:CGRect) { + //TODO: 数据源待完成 + let dayLab = ["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"] + weekLab.append(contentsOf: dayLab) + //设置layout + let flowlayout = UICollectionViewFlowLayout() + flowlayout.itemSize = CGSize.init(width: screenWidth/7, height:40) + flowlayout.minimumLineSpacing = 0 + flowlayout.minimumInteritemSpacing = 0 + flowlayout.headerReferenceSize = CGSize.init(width: 0, height: 0) + flowlayout.footerReferenceSize = CGSize.init(width: 0, height: 0) + flowlayout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0) + + let calendarView = UICollectionView.init(frame: frame, collectionViewLayout: flowlayout) + calendarView.delegate = self + calendarView.dataSource = self + calendarView.backgroundColor = UIColor.white + calendarView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "calendarCell") + self.addSubview(calendarView) + } + + //MARK: - Delegate + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return weekLab.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "calendarCell", for: indexPath) + let lab = UILabel.init(frame: cell.bounds) + lab.text = weekLab[indexPath.row] + lab.textAlignment = .center + cell.addSubview(lab) + return cell + + } + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + print("点击了 第 \(weekLab[indexPath.row])") + } + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + /* + // Only override draw() if you perform custom drawing. + // An empty implementation adversely affects performance during animation. + override func draw(_ rect: CGRect) { + // Drawing code + } + */ + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/EducationDetailCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/EducationDetailCell.swift new file mode 100644 index 0000000..63d24db --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/EducationDetailCell.swift @@ -0,0 +1,43 @@ +// +// EducationDetailCell.swift +// ParentAssistant +// +// Created by Cao yang on 2018/3/23. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class EducationDetailCell: UITableViewCell { + + @IBOutlet weak var lineChartView: UIView! + + var customLineChart = LineChartView() + + override func awakeFromNib() { + super.awakeFromNib() + let rect = self.lineChartView.bounds + print(rect) + customLineChart = LineChartView.init(frame: rect) + customLineChart.drawUI(xLableArr: nil) + let arr1 = [4,4,2,1,3] + let arr2 = [2,1,4,4,5] + + customLineChart.drawLine(point: arr1, color: UIColorWithRGB(R: 65, G: 105, B: 190)) + customLineChart.drawLine(point: arr2, color: UIColorWithRGB(R: 220, G: 0, B: 16)) + + + + self.lineChartView.addSubview(customLineChart) + + + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/LineChartView.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/LineChartView.swift new file mode 100644 index 0000000..18e4d6e --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/LineChartView.swift @@ -0,0 +1,220 @@ +// +// LineChartView.swift +// ParentAssistant +// +// Created by Cao yang on 2018/3/23. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class LineChartView: UIView { + + //默认横坐标 + private var xLabArr = ["行为","文明","课堂","作业","礼仪"] + //设置纵坐标 + private let yCount = 6 + //横坐标个数 + private let xCount = 5 + //最大绩点分数 + private let GPA = 5 + //储存横纵坐标,画线用 + private var xCenterArr = Array() + private var yCenterArr = Array() + //判断是否重复点击 + private var btnTouch = 10 + //虚线 + private let lineLayer = CAShapeLayer() + //横坐标下划线 + private let xMoveLayer = CAShapeLayer() + //纵坐标Lab数组 + private var yMoveLaArr = Array() + //折线图数据数组 + private var dateArr = Array>() + //显示的数字 + var yLabArray = Array() + + override init(frame: CGRect) { + super.init(frame: frame) + print("frame==\(frame)") + + } + func drawUI(xLableArr:Array?){ + + if xLableArr != nil { + xLabArr = xLableArr! + } + drawX() + drawY() + } + //设置纵坐标 + private func drawY() { + + let yHeight = (self.bounds.height-60)/CGFloat(yCount) + for index in 0..,color:UIColor){ + + let pointArr = swichPoint(arr: point) + + let drawLayer = DrawLayer() + drawLayer.xPointArr = xCenterArr + drawLayer.yPointArr = [yCenterArr[pointArr[0]],yCenterArr[pointArr[1]],yCenterArr[pointArr[2]],yCenterArr[pointArr[3]],yCenterArr[pointArr[4]]] + drawLayer.bounds = self.bounds + drawLayer.position = self.center + drawLayer.lineColor = color + self.layer.addSublayer(drawLayer) + drawLayer.setNeedsDisplay() + + dateArr.append(point) + + } + //MARK: - 点击横坐标 + @objc func touchXAction(tap:UIButton){ + + let index = tap.tag + + + if btnTouch != index { + + //竖虚线 + lineLayer.strokeColor = UIColorWithRGB(R: 92, G: 145, B: 230).cgColor + lineLayer.lineWidth = 1 + let arr = [5,5] + lineLayer.lineDashPhase = 0 + lineLayer.lineDashPattern = arr as [NSNumber] + self.layer.addSublayer(lineLayer) + + //X轴下划线 + let movePath = CGMutablePath() + movePath.move(to: CGPoint.init(x: xCenterArr[index], y: yCenterArr[0])) + movePath.addLine(to: CGPoint.init(x: xCenterArr[index], y: 10+5*(self.bounds.height-60)/CGFloat(yCount))) + lineLayer.path = movePath + + xMoveLayer.strokeColor = UIColorWithRGB(R: 92, G: 145, B: 230).cgColor + xMoveLayer.lineWidth = 2 + self.layer.addSublayer(xMoveLayer) + let movePath2 = CGMutablePath() + movePath2.move(to: CGPoint.init(x: xCenterArr[index]-15, y: self.bounds.height-45)) + movePath2.addLine(to: CGPoint.init(x: xCenterArr[index]+15, y: self.bounds.height-45)) + xMoveLayer.path = movePath2 + + if yLabArray.count == dateArr.count { + for label in yLabArray { + label.removeFromSuperview() + } + } + yLabArray.removeAll() + //数字显示 + for i in 0..)->Array{ + var array = Array() + for index in 0..() + var xPointArr = Array() + var lineColor = UIColor() + + override func draw(in ctx: CGContext) { + + let context = ctx + //点 + context.setFillColor(lineColor.cgColor) + + for i in 0.. ReportHeaderView { + return Bundle.main.loadNibNamed("ReportHeaderView", owner: nil, options: nil)?.first as! ReportHeaderView + } +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportHeaderView.xib b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportHeaderView.xib new file mode 100644 index 0000000..12143ee --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportHeaderView.xib @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneDownCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneDownCell.swift new file mode 100644 index 0000000..72bda50 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneDownCell.swift @@ -0,0 +1,30 @@ +// +// SceneDownCell.swift +// ParentAssistant +// +// Created by Cao yang on 2018/3/24. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class SceneDownCell: UITableViewCell { + + @IBOutlet weak var evaluateLab: UILabel! + @IBOutlet weak var sceneLab: UILabel! + @IBOutlet weak var scoreLab: UILabel! + @IBOutlet weak var nameLab: UILabel! + @IBOutlet weak var classLab: UILabel! + @IBOutlet weak var dateLab: UILabel! + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneMiddleCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneMiddleCell.swift new file mode 100644 index 0000000..4badb2f --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneMiddleCell.swift @@ -0,0 +1,44 @@ +// +// SceneMiddleCell.swift +// ParentAssistant +// +// Created by Cao yang on 2018/3/24. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class SceneMiddleCell: UITableViewCell { + + @IBOutlet weak var lineChartView: UIView! + + var customLineChart = LineChartView() + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + let rect = self.lineChartView.bounds + customLineChart = LineChartView.init(frame: rect) + let customXLabArr = ["03/12","03/13","03/14","03/15","03/16"] + + customLineChart.drawUI(xLableArr:customXLabArr) + + let arr1 = [5,4,5,5,5] + let arr2 = [4,4,2,1,3] + let arr3 = [3,3,4,3,4] + + + customLineChart.drawLine(point: arr1, color: UIColorWithRGB(R: 129, G: 199, B: 132)) + customLineChart.drawLine(point: arr2, color: UIColorWithRGB(R: 92, G: 145, B: 230)) + customLineChart.drawLine(point: arr3, color: UIColorWithRGB(R: 255, G: 213, B: 79)) + + self.lineChartView.addSubview(customLineChart) + + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneTopCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneTopCell.swift new file mode 100644 index 0000000..9c2b82a --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/SceneTopCell.swift @@ -0,0 +1,28 @@ +// +// SceneTopCell.swift +// ParentAssistant +// +// Created by Cao yang on 2018/3/24. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit + +class SceneTopCell: UITableViewCell { + + @IBOutlet weak var scoreLab: UILabel! //得分 + @IBOutlet weak var GPALab: UILabel! //绩点 + @IBOutlet weak var LevelLab: UILabel! //等级 + @IBOutlet weak var SuggestLab: UITextView! //指导意见 + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/TaskPresentationTableViewCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/TaskPresentationTableViewCell.swift new file mode 100644 index 0000000..285f220 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/TaskPresentationTableViewCell.swift @@ -0,0 +1,82 @@ +// +// TaskPresentationTableViewCell.swift +// ParentAssistant +// +// Created by 葛建军 on 2018/3/9. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit +//func degreesToRadians(x:Double) -> CGFloat{ +// return (CGFloat(Double.pi*(x)/180.0)) +//} //把角度转换成PI的方式 +//let PROGREESS_WIDTH = 160 //圆直径 +//let PROGRESS_LINE_WIDTH = 4 //弧线的宽度 +class TaskPresentationTableViewCell: UITableViewCell { + + @IBOutlet var layerLabel: UILabel! + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + //可以画出上面所示的整个轨道。这个圆形是从-210度的角度到30度。 +// let path = UIBezierPath(arcCenter: CGPoint(x: 40, y: 40), radius: CGFloat((PROGREESS_WIDTH-PROGRESS_LINE_WIDTH)/2), startAngle: degreesToRadians(x: -210), endAngle: degreesToRadians(x: 30), clockwise: true) + //画出一个完成的进度的背景轨道 +// let trackLayer = CAShapeLayer()//创建一个track shape layer +// trackLayer.frame = self.layerLabel.bounds +// trackLayer.fillColor = UIColor.clear.cgColor +// trackLayer.strokeColor = UIColor.red.cgColor//指定path的渲染颜色 +// trackLayer.opacity = 0.25 //背景同学你就甘心做背景吧,不要太明显了,透明度小一点 +// trackLayer.lineCap = kCALineCapRound//指定线的边缘是圆的 +// trackLayer.lineWidth = CGFloat(PROGRESS_LINE_WIDTH)//线的宽度 +// trackLayer.path = path.cgPath //把path传递給layer,然后layer会处理相应的渲染,整个逻辑和CoreGraph是一致的。 +// +// self.layerLabel.layer.addSublayer(trackLayer) + //渐变进度条 +// let progressLayer = CAShapeLayer() +// progressLayer.frame = self.layerLabel.bounds +// progressLayer.fillColor = UIColor.clear.cgColor +// progressLayer.strokeColor = UIColor.red.cgColor +// progressLayer.lineCap = kCALineCapRound; +// progressLayer.lineWidth = CGFloat(PROGRESS_LINE_WIDTH) +// progressLayer.path = path.cgPath +// progressLayer.strokeEnd = 50/100.0 //总进度 +// +// let gradientLayer = CALayer() +// let gradientLayer1 = CAGradientLayer() +// gradientLayer1.frame = CGRect(x: 0, y: 0, width: self.layerLabel.frame.size.width/2, height: self.layerLabel.frame.size.height) +// gradientLayer1.colors = [UIColor.yellow.cgColor,UIColor.blue.cgColor] +// gradientLayer1.locations = [0.5,0.9,1] +// gradientLayer1.startPoint = CGPoint(x: 0.5, y: 1) +// gradientLayer1.endPoint = CGPoint(x: 0.5, y: 0) +// gradientLayer.addSublayer(gradientLayer1) +// +// let gradientLayer2 = CAGradientLayer() +// gradientLayer2.frame = CGRect(x: self.layerLabel.frame.size.width/2, y: 0, width: self.layerLabel.frame.size.width/2, height: self.layerLabel.frame.size.height) +// gradientLayer2.colors = [UIColor.blue.cgColor,UIColor.blue.cgColor] +// gradientLayer2.locations = [0.1,0.5,1] +// gradientLayer2.startPoint = CGPoint(x: 0.5, y: 0) +// gradientLayer2.endPoint = CGPoint(x: 0.5, y: 1) +// gradientLayer.addSublayer(gradientLayer2) +// +// gradientLayer.mask = progressLayer//用progressLayer来截取渐变层 +// self.layerLabel.layer.addSublayer(gradientLayer) + } + //进度条效果 CAShapeLayer有一个strokeEnd的属性,这个属性是从0到1的浮点类型,正好可以用表达百分比,而且这个属性是animatable,可以动态的表示进度的变化。 + // -(void)setPercent:(NSInteger)percent animated:(BOOL)animated + // { + // [CATransaction begin]; + // [CATransaction setDisableActions:!animated]; + // [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]]; + // [CATransaction setAnimationDuration:MAIN_SCREEN_ANIMATION_TIME]; + // progressLayer.strokeEnd = percent/100.0; + // [CATransaction commit]; + // + // _percent = percent; + // } + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/MoralViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/MoralViewController.swift deleted file mode 100644 index 6894850..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/MoralViewController.swift +++ /dev/null @@ -1,105 +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 = Array() - 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 - print(backData!) - if error == nil && JSON.fromString(backData)!["status"].intValue == 1 { - -// self.data = SceneEvaluate(j: JSON.fromString(backData)!.contentData()) -// if self.data != nil{ -// 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/report/ReportViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/ReportViewController.swift deleted file mode 100644 index 86a497b..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/ReportViewController.swift +++ /dev/null @@ -1,223 +0,0 @@ -// -// ReportViewController.swift -// ParentAssistant -// -// Created by 葛建军 on 2018/3/5. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class ReportViewController: UIViewController { - var titleView:ReportHeaderView!//navigationBar自定义view - @IBOutlet weak var reportTable: UITableView! - //空白页 - var EmptyView: UIView! - - //膜板 - var keyWindow = UIWindow() - var backBotton = UIButton() - //日历 - var calendar = CalendarView() - -// var dateAry:(weeks:[String],days:[String]) = ([],[]) - - override func viewDidLoad() { - super.viewDidLoad() - - //MARK: - 空白页面 - EmptyView = UIView.init(frame: self.view.bounds) - EmptyView.backgroundColor = UIColor.white - self.EmptyView.isHidden = true - let imageV = UIImageView.init(frame: CGRect.init(x: 0, y: 80, width: screenWidth, height: screenWidth)) - imageV.image = UIImage.init(named: "report_none_icon") - imageV.contentMode = UIViewContentMode.scaleAspectFit - EmptyView.addSubview(imageV) - self.view.addSubview(EmptyView) - let backImage = UIImage(named: "navigationBar_backgrounImage") - self.navigationController?.navigationBar.setBackgroundImage(backImage, for: UIBarMetrics.default) - if self.EmptyView.isHidden { - //设置顶部按钮 - setupNavigationBar() - //设置日期页面 - setupDateView() - } - } - // MARK: - 设置顶部按钮 - func setupNavigationBar(){ - self.configTheme() - setuptitleView() - } - func setuptitleView(){ - - //左按钮 - let leftView = UIButton.init(frame: CGRect.init(x: 0, y: 0, width: 80, height: 44)) - let titleLab = UILabel.init(frame: CGRect.init(x: 0, y: 0, width: 60, height: 44)) - if AccountManager.shared.isOnline() { - if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { - titleLab.text = "未绑定" - }else{ - titleLab.text = AccountManager.shared.rawUserInfo!.contentData()["studentClass"][0]["studentName"].stringValue - } - }else{ - titleLab.text = "未登录" - } - leftView.addSubview(titleLab) - - let imageView = UIImageView.init(frame: CGRect.init(x: 60, y: 11, width: 20, height: 22)) - imageView.image = UIImage.init(named: "report_pull") - imageView.contentMode = .scaleAspectFit - leftView.addSubview(imageView) - - leftView.addTarget(self, action: #selector(showView), for: UIControlEvents.touchDown) - - let leftBtn = UIBarButtonItem.init(customView: leftView) - self.navigationItem.leftBarButtonItem = leftBtn - - //右按钮 - let rightView = UIButton.init(frame: CGRect.init(x: 0, y: 0, width: 80, height: 44)) - let titleRLab = UILabel.init(frame: CGRect.init(x: 0, y: 0, width: 50, height: 44)) - titleRLab.text = "筛选" - titleRLab.textAlignment = .right - rightView.addSubview(titleRLab) - - let imageRView = UIImageView.init(frame: CGRect.init(x: 60, y: 11, width: 20, height: 22)) - imageRView.image = UIImage.init(named: "report_select") - imageRView.contentMode = .scaleAspectFit - rightView.addSubview(imageRView) - - rightView.addTarget(self, action: #selector(showView), for: UIControlEvents.touchDown) - let rightBtn = UIBarButtonItem.init(customView: rightView) - self.navigationItem.rightBarButtonItem = rightBtn - - } - // 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)) - } - - @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 - } - } - - // MARK: - 页面将要显示时替换navigation的titleView - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - } - override func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - } - override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - if titleView != nil { - titleView.frame = CGRect(x: 0, y: 0, width: screenWidth, height: 44) - } - } - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - - -} -// MARK: - 点击顶部titleView按钮的代理方法 -//extension ReportViewController: ReportHeaderViewDelegate{ -// //点击孩子姓名 -// func selectStudentButton() { -// appDelegate.window!.makeToast("该功能暂不开放", duration: 1, position: CSToastPositionCenter) -// return -// //如果家长未绑定孩子 -// if AccountManager.shared.isOnline() { -// if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { -// appDelegate.window!.makeToast("请先绑定孩子", duration: 1, position: CSToastPositionCenter) -// }else{ -// //切换孩子 -// let alert = UIAlertController(title: "切换孩子", message: "", preferredStyle: UIAlertControllerStyle.actionSheet) -// for item in AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue { -// let action = UIAlertAction(title: item["studentName"].stringValue, style: UIAlertActionStyle.default, handler: { (action) in -// //选择完孩子切换数据 -// }) -// alert.addAction(action) -// } -// self.present(alert, animated: true, completion: nil) -// } -// }else{ -// appDelegate.window!.makeToast("请先登录", duration: 1, position: CSToastPositionCenter) -// } -// } -// //点击日期 -// func selectDateButton() { -// -// appDelegate.window!.makeToast("该功能暂不开放", duration: 1, position: CSToastPositionCenter) -// return -// } -// //点击筛选 -// func selectTypeButton() { -// appDelegate.window!.makeToast("该功能暂不开放", duration: 1, position: CSToastPositionCenter) -// return -// } -//} -//// MARK: - 顶部展示日期 -//extension ReportViewController: UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout { -// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { -// return CGSize(width: getScreenWidth()/7, height: getScreenWidth()/7) -// } -// func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { -// return 0 -// } -// -// func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { -// let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ReportDateCollectionViewCell", for: indexPath) as! ReportDateCollectionViewCell -// cell.setupWithDate(week: dateAry.weeks[indexPath.row], date: dateAry.days[indexPath.row]) -// return cell -// } -// -// -//} -// MARK: - 作业报告列表 -extension ReportViewController: UITableViewDelegate,UITableViewDataSource{ - 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: "TaskPresentationTableViewCell", for: indexPath) as! TaskPresentationTableViewCell - return cell - } - } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return 280 - } - -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/SceneDetailViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/SceneDetailViewController.swift deleted file mode 100644 index c2d9fa5..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/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/controllers/report/View/BehaviorDetailCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/BehaviorDetailCell.swift deleted file mode 100644 index 9f8fbae..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/BehaviorDetailCell.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// BehaviorDetailCell.swift -// ParentAssistant -// -// Created by Cao yang on 2018/3/23. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class BehaviorDetailCell: UITableViewCell { - - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/CalendarView.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/CalendarView.swift deleted file mode 100644 index 2192eea..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/CalendarView.swift +++ /dev/null @@ -1,72 +0,0 @@ -// -// CalendarView.swift -// ParentAssistant -// -// Created by Cao yang on 2018/3/27. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class CalendarView: UIView,UICollectionViewDelegate,UICollectionViewDataSource { - - - var weekLab = ["日","一","二","三","四","五","六"] - - override init(frame: CGRect) { - super.init(frame: frame) - self.drawCalendarView(frame: frame) - } - - func drawCalendarView(frame:CGRect) { - //TODO: 数据源待完成 - let dayLab = ["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"] - weekLab.append(contentsOf: dayLab) - //设置layout - let flowlayout = UICollectionViewFlowLayout() - flowlayout.itemSize = CGSize.init(width: screenWidth/7, height:40) - flowlayout.minimumLineSpacing = 0 - flowlayout.minimumInteritemSpacing = 0 - flowlayout.headerReferenceSize = CGSize.init(width: 0, height: 0) - flowlayout.footerReferenceSize = CGSize.init(width: 0, height: 0) - flowlayout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0) - - let calendarView = UICollectionView.init(frame: frame, collectionViewLayout: flowlayout) - calendarView.delegate = self - calendarView.dataSource = self - calendarView.backgroundColor = UIColor.white - calendarView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "calendarCell") - self.addSubview(calendarView) - } - - //MARK: - Delegate - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return weekLab.count - } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "calendarCell", for: indexPath) - let lab = UILabel.init(frame: cell.bounds) - lab.text = weekLab[indexPath.row] - lab.textAlignment = .center - cell.addSubview(lab) - return cell - - } - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - print("点击了 第 \(weekLab[indexPath.row])") - } - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - /* - // Only override draw() if you perform custom drawing. - // An empty implementation adversely affects performance during animation. - override func draw(_ rect: CGRect) { - // Drawing code - } - */ - -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/EducationDetailCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/EducationDetailCell.swift deleted file mode 100644 index 63d24db..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/EducationDetailCell.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// EducationDetailCell.swift -// ParentAssistant -// -// Created by Cao yang on 2018/3/23. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class EducationDetailCell: UITableViewCell { - - @IBOutlet weak var lineChartView: UIView! - - var customLineChart = LineChartView() - - override func awakeFromNib() { - super.awakeFromNib() - let rect = self.lineChartView.bounds - print(rect) - customLineChart = LineChartView.init(frame: rect) - customLineChart.drawUI(xLableArr: nil) - let arr1 = [4,4,2,1,3] - let arr2 = [2,1,4,4,5] - - customLineChart.drawLine(point: arr1, color: UIColorWithRGB(R: 65, G: 105, B: 190)) - customLineChart.drawLine(point: arr2, color: UIColorWithRGB(R: 220, G: 0, B: 16)) - - - - self.lineChartView.addSubview(customLineChart) - - - // Initialization code - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/LineChartView.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/LineChartView.swift deleted file mode 100644 index 18e4d6e..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/LineChartView.swift +++ /dev/null @@ -1,220 +0,0 @@ -// -// LineChartView.swift -// ParentAssistant -// -// Created by Cao yang on 2018/3/23. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class LineChartView: UIView { - - //默认横坐标 - private var xLabArr = ["行为","文明","课堂","作业","礼仪"] - //设置纵坐标 - private let yCount = 6 - //横坐标个数 - private let xCount = 5 - //最大绩点分数 - private let GPA = 5 - //储存横纵坐标,画线用 - private var xCenterArr = Array() - private var yCenterArr = Array() - //判断是否重复点击 - private var btnTouch = 10 - //虚线 - private let lineLayer = CAShapeLayer() - //横坐标下划线 - private let xMoveLayer = CAShapeLayer() - //纵坐标Lab数组 - private var yMoveLaArr = Array() - //折线图数据数组 - private var dateArr = Array>() - //显示的数字 - var yLabArray = Array() - - override init(frame: CGRect) { - super.init(frame: frame) - print("frame==\(frame)") - - } - func drawUI(xLableArr:Array?){ - - if xLableArr != nil { - xLabArr = xLableArr! - } - drawX() - drawY() - } - //设置纵坐标 - private func drawY() { - - let yHeight = (self.bounds.height-60)/CGFloat(yCount) - for index in 0..,color:UIColor){ - - let pointArr = swichPoint(arr: point) - - let drawLayer = DrawLayer() - drawLayer.xPointArr = xCenterArr - drawLayer.yPointArr = [yCenterArr[pointArr[0]],yCenterArr[pointArr[1]],yCenterArr[pointArr[2]],yCenterArr[pointArr[3]],yCenterArr[pointArr[4]]] - drawLayer.bounds = self.bounds - drawLayer.position = self.center - drawLayer.lineColor = color - self.layer.addSublayer(drawLayer) - drawLayer.setNeedsDisplay() - - dateArr.append(point) - - } - //MARK: - 点击横坐标 - @objc func touchXAction(tap:UIButton){ - - let index = tap.tag - - - if btnTouch != index { - - //竖虚线 - lineLayer.strokeColor = UIColorWithRGB(R: 92, G: 145, B: 230).cgColor - lineLayer.lineWidth = 1 - let arr = [5,5] - lineLayer.lineDashPhase = 0 - lineLayer.lineDashPattern = arr as [NSNumber] - self.layer.addSublayer(lineLayer) - - //X轴下划线 - let movePath = CGMutablePath() - movePath.move(to: CGPoint.init(x: xCenterArr[index], y: yCenterArr[0])) - movePath.addLine(to: CGPoint.init(x: xCenterArr[index], y: 10+5*(self.bounds.height-60)/CGFloat(yCount))) - lineLayer.path = movePath - - xMoveLayer.strokeColor = UIColorWithRGB(R: 92, G: 145, B: 230).cgColor - xMoveLayer.lineWidth = 2 - self.layer.addSublayer(xMoveLayer) - let movePath2 = CGMutablePath() - movePath2.move(to: CGPoint.init(x: xCenterArr[index]-15, y: self.bounds.height-45)) - movePath2.addLine(to: CGPoint.init(x: xCenterArr[index]+15, y: self.bounds.height-45)) - xMoveLayer.path = movePath2 - - if yLabArray.count == dateArr.count { - for label in yLabArray { - label.removeFromSuperview() - } - } - yLabArray.removeAll() - //数字显示 - for i in 0..)->Array{ - var array = Array() - for index in 0..() - var xPointArr = Array() - var lineColor = UIColor() - - override func draw(in ctx: CGContext) { - - let context = ctx - //点 - context.setFillColor(lineColor.cgColor) - - for i in 0.. ReportHeaderView { - return Bundle.main.loadNibNamed("ReportHeaderView", owner: nil, options: nil)?.first as! ReportHeaderView - } -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib deleted file mode 100644 index 12143ee..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/ReportHeaderView.xib +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneDownCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneDownCell.swift deleted file mode 100644 index 72bda50..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneDownCell.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// SceneDownCell.swift -// ParentAssistant -// -// Created by Cao yang on 2018/3/24. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class SceneDownCell: UITableViewCell { - - @IBOutlet weak var evaluateLab: UILabel! - @IBOutlet weak var sceneLab: UILabel! - @IBOutlet weak var scoreLab: UILabel! - @IBOutlet weak var nameLab: UILabel! - @IBOutlet weak var classLab: UILabel! - @IBOutlet weak var dateLab: UILabel! - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneMiddleCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneMiddleCell.swift deleted file mode 100644 index 4badb2f..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneMiddleCell.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// SceneMiddleCell.swift -// ParentAssistant -// -// Created by Cao yang on 2018/3/24. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class SceneMiddleCell: UITableViewCell { - - @IBOutlet weak var lineChartView: UIView! - - var customLineChart = LineChartView() - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - let rect = self.lineChartView.bounds - customLineChart = LineChartView.init(frame: rect) - let customXLabArr = ["03/12","03/13","03/14","03/15","03/16"] - - customLineChart.drawUI(xLableArr:customXLabArr) - - let arr1 = [5,4,5,5,5] - let arr2 = [4,4,2,1,3] - let arr3 = [3,3,4,3,4] - - - customLineChart.drawLine(point: arr1, color: UIColorWithRGB(R: 129, G: 199, B: 132)) - customLineChart.drawLine(point: arr2, color: UIColorWithRGB(R: 92, G: 145, B: 230)) - customLineChart.drawLine(point: arr3, color: UIColorWithRGB(R: 255, G: 213, B: 79)) - - self.lineChartView.addSubview(customLineChart) - - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneTopCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneTopCell.swift deleted file mode 100644 index 9c2b82a..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/SceneTopCell.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// SceneTopCell.swift -// ParentAssistant -// -// Created by Cao yang on 2018/3/24. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit - -class SceneTopCell: UITableViewCell { - - @IBOutlet weak var scoreLab: UILabel! //得分 - @IBOutlet weak var GPALab: UILabel! //绩点 - @IBOutlet weak var LevelLab: UILabel! //等级 - @IBOutlet weak var SuggestLab: UITextView! //指导意见 - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - -} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/TaskPresentationTableViewCell.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/View/TaskPresentationTableViewCell.swift deleted file mode 100644 index 285f220..0000000 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/View/TaskPresentationTableViewCell.swift +++ /dev/null @@ -1,82 +0,0 @@ -// -// TaskPresentationTableViewCell.swift -// ParentAssistant -// -// Created by 葛建军 on 2018/3/9. -// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. -// - -import UIKit -//func degreesToRadians(x:Double) -> CGFloat{ -// return (CGFloat(Double.pi*(x)/180.0)) -//} //把角度转换成PI的方式 -//let PROGREESS_WIDTH = 160 //圆直径 -//let PROGRESS_LINE_WIDTH = 4 //弧线的宽度 -class TaskPresentationTableViewCell: UITableViewCell { - - @IBOutlet var layerLabel: UILabel! - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - //可以画出上面所示的整个轨道。这个圆形是从-210度的角度到30度。 -// let path = UIBezierPath(arcCenter: CGPoint(x: 40, y: 40), radius: CGFloat((PROGREESS_WIDTH-PROGRESS_LINE_WIDTH)/2), startAngle: degreesToRadians(x: -210), endAngle: degreesToRadians(x: 30), clockwise: true) - //画出一个完成的进度的背景轨道 -// let trackLayer = CAShapeLayer()//创建一个track shape layer -// trackLayer.frame = self.layerLabel.bounds -// trackLayer.fillColor = UIColor.clear.cgColor -// trackLayer.strokeColor = UIColor.red.cgColor//指定path的渲染颜色 -// trackLayer.opacity = 0.25 //背景同学你就甘心做背景吧,不要太明显了,透明度小一点 -// trackLayer.lineCap = kCALineCapRound//指定线的边缘是圆的 -// trackLayer.lineWidth = CGFloat(PROGRESS_LINE_WIDTH)//线的宽度 -// trackLayer.path = path.cgPath //把path传递給layer,然后layer会处理相应的渲染,整个逻辑和CoreGraph是一致的。 -// -// self.layerLabel.layer.addSublayer(trackLayer) - //渐变进度条 -// let progressLayer = CAShapeLayer() -// progressLayer.frame = self.layerLabel.bounds -// progressLayer.fillColor = UIColor.clear.cgColor -// progressLayer.strokeColor = UIColor.red.cgColor -// progressLayer.lineCap = kCALineCapRound; -// progressLayer.lineWidth = CGFloat(PROGRESS_LINE_WIDTH) -// progressLayer.path = path.cgPath -// progressLayer.strokeEnd = 50/100.0 //总进度 -// -// let gradientLayer = CALayer() -// let gradientLayer1 = CAGradientLayer() -// gradientLayer1.frame = CGRect(x: 0, y: 0, width: self.layerLabel.frame.size.width/2, height: self.layerLabel.frame.size.height) -// gradientLayer1.colors = [UIColor.yellow.cgColor,UIColor.blue.cgColor] -// gradientLayer1.locations = [0.5,0.9,1] -// gradientLayer1.startPoint = CGPoint(x: 0.5, y: 1) -// gradientLayer1.endPoint = CGPoint(x: 0.5, y: 0) -// gradientLayer.addSublayer(gradientLayer1) -// -// let gradientLayer2 = CAGradientLayer() -// gradientLayer2.frame = CGRect(x: self.layerLabel.frame.size.width/2, y: 0, width: self.layerLabel.frame.size.width/2, height: self.layerLabel.frame.size.height) -// gradientLayer2.colors = [UIColor.blue.cgColor,UIColor.blue.cgColor] -// gradientLayer2.locations = [0.1,0.5,1] -// gradientLayer2.startPoint = CGPoint(x: 0.5, y: 0) -// gradientLayer2.endPoint = CGPoint(x: 0.5, y: 1) -// gradientLayer.addSublayer(gradientLayer2) -// -// gradientLayer.mask = progressLayer//用progressLayer来截取渐变层 -// self.layerLabel.layer.addSublayer(gradientLayer) - } - //进度条效果 CAShapeLayer有一个strokeEnd的属性,这个属性是从0到1的浮点类型,正好可以用表达百分比,而且这个属性是animatable,可以动态的表示进度的变化。 - // -(void)setPercent:(NSInteger)percent animated:(BOOL)animated - // { - // [CATransaction begin]; - // [CATransaction setDisableActions:!animated]; - // [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]]; - // [CATransaction setAnimationDuration:MAIN_SCREEN_ANIMATION_TIME]; - // progressLayer.strokeEnd = percent/100.0; - // [CATransaction commit]; - // - // _percent = percent; - // } - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - -} diff --git a/ParentAssistant/ParentAssistant/Classes/util/Macro.swift b/ParentAssistant/ParentAssistant/Classes/util/Macro.swift index a39067d..2d21211 100644 --- a/ParentAssistant/ParentAssistant/Classes/util/Macro.swift +++ b/ParentAssistant/ParentAssistant/Classes/util/Macro.swift @@ -72,7 +72,7 @@ let URL_PARENTSERVICE_GETADS="/api/ParentService/GetAds" //获取广告位 //MARK: 量规评价 /// 德育报告整体详情 -let URL_POST_EVALUATION_ANALYSIS = "/api/EvaluationLabel/GetStatisticalAnalysis" +let URL_POST_EVALUATION_ANALYSIS = "/api/EvaluationLabel/Getstatisticsanalytical" /// 德育报告场景详情 let URL_POST_EVALUATION_ANALYSIS_DETAILS = "/api/EvaluationLabel/GetSceneAnalysisDetails" diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard b/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard index 0facf36..692b997 100644 --- a/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard +++ b/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard @@ -527,16 +527,34 @@ + + + + + + + + + + + + + + + + + + - + - + @@ -769,14 +787,14 @@ - + - + @@ -787,7 +805,7 @@ - + @@ -1089,7 +1107,7 @@ - + @@ -1442,7 +1460,7 @@ - + @@ -1982,11 +2000,11 @@ - + - + @@ -1997,7 +2015,7 @@ - + -- libgit2 0.21.0