Commit ecf1f11c1a2c3aaaf497c64419d0f240b742f710
1 parent
59a2bac0
Exists in
parentassistant
添加图片
Showing
11 changed files
with
128 additions
and
9 deletions
Show diff stats
ParentAssistant/ParentAssistant.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist
ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift
@@ -41,6 +41,8 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -41,6 +41,8 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
41 | lineLay.backgroundColor = UIColor.blue.cgColor | 41 | lineLay.backgroundColor = UIColor.blue.cgColor |
42 | return lineLay | 42 | return lineLay |
43 | }() | 43 | }() |
44 | + //是否显示右侧按钮 | ||
45 | + var rightBtn = UIBarButtonItem() | ||
44 | 46 | ||
45 | override func viewDidLoad() { | 47 | override func viewDidLoad() { |
46 | super.viewDidLoad() | 48 | super.viewDidLoad() |
@@ -92,8 +94,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -92,8 +94,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
92 | rightView.addSubview(imageRView) | 94 | rightView.addSubview(imageRView) |
93 | 95 | ||
94 | // rightView.addTarget(self, action: #selector(showView), for: UIControlEvents.touchDown) | 96 | // rightView.addTarget(self, action: #selector(showView), for: UIControlEvents.touchDown) |
95 | - let rightBtn = UIBarButtonItem.init(customView: rightView) | ||
96 | - self.navigationItem.rightBarButtonItem = rightBtn | 97 | + self.rightBtn = UIBarButtonItem.init(customView: rightView) |
97 | 98 | ||
98 | //设置顶部样式 | 99 | //设置顶部样式 |
99 | self.configTheme() | 100 | self.configTheme() |
@@ -179,6 +180,11 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -179,6 +180,11 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
179 | contentScrollView.setContentOffset(CGPoint.init(x: index*getScreenWidth(), y: 0), animated: true) | 180 | contentScrollView.setContentOffset(CGPoint.init(x: index*getScreenWidth(), y: 0), animated: true) |
180 | } | 181 | } |
181 | } | 182 | } |
183 | + if btn.tag == 0 { | ||
184 | + self.navigationItem.rightBarButtonItem = nil | ||
185 | + }else if index == 1 { | ||
186 | + self.navigationItem.rightBarButtonItem = rightBtn | ||
187 | + } | ||
182 | } | 188 | } |
183 | //MARK: - ScrollView Delegate | 189 | //MARK: - ScrollView Delegate |
184 | func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { | 190 | func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { |
@@ -189,7 +195,6 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | @@ -189,7 +195,6 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { | ||
189 | let btn = titleBtnArr[index] | 195 | let btn = titleBtnArr[index] |
190 | 196 | ||
191 | clickTitleAction(btn: btn) | 197 | clickTitleAction(btn: btn) |
192 | - | ||
193 | } | 198 | } |
194 | } | 199 | } |
195 | 200 |
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Program/ProgramViewController.swift
@@ -11,24 +11,66 @@ import UIKit | @@ -11,24 +11,66 @@ import UIKit | ||
11 | class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { | 11 | class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { |
12 | 12 | ||
13 | lazy var tableView = {()->UITableView in | 13 | lazy var tableView = {()->UITableView in |
14 | - let table = UITableView.init(frame: CGRect.init(x: 15, y: 15, width: screenWidth-30, height: screenHeight-navigationBarHeight!-(self.tabBarController?.tabBar.frame.height)!-statusBarHeight-30)) | 14 | + let table = UITableView.init(frame: CGRect.init(x: 10, y: 10, width: screenWidth-20, height: screenHeight-navigationBarHeight!-(self.tabBarController?.tabBar.frame.height)!-statusBarHeight-20)) |
15 | table.backgroundColor = UIColor.white | 15 | table.backgroundColor = UIColor.white |
16 | table.delegate = self | 16 | table.delegate = self |
17 | table.dataSource = self | 17 | table.dataSource = self |
18 | + table.tableFooterView = UIView.init() | ||
18 | return table | 19 | return table |
19 | }() | 20 | }() |
20 | //Data | 21 | //Data |
21 | var tableData = Array<String>() | 22 | var tableData = Array<String>() |
23 | + var titleImage = Array<String>() | ||
22 | 24 | ||
23 | override func viewDidLoad() { | 25 | override func viewDidLoad() { |
24 | super.viewDidLoad() | 26 | super.viewDidLoad() |
25 | self.view.backgroundColor = backGroundColor | 27 | self.view.backgroundColor = backGroundColor |
26 | - self.view.addSubview(self.tableView) | ||
27 | - self.tableData = ["考勤","补卡","请假"] | ||
28 | 28 | ||
29 | + let isCheck = true | ||
30 | + | ||
31 | + if isCheck { | ||
32 | + self.view.addSubview(self.tableView) | ||
33 | + }else{ | ||
34 | + drawEmptyView() | ||
35 | + } | ||
36 | + self.tableData = ["考勤","补卡","请假"] | ||
37 | + self.titleImage = ["program_check","program_card","program_leave"] | ||
29 | // Do any additional setup after loading the view. | 38 | // Do any additional setup after loading the view. |
30 | } | 39 | } |
31 | 40 | ||
41 | + func drawEmptyView () { | ||
42 | + | ||
43 | + let emptyView = UIView.init(frame: self.view.bounds) | ||
44 | + emptyView.backgroundColor = backGroundColor | ||
45 | + | ||
46 | + let label1 = UILabel.init(frame: CGRect.init(x: 0, y: 50, width: screenWidth, height: 30)) | ||
47 | + label1.text = "如需使用该模块,请前往" | ||
48 | + label1.textAlignment = .center | ||
49 | + | ||
50 | + let label2 = UILabel.init(frame: CGRect.init(x: 0, y: 80, width: screenWidth, height: 30)) | ||
51 | + label2.text = "个人中心-我的孩子" | ||
52 | + label2.textAlignment = .center | ||
53 | + label2.textColor = UIColor.blue | ||
54 | + | ||
55 | + let tapGest = UITapGestureRecognizer.init(target: self, action: #selector(gotoChildView)) | ||
56 | + label2.isUserInteractionEnabled = true | ||
57 | + label2.addGestureRecognizer(tapGest) | ||
58 | + | ||
59 | + let label3 = UILabel.init(frame: CGRect.init(x: 0, y: 110, width: screenWidth, height: 30)) | ||
60 | + label3.textAlignment = .center | ||
61 | + label3.text = "绑定孩子账号" | ||
62 | + | ||
63 | + emptyView.addSubview(label1) | ||
64 | + emptyView.addSubview(label2) | ||
65 | + emptyView.addSubview(label3) | ||
66 | + | ||
67 | + self.view.addSubview(emptyView) | ||
68 | + | ||
69 | + } | ||
70 | + @objc func gotoChildView () { | ||
71 | + print("去个人中心页面-我的孩子!") | ||
72 | + } | ||
73 | + | ||
32 | 74 | ||
33 | //MARK: - UITableView Delegate & DataSource | 75 | //MARK: - UITableView Delegate & DataSource |
34 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | 76 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
@@ -49,10 +91,19 @@ class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDat | @@ -49,10 +91,19 @@ class ProgramViewController: UIViewController,UITableViewDelegate,UITableViewDat | ||
49 | } | 91 | } |
50 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | 92 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
51 | let cell = UITableViewCell.init() | 93 | let cell = UITableViewCell.init() |
94 | + cell.selectionStyle = .none | ||
52 | cell.textLabel?.text = self.tableData[indexPath.row] | 95 | cell.textLabel?.text = self.tableData[indexPath.row] |
53 | - cell.imageView?.image = UIImage.init(named: "my_icon_about") | 96 | + cell.imageView?.image = UIImage.init(named: self.titleImage[indexPath.row]) |
54 | return cell | 97 | return cell |
55 | } | 98 | } |
99 | + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | ||
100 | + return 60 | ||
101 | + } | ||
102 | + | ||
103 | + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | ||
104 | + | ||
105 | + | ||
106 | + } | ||
56 | 107 | ||
57 | override func didReceiveMemoryWarning() { | 108 | override func didReceiveMemoryWarning() { |
58 | super.didReceiveMemoryWarning() | 109 | super.didReceiveMemoryWarning() |
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/Contents.json
0 → 100644
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +{ | ||
2 | + "images" : [ | ||
3 | + { | ||
4 | + "idiom" : "universal", | ||
5 | + "scale" : "1x" | ||
6 | + }, | ||
7 | + { | ||
8 | + "idiom" : "universal", | ||
9 | + "filename" : "program_card@2x.png", | ||
10 | + "scale" : "2x" | ||
11 | + }, | ||
12 | + { | ||
13 | + "idiom" : "universal", | ||
14 | + "scale" : "3x" | ||
15 | + } | ||
16 | + ], | ||
17 | + "info" : { | ||
18 | + "version" : 1, | ||
19 | + "author" : "xcode" | ||
20 | + } | ||
21 | +} | ||
0 | \ No newline at end of file | 22 | \ No newline at end of file |
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_card.imageset/program_card@2x.png
0 → 100644
1.21 KB
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/Contents.json
0 → 100644
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +{ | ||
2 | + "images" : [ | ||
3 | + { | ||
4 | + "idiom" : "universal", | ||
5 | + "scale" : "1x" | ||
6 | + }, | ||
7 | + { | ||
8 | + "idiom" : "universal", | ||
9 | + "filename" : "program_check@2x.png", | ||
10 | + "scale" : "2x" | ||
11 | + }, | ||
12 | + { | ||
13 | + "idiom" : "universal", | ||
14 | + "scale" : "3x" | ||
15 | + } | ||
16 | + ], | ||
17 | + "info" : { | ||
18 | + "version" : 1, | ||
19 | + "author" : "xcode" | ||
20 | + } | ||
21 | +} | ||
0 | \ No newline at end of file | 22 | \ No newline at end of file |
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_check.imageset/program_check@2x.png
0 → 100644
1.35 KB
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/Contents.json
0 → 100644
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +{ | ||
2 | + "images" : [ | ||
3 | + { | ||
4 | + "idiom" : "universal", | ||
5 | + "scale" : "1x" | ||
6 | + }, | ||
7 | + { | ||
8 | + "idiom" : "universal", | ||
9 | + "filename" : "program_levave@2x.png", | ||
10 | + "scale" : "2x" | ||
11 | + }, | ||
12 | + { | ||
13 | + "idiom" : "universal", | ||
14 | + "scale" : "3x" | ||
15 | + } | ||
16 | + ], | ||
17 | + "info" : { | ||
18 | + "version" : 1, | ||
19 | + "author" : "xcode" | ||
20 | + } | ||
21 | +} | ||
0 | \ No newline at end of file | 22 | \ No newline at end of file |
ParentAssistant/ParentAssistant/Supporting Files/Assets.xcassets/report/program_leave.imageset/program_levave@2x.png
0 → 100644
2.48 KB
ParentAssistant/Pods/Pods.xcodeproj/xcuserdata/caoyang.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <key>Alamofire.xcscheme</key> | 7 | <key>Alamofire.xcscheme</key> |
8 | <dict> | 8 | <dict> |
9 | <key>orderHint</key> | 9 | <key>orderHint</key> |
10 | - <integer>0</integer> | 10 | + <integer>1</integer> |
11 | </dict> | 11 | </dict> |
12 | <key>DZNEmptyDataSet.xcscheme</key> | 12 | <key>DZNEmptyDataSet.xcscheme</key> |
13 | <dict> | 13 | <dict> |