Commit 965ec28b authored by admin's avatar admin

修改主页布局

parent c285d9ac
...@@ -33,6 +33,11 @@ ...@@ -33,6 +33,11 @@
8487D7721BF19A9C00E63E90 /* SearchToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 8487D7711BF19A9C00E63E90 /* SearchToolBar.m */; }; 8487D7721BF19A9C00E63E90 /* SearchToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 8487D7711BF19A9C00E63E90 /* SearchToolBar.m */; };
8487D8091BF20FAD00E63E90 /* TaxisView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8487D8081BF20FAD00E63E90 /* TaxisView.m */; }; 8487D8091BF20FAD00E63E90 /* TaxisView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8487D8081BF20FAD00E63E90 /* TaxisView.m */; };
8487D80C1BF218F900E63E90 /* MenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8487D80B1BF218F900E63E90 /* MenuView.m */; }; 8487D80C1BF218F900E63E90 /* MenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8487D80B1BF218F900E63E90 /* MenuView.m */; };
8490C4C31BF9A394006B6569 /* CustomPageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4C21BF9A394006B6569 /* CustomPageControl.m */; };
8490C4C61BF9CE85006B6569 /* HomeTitleTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4C51BF9CE85006B6569 /* HomeTitleTableCell.m */; };
8490C4D31BF9DEF0006B6569 /* PictureTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4CE1BF9DEF0006B6569 /* PictureTableCell.m */; };
8490C4D41BF9DEF0006B6569 /* PictureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4D21BF9DEF0006B6569 /* PictureViewController.m */; };
8490C4D71BF9DF1D006B6569 /* PictureStoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4D61BF9DF1D006B6569 /* PictureStoryViewController.m */; };
84970DEF1BD8DD8A00C1728A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970DEE1BD8DD8A00C1728A /* main.m */; }; 84970DEF1BD8DD8A00C1728A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970DEE1BD8DD8A00C1728A /* main.m */; };
84970DFA1BD8DD8A00C1728A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84970DF91BD8DD8A00C1728A /* Assets.xcassets */; }; 84970DFA1BD8DD8A00C1728A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84970DF91BD8DD8A00C1728A /* Assets.xcassets */; };
84970DFD1BD8DD8A00C1728A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84970DFB1BD8DD8A00C1728A /* LaunchScreen.storyboard */; }; 84970DFD1BD8DD8A00C1728A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84970DFB1BD8DD8A00C1728A /* LaunchScreen.storyboard */; };
...@@ -41,8 +46,6 @@ ...@@ -41,8 +46,6 @@
84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E231BD8DEFE00C1728A /* AppDelegate.m */; }; 84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E231BD8DEFE00C1728A /* AppDelegate.m */; };
84970E361BD8E09D00C1728A /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E351BD8E09D00C1728A /* LoginViewController.m */; }; 84970E361BD8E09D00C1728A /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E351BD8E09D00C1728A /* LoginViewController.m */; };
84970E391BD8E0B300C1728A /* LoginView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E381BD8E0B300C1728A /* LoginView.m */; }; 84970E391BD8E0B300C1728A /* LoginView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E381BD8E0B300C1728A /* LoginView.m */; };
84AB20A51BE648EC00B66F13 /* PictureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AB20A41BE648EC00B66F13 /* PictureViewController.m */; };
84AB20A91BE64DC600B66F13 /* PictureTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AB20A81BE64DC600B66F13 /* PictureTableCell.m */; };
84AD4F201BF425AC00BFB37C /* InspectDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F1F1BF425AC00BFB37C /* InspectDetailView.m */; }; 84AD4F201BF425AC00BFB37C /* InspectDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F1F1BF425AC00BFB37C /* InspectDetailView.m */; };
84AD4F221BF42F8E00BFB37C /* classfiy.plist in Resources */ = {isa = PBXBuildFile; fileRef = 84AD4F211BF42F8E00BFB37C /* classfiy.plist */; }; 84AD4F221BF42F8E00BFB37C /* classfiy.plist in Resources */ = {isa = PBXBuildFile; fileRef = 84AD4F211BF42F8E00BFB37C /* classfiy.plist */; };
84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F251BF4356A00BFB37C /* TaskModel.m */; }; 84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F251BF4356A00BFB37C /* TaskModel.m */; };
...@@ -56,7 +59,6 @@ ...@@ -56,7 +59,6 @@
84AD4F431BF4A66F00BFB37C /* WorkModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F421BF4A66F00BFB37C /* WorkModel.m */; }; 84AD4F431BF4A66F00BFB37C /* WorkModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F421BF4A66F00BFB37C /* WorkModel.m */; };
84AD4F461BF4A9E800BFB37C /* RankHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F451BF4A9E800BFB37C /* RankHeadView.m */; }; 84AD4F461BF4A9E800BFB37C /* RankHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F451BF4A9E800BFB37C /* RankHeadView.m */; };
84AD4F491BF4BC0600BFB37C /* RankDetailTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F481BF4BC0600BFB37C /* RankDetailTableCell.m */; }; 84AD4F491BF4BC0600BFB37C /* RankDetailTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F481BF4BC0600BFB37C /* RankDetailTableCell.m */; };
84C582EC1BDDFB0400AF838D /* HomeFunctionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C582EB1BDDFB0400AF838D /* HomeFunctionCell.m */; };
84C9574D1BDB344900083584 /* UIBarButtonItem+Create.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C9574A1BDB344900083584 /* UIBarButtonItem+Create.m */; }; 84C9574D1BDB344900083584 /* UIBarButtonItem+Create.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C9574A1BDB344900083584 /* UIBarButtonItem+Create.m */; };
84C9574E1BDB344900083584 /* UIView+Frame.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C9574C1BDB344900083584 /* UIView+Frame.m */; }; 84C9574E1BDB344900083584 /* UIView+Frame.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C9574C1BDB344900083584 /* UIView+Frame.m */; };
84C957551BDB54D600083584 /* AnnounceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C957541BDB54D600083584 /* AnnounceViewController.m */; }; 84C957551BDB54D600083584 /* AnnounceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C957541BDB54D600083584 /* AnnounceViewController.m */; };
...@@ -68,7 +70,6 @@ ...@@ -68,7 +70,6 @@
84D80EB61BF714BE00A10EA4 /* GroupTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D80EB41BF714BE00A10EA4 /* GroupTabBar.m */; }; 84D80EB61BF714BE00A10EA4 /* GroupTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D80EB41BF714BE00A10EA4 /* GroupTabBar.m */; };
84D8257F1BDD2F7E00CC61F7 /* MineTableFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8257E1BDD2F7E00CC61F7 /* MineTableFooterView.m */; }; 84D8257F1BDD2F7E00CC61F7 /* MineTableFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8257E1BDD2F7E00CC61F7 /* MineTableFooterView.m */; };
84D825821BDD35E000CC61F7 /* HomeHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D825811BDD35E000CC61F7 /* HomeHeaderView.m */; }; 84D825821BDD35E000CC61F7 /* HomeHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D825811BDD35E000CC61F7 /* HomeHeaderView.m */; };
84DB06111BE33F33003E581E /* NewAnnounceCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB06101BE33F33003E581E /* NewAnnounceCell.m */; };
84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */; }; 84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */; };
84DB9BC71BDCD67200822CC4 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC61BDCD67200822CC4 /* UIView+Extension.m */; }; 84DB9BC71BDCD67200822CC4 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DB9BC61BDCD67200822CC4 /* UIView+Extension.m */; };
84E420411BE849FC00689976 /* QuestionDescribeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E420401BE849FC00689976 /* QuestionDescribeCell.m */; }; 84E420411BE849FC00689976 /* QuestionDescribeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E420401BE849FC00689976 /* QuestionDescribeCell.m */; };
...@@ -157,6 +158,16 @@ ...@@ -157,6 +158,16 @@
8487D8081BF20FAD00E63E90 /* TaxisView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaxisView.m; sourceTree = "<group>"; }; 8487D8081BF20FAD00E63E90 /* TaxisView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaxisView.m; sourceTree = "<group>"; };
8487D80A1BF218F900E63E90 /* MenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuView.h; sourceTree = "<group>"; }; 8487D80A1BF218F900E63E90 /* MenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuView.h; sourceTree = "<group>"; };
8487D80B1BF218F900E63E90 /* MenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuView.m; sourceTree = "<group>"; }; 8487D80B1BF218F900E63E90 /* MenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuView.m; sourceTree = "<group>"; };
8490C4C11BF9A394006B6569 /* CustomPageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomPageControl.h; sourceTree = "<group>"; };
8490C4C21BF9A394006B6569 /* CustomPageControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomPageControl.m; sourceTree = "<group>"; };
8490C4C41BF9CE85006B6569 /* HomeTitleTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeTitleTableCell.h; sourceTree = "<group>"; };
8490C4C51BF9CE85006B6569 /* HomeTitleTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeTitleTableCell.m; sourceTree = "<group>"; };
8490C4CD1BF9DEF0006B6569 /* PictureTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureTableCell.h; sourceTree = "<group>"; };
8490C4CE1BF9DEF0006B6569 /* PictureTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureTableCell.m; sourceTree = "<group>"; };
8490C4D11BF9DEF0006B6569 /* PictureViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureViewController.h; sourceTree = "<group>"; };
8490C4D21BF9DEF0006B6569 /* PictureViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureViewController.m; sourceTree = "<group>"; };
8490C4D51BF9DF1D006B6569 /* PictureStoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureStoryViewController.h; sourceTree = "<group>"; };
8490C4D61BF9DF1D006B6569 /* PictureStoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureStoryViewController.m; sourceTree = "<group>"; };
84970DEA1BD8DD8A00C1728A /* redstar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = redstar.app; sourceTree = BUILT_PRODUCTS_DIR; }; 84970DEA1BD8DD8A00C1728A /* redstar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = redstar.app; sourceTree = BUILT_PRODUCTS_DIR; };
84970DEE1BD8DD8A00C1728A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; 84970DEE1BD8DD8A00C1728A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
84970DF91BD8DD8A00C1728A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 84970DF91BD8DD8A00C1728A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
...@@ -175,10 +186,6 @@ ...@@ -175,10 +186,6 @@
84970E371BD8E0B300C1728A /* LoginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginView.h; sourceTree = "<group>"; }; 84970E371BD8E0B300C1728A /* LoginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginView.h; sourceTree = "<group>"; };
84970E381BD8E0B300C1728A /* LoginView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginView.m; sourceTree = "<group>"; }; 84970E381BD8E0B300C1728A /* LoginView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginView.m; sourceTree = "<group>"; };
84970E3F1BD9127A00C1728A /* Constant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constant.h; sourceTree = "<group>"; }; 84970E3F1BD9127A00C1728A /* Constant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constant.h; sourceTree = "<group>"; };
84AB20A31BE648EC00B66F13 /* PictureViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureViewController.h; sourceTree = "<group>"; };
84AB20A41BE648EC00B66F13 /* PictureViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureViewController.m; sourceTree = "<group>"; };
84AB20A71BE64DC600B66F13 /* PictureTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureTableCell.h; sourceTree = "<group>"; };
84AB20A81BE64DC600B66F13 /* PictureTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureTableCell.m; sourceTree = "<group>"; };
84AD4F1E1BF425AC00BFB37C /* InspectDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectDetailView.h; sourceTree = "<group>"; }; 84AD4F1E1BF425AC00BFB37C /* InspectDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectDetailView.h; sourceTree = "<group>"; };
84AD4F1F1BF425AC00BFB37C /* InspectDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectDetailView.m; sourceTree = "<group>"; }; 84AD4F1F1BF425AC00BFB37C /* InspectDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectDetailView.m; sourceTree = "<group>"; };
84AD4F211BF42F8E00BFB37C /* classfiy.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = classfiy.plist; sourceTree = "<group>"; }; 84AD4F211BF42F8E00BFB37C /* classfiy.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = classfiy.plist; sourceTree = "<group>"; };
...@@ -203,8 +210,6 @@ ...@@ -203,8 +210,6 @@
84AD4F451BF4A9E800BFB37C /* RankHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankHeadView.m; sourceTree = "<group>"; }; 84AD4F451BF4A9E800BFB37C /* RankHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankHeadView.m; sourceTree = "<group>"; };
84AD4F471BF4BC0600BFB37C /* RankDetailTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankDetailTableCell.h; sourceTree = "<group>"; }; 84AD4F471BF4BC0600BFB37C /* RankDetailTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankDetailTableCell.h; sourceTree = "<group>"; };
84AD4F481BF4BC0600BFB37C /* RankDetailTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankDetailTableCell.m; sourceTree = "<group>"; }; 84AD4F481BF4BC0600BFB37C /* RankDetailTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankDetailTableCell.m; sourceTree = "<group>"; };
84C582EA1BDDFB0400AF838D /* HomeFunctionCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeFunctionCell.h; sourceTree = "<group>"; };
84C582EB1BDDFB0400AF838D /* HomeFunctionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeFunctionCell.m; sourceTree = "<group>"; };
84C957491BDB344900083584 /* UIBarButtonItem+Create.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIBarButtonItem+Create.h"; sourceTree = "<group>"; }; 84C957491BDB344900083584 /* UIBarButtonItem+Create.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIBarButtonItem+Create.h"; sourceTree = "<group>"; };
84C9574A1BDB344900083584 /* UIBarButtonItem+Create.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIBarButtonItem+Create.m"; sourceTree = "<group>"; }; 84C9574A1BDB344900083584 /* UIBarButtonItem+Create.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIBarButtonItem+Create.m"; sourceTree = "<group>"; };
84C9574B1BDB344900083584 /* UIView+Frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Frame.h"; sourceTree = "<group>"; }; 84C9574B1BDB344900083584 /* UIView+Frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Frame.h"; sourceTree = "<group>"; };
...@@ -228,8 +233,6 @@ ...@@ -228,8 +233,6 @@
84D8257E1BDD2F7E00CC61F7 /* MineTableFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineTableFooterView.m; sourceTree = "<group>"; }; 84D8257E1BDD2F7E00CC61F7 /* MineTableFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineTableFooterView.m; sourceTree = "<group>"; };
84D825801BDD35E000CC61F7 /* HomeHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeHeaderView.h; sourceTree = "<group>"; }; 84D825801BDD35E000CC61F7 /* HomeHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeHeaderView.h; sourceTree = "<group>"; };
84D825811BDD35E000CC61F7 /* HomeHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeHeaderView.m; sourceTree = "<group>"; }; 84D825811BDD35E000CC61F7 /* HomeHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeHeaderView.m; sourceTree = "<group>"; };
84DB060F1BE33F33003E581E /* NewAnnounceCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewAnnounceCell.h; sourceTree = "<group>"; };
84DB06101BE33F33003E581E /* NewAnnounceCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewAnnounceCell.m; sourceTree = "<group>"; };
84DB9BC21BDCD4B600822CC4 /* CustomDropMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomDropMenuView.h; sourceTree = "<group>"; }; 84DB9BC21BDCD4B600822CC4 /* CustomDropMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomDropMenuView.h; sourceTree = "<group>"; };
84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomDropMenuView.m; sourceTree = "<group>"; }; 84DB9BC31BDCD4B600822CC4 /* CustomDropMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomDropMenuView.m; sourceTree = "<group>"; };
84DB9BC51BDCD67200822CC4 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; }; 84DB9BC51BDCD67200822CC4 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; };
...@@ -449,29 +452,12 @@ ...@@ -449,29 +452,12 @@
8426A4A71BDF0CD600E5FDF5 /* Picture */ = { 8426A4A71BDF0CD600E5FDF5 /* Picture */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
84AB20A61BE64D9800B66F13 /* Cell */, 8490C4C71BF9DEF0006B6569 /* PictureDetail */,
8426A4A81BDF0CD600E5FDF5 /* View */, 8490C4CB1BF9DEF0006B6569 /* PictureList */,
8426A4A91BDF0CD600E5FDF5 /* ViewController */,
); );
path = Picture; path = Picture;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
8426A4A81BDF0CD600E5FDF5 /* View */ = {
isa = PBXGroup;
children = (
);
path = View;
sourceTree = "<group>";
};
8426A4A91BDF0CD600E5FDF5 /* ViewController */ = {
isa = PBXGroup;
children = (
84AB20A31BE648EC00B66F13 /* PictureViewController.h */,
84AB20A41BE648EC00B66F13 /* PictureViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
8426A4AA1BDF0CD600E5FDF5 /* Question */ = { 8426A4AA1BDF0CD600E5FDF5 /* Question */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -727,6 +713,83 @@ ...@@ -727,6 +713,83 @@
path = ViewController; path = ViewController;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
8490C4C01BF9A394006B6569 /* PageControl */ = {
isa = PBXGroup;
children = (
8490C4C11BF9A394006B6569 /* CustomPageControl.h */,
8490C4C21BF9A394006B6569 /* CustomPageControl.m */,
);
path = PageControl;
sourceTree = "<group>";
};
8490C4C71BF9DEF0006B6569 /* PictureDetail */ = {
isa = PBXGroup;
children = (
8490C4C81BF9DEF0006B6569 /* Cell */,
8490C4C91BF9DEF0006B6569 /* View */,
8490C4CA1BF9DEF0006B6569 /* ViewController */,
);
path = PictureDetail;
sourceTree = "<group>";
};
8490C4C81BF9DEF0006B6569 /* Cell */ = {
isa = PBXGroup;
children = (
);
path = Cell;
sourceTree = "<group>";
};
8490C4C91BF9DEF0006B6569 /* View */ = {
isa = PBXGroup;
children = (
);
path = View;
sourceTree = "<group>";
};
8490C4CA1BF9DEF0006B6569 /* ViewController */ = {
isa = PBXGroup;
children = (
8490C4D51BF9DF1D006B6569 /* PictureStoryViewController.h */,
8490C4D61BF9DF1D006B6569 /* PictureStoryViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
8490C4CB1BF9DEF0006B6569 /* PictureList */ = {
isa = PBXGroup;
children = (
8490C4CC1BF9DEF0006B6569 /* Cell */,
8490C4CF1BF9DEF0006B6569 /* View */,
8490C4D01BF9DEF0006B6569 /* ViewController */,
);
path = PictureList;
sourceTree = "<group>";
};
8490C4CC1BF9DEF0006B6569 /* Cell */ = {
isa = PBXGroup;
children = (
8490C4CD1BF9DEF0006B6569 /* PictureTableCell.h */,
8490C4CE1BF9DEF0006B6569 /* PictureTableCell.m */,
);
path = Cell;
sourceTree = "<group>";
};
8490C4CF1BF9DEF0006B6569 /* View */ = {
isa = PBXGroup;
children = (
);
path = View;
sourceTree = "<group>";
};
8490C4D01BF9DEF0006B6569 /* ViewController */ = {
isa = PBXGroup;
children = (
8490C4D11BF9DEF0006B6569 /* PictureViewController.h */,
8490C4D21BF9DEF0006B6569 /* PictureViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
84970DE11BD8DD8A00C1728A = { 84970DE11BD8DD8A00C1728A = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -840,6 +903,7 @@ ...@@ -840,6 +903,7 @@
84970E261BD8DEFE00C1728A /* Tools */ = { 84970E261BD8DEFE00C1728A /* Tools */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
8490C4C01BF9A394006B6569 /* PageControl */,
8419EAD11BEDC976002635ED /* HttpClient */, 8419EAD11BEDC976002635ED /* HttpClient */,
8419EABB1BEDA8F9002635ED /* Menu */, 8419EABB1BEDA8F9002635ED /* Menu */,
84F57C991BECA72C00DDEEB1 /* StarBar */, 84F57C991BECA72C00DDEEB1 /* StarBar */,
...@@ -893,15 +957,6 @@ ...@@ -893,15 +957,6 @@
path = Macro; path = Macro;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
84AB20A61BE64D9800B66F13 /* Cell */ = {
isa = PBXGroup;
children = (
84AB20A71BE64DC600B66F13 /* PictureTableCell.h */,
84AB20A81BE64DC600B66F13 /* PictureTableCell.m */,
);
path = Cell;
sourceTree = "<group>";
};
84AD4F1D1BF4257C00BFB37C /* View */ = { 84AD4F1D1BF4257C00BFB37C /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -960,12 +1015,10 @@ ...@@ -960,12 +1015,10 @@
84C582E91BDDFACD00AF838D /* Cell */ = { 84C582E91BDDFACD00AF838D /* Cell */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
84C582EA1BDDFB0400AF838D /* HomeFunctionCell.h */,
84C582EB1BDDFB0400AF838D /* HomeFunctionCell.m */,
84DB060F1BE33F33003E581E /* NewAnnounceCell.h */,
84DB06101BE33F33003E581E /* NewAnnounceCell.m */,
8474A01A1BE368D700315F30 /* HomeCellItem.h */, 8474A01A1BE368D700315F30 /* HomeCellItem.h */,
8474A01B1BE368D700315F30 /* HomeCellItem.m */, 8474A01B1BE368D700315F30 /* HomeCellItem.m */,
8490C4C41BF9CE85006B6569 /* HomeTitleTableCell.h */,
8490C4C51BF9CE85006B6569 /* HomeTitleTableCell.m */,
); );
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1390,9 +1443,8 @@ ...@@ -1390,9 +1443,8 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
8490C4C61BF9CE85006B6569 /* HomeTitleTableCell.m in Sources */,
840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */, 840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */,
84AB20A91BE64DC600B66F13 /* PictureTableCell.m in Sources */,
84C582EC1BDDFB0400AF838D /* HomeFunctionCell.m in Sources */,
84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */, 84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */,
841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */, 841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */,
84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */, 84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */,
...@@ -1407,6 +1459,7 @@ ...@@ -1407,6 +1459,7 @@
84C9574E1BDB344900083584 /* UIView+Frame.m in Sources */, 84C9574E1BDB344900083584 /* UIView+Frame.m in Sources */,
848699B01BDF810900859DFE /* InspectListCell.m in Sources */, 848699B01BDF810900859DFE /* InspectListCell.m in Sources */,
84AD4F3A1BF4844600BFB37C /* RankDetailHeaderView.m in Sources */, 84AD4F3A1BF4844600BFB37C /* RankDetailHeaderView.m in Sources */,
8490C4D41BF9DEF0006B6569 /* PictureViewController.m in Sources */,
8474C5951BE78AE1007DCF19 /* QuestionDetailViewController.m in Sources */, 8474C5951BE78AE1007DCF19 /* QuestionDetailViewController.m in Sources */,
84FD8A071BDA01C4006E442A /* ChartViewController.m in Sources */, 84FD8A071BDA01C4006E442A /* ChartViewController.m in Sources */,
84970DEF1BD8DD8A00C1728A /* main.m in Sources */, 84970DEF1BD8DD8A00C1728A /* main.m in Sources */,
...@@ -1417,7 +1470,7 @@ ...@@ -1417,7 +1470,7 @@
8487D8091BF20FAD00E63E90 /* TaxisView.m in Sources */, 8487D8091BF20FAD00E63E90 /* TaxisView.m in Sources */,
84AD4F361BF45BEB00BFB37C /* InspectSortTableCell.m in Sources */, 84AD4F361BF45BEB00BFB37C /* InspectSortTableCell.m in Sources */,
84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */, 84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */,
84AB20A51BE648EC00B66F13 /* PictureViewController.m in Sources */, 8490C4C31BF9A394006B6569 /* CustomPageControl.m in Sources */,
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */, 84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */,
84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */, 84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */,
8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */, 8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */,
...@@ -1427,7 +1480,6 @@ ...@@ -1427,7 +1480,6 @@
84E420471BE88AE000689976 /* RootTabBarController.m in Sources */, 84E420471BE88AE000689976 /* RootTabBarController.m in Sources */,
840826211BE5D2400022B795 /* OnLineFooterView.m in Sources */, 840826211BE5D2400022B795 /* OnLineFooterView.m in Sources */,
8487D80C1BF218F900E63E90 /* MenuView.m in Sources */, 8487D80C1BF218F900E63E90 /* MenuView.m in Sources */,
84DB06111BE33F33003E581E /* NewAnnounceCell.m in Sources */,
8474C5921BE78A85007DCF19 /* QuestionViewController.m in Sources */, 8474C5921BE78A85007DCF19 /* QuestionViewController.m in Sources */,
84AD4F291BF4360E00BFB37C /* TaskGroup.m in Sources */, 84AD4F291BF4360E00BFB37C /* TaskGroup.m in Sources */,
84AD4F2F1BF4370E00BFB37C /* InspectHeaderView.m in Sources */, 84AD4F2F1BF4370E00BFB37C /* InspectHeaderView.m in Sources */,
...@@ -1441,6 +1493,7 @@ ...@@ -1441,6 +1493,7 @@
84C9574D1BDB344900083584 /* UIBarButtonItem+Create.m in Sources */, 84C9574D1BDB344900083584 /* UIBarButtonItem+Create.m in Sources */,
84AD4F3D1BF4894D00BFB37C /* RankDetailView.m in Sources */, 84AD4F3D1BF4894D00BFB37C /* RankDetailView.m in Sources */,
84AD4F431BF4A66F00BFB37C /* WorkModel.m in Sources */, 84AD4F431BF4A66F00BFB37C /* WorkModel.m in Sources */,
8490C4D31BF9DEF0006B6569 /* PictureTableCell.m in Sources */,
84970E391BD8E0B300C1728A /* LoginView.m in Sources */, 84970E391BD8E0B300C1728A /* LoginView.m in Sources */,
84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */, 84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */,
84CF0ED81BE9AC7E00C855CE /* InspectSettleViewController.m in Sources */, 84CF0ED81BE9AC7E00C855CE /* InspectSettleViewController.m in Sources */,
...@@ -1455,6 +1508,7 @@ ...@@ -1455,6 +1508,7 @@
8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */, 8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */,
8474C5991BE78BBC007DCF19 /* QuestionDetailCell.m in Sources */, 8474C5991BE78BBC007DCF19 /* QuestionDetailCell.m in Sources */,
8474C5911BE78A85007DCF19 /* QuestionListTableCell.m in Sources */, 8474C5911BE78A85007DCF19 /* QuestionListTableCell.m in Sources */,
8490C4D71BF9DF1D006B6569 /* PictureStoryViewController.m in Sources */,
84F1669B1BE715E40061D350 /* ZanButton.m in Sources */, 84F1669B1BE715E40061D350 /* ZanButton.m in Sources */,
8419EAD41BEDC98F002635ED /* HttpClient.m in Sources */, 8419EAD41BEDC98F002635ED /* HttpClient.m in Sources */,
842547FC1BF03977006C79C5 /* QuestionModel.m in Sources */, 842547FC1BF03977006C79C5 /* QuestionModel.m in Sources */,
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "task_online@2x.png", "filename" : "back_btn@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "task_online@3x.png", "filename" : "back_btn@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "praise_image@2x.png", "filename" : "default_pic@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "praise_image@3x.png", "filename" : "default_pic@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "excellent_case@2x.png", "filename" : "function_check@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "excellent_case@3x.png", "filename" : "function_check@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "praise_standard@2x.png", "filename" : "function_uncheck@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "praise_standard@3x.png", "filename" : "function_uncheck@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "praise_report@2x.png", "filename" : "home_title@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "praise_report@3x.png", "filename" : "home_title@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "question_problem@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "question_problem@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "search@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "search@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_00@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_00@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_01@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_01@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_02@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_02@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_03@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_03@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_04@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_04@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_05@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_05@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -48,19 +48,27 @@ ...@@ -48,19 +48,27 @@
{ {
// 跳转到tabbarController // 跳转到tabbarController
HomeViewController *home = [[HomeViewController alloc]init]; HomeViewController *home = (HomeViewController *)[self setUpOneChildViewController:[[HomeViewController alloc] init] title:@"首页" imageName:@"home_unchecked" selImageName:@"home_checked"];
UINavigationController *homeNav = [self setUpOneChildViewController:home title:@"首页" imageName:@"home_unchecked" selImageName:@"home_checked"]; UINavigationController *homeNav = [[UINavigationController alloc] initWithRootViewController:home];
[homeNav.navigationBar setBarTintColor:kNavigationBarColor];
[homeNav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
AnnounceViewController *announce = [[AnnounceViewController alloc] init]; AnnounceViewController *announce = (AnnounceViewController *)[self setUpOneChildViewController:[[AnnounceViewController alloc] init] title:@"公告" imageName:@"notice_unchecked" selImageName:@"notice_checked"];
UINavigationController *announceNav = [self setUpOneChildViewController:announce title:@"公告" imageName:@"notice_unchecked" selImageName:@"notice_checked"]; // 添加nav
UINavigationController *announceNav = [[UINavigationController alloc] initWithRootViewController:announce];
[announceNav.navigationBar setBarTintColor:kNavigationBarColor];
[announceNav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
ChartViewController *chart = [[ChartViewController alloc] init]; ChartViewController *chart = (ChartViewController *)[self setUpOneChildViewController:[[ChartViewController alloc] init] title:@"报表查询" imageName:@"report_unchecked" selImageName:@"report_checked"];
UINavigationController *chartNav = [self setUpOneChildViewController:chart title:@"报表查询" imageName:@"report_unchecked" selImageName:@"report_checked"]; UINavigationController *chartNav = [[UINavigationController alloc] initWithRootViewController:chart];
[chartNav.navigationBar setBarTintColor:kNavigationBarColor];
[chartNav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
MineViewController *mine = [[MineViewController alloc] init]; MineViewController *mine = (MineViewController *)[self setUpOneChildViewController:[[MineViewController alloc] init] title:@"我的" imageName:@"aboutme_unchecked" selImageName:@"aboutme_checke"];
UINavigationController *mineNav = [self setUpOneChildViewController:mine title:@"我的" imageName:@"aboutme_unchecked" selImageName:@"aboutme_checke"]; UINavigationController *mineNav = [[UINavigationController alloc] initWithRootViewController:mine];
[mineNav.navigationBar setBarTintColor:kNavigationBarColor];
[mineNav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
kNavigationBarColor, NSForegroundColorAttributeName, kNavigationBarColor, NSForegroundColorAttributeName,
...@@ -72,7 +80,7 @@ ...@@ -72,7 +80,7 @@
// 添加一个控制器的属性 // 添加一个控制器的属性
- (UINavigationController *)setUpOneChildViewController:(UIViewController *)vc title:(NSString *)title imageName:(NSString *)imageName selImageName:(NSString *)selImageName - (UIViewController *)setUpOneChildViewController:(UIViewController *)vc title:(NSString *)title imageName:(NSString *)imageName selImageName:(NSString *)selImageName
{ {
// 添加TabBar按钮的图片文字 // 添加TabBar按钮的图片文字
vc.title = title; vc.title = title;
...@@ -81,11 +89,9 @@ ...@@ -81,11 +89,9 @@
selImage = [selImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; selImage = [selImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
vc.tabBarItem.selectedImage = selImage; vc.tabBarItem.selectedImage = selImage;
// 添加nav return vc;
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
[nav.navigationBar setBarTintColor:kNavigationBarColor];
[nav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
return nav;
} }
#pragma mark - UITabBarController Delegate #pragma mark - UITabBarController Delegate
......
// //
// NewAnnounceCell.h // PictureStoryViewController.h
// redstar // redstar
// //
// Created by admin on 15/10/30. // Created by admin on 15/11/16.
// Copyright © 2015年 ZWF. All rights reserved. // Copyright © 2015年 ZWF. All rights reserved.
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface NewAnnounceCell : UITableViewCell @interface PictureStoryViewController : UIViewController
@property (nonatomic, strong) UILabel *announceLabel; // 公告
@property (nonatomic, strong) UILabel *pointLabel; // 点点
@end @end
//
// PictureStoryViewController.m
// redstar
//
// Created by admin on 15/11/16.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "PictureStoryViewController.h"
@interface PictureStoryViewController ()
@end
@implementation PictureStoryViewController
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
[self setupNav];
}
#pragma mark - Private Methods
- (void)setupNav
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"图说口碑"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
-(void)doBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#pragma mark - Private Methods #pragma mark - Private Methods
- (void)setup - (void)setup
{ {
self.titleImageView.image = [UIImage imageNamed:@""]; self.titleImageView.image = [UIImage imageNamed:@"default_pic"];
self.titleLabel.textColor = kPictureCellTitleColor; self.titleLabel.textColor = kPictureCellTitleColor;
self.hotLabel.font = [UIFont boldSystemFontOfSize:12.0]; self.hotLabel.font = [UIFont boldSystemFontOfSize:12.0];
self.detailsLabel.textColor = kPictureCellDetailsColor; self.detailsLabel.textColor = kPictureCellDetailsColor;
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#import "MenuButton.h" #import "MenuButton.h"
#import "PictureTableCell.h" #import "PictureTableCell.h"
#import "PictureStoryViewController.h"
#define kPictureTableViewCell @"pictureTabelViewCell" #define kPictureTableViewCell @"pictureTabelViewCell"
@interface PictureViewController () <UITableViewDelegate, UITableViewDataSource> @interface PictureViewController () <UITableViewDelegate, UITableViewDataSource>
...@@ -54,6 +56,20 @@ ...@@ -54,6 +56,20 @@
rightButton.titleLabel.font = [UIFont systemFontOfSize:15]; rightButton.titleLabel.font = [UIFont systemFontOfSize:15];
UIBarButtonItem *rightButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightButton]; UIBarButtonItem *rightButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightButton];
self.navigationItem.rightBarButtonItem = rightButtonItem; self.navigationItem.rightBarButtonItem = rightButtonItem;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
-(void)doBack:(id)sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
} }
- (void)setupTableView - (void)setupTableView
...@@ -104,6 +120,12 @@ ...@@ -104,6 +120,12 @@
return 0; return 0;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
[self.navigationController pushViewController:storyVC animated:YES];
}
// 自定义section // 自定义section
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{ {
......
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
{ {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
self.tabBarController.tabBar.hidden = YES; self.tabBarController.tabBar.hidden = YES;
} }
......
...@@ -37,6 +37,6 @@ ...@@ -37,6 +37,6 @@
@property (nonatomic, strong) NSString *submitTime;// @property (nonatomic, strong) NSString *submitTime;//
@property (nonatomic, strong) NSString *type;//问题处理分类 @property (nonatomic, strong) NSString *type;//问题处理分类
@property (nonatomic, strong) NSString *version;// @property (nonatomic, strong) NSString *version;//
@property (nonatomic, strong) NSString *hotspot; // 热点问题
@property (nonatomic, strong) NSString *likeCount; //
@end @end
...@@ -118,7 +118,6 @@ ...@@ -118,7 +118,6 @@
- (void)setupTableView - (void)setupTableView
{ {
[self.tableView registerClass:[QuestionListTableCell class] forCellReuseIdentifier:kQuestionListCell]; [self.tableView registerClass:[QuestionListTableCell class] forCellReuseIdentifier:kQuestionListCell];
self.searchBar.backgroundColor = kSectionBackGroundColor; self.searchBar.backgroundColor = kSectionBackGroundColor;
} }
...@@ -138,8 +137,22 @@ ...@@ -138,8 +137,22 @@
rightButton.titleLabel.font = [UIFont systemFontOfSize:15]; rightButton.titleLabel.font = [UIFont systemFontOfSize:15];
UIBarButtonItem *rightButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightButton]; UIBarButtonItem *rightButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightButton];
self.navigationItem.rightBarButtonItem = rightButtonItem; self.navigationItem.rightBarButtonItem = rightButtonItem;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
} }
- (void)doBack:(id)sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
- (void)addClick:(UIButton *)sender - (void)addClick:(UIButton *)sender
{ {
AddQuestionViewController *addQuestionVC = [[AddQuestionViewController alloc] init]; AddQuestionViewController *addQuestionVC = [[AddQuestionViewController alloc] init];
......
...@@ -13,10 +13,16 @@ ...@@ -13,10 +13,16 @@
#import "HttpClient.h" #import "HttpClient.h"
#import "MenuView.h"
#import "MenuButton.h"
#import "TaxisView.h"
#import "ScreenView.h"
#define kInspectListCell @"InspectListCellTableViewCell" #define kInspectListCell @"InspectListCellTableViewCell"
@interface InspectListViewController ()<UITableViewDelegate, UITableViewDataSource> @interface InspectListViewController ()<UITableViewDelegate, UITableViewDataSource, ScreenTableDelegate>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) MenuView *menuView;
@property (nonatomic, strong) NSArray *test1Array; @property (nonatomic, strong) NSArray *test1Array;
@property (nonatomic, strong) NSArray *test2Array; @property (nonatomic, strong) NSArray *test2Array;
...@@ -25,6 +31,12 @@ ...@@ -25,6 +31,12 @@
@property (nonatomic, strong) NSArray *test5Array; @property (nonatomic, strong) NSArray *test5Array;
@property (nonatomic, strong) NSArray *test6Array; @property (nonatomic, strong) NSArray *test6Array;
@property (nonatomic, strong) TaxisView *taxisView;
@property (nonatomic, strong) ScreenView *screenView;
@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) MenuButton *selctedButton;
@end @end
@implementation InspectListViewController @implementation InspectListViewController
...@@ -38,6 +50,22 @@ ...@@ -38,6 +50,22 @@
customLab.font = [UIFont boldSystemFontOfSize:19]; customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab; self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
[self.tableView registerClass:[InspectListCell class] forCellReuseIdentifier:kInspectListCell]; [self.tableView registerClass:[InspectListCell class] forCellReuseIdentifier:kInspectListCell];
// //
...@@ -57,6 +85,15 @@ ...@@ -57,6 +85,15 @@
[super viewWillAppear:animated]; [super viewWillAppear:animated];
self.tabBarController.tabBar.hidden = YES; self.tabBarController.tabBar.hidden = YES;
[self.menuView.taxiButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
[self.menuView.screenButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[self.menuView removeFromSuperview];
self.menuView = nil;
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
...@@ -70,6 +107,11 @@ ...@@ -70,6 +107,11 @@
NSLog(@"拍讯"); NSLog(@"拍讯");
} }
-(void)doBack:(id)sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
- (void)requestInspectList - (void)requestInspectList
{ {
...@@ -89,6 +131,163 @@ ...@@ -89,6 +131,163 @@
}]; }];
} }
- (void)dropCilck:(MenuButton *)sender
{
sender.isDrop = !sender.isDrop;
if (_selctedButton.tag == sender.tag) {
if (sender.isDrop) {
if (sender.tag == 4001) {
[self showRedView];
} else {
[self showGreenView];
}
[sender setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
} else {
if (sender.tag == 4001) {
[self closeRedView];
} else {
[self closeGreenView];
}
[sender setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
}
} else {
// 前一次选中的按钮 选中状态置为NO
_selctedButton.selected = NO;
_selctedButton.isDrop = NO;
// 进行选中状态为NO 的操作
// 1.将发生“选中”->“未选中”状态变化的按钮文字由Orange->White
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
// 2.判断当前是否有bgView 有->移除, 没有->跳过
if (_bgView) {
// _bgView存在
[_bgView removeFromSuperview];
_bgView = nil;
}
if (_taxisView) {
[_taxisView removeFromSuperview];
_taxisView = nil;
}
if (_screenView) {
[_screenView removeFromSuperview];
_screenView = nil;
}
// 将当前选中的按钮设置 选中状态为YES;
sender.selected = YES;
// 对选中按钮 进行相关操作
// 1.将选中按钮的文字设置为Orange
[sender setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
_selctedButton = (MenuButton *)sender;
if (sender.tag == 4001) {
[self showRedView];
} else {
[self showGreenView];
}
}
}
- (void)showRedView
{
if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:self.view.bounds];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeRedView)];
[_bgView addGestureRecognizer:tapGR];
}
if (!_taxisView) {
_taxisView = [[TaxisView alloc] init];
_taxisView.backgroundColor = [UIColor whiteColor];
}
[self.view addSubview:_bgView];
[self.view insertSubview:_taxisView aboveSubview:_bgView];
_bgView.alpha = 0;
_bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kTaxisViewHeight);
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight);
_taxisView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6;
_taxisView.frame = toFrame;
}];
}
- (void)closeRedView
{
_selctedButton.isDrop = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight);
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f;
_taxisView.frame = fromFrame;
} completion:^(BOOL finished) {
[_bgView removeFromSuperview];
[_taxisView removeFromSuperview];
}];
}
- (void)showGreenView
{
if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:self.view.bounds];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeGreenView)];
[_bgView addGestureRecognizer:tapGR];
}
if (!_screenView) {
_screenView = [[ScreenView alloc] init];
_screenView.delegate = self;
_screenView.backgroundColor = [UIColor whiteColor];
}
[self.view addSubview:_bgView];
[self.view insertSubview:_screenView aboveSubview:_bgView];
_bgView.alpha = 0;
_bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kScreenViewHeight);
CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight);
_screenView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6;
_screenView.frame = toFrame;
}];
}
- (void)closeGreenView
{
_selctedButton.isDrop = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight);
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f;
_screenView.frame = fromFrame;
} completion:^(BOOL finished) {
[_bgView removeFromSuperview];
[_screenView removeFromSuperview];
}];
}
#pragma mark - ScreenDelegate
- (void)click
{
NSLog(@"未上报或已上报");
}
#pragma mark - UITableView Delegate/DataSource #pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
...@@ -144,7 +343,7 @@ ...@@ -144,7 +343,7 @@
// section高度 // section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{ {
return 45; return 0;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
...@@ -152,78 +351,103 @@ ...@@ -152,78 +351,103 @@
return 0; return 0;
} }
// 自定义section //// 自定义section
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section //- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
//{
// // 创建sectionView
// UIView *sectionView = [[UIView alloc] init];
// sectionView.userInteractionEnabled = YES;
// sectionView.backgroundColor = kInspectSectionBackGroundColor;
//
// UIView *lineView = [[UIView alloc] init];
// lineView.translatesAutoresizingMaskIntoConstraints = NO;
// lineView.backgroundColor = kSeparateLineColor;
// [sectionView addSubview:lineView];
//
// NSLayoutConstraint *lineTop = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
// [sectionView addConstraint:lineTop];
//
// NSLayoutConstraint *lineLeft = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-0.5];
// [sectionView addConstraint:lineLeft];
//
// NSLayoutConstraint *lineWidth = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:1];
// [sectionView addConstraint:lineWidth];
//
// NSLayoutConstraint *lineBottom = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
// [sectionView addConstraint:lineBottom];
//
// MenuButton *taxiButton = [[MenuButton alloc] init];
// taxiButton.translatesAutoresizingMaskIntoConstraints = NO;
// [taxiButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
// [taxiButton setImage:[UIImage imageNamed:@"sort_icon"] forState:UIControlStateNormal];
// taxiButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
// [taxiButton setTitle:@"排序" forState:UIControlStateNormal];
// [taxiButton addTarget:self action:@selector(taxisBtnCilck:) forControlEvents:UIControlEventTouchUpInside];
// [sectionView addSubview:taxiButton];
//
// MenuButton *screenButton = [[MenuButton alloc] init];
// screenButton.translatesAutoresizingMaskIntoConstraints = NO;
// [screenButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
// [screenButton setImage:[UIImage imageNamed:@"filter_icon"] forState:UIControlStateNormal];
// screenButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
// [screenButton setTitle:@"筛选" forState:UIControlStateNormal];
// [sectionView addSubview:screenButton];
//
// // taxiButton布局
// NSLayoutConstraint *taxiButtonTop = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
// [sectionView addConstraint:taxiButtonTop];
//
// NSLayoutConstraint *taxiButtonLeft = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
// [sectionView addConstraint:taxiButtonLeft];
//
// NSLayoutConstraint *taxiButtonWidth = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:screenButton attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
// [sectionView addConstraint:taxiButtonWidth];
//
// NSLayoutConstraint *taxiButtonBottom = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
// [sectionView addConstraint:taxiButtonBottom];
//
// // screenButton布局
// NSLayoutConstraint *screenButtonTop = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
// [sectionView addConstraint:screenButtonTop];
//
// NSLayoutConstraint *screenButtonRight = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
// [sectionView addConstraint:screenButtonRight];
//
// NSLayoutConstraint *screenButtonLeft = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:taxiButton attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
// [sectionView addConstraint:screenButtonLeft];
//
// NSLayoutConstraint *screenButtonBottom = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
// [sectionView addConstraint:screenButtonBottom];
//
// return sectionView;
//}
#pragma mark - lazy loading
- (MenuView *)menuView
{ {
// 创建sectionView if (!_menuView) {
UIView *sectionView = [[UIView alloc] init]; _menuView = [[MenuView alloc] init];
sectionView.userInteractionEnabled = YES; _menuView.translatesAutoresizingMaskIntoConstraints = NO;
sectionView.backgroundColor = kInspectSectionBackGroundColor; _menuView.backgroundColor = kInspectSectionBackGroundColor;
UIWindow *window = [[UIApplication sharedApplication].windows lastObject];
UIView *lineView = [[UIView alloc] init]; [window addSubview:_menuView];
lineView.translatesAutoresizingMaskIntoConstraints = NO;
lineView.backgroundColor = kSeparateLineColor; NSLayoutConstraint *menuTop = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeTop multiplier:1.0 constant:64];
[sectionView addSubview:lineView]; [window addConstraint:menuTop];
NSLayoutConstraint *lineTop = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *menuLeft = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[sectionView addConstraint:lineTop]; [window addConstraint:menuLeft];
NSLayoutConstraint *lineLeft = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-0.5]; NSLayoutConstraint *menuRight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[sectionView addConstraint:lineLeft]; [window addConstraint:menuRight];
NSLayoutConstraint *lineWidth = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:1]; NSLayoutConstraint *menuHeight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[sectionView addConstraint:lineWidth]; [window addConstraint:menuHeight];
}
NSLayoutConstraint *lineBottom = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; return _menuView;
[sectionView addConstraint:lineBottom];
MenuButton *taxiButton = [[MenuButton alloc] init];
taxiButton.translatesAutoresizingMaskIntoConstraints = NO;
[taxiButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
[taxiButton setImage:[UIImage imageNamed:@"sort_icon"] forState:UIControlStateNormal];
taxiButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
[taxiButton setTitle:@"排序" forState:UIControlStateNormal];
[taxiButton addTarget:self action:@selector(taxisBtnCilck:) forControlEvents:UIControlEventTouchUpInside];
[sectionView addSubview:taxiButton];
MenuButton *screenButton = [[MenuButton alloc] init];
screenButton.translatesAutoresizingMaskIntoConstraints = NO;
[screenButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
[screenButton setImage:[UIImage imageNamed:@"filter_icon"] forState:UIControlStateNormal];
screenButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
[screenButton setTitle:@"筛选" forState:UIControlStateNormal];
[sectionView addSubview:screenButton];
// taxiButton布局
NSLayoutConstraint *taxiButtonTop = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[sectionView addConstraint:taxiButtonTop];
NSLayoutConstraint *taxiButtonLeft = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[sectionView addConstraint:taxiButtonLeft];
NSLayoutConstraint *taxiButtonWidth = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:screenButton attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[sectionView addConstraint:taxiButtonWidth];
NSLayoutConstraint *taxiButtonBottom = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[sectionView addConstraint:taxiButtonBottom];
// screenButton布局
NSLayoutConstraint *screenButtonTop = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[sectionView addConstraint:screenButtonTop];
NSLayoutConstraint *screenButtonRight = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[sectionView addConstraint:screenButtonRight];
NSLayoutConstraint *screenButtonLeft = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:taxiButton attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[sectionView addConstraint:screenButtonLeft];
NSLayoutConstraint *screenButtonBottom = [NSLayoutConstraint constraintWithItem:screenButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[sectionView addConstraint:screenButtonBottom];
return sectionView;
} }
#pragma mark - lazy loading
- (UITableView *)tableView - (UITableView *)tableView
{ {
if (!_tableView) { if (!_tableView) {
...@@ -235,7 +459,7 @@ ...@@ -235,7 +459,7 @@
_tableView.showsHorizontalScrollIndicator = NO; _tableView.showsHorizontalScrollIndicator = NO;
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:45];
[self.view addConstraint:tableTop]; [self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
......
...@@ -30,6 +30,13 @@ ...@@ -30,6 +30,13 @@
@implementation InspectTaskViewController @implementation InspectTaskViewController
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
......
...@@ -28,6 +28,13 @@ ...@@ -28,6 +28,13 @@
@end @end
@implementation RankDetailViewController @implementation RankDetailViewController
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
self.tabBarController.tabBar.hidden = YES;
}
- (void)viewDidLoad - (void)viewDidLoad
{ {
......
...@@ -34,6 +34,16 @@ ...@@ -34,6 +34,16 @@
customLab.font = [UIFont boldSystemFontOfSize:19]; customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab; self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
if([[[UIDevice currentDevice]systemVersion]floatValue] >= 7.0) { if([[[UIDevice currentDevice]systemVersion]floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone; self.edgesForExtendedLayout = UIRectEdgeNone;
} }
...@@ -79,6 +89,11 @@ ...@@ -79,6 +89,11 @@
}]; }];
} }
-(void)doBack:(id)sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
- (void)addTableViews - (void)addTableViews
{ {
[self.tableView registerClass:[RankingListCell class] forCellReuseIdentifier:kRankingCell]; [self.tableView registerClass:[RankingListCell class] forCellReuseIdentifier:kRankingCell];
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
self.titleLabel.font = [UIFont systemFontOfSize:15]; self.titleLabel.font = [UIFont systemFontOfSize:15];
[self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[self setTitleColor:[UIColor orangeColor] forState:UIControlStateSelected]; [self setTitleColor:[UIColor orangeColor] forState:UIControlStateSelected];
self.layer.borderWidth = 0.5;
self.layer.borderColor = kLineCGColor;
} }
return self; return self;
} }
...@@ -31,11 +30,10 @@ ...@@ -31,11 +30,10 @@
CGFloat btnW = self.width; CGFloat btnW = self.width;
CGFloat btnH = self.height; CGFloat btnH = self.height;
CGFloat imageH = btnH * 0.7; self.imageView.frame = CGRectMake((btnW - 45) / 2 , 13, 45, 45);
self.imageView.frame = CGRectMake(0, 7, btnW, imageH);
CGFloat titleH = btnH - imageH; CGFloat titleH = btnH - 55;
CGFloat titleY = imageH - 5; CGFloat titleY = 61;
self.titleLabel.frame = CGRectMake(0, titleY, btnW, titleH); self.titleLabel.frame = CGRectMake(0, titleY, btnW, titleH);
// // 设置badgeView尺寸 // // 设置badgeView尺寸
......
//
// HomeFunctionCell.h
// redstar
//
// Created by admin on 15/10/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HomeCellItem.h"
@interface HomeFunctionCell : UITableViewCell
@property (nonatomic, strong) HomeCellItem *onLineSamplingBtn; // 在线抽查按钮
@property (nonatomic, strong) HomeCellItem *wordOfMouthBtn; // 口碑按钮
@property (nonatomic, strong) HomeCellItem *standardBtn; // 口碑标准按钮
@property (nonatomic, strong) HomeCellItem *pictureBtn; // 图说口碑按钮
@property (nonatomic, strong) HomeCellItem *questionBtn; // 问题与知识按钮
@property (nonatomic, strong) HomeCellItem *caseBtn; // 优秀案例按钮
@end
//
// HomeFunctionCell.m
// redstar
//
// Created by admin on 15/10/26.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "HomeFunctionCell.h"
@interface HomeFunctionCell ()
@property (nonatomic, strong) UIView *lineView;
@end
@implementation HomeFunctionCell
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
#pragma mark - Private Methods
- (void)setup
{
[self.onLineSamplingBtn setTitle:@"在线抽查" forState:UIControlStateNormal];
[self.wordOfMouthBtn setTitle:@"口碑报告" forState:UIControlStateNormal];
[self.standardBtn setTitle:@"口碑标准" forState:UIControlStateNormal];
[self.pictureBtn setTitle:@"图说口碑" forState:UIControlStateNormal];
[self.questionBtn setTitle:@"问题与知识" forState:UIControlStateNormal];
[self.caseBtn setTitle:@"优秀案例" forState:UIControlStateNormal];
self.lineView.backgroundColor = kSeparateLineViewColor;
}
#pragma mark - lazy loading
- (HomeCellItem *)onLineSamplingBtn
{
if (!_onLineSamplingBtn) {
_onLineSamplingBtn = [[HomeCellItem alloc] init];
_onLineSamplingBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_onLineSamplingBtn setImage:[UIImage imageNamed:@"task_online"] forState:UIControlStateNormal];
[self.contentView addSubview:_onLineSamplingBtn];
NSLayoutConstraint *onLineSamplingTop = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:onLineSamplingTop];
NSLayoutConstraint *onLineSamplingLeft = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:onLineSamplingLeft];
NSLayoutConstraint *onLineSamplingWidth = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.wordOfMouthBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.contentView addConstraint:onLineSamplingWidth];
NSLayoutConstraint *onLineSamplingRight = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.wordOfMouthBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:onLineSamplingRight];
NSLayoutConstraint *onLineSamplingHeight = [NSLayoutConstraint constraintWithItem:_onLineSamplingBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:119];
[self.contentView addConstraint:onLineSamplingHeight];
}
return _onLineSamplingBtn;
}
- (HomeCellItem *)wordOfMouthBtn
{
if (!_wordOfMouthBtn) {
_wordOfMouthBtn = [[HomeCellItem alloc] init];
[_wordOfMouthBtn setImage:[UIImage imageNamed:@"praise_report"] forState:UIControlStateNormal];
_wordOfMouthBtn.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_wordOfMouthBtn];
NSLayoutConstraint *wordOfMouthTop = [NSLayoutConstraint constraintWithItem:_wordOfMouthBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:wordOfMouthTop];
NSLayoutConstraint *wordOfMouthRight = [NSLayoutConstraint constraintWithItem:_wordOfMouthBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.standardBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:wordOfMouthRight];
NSLayoutConstraint *wordOfMouthWithd = [NSLayoutConstraint constraintWithItem:_wordOfMouthBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.standardBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.contentView addConstraint:wordOfMouthWithd];
NSLayoutConstraint *wordOfMouthHeight = [NSLayoutConstraint constraintWithItem:_wordOfMouthBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_onLineSamplingBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.contentView addConstraint:wordOfMouthHeight];
}
return _wordOfMouthBtn;
}
- (HomeCellItem *)standardBtn
{
if (!_standardBtn) {
_standardBtn = [[HomeCellItem alloc] init];
[_standardBtn setImage:[UIImage imageNamed:@"praise_standard"] forState:UIControlStateNormal];
_standardBtn.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_standardBtn];
NSLayoutConstraint *standardRight = [NSLayoutConstraint constraintWithItem:_standardBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:standardRight];
NSLayoutConstraint *standardHeight = [NSLayoutConstraint constraintWithItem:_standardBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_wordOfMouthBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.contentView addConstraint:standardHeight];
NSLayoutConstraint *standardTop = [NSLayoutConstraint constraintWithItem:_standardBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:standardTop];
}
return _standardBtn;
}
- (HomeCellItem *)pictureBtn
{
if (!_pictureBtn) {
_pictureBtn = [[HomeCellItem alloc] init];
[_pictureBtn setImage:[UIImage imageNamed:@"praise_image"] forState:UIControlStateNormal];
_pictureBtn.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_pictureBtn];
NSLayoutConstraint *pictureTop = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.onLineSamplingBtn attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:pictureTop];
NSLayoutConstraint *pictureLeft = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:pictureLeft];
NSLayoutConstraint *pictureRight = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.questionBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:pictureRight];
NSLayoutConstraint *pictureWidth = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.questionBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.contentView addConstraint:pictureWidth];
NSLayoutConstraint *pictureHeight = [NSLayoutConstraint constraintWithItem:_pictureBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.onLineSamplingBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.contentView addConstraint:pictureHeight];
}
return _pictureBtn;
}
- (HomeCellItem *)questionBtn
{
if (!_questionBtn) {
_questionBtn = [[HomeCellItem alloc] init];
[_questionBtn setImage:[UIImage imageNamed:@"question_problem"] forState:UIControlStateNormal];
_questionBtn.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_questionBtn];
NSLayoutConstraint *questionWidth = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.caseBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.contentView addConstraint:questionWidth];
NSLayoutConstraint *questionRight = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.caseBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:questionRight];
NSLayoutConstraint *questionTop = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_pictureBtn attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:questionTop];
NSLayoutConstraint *questionHeight = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_pictureBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.contentView addConstraint:questionHeight];
}
return _questionBtn;
}
- (HomeCellItem *)caseBtn
{
if (!_caseBtn) {
_caseBtn = [[HomeCellItem alloc] init];
[_caseBtn setImage:[UIImage imageNamed:@"excellent_case"] forState:UIControlStateNormal];
_caseBtn.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_caseBtn];
NSLayoutConstraint *caseTop = [NSLayoutConstraint constraintWithItem:_caseBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_questionBtn attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:caseTop];
NSLayoutConstraint *caseRight = [NSLayoutConstraint constraintWithItem:_caseBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:caseRight];
NSLayoutConstraint *caseHeight = [NSLayoutConstraint constraintWithItem:_caseBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_questionBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.contentView addConstraint:caseHeight];
}
return _caseBtn;
}
- (UIView *)lineView
{
if (!_lineView) {
_lineView = [[UIView alloc] init];
_lineView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_lineView];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:lineViewLeft];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:lineViewRight];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:lineViewBottom];
NSLayoutConstraint *lineViewHeight = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:2];
[self.contentView addConstraint:lineViewHeight];
}
return _lineView;
}
@end
//
// HomeTitleTableCell.h
// redstar
//
// Created by admin on 15/11/16.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HomeTitleTableCell : UITableViewCell
@end
//
// HomeTitleTableCell.m
// redstar
//
// Created by admin on 15/11/16.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "HomeTitleTableCell.h"
@implementation HomeTitleTableCell
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
- (void)setup
{
// 商场
UILabel *shoppingLabel = [[UILabel alloc] init];
shoppingLabel.text = @"商场名称";
shoppingLabel.textAlignment = NSTextAlignmentCenter;
shoppingLabel.textColor = kRankHeadTitleTextColor;
shoppingLabel.font = [UIFont systemFontOfSize:17.0];
shoppingLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:shoppingLabel];
// 总分
UILabel *scoreLabel = [[UILabel alloc] init];
scoreLabel.text = @"总分";
scoreLabel.textAlignment = NSTextAlignmentCenter;
scoreLabel.textColor = kRankHeadTitleTextColor;
scoreLabel.font = [UIFont systemFontOfSize:17.0];
scoreLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:scoreLabel];
// 排名
UILabel *gradeLabel = [[UILabel alloc] init];
gradeLabel.text = @"排名";
gradeLabel.textAlignment = NSTextAlignmentCenter;
gradeLabel.textColor = kRankHeadTitleTextColor;
gradeLabel.font = [UIFont systemFontOfSize:17.0];
gradeLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:gradeLabel];
//
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:shoppingLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:shoppingTop];
NSLayoutConstraint *shoppingLeft = [NSLayoutConstraint constraintWithItem:shoppingLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingLeft];
NSLayoutConstraint *shoppingRight = [NSLayoutConstraint constraintWithItem:shoppingLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:scoreLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingRight];
NSLayoutConstraint *shoppingBottom = [NSLayoutConstraint constraintWithItem:shoppingLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingBottom];
NSLayoutConstraint *shoppingWidth = [NSLayoutConstraint constraintWithItem:shoppingLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:scoreLabel attribute:NSLayoutAttributeWidth multiplier:1.2 constant:0];
[self.contentView addConstraint:shoppingWidth];
//
NSLayoutConstraint *scoreTop = [NSLayoutConstraint constraintWithItem:scoreLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:scoreTop];
NSLayoutConstraint *scoreRight = [NSLayoutConstraint constraintWithItem:scoreLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:gradeLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:scoreRight];
NSLayoutConstraint *scoreWidth = [NSLayoutConstraint constraintWithItem:scoreLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:gradeLabel attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.contentView addConstraint:scoreWidth];
NSLayoutConstraint *scoreBottom = [NSLayoutConstraint constraintWithItem:scoreLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:scoreBottom];
//
NSLayoutConstraint *gradeTop = [NSLayoutConstraint constraintWithItem:gradeLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:gradeTop];
NSLayoutConstraint *gradeRight = [NSLayoutConstraint constraintWithItem:gradeLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:gradeRight];
NSLayoutConstraint *gradeBottom = [NSLayoutConstraint constraintWithItem:gradeLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:gradeBottom];
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// NewAnnounceCell.m
// redstar
//
// Created by admin on 15/10/30.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "NewAnnounceCell.h"
@implementation NewAnnounceCell
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
#pragma mark - Private Methods
- (void)setup
{
self.announceLabel.textColor = kAnnounceTextColor;
self.pointLabel.text = @"···";
}
#pragma mark - Lazy Loading
- (UILabel *)announceLabel
{
if (!_announceLabel) {
_announceLabel = [[UILabel alloc] init];
_announceLabel.translatesAutoresizingMaskIntoConstraints = NO;
_announceLabel.font = [UIFont systemFontOfSize:15.0];
[self.contentView addSubview:_announceLabel];
NSLayoutConstraint *announceTop = [NSLayoutConstraint constraintWithItem:_announceLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:announceTop];
NSLayoutConstraint *announceLeft = [NSLayoutConstraint constraintWithItem:_announceLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:announceLeft];
NSLayoutConstraint *announceRight = [NSLayoutConstraint constraintWithItem:_announceLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.pointLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:announceRight];
NSLayoutConstraint *announceBottom = [NSLayoutConstraint constraintWithItem:_announceLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:announceBottom];
}
return _announceLabel;
}
- (UILabel *)pointLabel
{
if (!_pointLabel) {
_pointLabel = [[UILabel alloc] init];
_pointLabel.textColor = kPointColor;
_pointLabel.translatesAutoresizingMaskIntoConstraints = NO;
_pointLabel.font = [UIFont systemFontOfSize:15.0];
[self.contentView addSubview:_pointLabel];
NSLayoutConstraint *pointTop = [NSLayoutConstraint constraintWithItem:_pointLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:pointTop];
NSLayoutConstraint *pointWidth = [NSLayoutConstraint constraintWithItem:_pointLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:20];
[self.contentView addConstraint:pointWidth];
NSLayoutConstraint *pointRight = [NSLayoutConstraint constraintWithItem:_pointLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:pointRight];
NSLayoutConstraint *pointBottom = [NSLayoutConstraint constraintWithItem:_pointLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:pointBottom];
}
return _pointLabel;
}
@end
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CustomPageControl.h"
@interface HomeHeaderView : UIView @interface HomeHeaderView : UIView
@property (nonatomic, strong) UIScrollView *scrollView; @property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic,strong) UILabel *weatherLabel; @property (nonatomic, strong) CustomPageControl *customPageControl; // 自定义的pageControl
@end @end
...@@ -10,11 +10,7 @@ ...@@ -10,11 +10,7 @@
#define ImageCount 5 #define ImageCount 5
@interface HomeHeaderView () <UIScrollViewDelegate> @interface HomeHeaderView () <UIScrollViewDelegate>
@property (nonatomic, strong) UIView *bgView; // 背景View
@property (nonatomic,assign) BOOL isDragging; //是否正在拖动
@property (nonatomic,strong) NSTimer *timer; //设置动画
@end @end
@implementation HomeHeaderView @implementation HomeHeaderView
...@@ -34,83 +30,174 @@ ...@@ -34,83 +30,174 @@
#pragma mark - Private Methods #pragma mark - Private Methods
- (void)setup - (void)setup
{ {
_isDragging = NO; [self.customPageControl setNumberOfPages:2];
// 天气label self.bgView.backgroundColor = [UIColor whiteColor];
self.weatherLabel.text = @"上海 ⛅️ 多云转晴 21-29℃";
CGFloat width = self.scrollView.frame.size.width;
CGFloat height = self.scrollView.frame.size.height;
_scrollView.contentSize = CGSizeMake(ImageCount * width, 0);
for (int i = 0; i < ImageCount; i++) {
UIImageView *imageView = [[UIImageView alloc] init];
CGFloat imageX = i * width;
CGFloat imageY = 0.f;
imageView.frame = CGRectMake(imageX, imageY, width, height);
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"0%d", i]];
imageView.userInteractionEnabled = YES;
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGRClick:)];
[imageView addGestureRecognizer:tapGR];
[_scrollView addSubview:imageView];
}
// 设置时钟动画 定时器
self.timer = [NSTimer scheduledTimerWithTimeInterval:1.5f target:self selector:@selector(update:) userInfo:nil repeats:YES];
// 将定时器添加到主线程
[[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
} }
- (void)update:(NSTimer *)timer{
//定时移动
if (_isDragging == YES) {
return ;
}
CGPoint offSet = self.scrollView.contentOffset;
if (offSet.x == 0) {
offSet.x = _scrollView.frame.size.width;
} else if (offSet.x <= (ImageCount - 2) * _scrollView.frame.size.width){
offSet.x +=_scrollView.frame.size.width;
} else {
offSet.x = 0;
}
[self.scrollView setContentOffset:offSet animated:YES];
#pragma mark - UIScrollView Delegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat pageWidth = _scrollView.bounds.size.width;
float fractionalPage = _scrollView.contentOffset.x / pageWidth;
NSInteger nearestNumber = lround(fractionalPage);
if (_customPageControl.currentPage != nearestNumber) {
_customPageControl.currentPage = nearestNumber;
// 当scrollView在滑动
if (_scrollView.dragging) {
// 更新选中的小点点的位置
[_customPageControl updateCurrentPageDisplay];
}
}
} }
- (void)tapGRClick:(UITapGestureRecognizer *)sender - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
{ [_customPageControl updateCurrentPageDisplay] ;
NSLog(@"轮播图点击···");
} }
#pragma mark - UIScrollView Delegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
}
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView //#pragma mark - lazy loading
{ //- (UIImageView *)bgImageView
_isDragging = YES; //{
} // if (!_bgImageView) {
// 停止滚动 // _bgImageView = [[UIImageView alloc] init];
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView // _bgImageView.translatesAutoresizingMaskIntoConstraints = NO;
// _bgImageView.userInteractionEnabled = YES;
// [self addSubview:_bgImageView];
//
// NSLayoutConstraint *bgImageTop = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
// [self addConstraint:bgImageTop];
//
// NSLayoutConstraint *bgImageLeft = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
// [self addConstraint:bgImageLeft];
//
// NSLayoutConstraint *bgImageHeight = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:95];
// [self addConstraint:bgImageHeight];
//
// NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
// [self addConstraint:bgImageRight];
// }
// return _bgImageView;
//}
//
//- (UITextField *)searchTextField
//{
// if (!_searchTextField) {
// _searchTextField = [[UITextField alloc] init];
// _searchTextField.translatesAutoresizingMaskIntoConstraints = NO;
// _searchTextField.font = [UIFont systemFontOfSize:13.0];
// _searchTextField.textAlignment = NSTextAlignmentCenter;
// _searchTextField.layer.cornerRadius = 4.0;
// _searchTextField.textColor = [UIColor whiteColor];
// _searchTextField.layer.borderColor = [[UIColor whiteColor] CGColor];
// _searchTextField.layer.borderWidth = 0.5;
// _searchTextField.placeholder = @"查询";
// [_searchTextField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
// UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"search"]];
// imageV.contentMode = UIViewContentModeCenter;
// imageV.width += 10;
// _searchTextField.rightView = imageV;
// _searchTextField.rightViewMode = UITextFieldViewModeAlways;
// [self.bgImageView addSubview:_searchTextField];
//
// NSLayoutConstraint *bgImageTop = [NSLayoutConstraint constraintWithItem:_searchTextField attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeTop multiplier:1.0 constant:35];
// [self.bgImageView addConstraint:bgImageTop];
//
// NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_searchTextField attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self.bgImageView addConstraint:bgImageRight];
//
// NSLayoutConstraint *bgImageHeight = [NSLayoutConstraint constraintWithItem:_searchTextField attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:28];
// [self.bgImageView addConstraint:bgImageHeight];
//
// NSLayoutConstraint *bgImageWidth = [NSLayoutConstraint constraintWithItem:_searchTextField attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:100];
// [self.bgImageView addConstraint:bgImageWidth];
// }
// return _searchTextField;
//}
//
//- (UILabel *)nameLabel
//{
// if (!_nameLabel) {
// _nameLabel = [[UILabel alloc] init];
// _nameLabel.translatesAutoresizingMaskIntoConstraints = NO;
// _nameLabel.font = [UIFont systemFontOfSize:13.0];
// _nameLabel.textAlignment = NSTextAlignmentRight;
// _nameLabel.textColor = [UIColor whiteColor];
// [self.bgImageView addSubview:_nameLabel];
//
// NSLayoutConstraint *bgImageTop = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.searchTextField attribute:NSLayoutAttributeBottom multiplier:1.0 constant:3];
// [self.bgImageView addConstraint:bgImageTop];
//
// NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self.bgImageView addConstraint:bgImageRight];
//
// NSLayoutConstraint *bgImageBottom = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
// [self.bgImageView addConstraint:bgImageBottom];
//
// NSLayoutConstraint *bgImageWidth = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:95];
// [self.bgImageView addConstraint:bgImageWidth];
// }
// return _nameLabel;
//}
//
//- (UILabel *)shopnameLabel
//{
// if (!_shopnameLabel) {
// _shopnameLabel = [[UILabel alloc] init];
// _shopnameLabel.translatesAutoresizingMaskIntoConstraints = NO;
// _shopnameLabel.font = [UIFont systemFontOfSize:13.0];
// _shopnameLabel.textAlignment = NSTextAlignmentRight;
// _shopnameLabel.textColor = [UIColor whiteColor];
// [self.bgImageView addSubview:_shopnameLabel];
//
// NSLayoutConstraint *bgImageTop = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.searchTextField attribute:NSLayoutAttributeBottom multiplier:1.0 constant:3];
// [self.bgImageView addConstraint:bgImageTop];
//
// NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.nameLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:-10];
// [self.bgImageView addConstraint:bgImageRight];
//
// NSLayoutConstraint *bgImageBottom = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
// [self.bgImageView addConstraint:bgImageBottom];
//
// NSLayoutConstraint *bgImageLeft = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
// [self.bgImageView addConstraint:bgImageLeft];
// }
// return _shopnameLabel;
//}
- (UIView *)bgView
{ {
_isDragging = NO; if (!_bgView) {
_bgView = [[UIView alloc] init];
_bgView.translatesAutoresizingMaskIntoConstraints = NO;
_bgView.layer.borderWidth = 0.5;
_bgView.layer.borderColor = kSeparateLineCGColor;
[self addSubview:_bgView] ;
NSLayoutConstraint *bgImageTop = [NSLayoutConstraint constraintWithItem:_bgView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self addConstraint:bgImageTop];
NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_bgView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self addConstraint:bgImageRight];
NSLayoutConstraint *bgImageBottom = [NSLayoutConstraint constraintWithItem:_bgView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-10];
[self addConstraint:bgImageBottom];
NSLayoutConstraint *bgImageLeft = [NSLayoutConstraint constraintWithItem:_bgView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self addConstraint:bgImageLeft];
}
return _bgView;
} }
#pragma mark - lazy loading
- (UIScrollView *)scrollView - (UIScrollView *)scrollView
{ {
if (!_scrollView) { if (!_scrollView) {
_scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height)]; _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 86)];
_scrollView.bounces = NO; _scrollView.bounces = NO;
_scrollView.backgroundColor = [UIColor whiteColor];
_scrollView.pagingEnabled = YES; _scrollView.pagingEnabled = YES;
_scrollView.delegate = self; _scrollView.delegate = self;
_scrollView.showsHorizontalScrollIndicator = NO; _scrollView.showsHorizontalScrollIndicator = NO;
...@@ -120,27 +207,36 @@ ...@@ -120,27 +207,36 @@
return _scrollView; return _scrollView;
} }
- (UILabel *)weatherLabel - (CustomPageControl *)customPageControl
{ {
if (!_weatherLabel) { if (!_customPageControl) {
_weatherLabel = [[UILabel alloc] init]; _customPageControl = [[CustomPageControl alloc] init];
_weatherLabel.translatesAutoresizingMaskIntoConstraints = NO; _customPageControl.translatesAutoresizingMaskIntoConstraints = NO;
_weatherLabel.textAlignment = NSTextAlignmentRight; _customPageControl.backgroundColor = [UIColor clearColor];
_weatherLabel.textColor = [UIColor whiteColor]; [_customPageControl setCenter: CGPointMake(self.bgView.center.x, self.bgView.bounds.size.height-7.5f)] ;
_weatherLabel.font = [UIFont systemFontOfSize:15.0]; [_customPageControl setCurrentPage:0] ;
[_weatherLabel setShadowColor:[UIColor blackColor]]; [_customPageControl setDefersCurrentPageDisplay: YES] ;
[_weatherLabel setShadowOffset:CGSizeMake(1, 1)]; [_customPageControl setOnColor:kLineColor] ;
[self insertSubview:_weatherLabel aboveSubview:self.scrollView]; [_customPageControl setOffColor:kLineColor] ;
[_customPageControl setIndicatorDiameter:7.5f] ;
[_customPageControl setIndicatorSpace:8.0f] ;
[self.bgView addSubview:_customPageControl];
NSLayoutConstraint *weatherHeight = [NSLayoutConstraint constraintWithItem:_weatherLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:35]; NSLayoutConstraint *bgImageHeight = [NSLayoutConstraint constraintWithItem:_customPageControl attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:10];
[_weatherLabel addConstraint:weatherHeight]; [self.bgView addConstraint:bgImageHeight];
NSLayoutConstraint *weatherRight = [NSLayoutConstraint constraintWithItem:_weatherLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:-10]; NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_customPageControl attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.bgView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self addConstraint:weatherRight]; [self.bgView addConstraint:bgImageRight];
NSLayoutConstraint *bgImageBottom = [NSLayoutConstraint constraintWithItem:_customPageControl attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.bgView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
[self.bgView addConstraint:bgImageBottom];
NSLayoutConstraint *bgImageLeft = [NSLayoutConstraint constraintWithItem:_customPageControl attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.bgView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.bgView addConstraint:bgImageLeft];
NSLayoutConstraint *weatherBottom = [NSLayoutConstraint constraintWithItem:_weatherLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:weatherBottom];
} }
return _weatherLabel;
return _customPageControl;
} }
@end @end
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
#import "HomeViewController.h" #import "HomeViewController.h"
#import "HomeHeaderView.h" #import "HomeHeaderView.h"
#import "HomeFunctionCell.h"
#import "NewAnnounceCell.h"
#import "InspectListViewController.h" #import "InspectListViewController.h"
#import "RankingListViewController.h" #import "RankingListViewController.h"
...@@ -17,16 +16,56 @@ ...@@ -17,16 +16,56 @@
#import "PictureViewController.h" #import "PictureViewController.h"
#import "QuestionViewController.h" #import "QuestionViewController.h"
#define kNewAnnounceCell @"NewAnnounceTableViewCell" #import "HomeCellItem.h"
#define kHomeFunctionCell @"HomeFunctionCell"
#import "PictureTableCell.h"
#define kHomePictureListCell @"homePictureListCell"
#import "PictureStoryViewController.h"
#import "HomeTitleTableCell.h"
#define kHomeTitleTableCell @"homeTitleTableCell"
#import "RankingListCell.h"
#define kHomeRankingListCell @"homeRankingListsCell"
#import "RankDetailViewController.h"
#import "QuestionListTableCell.h"
#define kHomeQuestionListTableCell @"homeQuestionListTableCell"
#import "QuestionModel.h"
#import "QuestionDetailViewController.h"
#import "InspectListCell.h"
#define kHomeInspectListCell @"homeInspectListsCell"
#import "InspectTaskViewController.h"
@interface HomeViewController () <UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate> @interface HomeViewController () <UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate>
@property (nonatomic, strong) UIImageView *bgImageView; // 背景
@property (nonatomic, strong) UITextField *searchTextField; // 搜索框
@property (nonatomic, strong) UILabel *shopnameLabel; // 店名
@property (nonatomic, strong) UILabel *nameLabel; // 用户姓名
// 当前视图 // 当前视图
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) HomeHeaderView *headView; @property (nonatomic, strong) HomeHeaderView *headView;
@property (nonatomic, strong) NSArray *titleArray; // section标题 @property (nonatomic, strong) NSArray *titleArray; // section标题
@property (nonatomic, strong) NSArray *btnTitleArray; // section标题
@property (nonatomic, strong) NSArray *announeArray; // 公告内容 @property (nonatomic, strong) NSArray *announeArray; // 公告内容
@property (nonatomic, strong) NSArray *test1Array; // section标题
@property (nonatomic, strong) NSArray *test2Array; // section标题
@property (nonatomic, strong) NSArray *test3Array; // section标题
@property (nonatomic, strong) NSArray *test4Array;
@property (nonatomic, strong) NSArray *test5Array;
@property (nonatomic, strong) NSArray *test6Array;
@property (nonatomic, strong) NSArray *test7Array;
@property (nonatomic, strong) NSArray *test8Array;
@property (nonatomic, strong) NSArray *test9Array;
// rank cell
@property (nonatomic, strong) NSMutableDictionary *selectedIndexes;
@end @end
@implementation HomeViewController @implementation HomeViewController
...@@ -43,11 +82,28 @@ ...@@ -43,11 +82,28 @@
self.navigationItem.titleView = customLab; self.navigationItem.titleView = customLab;
// 初始化容器 // 初始化容器
self.titleArray = [NSArray arrayWithObjects:@"最新公告", @"常用功能", nil]; self.titleArray = [NSArray arrayWithObjects:@"图说口碑", @"8月口碑巡检",@"问题与知识",@"口碑任务", nil];
self.btnTitleArray = [NSArray arrayWithObjects:@"在线抽查", @"口碑报告",@"口碑标准",@"图说口碑",@"问题与知识",@"优秀案例", nil];
self.announeArray = [NSArray arrayWithObjects:@"关于展开10月口碑巡检的说明", @"迎2015十一大促活动启动", @"9月口碑巡检结果排名已公布", nil]; self.announeArray = [NSArray arrayWithObjects:@"关于展开10月口碑巡检的说明", @"迎2015十一大促活动启动", @"9月口碑巡检结果排名已公布", nil];
// 初始化
self.test1Array = [NSArray arrayWithObjects:@"【服务口碑现场】第二期",@"讲述红星人自己的故事",@"【服务口碑现场】第一期", nil];
self.test2Array = [NSArray arrayWithObjects:@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。",@"变成商场服务提升的契机,变成商场服务提升的契机。",@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。", nil];
self.test3Array = [NSArray arrayWithObjects:@"2015-08-26",@"2015-08-09",@"2015-07-31", nil];
self.test7Array = [NSArray arrayWithObjects:@"2015年9月口碑巡检",@"2015年9月卫生专项巡检",@"2015年9月真北店安全临时巡检",@"2015年10月卫生专项巡检",@"2015年10月设备安全巡检", nil];
self.test8Array = [NSArray arrayWithObjects:@"2015-09-01 10:28:52",@"2015-09-08 12:47:32",@"2015-10-21 07:58:22",@"2015-10-09 19:08:52",@"2015-09-01 14:19:52", nil];
self.test9Array = [NSArray arrayWithObjects:@"2015-09-03",@"2015-09-15",@"2015-10-22",@"2015-11-02",@"2015-11-05", nil];
self.test4Array = [NSArray arrayWithObjects:@"2",@"3",@"1",@"2",@"1", nil];
self.test5Array = [NSArray arrayWithObjects:@(5),@(12),@(0),@(8),@(20), nil];
self.test6Array = [NSArray arrayWithObjects:@(16),@(25),@(20),@(100),@(20), nil];
[self setupNav];
[self setupTableView]; [self setupTableView];
// 初始化容器
self.selectedIndexes = [[NSMutableDictionary alloc] init];
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
...@@ -55,6 +111,7 @@ ...@@ -55,6 +111,7 @@
[super viewWillAppear:animated]; [super viewWillAppear:animated];
self.tabBarController.tabBar.hidden = NO; self.tabBarController.tabBar.hidden = NO;
self.navigationController.navigationBar.hidden = YES;
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
...@@ -62,64 +119,195 @@ ...@@ -62,64 +119,195 @@
} }
#pragma mark - Private Methods #pragma mark - Private Methods
- (void)setupNav
{
UIEdgeInsets insets = UIEdgeInsetsMake( 0, 199, 0, 175);
UIImage *image = [[UIImage imageNamed:@"home_title"] resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch];
self.bgImageView.image = image;
self.searchTextField.backgroundColor = [UIColor clearColor];
self.nameLabel.backgroundColor = [UIColor clearColor];
_nameLabel.text = @"东方明珠,你好!";
self.shopnameLabel.backgroundColor = [UIColor clearColor];
_shopnameLabel.text = @"上海真北店";
}
- (void)setupTableView - (void)setupTableView
{ {
self.headView = [[HomeHeaderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 125)]; self.headView = [[HomeHeaderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 115)];
self.headView.scrollView.contentSize = CGSizeMake(2 * kScreenWidth, 85);
CGFloat itemW = kScreenWidth / 4;
CGFloat itemH = self.headView.scrollView.frame.size.height;
for (int i = 0; i < 6; i++) {
HomeCellItem *item = [[HomeCellItem alloc] init];
item.frame = CGRectMake(i * itemW, 0, itemW, itemH);
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"task_0%d", i]];
[item setImage:image forState:UIControlStateNormal];
[item setTitleColor:kPictureCellDetailsColor forState:UIControlStateNormal];
[item setTitle:[NSString stringWithFormat:@"%@", self.btnTitleArray[i]] forState:UIControlStateNormal];
[item addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
[self.headView.scrollView addSubview:item];
}
self.tableView.tableHeaderView = self.headView; self.tableView.tableHeaderView = self.headView;
} }
- (void)moreButtonClick:(UIButton *)sender - (void)moreButtonClick:(UIButton *)sender
{ {
NSLog(@"查看全部公告···"); NSLog(@"查看全部公告···");
} }
// 在线抽查或任务处理 - (void)itemClick:(HomeCellItem *)sender
- (void)onLineSamplingClick:(UIButton *)sender
{
OnLineViewController *onLineVC = [[OnLineViewController alloc] init];
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:onLineVC animated:YES];
}
// 口碑列表 或口碑排名
- (void)wordOfMouthClick:(UIButton *)sender
{ {
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init]; HomeCellItem *item = (HomeCellItem *)sender;
self.hidesBottomBarWhenPushed = YES; UINavigationController *nav;
[self.navigationController pushViewController:inspectListVC animated:YES]; if ([item.titleLabel.text isEqualToString:@"在线抽查"]) {
return;
} else if ([item.titleLabel.text isEqualToString:@"口碑报告"]) {
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
} else if ([item.titleLabel.text isEqualToString:@"口碑标准"]) {
return;
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
PictureViewController *pictureVC = [[PictureViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:pictureVC];
} else if ([item.titleLabel.text isEqualToString:@"问题与知识"]) {
QuestionViewController *questionVC = [[QuestionViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:questionVC];
} else if ([item.titleLabel.text isEqualToString:@"优秀案例"]) {
RankingListViewController *rankingListVC = [[RankingListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:rankingListVC];
} else {
return;
}
// RankingListViewController *rankListVC = [[RankingListViewController alloc] init]; [nav.navigationBar setBarTintColor:kNavigationBarColor];
// self.hidesBottomBarWhenPushed = YES; [nav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
// [self.navigationController pushViewController:rankListVC animated:YES]; [self presentViewController:nav animated:YES completion:nil];
} }
// 问题与知识
- (void)questionClick:(UIButton *)sender
{
QuestionViewController *questionVC = [[QuestionViewController alloc] init];
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:questionVC animated:YES];
}
- (void)standardClick:(UIButton *)sender // rank Cell
{ - (BOOL)cellIsSelected:(NSIndexPath *)indexPath {
// Return whether the cell at the specified index path is selected or not
NSNumber *selectedIndex = [_selectedIndexes objectForKey:indexPath];
return selectedIndex == nil ? FALSE : [selectedIndex boolValue];
} }
// 图说口碑 - (void)loadMoreInfo:(UIButton *)sender
- (void)pictureClick:(UIButton *)sender
{ {
PictureViewController *pictureVC = [[PictureViewController alloc] init]; RankingListCell * cell = (RankingListCell *)[[sender superview] superview];
self.hidesBottomBarWhenPushed = YES; cell.isDrop = !cell.isDrop;
[self.navigationController pushViewController:pictureVC animated:YES]; NSIndexPath * path = [self.tableView indexPathForCell:cell];
[_tableView deselectRowAtIndexPath:path animated:TRUE];
BOOL isSelected = ![self cellIsSelected:path];
NSNumber *selectedIndex = [NSNumber numberWithBool:isSelected];
[_selectedIndexes setObject:selectedIndex forKey:path];
if (cell.isDrop) {
[UIView animateWithDuration:0.2 animations:^{
cell.arrowImageView.transform = CGAffineTransformIdentity;
cell.arrowImageView.transform = CGAffineTransformMakeRotation(M_PI / 2);
}];
cell.someoneLabel = [[UILabel alloc] init];
cell.someoneLabel.text = @"集团领导某总";
cell.someoneLabel.font = [UIFont systemFontOfSize:15.0];
cell.someoneLabel.textAlignment = NSTextAlignmentCenter;
cell.someoneLabel.textColor = kRankHeadTitleTextColor;
cell.someoneLabel.translatesAutoresizingMaskIntoConstraints = NO;
[cell.contentView addSubview:cell.someoneLabel];
cell.dateLabel = [[UILabel alloc] init];
cell.dateLabel.text = @"2015-09-25 12:12:09";
cell.dateLabel.font = [UIFont systemFontOfSize:15.0];
cell.dateLabel.textAlignment = NSTextAlignmentCenter;
cell.dateLabel.textColor = kRankHeadTitleTextColor;
cell.dateLabel.translatesAutoresizingMaskIntoConstraints = NO;
[cell.contentView addSubview:cell.dateLabel];
cell.remarkLabel = [[UILabel alloc] init];
cell.remarkLabel.translatesAutoresizingMaskIntoConstraints = NO;
cell.remarkLabel.text = @"评语:该店进步非常大,值得大家一起学习!";
cell.remarkLabel.font = [UIFont systemFontOfSize:15.0];
cell.remarkLabel.textColor = kRankHeadTitleTextColor;
[cell.contentView addSubview:cell.remarkLabel];
NSLayoutConstraint *someoneTop = [NSLayoutConstraint constraintWithItem:cell.someoneLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.shopNameButton attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[cell.contentView addConstraint:someoneTop];
NSLayoutConstraint *someoneCenterX = [NSLayoutConstraint constraintWithItem:cell.someoneLabel attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:cell.shopNameButton attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:5];
[cell.contentView addConstraint:someoneCenterX];
NSLayoutConstraint *someoneWidth = [NSLayoutConstraint constraintWithItem:cell.someoneLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:100];
[cell.contentView addConstraint:someoneWidth];
NSLayoutConstraint *someoneHeight = [NSLayoutConstraint constraintWithItem:cell.someoneLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[cell.contentView addConstraint:someoneHeight];
//
NSLayoutConstraint *dateTop = [NSLayoutConstraint constraintWithItem:cell.dateLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.shopNameButton attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[cell.contentView addConstraint:dateTop];
NSLayoutConstraint *dateLeft = [NSLayoutConstraint constraintWithItem:cell.dateLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:cell.someoneLabel attribute:NSLayoutAttributeRight multiplier:1.0 constant:10];
[cell.contentView addConstraint:dateLeft];
NSLayoutConstraint *dateRight = [NSLayoutConstraint constraintWithItem:cell.dateLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[cell.contentView addConstraint:dateRight];
NSLayoutConstraint *dateHeight = [NSLayoutConstraint constraintWithItem:cell.dateLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[cell.contentView addConstraint:dateHeight];
//
NSLayoutConstraint *remarkTop = [NSLayoutConstraint constraintWithItem:cell.remarkLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.someoneLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[cell.contentView addConstraint:remarkTop];
NSLayoutConstraint *remarkLeft = [NSLayoutConstraint constraintWithItem:cell.remarkLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:cell.someoneLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:5];
[cell.contentView addConstraint:remarkLeft];
NSLayoutConstraint *remarkRight = [NSLayoutConstraint constraintWithItem:cell.remarkLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[cell.contentView addConstraint:remarkRight];
NSLayoutConstraint *remarkHeight = [NSLayoutConstraint constraintWithItem:cell.remarkLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[cell.contentView addConstraint:remarkHeight];
} else {
[UIView animateWithDuration:0.2 animations:^{
cell.arrowImageView.transform = CGAffineTransformIdentity;
cell.arrowImageView.transform = CGAffineTransformMakeRotation(0);
}];
if (cell.someoneLabel) {
[cell.someoneLabel removeFromSuperview];
cell.someoneLabel = nil;
}
if (cell.dateLabel) {
[cell.dateLabel removeFromSuperview];
cell.dateLabel = nil;
}
if (cell.remarkLabel) {
[cell.remarkLabel removeFromSuperview];
cell.remarkLabel = nil;
}
}
[_tableView beginUpdates];
[_tableView endUpdates];
} }
- (void)caseClick:(UIButton *)sender
{
RankingListViewController *rankListVC = [[RankingListViewController alloc] init];
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:rankListVC animated:YES];
}
...@@ -133,49 +321,152 @@ ...@@ -133,49 +321,152 @@
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
if (section == 0) { if (section == 1) {
return 3; return 4;
} else { } else {
return 1; return 2;
} }
} }
// cell显示的内容 // cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
if (indexPath.section == 0) { if (indexPath.section == 0) {
NewAnnounceCell *cell=[tableView dequeueReusableCellWithIdentifier:kNewAnnounceCell];
// 图说口碑
PictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomePictureListCell];
if (!cell) { if (!cell) {
cell = [[NewAnnounceCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kNewAnnounceCell]; cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomePictureListCell];
} }
cell.announceLabel.text = _announeArray[indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.titleLabel.text = _test1Array[indexPath.row];
cell.detailsLabel.text = _test2Array[indexPath.row];
cell.dateLabel.text = [NSString stringWithFormat:@"发布时间: %@", _test3Array[indexPath.row]];
[cell.thumbBtn setTitle:@"220" forState:UIControlStateNormal];
[cell.commentBtn setTitle:@"18" forState:UIControlStateNormal];
return cell;
} else if (indexPath.section == 1) {
// 口碑巡检
if (indexPath.row == 0) {
HomeTitleTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeTitleTableCell];
if (!cell) {
cell = [[HomeTitleTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeTitleTableCell];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else {
RankingListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeRankingListCell];
if (!cell) {
cell = [[RankingListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeRankingListCell];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.scoreState = ScoreStateHigh;
NSString *imageName = [NSString stringWithFormat:@"medal_0%ld", (long)(indexPath.row)];
cell.gradeImageView.image = [UIImage imageNamed:imageName];
[cell.shopNameButton setTitle:@"上海真北店" forState:UIControlStateNormal];
cell.scoreLabel.text = @"98";
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// 添加点击事件
[cell.shopNameButton addTarget:self action:@selector(loadMoreInfo:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
} else if (indexPath.section == 2) {
QuestionListTableCell *cell = [tableView dequeueReusableCellWithIdentifier:kHomeQuestionListTableCell];
if (!cell) {
cell = [[QuestionListTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeQuestionListTableCell];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
QuestionModel *question = [[QuestionModel alloc] init];
question.content = @"OMS系统不能执行15分钟退货程序处理,应该添加";
question.feedback = @"启动线下“30天无理由退货”程序处理OMS系统的相关问题";
question.categoryName = @"送货跟单-送货跟单";
question.submitTime = @"2015-09-11 10:23:12";
cell.question = question;
return cell; return cell;
} else { } else {
HomeFunctionCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeFunctionCell]; InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomeInspectListCell];
if (!cell) { if (!cell) {
cell = [[HomeFunctionCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeFunctionCell]; cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeInspectListCell];
} }
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell.onLineSamplingBtn addTarget:self action:@selector(onLineSamplingClick:) forControlEvents:UIControlEventTouchUpInside]; cell.titleLabel.text = [NSString stringWithFormat:@"%@", _test7Array[indexPath.row]];
[cell.wordOfMouthBtn addTarget:self action:@selector(wordOfMouthClick:) forControlEvents:UIControlEventTouchUpInside]; cell.startDate.text = [NSString stringWithFormat:@"起始时间:%@", _test8Array[indexPath.row]];
[cell.questionBtn addTarget:self action:@selector(questionClick:) forControlEvents:UIControlEventTouchUpInside]; cell.overDate.text = [NSString stringWithFormat:@"截止时间:%@", _test9Array[indexPath.row]];
[cell.standardBtn addTarget:self action:@selector(standardClick:) forControlEvents:UIControlEventTouchUpInside]; if ([_test4Array[indexPath.row] isEqualToString:@"1"]) {
[cell.pictureBtn addTarget:self action:@selector(pictureClick:) forControlEvents:UIControlEventTouchUpInside]; cell.progressState = ProgressStateUnSettled;
[cell.caseBtn addTarget:self action:@selector(caseClick:) forControlEvents:UIControlEventTouchUpInside]; } else if ([_test4Array[indexPath.row] isEqualToString:@"2"]) {
cell.progressState = ProgressStateDealWith;
} else {
cell.progressState = ProgressStateOverDue;
}
cell.alreadyLabel.text = [NSString stringWithFormat:@"%@", _test5Array[indexPath.row]];
cell.allLabel.text = [NSString stringWithFormat:@"/%@", _test6Array[indexPath.row]];
CGFloat already = [_test5Array[indexPath.row] floatValue];
CGFloat all = [_test6Array[indexPath.row] floatValue];
cell.multiplier = already / all;
cell.allView.backgroundColor = kProgressViewAllBackColor;
cell.alreadyView.backgroundColor = kProgressViewAlreadyBackColor;
return cell; return cell;
} }
}
// cell点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0) {
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
[self.navigationController pushViewController:storyVC animated:YES];
} else if (indexPath.section == 1) {
if (indexPath.row != 0) {
RankDetailViewController *rankDetailVC = [[RankDetailViewController alloc] init];
rankDetailVC.indexRow = indexPath.row - 1;
[self.navigationController pushViewController:rankDetailVC animated:YES];
}
} else if (indexPath.section == 2) {
QuestionDetailViewController *questionDetailVC = [[QuestionDetailViewController alloc] init];
QuestionModel *question = [[QuestionModel alloc] init];
question.content = @"OMS系统不能执行15分钟退货程序处理,应该添加";
question.feedback = @"启动线下“30天无理由退货”程序处理OMS系统的相关问题";
question.categoryName = @"送货跟单-送货跟单";
question.submitTime = @"2015-09-11 10:23:12";
questionDetailVC.question = question;
[self.navigationController pushViewController:questionDetailVC animated:YES];
} else {
InspectListCell *cell = (InspectListCell *)[self tableView:_tableView cellForRowAtIndexPath:indexPath];
InspectTaskViewController *inspectTaskVC = [[InspectTaskViewController alloc] init];
inspectTaskVC.multiplier = cell.multiplier;
inspectTaskVC.alreadyNumber = cell.alreadyLabel.text;
inspectTaskVC.allNumber = cell.allLabel.text;
inspectTaskVC.progressState = cell.progressState;
[self.navigationController pushViewController:inspectTaskVC animated:YES];
}
} }
// cell的高度 // cell的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
if (indexPath.section == 0) { if (indexPath.section == 0) {
return 40; return 123;
} else if (indexPath.section == 1) {
if (indexPath.row == 0) {
return 40;
} else {
if([self cellIsSelected:indexPath]) {
return 108;
}
return 50;
}
} else if (indexPath.section == 2) {
return 120;
} else { } else {
return 240; return 145;
} }
} }
...@@ -187,86 +478,218 @@ ...@@ -187,86 +478,218 @@
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{ {
return CGFLOAT_MIN; return 10;
} }
// 自定义section // 自定义section
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{ {
// 创建sectionView // 创建sectionView
UIView *sectionView = [[UIView alloc] init]; UIView *sectionView = [[UIView alloc] init];
sectionView.userInteractionEnabled = YES; sectionView.userInteractionEnabled = YES;
sectionView.backgroundColor = kSectionBackGroundColor; sectionView.backgroundColor = [UIColor whiteColor];
UIView *lineView = [[UIView alloc] init];
lineView.translatesAutoresizingMaskIntoConstraints = NO;
lineView.backgroundColor = kSeparateLineColor;
[sectionView addSubview:lineView];
NSLayoutConstraint *lineTop = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[sectionView addConstraint:lineTop];
NSLayoutConstraint *lineLeft = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[sectionView addConstraint:lineLeft];
NSLayoutConstraint *lineRight = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[sectionView addConstraint:lineRight];
NSLayoutConstraint *lineHeight = [NSLayoutConstraint constraintWithItem:lineView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0.5];
[sectionView addConstraint:lineHeight];
// 创建标题label // 创建标题label
UILabel *titleLabel = [[UILabel alloc] init]; UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.translatesAutoresizingMaskIntoConstraints = NO; titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
titleLabel.textColor = kHomeSectionTitleTextColor; titleLabel.textColor = kPictureCellDetailsColor;
titleLabel.font = [UIFont systemFontOfSize:17.0]; titleLabel.font = [UIFont systemFontOfSize:17.0];
titleLabel.text = _titleArray[section]; titleLabel.text = _titleArray[section];
[sectionView addSubview:titleLabel]; [sectionView addSubview:titleLabel];
// 查看更多按钮
UIButton *moreButton = [[UIButton alloc] init];
moreButton.translatesAutoresizingMaskIntoConstraints = NO;
[moreButton setTitle:@"更多" forState:UIControlStateNormal];
[moreButton setTitleColor:kMoreButtonTextColor forState:UIControlStateNormal];
[moreButton addTarget:self action:@selector(moreButtonClick:) forControlEvents:UIControlEventTouchUpInside];
moreButton.titleLabel.font = [UIFont systemFontOfSize:13.0];
[sectionView addSubview:moreButton];
// 箭头Iamge
UIImageView *arrowIamgeView = [[UIImageView alloc] init];
arrowIamgeView.image = [UIImage imageNamed:@"arrow_right"];
arrowIamgeView.translatesAutoresizingMaskIntoConstraints = NO;
[sectionView addSubview:arrowIamgeView];
NSLayoutConstraint *titleLabelTop = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:3]; NSLayoutConstraint *titleLabelTop = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:3];
[sectionView addConstraint:titleLabelTop]; [sectionView addConstraint:titleLabelTop];
NSLayoutConstraint *titleLabelLeft = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20]; NSLayoutConstraint *titleLabelLeft = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[sectionView addConstraint:titleLabelLeft]; [sectionView addConstraint:titleLabelLeft];
NSLayoutConstraint *titleLabelWidth = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:80]; NSLayoutConstraint *titleLabelRight = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:moreButton attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[sectionView addConstraint:titleLabelWidth]; [sectionView addConstraint:titleLabelRight];
NSLayoutConstraint *titleLabelBottom = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *titleLabelBottom = [NSLayoutConstraint constraintWithItem:titleLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[sectionView addConstraint:titleLabelBottom]; [sectionView addConstraint:titleLabelBottom];
if (section == 0) {
// 查看更多按钮
UIButton *moreButton = [[UIButton alloc] init];
moreButton.translatesAutoresizingMaskIntoConstraints = NO; // moreButton布局
[moreButton setTitle:@"查看全部" forState:UIControlStateNormal]; NSLayoutConstraint *moreButtonTop = [NSLayoutConstraint constraintWithItem:moreButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:3];
[moreButton setTitleColor:kMoreButtonTextColor forState:UIControlStateNormal]; [sectionView addConstraint:moreButtonTop];
[moreButton addTarget:self action:@selector(moreButtonClick:) forControlEvents:UIControlEventTouchUpInside];
moreButton.titleLabel.font = [UIFont systemFontOfSize:13.0]; NSLayoutConstraint *moreButtonRight = [NSLayoutConstraint constraintWithItem:moreButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:arrowIamgeView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[sectionView addSubview:moreButton]; [sectionView addConstraint:moreButtonRight];
NSLayoutConstraint *moreButtonWidth = [NSLayoutConstraint constraintWithItem:moreButton attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:35];
[sectionView addConstraint:moreButtonWidth];
NSLayoutConstraint *moreButtonBottom = [NSLayoutConstraint constraintWithItem:moreButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[sectionView addConstraint:moreButtonBottom];
// arrowIamgeView布局
NSLayoutConstraint *arrowIamgeViewTop = [NSLayoutConstraint constraintWithItem:arrowIamgeView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:13];
[sectionView addConstraint:arrowIamgeViewTop];
NSLayoutConstraint *arrowIamgeViewRight = [NSLayoutConstraint constraintWithItem:arrowIamgeView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[sectionView addConstraint:arrowIamgeViewRight];
NSLayoutConstraint *arrowIamgeViewWidth = [NSLayoutConstraint constraintWithItem:arrowIamgeView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:7];
[sectionView addConstraint:arrowIamgeViewWidth];
NSLayoutConstraint *arrowIamgeViewHeight = [NSLayoutConstraint constraintWithItem:arrowIamgeView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:12];
[sectionView addConstraint:arrowIamgeViewHeight];
return sectionView;
}
#pragma mark - lazy loading
- (UIImageView *)bgImageView
{
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] init];
_bgImageView.translatesAutoresizingMaskIntoConstraints = NO;
_bgImageView.userInteractionEnabled = YES;
[self.view addSubview:_bgImageView];
NSLayoutConstraint *bgImageTop = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:bgImageTop];
NSLayoutConstraint *bgImageLeft = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:bgImageLeft];
NSLayoutConstraint *bgImageHeight = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:95];
[self.view addConstraint:bgImageHeight];
NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_bgImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:bgImageRight];
}
return _bgImageView;
}
- (UITextField *)searchTextField
{
if (!_searchTextField) {
_searchTextField = [[UITextField alloc] init];
_searchTextField.translatesAutoresizingMaskIntoConstraints = NO;
_searchTextField.font = [UIFont systemFontOfSize:13.0];
_searchTextField.textAlignment = NSTextAlignmentCenter;
_searchTextField.layer.cornerRadius = 4.0;
_searchTextField.textColor = [UIColor whiteColor];
_searchTextField.layer.borderColor = [[UIColor whiteColor] CGColor];
_searchTextField.layer.borderWidth = 0.5;
_searchTextField.placeholder = @"查询";
[_searchTextField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
UIImageView *imageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"search"]];
imageV.contentMode = UIViewContentModeCenter;
imageV.width += 10;
_searchTextField.rightView = imageV;
_searchTextField.rightViewMode = UITextFieldViewModeAlways;
[self.bgImageView addSubview:_searchTextField];
// 箭头Iamge NSLayoutConstraint *bgImageTop = [NSLayoutConstraint constraintWithItem:_searchTextField attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeTop multiplier:1.0 constant:35];
UIImageView *arrowIamgeView = [[UIImageView alloc] init]; [self.bgImageView addConstraint:bgImageTop];
arrowIamgeView.image = [UIImage imageNamed:@"arrow_right"];
arrowIamgeView.translatesAutoresizingMaskIntoConstraints = NO;
[sectionView addSubview:arrowIamgeView];
// moreButton布局 NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_searchTextField attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
NSLayoutConstraint *moreButtonTop = [NSLayoutConstraint constraintWithItem:moreButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:3]; [self.bgImageView addConstraint:bgImageRight];
[sectionView addConstraint:moreButtonTop];
NSLayoutConstraint *moreButtonRight = [NSLayoutConstraint constraintWithItem:moreButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:arrowIamgeView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *bgImageHeight = [NSLayoutConstraint constraintWithItem:_searchTextField attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:28];
[sectionView addConstraint:moreButtonRight]; [self.bgImageView addConstraint:bgImageHeight];
NSLayoutConstraint *moreButtonWidth = [NSLayoutConstraint constraintWithItem:moreButton attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:60]; NSLayoutConstraint *bgImageWidth = [NSLayoutConstraint constraintWithItem:_searchTextField attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:100];
[sectionView addConstraint:moreButtonWidth]; [self.bgImageView addConstraint:bgImageWidth];
}
return _searchTextField;
}
- (UILabel *)nameLabel
{
if (!_nameLabel) {
_nameLabel = [[UILabel alloc] init];
_nameLabel.translatesAutoresizingMaskIntoConstraints = NO;
_nameLabel.font = [UIFont systemFontOfSize:13.0];
_nameLabel.textAlignment = NSTextAlignmentRight;
_nameLabel.textColor = [UIColor whiteColor];
[self.bgImageView addSubview:_nameLabel];
NSLayoutConstraint *moreButtonBottom = [NSLayoutConstraint constraintWithItem:moreButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *bgImageTop = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.searchTextField attribute:NSLayoutAttributeBottom multiplier:1.0 constant:3];
[sectionView addConstraint:moreButtonBottom]; [self.bgImageView addConstraint:bgImageTop];
// arrowIamgeView布局 NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
NSLayoutConstraint *arrowIamgeViewTop = [NSLayoutConstraint constraintWithItem:arrowIamgeView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:13]; [self.bgImageView addConstraint:bgImageRight];
[sectionView addConstraint:arrowIamgeViewTop];
NSLayoutConstraint *bgImageBottom = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.bgImageView addConstraint:bgImageBottom];
NSLayoutConstraint *bgImageWidth = [NSLayoutConstraint constraintWithItem:_nameLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:95];
[self.bgImageView addConstraint:bgImageWidth];
}
return _nameLabel;
}
- (UILabel *)shopnameLabel
{
if (!_shopnameLabel) {
_shopnameLabel = [[UILabel alloc] init];
_shopnameLabel.translatesAutoresizingMaskIntoConstraints = NO;
_shopnameLabel.font = [UIFont systemFontOfSize:13.0];
_shopnameLabel.textAlignment = NSTextAlignmentRight;
_shopnameLabel.textColor = [UIColor whiteColor];
[self.bgImageView addSubview:_shopnameLabel];
NSLayoutConstraint *arrowIamgeViewRight = [NSLayoutConstraint constraintWithItem:arrowIamgeView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20]; NSLayoutConstraint *bgImageTop = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.searchTextField attribute:NSLayoutAttributeBottom multiplier:1.0 constant:3];
[sectionView addConstraint:arrowIamgeViewRight]; [self.bgImageView addConstraint:bgImageTop];
NSLayoutConstraint *arrowIamgeViewWidth = [NSLayoutConstraint constraintWithItem:arrowIamgeView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:7]; NSLayoutConstraint *bgImageRight = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.nameLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:-10];
[sectionView addConstraint:arrowIamgeViewWidth]; [self.bgImageView addConstraint:bgImageRight];
NSLayoutConstraint *arrowIamgeViewHeight = [NSLayoutConstraint constraintWithItem:arrowIamgeView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:12]; NSLayoutConstraint *bgImageBottom = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[sectionView addConstraint:arrowIamgeViewHeight]; [self.bgImageView addConstraint:bgImageBottom];
} else {
NSLayoutConstraint *bgImageLeft = [NSLayoutConstraint constraintWithItem:_shopnameLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.bgImageView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.bgImageView addConstraint:bgImageLeft];
} }
return _shopnameLabel;
return sectionView;
} }
#pragma mark - lazy loading
- (UITableView *)tableView - (UITableView *)tableView
{ {
if (!_tableView) { if (!_tableView) {
...@@ -276,11 +699,15 @@ ...@@ -276,11 +699,15 @@
_tableView.dataSource = self; _tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO; _tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO; _tableView.showsHorizontalScrollIndicator = NO;
[_tableView registerClass:[NewAnnounceCell class] forCellReuseIdentifier:kNewAnnounceCell];
[_tableView registerClass:[HomeFunctionCell class] forCellReuseIdentifier:kHomeFunctionCell]; [_tableView registerClass:[PictureTableCell class] forCellReuseIdentifier:kHomePictureListCell];
[_tableView registerClass:[HomeTitleTableCell class] forCellReuseIdentifier:kHomeTitleTableCell];
[_tableView registerClass:[RankingListCell class] forCellReuseIdentifier:kHomeRankingListCell];
[_tableView registerClass:[QuestionListTableCell class] forCellReuseIdentifier:kHomeQuestionListTableCell];
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:95];
[self.view addConstraint:tableTop]; [self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
...@@ -289,7 +716,7 @@ ...@@ -289,7 +716,7 @@
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight]; [self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0]; NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-40];
[self.view addConstraint:tableBottom]; [self.view addConstraint:tableBottom];
} }
return _tableView; return _tableView;
......
...@@ -108,31 +108,35 @@ ...@@ -108,31 +108,35 @@
*/ */
- (void)loginButtonClick:(UIButton *)sender - (void)loginButtonClick:(UIButton *)sender
{ {
if (self.loginView.usernameTextFiled.text.length == 0 || self.loginView.passwordTextFiled.text.length == 0) { // 进入RootTabBar
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"账号、密码不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; self.rootTBC = [[RootTabBarController alloc] init];
[alertView show]; [self presentViewController:_rootTBC animated:YES completion:nil];
return;
}
HttpClient *httpClient = [[HttpClient alloc] initWithLogin]; // if (self.loginView.usernameTextFiled.text.length == 0 || self.loginView.passwordTextFiled.text.length == 0) {
[httpClient loginWithUsername:self.loginView.usernameTextFiled.text password:self.loginView.passwordTextFiled.text completion:^(id response, NSError *error) { // UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"账号、密码不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
if ([response[@"message"] isEqualToString:@"ok"]) { // [alertView show];
// return;
// 保存登陆信息 // }
[[NSUserDefaults standardUserDefaults] setObject:self.loginView.usernameTextFiled.text forKey:@"username"]; //
[[NSUserDefaults standardUserDefaults] setObject:self.loginView.passwordTextFiled.text forKey:@"password"]; // HttpClient *httpClient = [[HttpClient alloc] initWithLogin];
[[NSUserDefaults standardUserDefaults] setObject:response[@"message"] forKey:@"loginMessage"]; // [httpClient loginWithUsername:self.loginView.usernameTextFiled.text password:self.loginView.passwordTextFiled.text completion:^(id response, NSError *error) {
[[NSUserDefaults standardUserDefaults] setObject:response[@"data"] forKey:@"loginData"]; // if ([response[@"message"] isEqualToString:@"ok"]) {
//
// 进入RootTabBar // // 保存登陆信息
self.rootTBC = [[RootTabBarController alloc] init]; // [[NSUserDefaults standardUserDefaults] setObject:self.loginView.usernameTextFiled.text forKey:@"username"];
[self presentViewController:_rootTBC animated:YES completion:nil]; // [[NSUserDefaults standardUserDefaults] setObject:self.loginView.passwordTextFiled.text forKey:@"password"];
// [[NSUserDefaults standardUserDefaults] setObject:response[@"message"] forKey:@"loginMessage"];
} else { // [[NSUserDefaults standardUserDefaults] setObject:response[@"data"] forKey:@"loginData"];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:@"%@", response[@"message"]] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; //
[alertView show]; // // 进入RootTabBar
} // self.rootTBC = [[RootTabBarController alloc] init];
}]; // [self presentViewController:_rootTBC animated:YES completion:nil];
//
// } else {
// UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:@"%@", response[@"message"]] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
// [alertView show];
// }
// }];
} }
......
//
// CustomPageControl.h
// Parking
//
// Created by admin on 15/9/16.
// Copyright (c) 2015年 moobox. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CustomPageControl : UIControl
@property(nonatomic) NSInteger numberOfPages; // 小点点的数量
@property(nonatomic) NSInteger currentPage; // 选中的小点点
@property(nonatomic) BOOL hidesForSinglePage ;
@property(nonatomic) BOOL defersCurrentPageDisplay ;
@property (nonatomic,retain) UIColor *onColor; // 选中小点点的颜色
@property (nonatomic,retain) UIColor *offColor; // 未选中小点点颜色
@property (nonatomic) CGFloat indicatorDiameter; // 小点点直径
@property (nonatomic) CGFloat indicatorSpace; // 小点点的间距
// 更新(重画)选中小点点
- (void)updateCurrentPageDisplay;
@end
//
// CustomPageControl.m
// Parking
//
// Created by admin on 15/9/16.
// Copyright (c) 2015年 moobox. All rights reserved.
//
#import "CustomPageControl.h"
#define kDotDiameter 4.0f
#define kDotSpace 12.0f
@implementation CustomPageControl
@synthesize numberOfPages ;
@synthesize currentPage ;
@synthesize hidesForSinglePage ;
@synthesize defersCurrentPageDisplay ;
@synthesize onColor ;
@synthesize offColor ;
@synthesize indicatorDiameter ;
@synthesize indicatorSpace ;
#pragma mark - init
- (id)init {
self = [self initWithFrame:CGRectZero] ;
return self ;
}
- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:CGRectZero])) {
self.backgroundColor = [UIColor clearColor] ;
}
return self ;
}
#pragma mark - drawRect
- (void)drawRect:(CGRect)rect {
// 获取上下文
CGContextRef context = UIGraphicsGetCurrentContext() ;
CGContextSaveGState(context) ;
CGContextSetAllowsAntialiasing(context, TRUE) ;
// 判断小点点直径 间距
CGFloat diameter = (indicatorDiameter > 0) ? indicatorDiameter : kDotDiameter ;
CGFloat space = (indicatorSpace > 0) ? indicatorSpace : kDotSpace ;
// 整个pageControl的bounds
CGRect currentBounds = self.bounds;
CGFloat dotsWidth = self.numberOfPages * diameter + MAX(0, self.numberOfPages - 1) * space;
CGFloat x = CGRectGetMidX(currentBounds) - dotsWidth / 2;
CGFloat y = CGRectGetMidY(currentBounds) - diameter / 2;
// 设置选中和未选中的小点点的颜色
CGColorRef onColorCG = onColor ? onColor.CGColor : [UIColor colorWithWhite: 1.0f alpha: 1.0f].CGColor ;
CGColorRef offColorCG = offColor ? offColor.CGColor : [UIColor colorWithWhite: 0.7f alpha: 0.5f].CGColor ;
// 遍历画(draw)点
for (int i = 0 ; i < numberOfPages ; i++)
{
CGRect dotRect = CGRectMake(x, y, diameter, diameter) ;
if (i == currentPage) {
CGContextSetFillColorWithColor(context, onColorCG) ;
CGContextFillEllipseInRect(context, CGRectInset(dotRect, -0.5f, -0.5f)) ;
} else {
CGContextSetStrokeColorWithColor(context, offColorCG) ;
CGContextStrokeEllipseInRect(context, dotRect) ;
}
x += diameter + space ;
}
// 恢复画板
CGContextRestoreGState(context) ;
}
#pragma mark - 重写setter方法
- (void)setCurrentPage:(NSInteger)pageNumber {
if (currentPage == pageNumber) {
return;
}
currentPage = MIN(MAX(0, pageNumber), numberOfPages - 1);
if (self.defersCurrentPageDisplay == NO) {
[self setNeedsDisplay];
}
}
- (void)setNumberOfPages:(NSInteger)numOfPages {
numberOfPages = MAX(0, numOfPages);
currentPage = MIN(MAX(0, currentPage), numberOfPages - 1);
self.bounds = self.bounds;
[self setNeedsDisplay];
if (hidesForSinglePage && (numOfPages < 2)) {
[self setHidden: YES];
} else {
[self setHidden: NO];
}
}
- (void)setHidesForSinglePage:(BOOL)hide {
hidesForSinglePage = hide ;
if (hidesForSinglePage && (numberOfPages < 2)){
[self setHidden:YES];
}
}
- (void)setDefersCurrentPageDisplay:(BOOL)defers {
defersCurrentPageDisplay = defers ;
}
- (void)setOnColor:(UIColor *)aColor {
onColor = aColor;
[self setNeedsDisplay];
}
- (void)setOffColor:(UIColor *)aColor {
offColor = aColor;
[self setNeedsDisplay];
}
- (void)setIndicatorDiameter:(CGFloat)aDiameter {
indicatorDiameter = aDiameter;
self.bounds = self.bounds;
[self setNeedsDisplay];
}
- (void)setIndicatorSpace:(CGFloat)aSpace {
indicatorSpace = aSpace;
self.bounds = self.bounds;
[self setNeedsDisplay];
}
- (void)setFrame:(CGRect)aFrame {
aFrame.size = [self sizeForNumberOfPages:numberOfPages];
super.frame = aFrame;
}
- (void)setBounds:(CGRect)aBounds {
aBounds.size = [self sizeForNumberOfPages: numberOfPages];
super.bounds = aBounds;
}
#pragma mark UIPageControl methods
- (void)updateCurrentPageDisplay {
if (self.defersCurrentPageDisplay == NO) {
return;
}
[self setNeedsDisplay] ;
}
- (CGSize)sizeForNumberOfPages:(NSInteger)pageCount {
CGFloat diameter = (indicatorDiameter > 0) ? indicatorDiameter : kDotDiameter;
CGFloat space = (indicatorSpace > 0) ? indicatorSpace : kDotSpace;
return CGSizeMake(pageCount * diameter + (pageCount - 1) * space + 44.0f, MAX(44.0f, diameter + 4.0f));
}
#pragma mark - Touches handlers
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
// 获取触摸的地方
UITouch *theTouch = [touches anyObject] ;
CGPoint touchLocation = [theTouch locationInView: self] ;
// 检测触摸的方向
if (touchLocation.x < (self.bounds.size.width / 2)) {
self.currentPage = MAX(self.currentPage - 1, 0);
} else {
self.currentPage = MIN(self.currentPage + 1, numberOfPages - 1);
}
[self sendActionsForControlEvents: UIControlEventValueChanged] ;
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment