From ecf1f11c1a2c3aaaf497c64419d0f240b742f710 Mon Sep 17 00:00:00 2001 From: Cao yang Date: Tue, 10 Apr 2018 16:57:14 +0800 Subject: [PATCH] 添加图片 --- ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist | 2 +- ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate | Bin 165163 -> 0 bytes ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift | 11 ++++++++--- ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/Contents.json | 21 +++++++++++++++++++++ ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/program_card@2x.png | Bin 0 -> 1236 bytes ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/Contents.json | 21 +++++++++++++++++++++ ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/program_check@2x.png | Bin 0 -> 1380 bytes ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/Contents.json | 21 +++++++++++++++++++++ ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/program_levave@2x.png | Bin 0 -> 2542 bytes ParentAssistant/Pods/Pods.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist | 2 +- 11 files changed, 128 insertions(+), 9 deletions(-) create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/Contents.json create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/program_card@2x.png create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/Contents.json create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/program_check@2x.png create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/Contents.json create mode 100644 ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/program_levave@2x.png diff --git a/ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist b/ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist index d073d4a..51a860c 100644 --- a/ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ ParentAssistant.xcscheme orderHint - 1 + 0 diff --git a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate index 1a723c1..b0ebeb9 100644 Binary files a/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate and b/ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift index 7ba31b0..696c98b 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift @@ -41,6 +41,8 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { lineLay.backgroundColor = UIColor.blue.cgColor return lineLay }() + //是否显示右侧按钮 + var rightBtn = UIBarButtonItem() override func viewDidLoad() { super.viewDidLoad() @@ -92,8 +94,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { rightView.addSubview(imageRView) // rightView.addTarget(self, action: #selector(showView), for: UIControlEvents.touchDown) - let rightBtn = UIBarButtonItem.init(customView: rightView) - self.navigationItem.rightBarButtonItem = rightBtn + self.rightBtn = UIBarButtonItem.init(customView: rightView) //设置顶部样式 self.configTheme() @@ -179,6 +180,11 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { contentScrollView.setContentOffset(CGPoint.init(x: index*getScreenWidth(), y: 0), animated: true) } } + if btn.tag == 0 { + self.navigationItem.rightBarButtonItem = nil + }else if index == 1 { + self.navigationItem.rightBarButtonItem = rightBtn + } } //MARK: - ScrollView Delegate func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { @@ -189,7 +195,6 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { let btn = titleBtnArr[index] clickTitleAction(btn: btn) - } } diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift index ab91508..18d4ba1 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift @@ -11,24 +11,66 @@ import UIKit class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { lazy var tableView = {()->UITableView in - let table = UITableView.init(frame: CGRect.init(x: 15, y: 15, width: screenWidth-30, height: screenHeight-navigationBarHeight!-(self.tabBarController?.tabBar.frame.height)!-statusBarHeight-30)) + let table = UITableView.init(frame: CGRect.init(x: 10, y: 10, width: screenWidth-20, height: screenHeight-navigationBarHeight!-(self.tabBarController?.tabBar.frame.height)!-statusBarHeight-20)) table.backgroundColor = UIColor.white table.delegate = self table.dataSource = self + table.tableFooterView = UIView.init() return table }() //Data var tableData = Array() + var titleImage = Array() override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = backGroundColor - self.view.addSubview(self.tableView) - self.tableData = ["考勤","补卡","请假"] + let isCheck = true + + if isCheck { + self.view.addSubview(self.tableView) + }else{ + drawEmptyView() + } + self.tableData = ["考勤","补卡","请假"] + self.titleImage = ["program_check","program_card","program_leave"] // Do any additional setup after loading the view. } + func drawEmptyView () { + + let emptyView = UIView.init(frame: self.view.bounds) + emptyView.backgroundColor = backGroundColor + + let label1 = UILabel.init(frame: CGRect.init(x: 0, y: 50, width: screenWidth, height: 30)) + label1.text = "如需使用该模块,请前往" + label1.textAlignment = .center + + let label2 = UILabel.init(frame: CGRect.init(x: 0, y: 80, width: screenWidth, height: 30)) + label2.text = "个人中心-我的孩子" + label2.textAlignment = .center + label2.textColor = UIColor.blue + + let tapGest = UITapGestureRecognizer.init(target: self, action: #selector(gotoChildView)) + label2.isUserInteractionEnabled = true + label2.addGestureRecognizer(tapGest) + + let label3 = UILabel.init(frame: CGRect.init(x: 0, y: 110, width: screenWidth, height: 30)) + label3.textAlignment = .center + label3.text = "绑定孩子账号" + + emptyView.addSubview(label1) + emptyView.addSubview(label2) + emptyView.addSubview(label3) + + self.view.addSubview(emptyView) + + } + @objc func gotoChildView () { + print("去个人中心页面-我的孩子!") + } + //MARK: - UITableView Delegate & DataSource func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { @@ -49,10 +91,19 @@ class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDat } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = UITableViewCell.init() + cell.selectionStyle = .none cell.textLabel?.text = self.tableData[indexPath.row] - cell.imageView?.image = UIImage.init(named: "my_icon_about") + cell.imageView?.image = UIImage.init(named: self.titleImage[indexPath.row]) return cell } + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return 60 + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + + + } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/Contents.json b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/Contents.json new file mode 100644 index 0000000..3f3a192 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "program_card@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/program_card.imageset/program_card@2x.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/program_card@2x.png new file mode 100644 index 0000000..92d65d6 Binary files /dev/null and b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/program_card@2x.png differ diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/Contents.json b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/Contents.json new file mode 100644 index 0000000..cfd3569 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "program_check@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/program_check.imageset/program_check@2x.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/program_check@2x.png new file mode 100644 index 0000000..f42e9bc Binary files /dev/null and b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/program_check@2x.png differ diff --git a/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/Contents.json b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/Contents.json new file mode 100644 index 0000000..b547f37 --- /dev/null +++ b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "program_levave@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/program_leave.imageset/program_levave@2x.png b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/program_levave@2x.png new file mode 100644 index 0000000..3976b06 Binary files /dev/null and b/ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/program_levave@2x.png differ diff --git a/ParentAssistant/Pods/Pods.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist b/ParentAssistant/Pods/Pods.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist index 1e7f9aa..d1b4da5 100644 --- a/ParentAssistant/Pods/Pods.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/ParentAssistant/Pods/Pods.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ Alamofire.xcscheme orderHint - 0 + 1 DZNEmptyDataSet.xcscheme -- libgit2 0.21.0