diff --git a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate index de86e90..03cbb7f 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/report/ReportViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/report/ReportViewController.swift index 14d86df..7ef33ce 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/report/ReportViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/report/ReportViewController.swift @@ -47,30 +47,54 @@ class ReportViewController: UIViewController { self.navigationController?.navigationBar.barStyle = UIBarStyle.default// UIColorFromRGB(0xC5DAFF) let backImage = UIImage(named: "navigationBar_backgrounImage") self.navigationController?.navigationBar.setBackgroundImage(backImage, for: UIBarMetrics.default) + self.configTheme() -// self.navigationItem.title = "报告" + 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) -// // MARK: - 设置顶部的titleView -// titleView = Bundle.main.loadNibNamed("ReportHeaderView", owner: nil, options: nil)![0] as! ReportHeaderView -//// titleView.delegate = self -// titleView.frame = CGRect(x: 0, y: 0, width: screenWidth, height: 44) -// self.navigationItem.titleView = titleView -// titleView.layoutSubviews() -// //navigation左上角显示名称 家长未绑定孩子 -// if AccountManager.shared.isOnline() { -// if AccountManager.shared.rawUserInfo!.contentData()["studentClass"].arrayValue.count == 0 { -// titleView.nameButton.setTitle("未绑定", for: UIControlState.normal) -// }else{ -// titleView.nameButton.setTitle(AccountManager.shared.rawUserInfo!.contentData()["studentClass"][0]["studentName"].stringValue, for: UIControlState.normal) -// } -// }else{ -// titleView.nameButton.setTitle("未登录", for: UIControlState.normal) -// } + 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(){ diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_pull.imageset/Contents.json b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_pull.imageset/Contents.json new file mode 100644 index 0000000..d2e6eb3 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_pull.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "report_pull@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_pull.imageset/report_pull@2x.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_pull.imageset/report_pull@2x.png new file mode 100644 index 0000000..389ec3a Binary files /dev/null and b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_pull.imageset/report_pull@2x.png differ diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_select.imageset/Contents.json b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_select.imageset/Contents.json new file mode 100644 index 0000000..415354b --- /dev/null +++ b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_select.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "report_select@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_select.imageset/report_select@2x.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_select.imageset/report_select@2x.png new file mode 100644 index 0000000..29528ca Binary files /dev/null and b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/report_select.imageset/report_select@2x.png differ diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard b/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard index 45e6bc0..20a0b05 100644 --- a/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard +++ b/ParentAssistant/ParentAssistant/Supporting Files/Base.lproj/Main.storyboard @@ -2030,7 +2030,7 @@ - + -- libgit2 0.21.0