Commit eb106734 authored by admin's avatar admin

口碑排名完成

parent 54c14e77
......@@ -8,6 +8,13 @@
/* Begin PBXBuildFile section */
2381E9EBA834CB171E43657A /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 083F3F95EB690FA24FEC0C8E /* libPods.a */; };
8409BDF81C281ACD00354460 /* CheckBoxButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8409BDE81C281ACD00354460 /* CheckBoxButton.m */; };
8409BDF91C281ACD00354460 /* SelectYetTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8409BDEA1C281ACD00354460 /* SelectYetTableViewCell.m */; };
8409BDFA1C281ACD00354460 /* TreeNodeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8409BDEC1C281ACD00354460 /* TreeNodeCell.m */; };
8409BDFB1C281ACD00354460 /* TreeNodeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8409BDEF1C281ACD00354460 /* TreeNodeModel.m */; };
8409BDFC1C281ACD00354460 /* SelectStoreHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8409BDF21C281ACD00354460 /* SelectStoreHeadView.m */; };
8409BDFD1C281ACD00354460 /* TreeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8409BDF41C281ACD00354460 /* TreeView.m */; };
8409BDFE1C281ACD00354460 /* SelectStoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8409BDF71C281ACD00354460 /* SelectStoreViewController.m */; };
840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 840ABECB1BE1C29F006E49C5 /* RankDetailViewController.m */; };
8419EAD41BEDC98F002635ED /* HttpClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 8419EAD31BEDC98F002635ED /* HttpClient.m */; };
841D24F81BEB473C0005CC9F /* CheckPicViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 841D24F71BEB473C0005CC9F /* CheckPicViewController.m */; };
......@@ -22,10 +29,6 @@
846ABDF51C1E5E780020C331 /* PictureListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABDF41C1E5E780020C331 /* PictureListModel.m */; };
846ABDF91C1E74430020C331 /* PictureDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABDF81C1E74430020C331 /* PictureDetailModel.m */; };
846ABDFC1C1EAB160020C331 /* PicTextModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABDFB1C1EAB160020C331 /* PicTextModel.m */; };
846ABE0A1C1EE3970020C331 /* AreaModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABE011C1EE3970020C331 /* AreaModel.m */; };
846ABE0B1C1EE3970020C331 /* ProvinceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABE031C1EE3970020C331 /* ProvinceModel.m */; };
846ABE0C1C1EE3970020C331 /* StoreModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABE051C1EE3970020C331 /* StoreModel.m */; };
846ABE0D1C1EE3970020C331 /* SelectStoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 846ABE091C1EE3970020C331 /* SelectStoreViewController.m */; };
84720BC11C0377D300314099 /* CommentWithStarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84720BC01C0377D300314099 /* CommentWithStarView.m */; };
8473E3881C1BBFF600960257 /* InspectTaskDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8473E3871C1BBFF600960257 /* InspectTaskDetailCell.m */; };
8473E38B1C1BCFC400960257 /* InspectTitleTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8473E38A1C1BCFC400960257 /* InspectTitleTableViewCell.m */; };
......@@ -35,9 +38,6 @@
8474C5921BE78A85007DCF19 /* QuestionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474C5901BE78A85007DCF19 /* QuestionViewController.m */; };
8474C5951BE78AE1007DCF19 /* QuestionDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474C5941BE78AE1007DCF19 /* QuestionDetailViewController.m */; };
8474C5991BE78BBC007DCF19 /* QuestionDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474C5981BE78BBC007DCF19 /* QuestionDetailCell.m */; };
84800D1E1C1FB67300E8B673 /* SelectAreaTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D1D1C1FB67300E8B673 /* SelectAreaTableCell.m */; };
84800D211C1FB69400E8B673 /* SelectProvinceTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D201C1FB69400E8B673 /* SelectProvinceTableCell.m */; };
84800D241C1FB6A000E8B673 /* SelectStoreTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84800D231C1FB6A000E8B673 /* SelectStoreTableCell.m */; };
8480BEA21C14326100E2F18F /* MoreScreenView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8480BEA11C14326100E2F18F /* MoreScreenView.m */; };
8480BEA61C14378C00E2F18F /* ScopeTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8480BEA51C14378C00E2F18F /* ScopeTableView.m */; };
8480BEA91C143A0800E2F18F /* GroupTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8480BEA81C143A0800E2F18F /* GroupTableView.m */; };
......@@ -128,10 +128,10 @@
84D863701C1148EC00E4F4CC /* InspectPicAddCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8636D1C1148EC00E4F4CC /* InspectPicAddCell.m */; };
84D863731C11923F00E4F4CC /* AddQuestionTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D863721C11923F00E4F4CC /* AddQuestionTableCell.m */; };
84D98D131C210F3300C7C96F /* RankScreenTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D98D121C210F3300C7C96F /* RankScreenTableViewCell.m */; };
84D98D161C21371D00C7C96F /* SelectStoreHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D98D151C21371D00C7C96F /* SelectStoreHeadView.m */; };
84D98D191C21507500C7C96F /* CheckBoxButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D98D181C21507500C7C96F /* CheckBoxButton.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 */; };
84DC873E1C24E90E00811037 /* AddPicTextTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DC873D1C24E90E00811037 /* AddPicTextTableViewCell.m */; };
84DC87411C24F33900811037 /* AddButtonTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84DC87401C24F33900811037 /* AddButtonTableViewCell.m */; };
84E0ABCD1BFB082E001C8F45 /* TaskDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E0ABCC1BFB082E001C8F45 /* TaskDetailModel.m */; };
84E363D21BFAC5200061547E /* TaskListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E363D11BFAC5200061547E /* TaskListModel.m */; };
84E420411BE849FC00689976 /* QuestionDescribeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E420401BE849FC00689976 /* QuestionDescribeCell.m */; };
......@@ -173,6 +173,20 @@
083F3F95EB690FA24FEC0C8E /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
13B0DDED3E0E584D79B395CF /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
6C6D8B0ECF8531E34D0DFF6B /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
8409BDE71C281ACD00354460 /* CheckBoxButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckBoxButton.h; sourceTree = "<group>"; };
8409BDE81C281ACD00354460 /* CheckBoxButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CheckBoxButton.m; sourceTree = "<group>"; };
8409BDE91C281ACD00354460 /* SelectYetTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectYetTableViewCell.h; sourceTree = "<group>"; };
8409BDEA1C281ACD00354460 /* SelectYetTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectYetTableViewCell.m; sourceTree = "<group>"; };
8409BDEB1C281ACD00354460 /* TreeNodeCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TreeNodeCell.h; sourceTree = "<group>"; };
8409BDEC1C281ACD00354460 /* TreeNodeCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TreeNodeCell.m; sourceTree = "<group>"; };
8409BDEE1C281ACD00354460 /* TreeNodeModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TreeNodeModel.h; sourceTree = "<group>"; };
8409BDEF1C281ACD00354460 /* TreeNodeModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TreeNodeModel.m; sourceTree = "<group>"; };
8409BDF11C281ACD00354460 /* SelectStoreHeadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectStoreHeadView.h; sourceTree = "<group>"; };
8409BDF21C281ACD00354460 /* SelectStoreHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectStoreHeadView.m; sourceTree = "<group>"; };
8409BDF31C281ACD00354460 /* TreeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TreeView.h; sourceTree = "<group>"; };
8409BDF41C281ACD00354460 /* TreeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TreeView.m; sourceTree = "<group>"; };
8409BDF61C281ACD00354460 /* SelectStoreViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectStoreViewController.h; sourceTree = "<group>"; };
8409BDF71C281ACD00354460 /* SelectStoreViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectStoreViewController.m; sourceTree = "<group>"; };
840ABECA1BE1C29F006E49C5 /* RankDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankDetailViewController.h; sourceTree = "<group>"; };
840ABECB1BE1C29F006E49C5 /* RankDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankDetailViewController.m; sourceTree = "<group>"; };
8419EAD21BEDC98F002635ED /* HttpClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpClient.h; sourceTree = "<group>"; };
......@@ -201,14 +215,6 @@
846ABDF81C1E74430020C331 /* PictureDetailModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureDetailModel.m; sourceTree = "<group>"; };
846ABDFA1C1EAB160020C331 /* PicTextModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PicTextModel.h; sourceTree = "<group>"; };
846ABDFB1C1EAB160020C331 /* PicTextModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PicTextModel.m; sourceTree = "<group>"; };
846ABE001C1EE3970020C331 /* AreaModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AreaModel.h; sourceTree = "<group>"; };
846ABE011C1EE3970020C331 /* AreaModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AreaModel.m; sourceTree = "<group>"; };
846ABE021C1EE3970020C331 /* ProvinceModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProvinceModel.h; sourceTree = "<group>"; };
846ABE031C1EE3970020C331 /* ProvinceModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProvinceModel.m; sourceTree = "<group>"; };
846ABE041C1EE3970020C331 /* StoreModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StoreModel.h; sourceTree = "<group>"; };
846ABE051C1EE3970020C331 /* StoreModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreModel.m; sourceTree = "<group>"; };
846ABE081C1EE3970020C331 /* SelectStoreViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectStoreViewController.h; sourceTree = "<group>"; };
846ABE091C1EE3970020C331 /* SelectStoreViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectStoreViewController.m; sourceTree = "<group>"; };
84720BBF1C0377D300314099 /* CommentWithStarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentWithStarView.h; sourceTree = "<group>"; };
84720BC01C0377D300314099 /* CommentWithStarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentWithStarView.m; sourceTree = "<group>"; };
8473E3861C1BBFF600960257 /* InspectTaskDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectTaskDetailCell.h; sourceTree = "<group>"; };
......@@ -228,12 +234,6 @@
8474C5941BE78AE1007DCF19 /* QuestionDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuestionDetailViewController.m; sourceTree = "<group>"; };
8474C5971BE78BBC007DCF19 /* QuestionDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuestionDetailCell.h; sourceTree = "<group>"; };
8474C5981BE78BBC007DCF19 /* QuestionDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuestionDetailCell.m; sourceTree = "<group>"; };
84800D1C1C1FB67300E8B673 /* SelectAreaTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectAreaTableCell.h; sourceTree = "<group>"; };
84800D1D1C1FB67300E8B673 /* SelectAreaTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectAreaTableCell.m; sourceTree = "<group>"; };
84800D1F1C1FB69400E8B673 /* SelectProvinceTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectProvinceTableCell.h; sourceTree = "<group>"; };
84800D201C1FB69400E8B673 /* SelectProvinceTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectProvinceTableCell.m; sourceTree = "<group>"; };
84800D221C1FB6A000E8B673 /* SelectStoreTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectStoreTableCell.h; sourceTree = "<group>"; };
84800D231C1FB6A000E8B673 /* SelectStoreTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectStoreTableCell.m; sourceTree = "<group>"; };
8480BEA01C14326100E2F18F /* MoreScreenView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoreScreenView.h; sourceTree = "<group>"; };
8480BEA11C14326100E2F18F /* MoreScreenView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MoreScreenView.m; sourceTree = "<group>"; };
8480BEA41C14378C00E2F18F /* ScopeTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopeTableView.h; sourceTree = "<group>"; };
......@@ -415,14 +415,14 @@
84D863721C11923F00E4F4CC /* AddQuestionTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddQuestionTableCell.m; sourceTree = "<group>"; };
84D98D111C210F3300C7C96F /* RankScreenTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankScreenTableViewCell.h; sourceTree = "<group>"; };
84D98D121C210F3300C7C96F /* RankScreenTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankScreenTableViewCell.m; sourceTree = "<group>"; };
84D98D141C21371D00C7C96F /* SelectStoreHeadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectStoreHeadView.h; sourceTree = "<group>"; };
84D98D151C21371D00C7C96F /* SelectStoreHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectStoreHeadView.m; sourceTree = "<group>"; };
84D98D171C21507500C7C96F /* CheckBoxButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckBoxButton.h; sourceTree = "<group>"; };
84D98D181C21507500C7C96F /* CheckBoxButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CheckBoxButton.m; 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>"; };
84DB9BC51BDCD67200822CC4 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; };
84DB9BC61BDCD67200822CC4 /* UIView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIView+Extension.m"; path = "../../Other/Category/UIView+Extension.m"; sourceTree = "<group>"; };
84DC873C1C24E90E00811037 /* AddPicTextTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddPicTextTableViewCell.h; sourceTree = "<group>"; };
84DC873D1C24E90E00811037 /* AddPicTextTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddPicTextTableViewCell.m; sourceTree = "<group>"; };
84DC873F1C24F33900811037 /* AddButtonTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddButtonTableViewCell.h; sourceTree = "<group>"; };
84DC87401C24F33900811037 /* AddButtonTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddButtonTableViewCell.m; sourceTree = "<group>"; };
84E0ABCB1BFB082E001C8F45 /* TaskDetailModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskDetailModel.h; sourceTree = "<group>"; };
84E0ABCC1BFB082E001C8F45 /* TaskDetailModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskDetailModel.m; sourceTree = "<group>"; };
84E363D01BFAC5200061547E /* TaskListModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskListModel.h; sourceTree = "<group>"; };
......@@ -496,6 +496,59 @@
name = Pods;
sourceTree = "<group>";
};
8409BDE51C281ACD00354460 /* SelectStore */ = {
isa = PBXGroup;
children = (
8409BDE61C281ACD00354460 /* Cell */,
8409BDED1C281ACD00354460 /* Model */,
8409BDF01C281ACD00354460 /* View */,
8409BDF51C281ACD00354460 /* ViewController */,
);
path = SelectStore;
sourceTree = "<group>";
};
8409BDE61C281ACD00354460 /* Cell */ = {
isa = PBXGroup;
children = (
8409BDE71C281ACD00354460 /* CheckBoxButton.h */,
8409BDE81C281ACD00354460 /* CheckBoxButton.m */,
8409BDE91C281ACD00354460 /* SelectYetTableViewCell.h */,
8409BDEA1C281ACD00354460 /* SelectYetTableViewCell.m */,
8409BDEB1C281ACD00354460 /* TreeNodeCell.h */,
8409BDEC1C281ACD00354460 /* TreeNodeCell.m */,
);
path = Cell;
sourceTree = "<group>";
};
8409BDED1C281ACD00354460 /* Model */ = {
isa = PBXGroup;
children = (
8409BDEE1C281ACD00354460 /* TreeNodeModel.h */,
8409BDEF1C281ACD00354460 /* TreeNodeModel.m */,
);
path = Model;
sourceTree = "<group>";
};
8409BDF01C281ACD00354460 /* View */ = {
isa = PBXGroup;
children = (
8409BDF11C281ACD00354460 /* SelectStoreHeadView.h */,
8409BDF21C281ACD00354460 /* SelectStoreHeadView.m */,
8409BDF31C281ACD00354460 /* TreeView.h */,
8409BDF41C281ACD00354460 /* TreeView.m */,
);
path = View;
sourceTree = "<group>";
};
8409BDF51C281ACD00354460 /* ViewController */ = {
isa = PBXGroup;
children = (
8409BDF61C281ACD00354460 /* SelectStoreViewController.h */,
8409BDF71C281ACD00354460 /* SelectStoreViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
8419EABB1BEDA8F9002635ED /* Menu */ = {
isa = PBXGroup;
children = (
......@@ -616,7 +669,7 @@
8426A4A41BDF0CD600E5FDF5 /* OnLine */ = {
isa = PBXGroup;
children = (
846ABDFD1C1EE3970020C331 /* SelectStore */,
8409BDE51C281ACD00354460 /* SelectStore */,
848A201E1C183F1800422FAB /* LookOnLineResult */,
84A673821C0B4D3B000F828E /* OnLineTaskComplete */,
843D1B991C0B3F6200E30002 /* SpotCheckOnLine */,
......@@ -740,63 +793,6 @@
path = Model;
sourceTree = "<group>";
};
846ABDFD1C1EE3970020C331 /* SelectStore */ = {
isa = PBXGroup;
children = (
846ABDFE1C1EE3970020C331 /* Cell */,
846ABDFF1C1EE3970020C331 /* Model */,
846ABE061C1EE3970020C331 /* View */,
846ABE071C1EE3970020C331 /* ViewController */,
);
path = SelectStore;
sourceTree = "<group>";
};
846ABDFE1C1EE3970020C331 /* Cell */ = {
isa = PBXGroup;
children = (
84800D1C1C1FB67300E8B673 /* SelectAreaTableCell.h */,
84800D1D1C1FB67300E8B673 /* SelectAreaTableCell.m */,
84800D1F1C1FB69400E8B673 /* SelectProvinceTableCell.h */,
84800D201C1FB69400E8B673 /* SelectProvinceTableCell.m */,
84800D221C1FB6A000E8B673 /* SelectStoreTableCell.h */,
84800D231C1FB6A000E8B673 /* SelectStoreTableCell.m */,
84D98D171C21507500C7C96F /* CheckBoxButton.h */,
84D98D181C21507500C7C96F /* CheckBoxButton.m */,
);
path = Cell;
sourceTree = "<group>";
};
846ABDFF1C1EE3970020C331 /* Model */ = {
isa = PBXGroup;
children = (
846ABE001C1EE3970020C331 /* AreaModel.h */,
846ABE011C1EE3970020C331 /* AreaModel.m */,
846ABE021C1EE3970020C331 /* ProvinceModel.h */,
846ABE031C1EE3970020C331 /* ProvinceModel.m */,
846ABE041C1EE3970020C331 /* StoreModel.h */,
846ABE051C1EE3970020C331 /* StoreModel.m */,
);
path = Model;
sourceTree = "<group>";
};
846ABE061C1EE3970020C331 /* View */ = {
isa = PBXGroup;
children = (
84D98D141C21371D00C7C96F /* SelectStoreHeadView.h */,
84D98D151C21371D00C7C96F /* SelectStoreHeadView.m */,
);
path = View;
sourceTree = "<group>";
};
846ABE071C1EE3970020C331 /* ViewController */ = {
isa = PBXGroup;
children = (
846ABE081C1EE3970020C331 /* SelectStoreViewController.h */,
846ABE091C1EE3970020C331 /* SelectStoreViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
8474C5801BE751A2007DCF19 /* CommonFunc */ = {
isa = PBXGroup;
children = (
......@@ -1352,6 +1348,10 @@
children = (
849A18441C152EBA00071600 /* AddPictureTableCell.h */,
849A18451C152EBA00071600 /* AddPictureTableCell.m */,
84DC873C1C24E90E00811037 /* AddPicTextTableViewCell.h */,
84DC873D1C24E90E00811037 /* AddPicTextTableViewCell.m */,
84DC873F1C24F33900811037 /* AddButtonTableViewCell.h */,
84DC87401C24F33900811037 /* AddButtonTableViewCell.m */,
);
path = Cell;
sourceTree = "<group>";
......@@ -2161,6 +2161,7 @@
8490C4C61BF9CE85006B6569 /* HomeTitleTableCell.m in Sources */,
840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */,
8497B62B1C043671007ECBE6 /* InspectTableView.m in Sources */,
8409BDF91C281ACD00354460 /* SelectYetTableViewCell.m in Sources */,
84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */,
84E7BD801C16809E0030C441 /* LookOnLineFootView.m in Sources */,
841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */,
......@@ -2178,56 +2179,56 @@
84FD8A0A1BDA01D1006E442A /* MineViewController.m in Sources */,
84C972991C1ADB9C003A3276 /* PictureDetailTableCell.m in Sources */,
848A20271C183FCB00422FAB /* OnLineResultViewController.m in Sources */,
8409BDF81C281ACD00354460 /* CheckBoxButton.m in Sources */,
848699B21BDF810900859DFE /* InspectListViewController.m in Sources */,
84BB16A21C191A7F00383A64 /* OnLineResultFootView.m in Sources */,
84846E971BE069BC0010550A /* DateButton.m in Sources */,
84800D1E1C1FB67300E8B673 /* SelectAreaTableCell.m in Sources */,
84CC34CC1C093C2F002F10E2 /* OnLineTableViewCell.m in Sources */,
84E363D21BFAC5200061547E /* TaskListModel.m in Sources */,
84C9574E1BDB344900083584 /* UIView+Frame.m in Sources */,
848699B01BDF810900859DFE /* InspectListCell.m in Sources */,
846206B51C06AF700015C456 /* RankListHeaderView.m in Sources */,
846ABE0B1C1EE3970020C331 /* ProvinceModel.m in Sources */,
84AD4F3A1BF4844600BFB37C /* RankDetailHeaderView.m in Sources */,
8490C4D41BF9DEF0006B6569 /* PictureViewController.m in Sources */,
8474C5951BE78AE1007DCF19 /* QuestionDetailViewController.m in Sources */,
84970DEF1BD8DD8A00C1728A /* main.m in Sources */,
8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */,
8409BDFD1C281ACD00354460 /* TreeView.m in Sources */,
8409BDFB1C281ACD00354460 /* TreeNodeModel.m in Sources */,
84CC34D11C093C5E002F10E2 /* LookOnLineViewController.m in Sources */,
84D863731C11923F00E4F4CC /* AddQuestionTableCell.m in Sources */,
84D8257F1BDD2F7E00CC61F7 /* MineTableFooterView.m in Sources */,
84800D241C1FB6A000E8B673 /* SelectStoreTableCell.m in Sources */,
846ABE0C1C1EE3970020C331 /* StoreModel.m in Sources */,
84F57C501BEC7AA300DDEEB1 /* AddQuestionFooterView.m in Sources */,
84CF0F1E1BE9B40400C855CE /* InspectDetailFooterView.m in Sources */,
84D98D161C21371D00C7C96F /* SelectStoreHeadView.m in Sources */,
84F30DA41BFC19F200CBAD13 /* RankListModel.m in Sources */,
8409BDFC1C281ACD00354460 /* SelectStoreHeadView.m in Sources */,
84CC34EF1C09AEC0002F10E2 /* LookOnLineDetailViewController.m in Sources */,
8487D8091BF20FAD00E63E90 /* TaxisView.m in Sources */,
84A673C71C0C7E0C000F828E /* AnnounceDetailHeadView.m in Sources */,
84AD4F361BF45BEB00BFB37C /* InspectSortTableCell.m in Sources */,
8480BEA21C14326100E2F18F /* MoreScreenView.m in Sources */,
84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */,
8409BDFE1C281ACD00354460 /* SelectStoreViewController.m in Sources */,
849B2F771C0CABE6005D809F /* AnnounceDetailModel.m in Sources */,
8490C4C31BF9A394006B6569 /* CustomPageControl.m in Sources */,
848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */,
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */,
84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */,
84D98D191C21507500C7C96F /* CheckBoxButton.m in Sources */,
8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */,
84AD4F491BF4BC0600BFB37C /* RankDetailTableCell.m in Sources */,
84DC873E1C24E90E00811037 /* AddPicTextTableViewCell.m in Sources */,
848699B31BDF810900859DFE /* InspectTaskViewController.m in Sources */,
84CC34D81C094682002F10E2 /* StandardTableViewCell.m in Sources */,
84CC34EC1C09AD98002F10E2 /* LookOnLineDetailView.m in Sources */,
84E420471BE88AE000689976 /* RootTabBarController.m in Sources */,
84D3E5F01C04BC8C001FF1DD /* InspectUploadedViewController.m in Sources */,
846ABE0D1C1EE3970020C331 /* SelectStoreViewController.m in Sources */,
8487D80C1BF218F900E63E90 /* MenuView.m in Sources */,
84CC34CE1C093C2F002F10E2 /* OnLineViewController.m in Sources */,
84D8636E1C1148EC00E4F4CC /* InpectPictureCell.m in Sources */,
8480BEAF1C143A2200E2F18F /* TimeTableView.m in Sources */,
8474C5921BE78A85007DCF19 /* QuestionViewController.m in Sources */,
84A673BF1C0C7AEB000F828E /* AnnounceModel.m in Sources */,
84DC87411C24F33900811037 /* AddButtonTableViewCell.m in Sources */,
84CC34CD1C093C2F002F10E2 /* OnLineFooterView.m in Sources */,
84AD4F291BF4360E00BFB37C /* TaskGroup.m in Sources */,
84FAC7611BFF2C6E00FD094D /* NoDataView.m in Sources */,
......@@ -2252,6 +2253,7 @@
84970E391BD8E0B300C1728A /* LoginView.m in Sources */,
84DB9BC41BDCD4B600822CC4 /* CustomDropMenuView.m in Sources */,
84D3E5F31C04BCD3001FF1DD /* InspectNotUploadViewController.m in Sources */,
8409BDFA1C281ACD00354460 /* TreeNodeCell.m in Sources */,
846ABDF91C1E74430020C331 /* PictureDetailModel.m in Sources */,
84D3E5F91C04BD8E001FF1DD /* InspectNotUpLoadCell.m in Sources */,
84ECCF181C01FA2600EA4960 /* QuestionDetailModel.m in Sources */,
......@@ -2263,10 +2265,8 @@
84C9729C1C1ADC5B003A3276 /* PictureTextTableCell.m in Sources */,
84D825821BDD35E000CC61F7 /* HomeHeaderView.m in Sources */,
849A18431C152CEE00071600 /* AddPictureViewController.m in Sources */,
84800D211C1FB69400E8B673 /* SelectProvinceTableCell.m in Sources */,
8480BEA61C14378C00E2F18F /* ScopeTableView.m in Sources */,
84FD89F21BD9FC71006E442A /* HomeViewController.m in Sources */,
846ABE0A1C1EE3970020C331 /* AreaModel.m in Sources */,
84AD4F461BF4A9E800BFB37C /* RankHeadView.m in Sources */,
8480BEA91C143A0800E2F18F /* GroupTableView.m in Sources */,
84E420411BE849FC00689976 /* QuestionDescribeCell.m in Sources */,
......
......@@ -49,7 +49,7 @@
[self.contentView addConstraint:titleLeft];
// 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.selectLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:65];
[self.contentView addConstraint:titleRight];
// 高度
......@@ -82,10 +82,10 @@
NSLayoutConstraint *selectRight = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:selectRight];
// 右边
// NSLayoutConstraint *selectWidth = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50];
// [self.contentView addConstraint:selectWidth];
//
// 右边
NSLayoutConstraint *selectWidth = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeRight multiplier:1.0 constant:5];
[self.contentView addConstraint:selectWidth];
//
// 高度
NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:selectBottom];
......
//
// SelectAreaTableCell.h
// redstar
//
// Created by admin on 15/12/15.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CheckBoxButton.h"
#import "AreaModel.h"
@interface SelectAreaTableCell : UITableViewCell
@property (nonatomic, strong) CheckBoxButton *checkBoxButton;
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) AreaModel *areaModel;
@end
//
// SelectAreaTableCell.m
// redstar
//
// Created by admin on 15/12/15.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "SelectAreaTableCell.h"
@implementation SelectAreaTableCell
- (CheckBoxButton *)checkBoxButton
{
if (!_checkBoxButton) {
_checkBoxButton = [[CheckBoxButton alloc] init];
[_checkBoxButton setTitleColor:kLightBlack forState:UIControlStateNormal];
[_checkBoxButton setTitleColor:kSelectStoreColor forState:UIControlStateSelected];
_checkBoxButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
_checkBoxButton.translatesAutoresizingMaskIntoConstraints = NO;
[_checkBoxButton setImage:[UIImage imageNamed:@"uncheck_box"] forState:UIControlStateNormal];
[_checkBoxButton setImage:[UIImage imageNamed:@"check_box"] forState:UIControlStateSelected];
_checkBoxButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_checkBoxButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
_checkBoxButton.imageView.contentMode = UIViewContentModeRight;
_checkBoxButton.titleLabel.contentMode = UIViewContentModeLeft;
[self.contentView addSubview:_checkBoxButton];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:8];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:34];
[self.contentView addConstraint:titleHeight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-8];
[self.contentView addConstraint:titleBottom];
}
return _checkBoxButton;
}
- (UIImageView *)iconImageView
{
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
_iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_iconImageView];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:23];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:13];
[self.contentView addConstraint:titleWidth];
// 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleRight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:8];
[self.contentView addConstraint:titleBottom];
}
return _iconImageView;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// SelectProvinceTableCell.h
// redstar
//
// Created by admin on 15/12/15.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CheckBoxButton.h"
#import "ProvinceModel.h"
@interface SelectProvinceTableCell : UITableViewCell
@property (nonatomic, strong) CheckBoxButton *checkBoxButton;
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) ProvinceModel *provinceModel;
@end
//
// SelectProvinceTableCell.m
// redstar
//
// Created by admin on 15/12/15.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "SelectProvinceTableCell.h"
@implementation SelectProvinceTableCell
- (CheckBoxButton *)checkBoxButton
{
if (!_checkBoxButton) {
_checkBoxButton = [[CheckBoxButton alloc] init];
[_checkBoxButton setTitleColor:kLightBlack forState:UIControlStateNormal];
[_checkBoxButton setTitleColor:kSelectStoreColor forState:UIControlStateSelected];
_checkBoxButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
_checkBoxButton.translatesAutoresizingMaskIntoConstraints = NO;
[_checkBoxButton setImage:[UIImage imageNamed:@"uncheck_box"] forState:UIControlStateNormal];
[_checkBoxButton setImage:[UIImage imageNamed:@"check_box"] forState:UIControlStateSelected];
_checkBoxButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_checkBoxButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
_checkBoxButton.imageView.contentMode = UIViewContentModeRight;
_checkBoxButton.titleLabel.contentMode = UIViewContentModeLeft;
[self.contentView addSubview:_checkBoxButton];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:8];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:50];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.contentView addConstraint:titleHeight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-8];
[self.contentView addConstraint:titleBottom];
}
return _checkBoxButton;
}
- (UIImageView *)iconImageView
{
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
_iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_iconImageView];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:23];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:11];
[self.contentView addConstraint:titleWidth];
// 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleRight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:7.5];
[self.contentView addConstraint:titleBottom];
}
return _iconImageView;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// SelectStoreTableCell.h
// redstar
//
// Created by admin on 15/12/15.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CheckBoxButton.h"
#import "StoreModel.h"
@interface SelectStoreTableCell : UITableViewCell
//@property (nonatomic, strong) UIButton *storeButton1;
//@property (nonatomic, strong) UIButton *storeButton2;
@property (nonatomic, strong) CheckBoxButton *checkBoxButton;
@property (nonatomic, strong) StoreModel *storeModel;
@end
//
// SelectStoreTableCell.m
// redstar
//
// Created by admin on 15/12/15.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "SelectStoreTableCell.h"
@implementation SelectStoreTableCell
//- (UIButton *)storeButton1
//{
// if (!_storeButton1) {
// _storeButton1 = [[UIButton alloc] init];
// _storeButton1.translatesAutoresizingMaskIntoConstraints = NO;
// _storeButton1.backgroundColor = [UIColor lightGrayColor];
// [self.contentView addSubview:_storeButton1];
//
// // 顶端
// NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
// [self.contentView addConstraint:titleTop];
//
// // 右边
// NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-5];
// [self.contentView addConstraint:titleRight];
//
// // 左边
// NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
// [self.contentView addConstraint:titleLeft];
//
// // 高度
// NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
// [self.contentView addConstraint:titleHeight];
//
// // 高度
// NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_storeButton1 attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
// [self.contentView addConstraint:titleBottom];
// }
// return _storeButton1;
//}
//
//- (UIButton *)storeButton2
//{
// if (!_storeButton2) {
// _storeButton2 = [[UIButton alloc] init];
// _storeButton2.translatesAutoresizingMaskIntoConstraints = NO;
// _storeButton2.backgroundColor = [UIColor lightGrayColor];
// [self.contentView addSubview:_storeButton2];
//
// // 顶端
// NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_storeButton2 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
// [self.contentView addConstraint:titleTop];
//
// // 右边
// NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_storeButton2 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
// [self.contentView addConstraint:titleRight];
//
// // 左边
// NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_storeButton2 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:5];
// [self.contentView addConstraint:titleLeft];
//
// // 高度
// NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_storeButton2 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
// [self.contentView addConstraint:titleHeight];
// }
// return _storeButton2;
//}
- (CheckBoxButton *)checkBoxButton
{
if (!_checkBoxButton) {
_checkBoxButton = [[CheckBoxButton alloc] init];
[_checkBoxButton setTitleColor:kLightBlack forState:UIControlStateNormal];
[_checkBoxButton setTitleColor:kSelectStoreColor forState:UIControlStateSelected];
_checkBoxButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
_checkBoxButton.translatesAutoresizingMaskIntoConstraints = NO;
[_checkBoxButton setImage:[UIImage imageNamed:@"uncheck_box"] forState:UIControlStateNormal];
[_checkBoxButton setImage:[UIImage imageNamed:@"check_box"] forState:UIControlStateSelected];
_checkBoxButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_checkBoxButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
_checkBoxButton.imageView.contentMode = UIViewContentModeRight;
_checkBoxButton.titleLabel.contentMode = UIViewContentModeLeft;
[self.contentView addSubview:_checkBoxButton];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:8];
[self.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:80];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.contentView addConstraint:titleHeight];
// 高度
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_checkBoxButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-8];
[self.contentView addConstraint:titleBottom];
}
return _checkBoxButton;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// SelectYetTableViewCell.h
// redstar
//
// Created by admin on 15/12/21.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol SelectYetDelegate <NSObject>
- (void)removeCurrentWithButton:(UIButton *)sender;
@end
@interface SelectYetTableViewCell : UITableViewCell
@property (nonatomic, strong) NSMutableArray *selectTreeArray;
@property (nonatomic, assign) id <SelectYetDelegate> delegate;
@end
//
// SelectYetTableViewCell.m
// redstar
//
// Created by admin on 15/12/21.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "SelectYetTableViewCell.h"
#import "TreeNodeModel.h"
@implementation SelectYetTableViewCell
- (void)setSelectTreeArray:(NSMutableArray *)selectTreeArray
{
for (UIButton *button in self.contentView.subviews) {
[button removeFromSuperview];
}
_selectTreeArray = selectTreeArray;
for (int i = 0; i < selectTreeArray.count; i++) {
TreeNodeModel *model = selectTreeArray[i];
UIButton *button = [[UIButton alloc] init];
button.tag = 6666687 + i;
button.translatesAutoresizingMaskIntoConstraints = NO;
[button setTitle:model.name forState:UIControlStateNormal];
button.titleLabel.font = [UIFont systemFontOfSize:14.0];
button.backgroundColor = kSelectStoreColor;
button.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 8);
[self.contentView addSubview:button];
CGFloat x,y;
CGFloat marginX = 5;
CGFloat marginY = 5;
CGFloat w = (kScreenWidth - 80) / 2 - marginX;
CGFloat h = 25;
NSInteger row;
if ((i + 1) % 2 == 0) {
x = -20;
row = (i - 1) / 2;
y = 10 + (i / 2) * (h + marginY);
NSLayoutConstraint *imageViewRight = [NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:x];
[self.contentView addConstraint:imageViewRight];
} else {
x = 60;
row = i / 2;
y = 10 + (i / 2) * (h + marginY);
NSLayoutConstraint *imageViewLeft = [NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:x];
[self.contentView addConstraint:imageViewLeft];
}
NSLayoutConstraint *imageViewTop = [NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:y];
[self.contentView addConstraint:imageViewTop];
NSLayoutConstraint *imageViewHeight = [NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:h];
[self.contentView addConstraint:imageViewHeight];
NSLayoutConstraint *imageViewWidth = [NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:w];
[self.contentView addConstraint:imageViewWidth];
if (i == (_selectTreeArray.count - 1)) {
NSLayoutConstraint *imageViewBootom = [NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
[self.contentView addConstraint:imageViewBootom];
}
// 删除按钮
UIButton *deleteBtn = [[UIButton alloc] init];
deleteBtn.translatesAutoresizingMaskIntoConstraints = NO;
[deleteBtn setImage:[UIImage imageNamed:@"delete_box"] forState:UIControlStateNormal];
[deleteBtn addTarget:self action:@selector(deleteBox:) forControlEvents:UIControlEventTouchUpInside];
[button addSubview:deleteBtn];
NSLayoutConstraint *deleteTop = [NSLayoutConstraint constraintWithItem:deleteBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:button attribute:NSLayoutAttributeTop multiplier:1.0 constant:3];
[button addConstraint:deleteTop];
NSLayoutConstraint *deleteHeight = [NSLayoutConstraint constraintWithItem:deleteBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:7.5];
[button addConstraint:deleteHeight];
NSLayoutConstraint *deleteWidth = [NSLayoutConstraint constraintWithItem:deleteBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:7.5];
[button addConstraint:deleteWidth];
NSLayoutConstraint *deleteRight = [NSLayoutConstraint constraintWithItem:deleteBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:button attribute:NSLayoutAttributeRight multiplier:1.0 constant:-3];
[button addConstraint:deleteRight];
}
}
- (void)deleteBox:(UIButton *)sender
{
if (_delegate && [_delegate respondsToSelector:@selector(removeCurrentWithButton:)]) {
[_delegate removeCurrentWithButton:sender];
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
@end
//
// TreeNodeCell.h
// redstar
//
// Created by admin on 15/12/18.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TreeNodeModel.h"
#import "CheckBoxButton.h"
@class TreeNodeCell;
@protocol TreeNodeDelegate <NSObject>
@optional
/**
* @brief 将要点击折叠图标,返回YES将执行,返回NO取消执行
* @param tree 所在树
* @return YES-执行折叠展开操作,NO-不执行折叠展开操作
*/
-(BOOL)shouldClickFoldButtonAtNode:(TreeNodeCell *)node;
/**
* @brief 点击折叠图标后要执行的操作
* @param node 所在节点
* @return void
*/
-(void)didClickFoldButtonAtNode:(TreeNodeCell *)node;
/**
* @brief 点击标题后要执行的操作
* @param node 所在节点
* @return void
*/
-(void)didClickTitleAtNode:(TreeNodeCell *)node;
@end
@interface TreeNodeCell : UITableViewCell
@property (nonatomic, weak) TreeNodeModel *nodeData;
@property (nonatomic, weak) id<TreeNodeDelegate> nodeDelegate;
@property (nonatomic) UIButton *foldButton;
@property (nonatomic) CheckBoxButton *titleButton;
@end
//
// TreeNodeCell.m
// redstar
//
// Created by admin on 15/12/18.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "TreeNodeCell.h"
#import "CheckBoxButton.h"
@interface TreeNodeCell ()
@end
@implementation TreeNodeCell
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
#pragma mark - 初始化函数
-(instancetype)init {
self = [super init];
if (self) {
[self configSelf];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[self configSelf];
}
return self;
}
-(instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self configSelf];
}
return self;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self configSelf];
}
return self;
}
-(void)configSelf {
}
#pragma mark - 属性
-(void)setNodeData:(TreeNodeModel *)nodeData {
_nodeData = nodeData;
[self configFoldButton];
[self configTitleButton];
}
#pragma mark - 折叠按钮
- (void)configFoldButton {
if (self.foldButton == nil) {
self.foldButton = [UIButton buttonWithType:UIButtonTypeCustom];
_foldButton.translatesAutoresizingMaskIntoConstraints = NO;
[self.foldButton addTarget:self action:@selector(actionFoldButton:) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:self.foldButton];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_foldButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_foldButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:tableLeft];
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_foldButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_foldButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:tableBottom];
NSLayoutConstraint *tableHeight = [NSLayoutConstraint constraintWithItem:_foldButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50];
[self.contentView addConstraint:tableHeight];
}
self.foldButton.selected = self.nodeData.expand;
}
-(void)actionFoldButton:(UIButton *)sender {
if ([self.nodeDelegate respondsToSelector:@selector(shouldClickFoldButtonAtNode:)]) {
if ([self.nodeDelegate shouldClickFoldButtonAtNode:self] == NO) {
return;
}
}
sender.selected = ! sender.selected;
self.nodeData.expand = sender.selected;
if ([self.nodeDelegate respondsToSelector:@selector(didClickFoldButtonAtNode:)]) {
[self.nodeDelegate didClickFoldButtonAtNode:self];
}
}
#pragma mark - 标题按钮
-(void)configTitleButton {
[self.titleButton removeFromSuperview];
self.titleButton = [[CheckBoxButton alloc] init];
_titleButton.translatesAutoresizingMaskIntoConstraints = NO;
self.titleButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[self.titleButton addTarget:self action:@selector(actionTitleButton:) forControlEvents:UIControlEventTouchUpInside];
[_titleButton setImage:[UIImage imageNamed:@"uncheck_box"] forState:UIControlStateNormal];
[_titleButton setImage:[UIImage imageNamed:@"check_box"] forState:UIControlStateSelected];
[self.titleButton setTitle:self.nodeData.name forState:UIControlStateNormal];
[self.titleButton setTitleColor:kLightBlack forState:UIControlStateNormal];
[self.titleButton setTitleColor:kSelectStoreColor forState:UIControlStateSelected];
self.titleButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
[self addSubview:self.titleButton];
//CGFloat x = 20 + self.nodeData.levelDeep * 22;
CGFloat x = self.nodeData.levelDeep * 22;
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_titleButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_titleButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:x];
[self addConstraint:tableLeft];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_titleButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self addConstraint:tableBottom];
}
-(void)actionTitleButton:(UIButton *)sender {
if ([self.nodeDelegate respondsToSelector:@selector(didClickTitleAtNode:)]) {
[self.nodeDelegate didClickTitleAtNode:self];
}
}
@end
//
// AreaModel.h
// redstar
//
// Created by admin on 15/12/13.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface AreaModel : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, strong) NSArray *provinceArray;
@property (nonatomic, assign) BOOL isChoose;
- (id)initWithName:(NSString *)name children:(NSArray *)children;
+ (id)dataObjectWithName:(NSString *)name children:(NSArray *)children;
@end
//
// AreaModel.m
// redstar
//
// Created by admin on 15/12/13.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "AreaModel.h"
@implementation AreaModel
- (id)initWithName:(NSString *)name children:(NSArray *)children
{
self = [super init];
if (self) {
self.provinceArray = [NSArray arrayWithArray:children];
self.name = name;
}
return self;
}
+ (id)dataObjectWithName:(NSString *)name children:(NSArray *)children
{
return [[self alloc] initWithName:name children:children];
}
- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues{
Class cls = self.class;
for (NSString *key in keyedValues.allKeys) {
NSString *varName = [NSString stringWithFormat:@"_%@", key];
const char *c_key = [varName cStringUsingEncoding:NSUTF8StringEncoding];
Ivar var = class_getInstanceVariable(cls, c_key);
if (var) {
[self setValue:[keyedValues objectForKey:key] forKey:key];
}
}
}
@end
//
// ProvinceModel.h
// redstar
//
// Created by admin on 15/12/13.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ProvinceModel : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, strong) NSArray *storeArray;
@property (nonatomic, assign) BOOL isChoose;
- (id)initWithName:(NSString *)name children:(NSArray *)children;
+ (id)dataObjectWithName:(NSString *)name children:(NSArray *)children;
@end
//
// ProvinceModel.m
// redstar
//
// Created by admin on 15/12/13.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "ProvinceModel.h"
@implementation ProvinceModel
- (id)initWithName:(NSString *)name children:(NSArray *)children
{
self = [super init];
if (self) {
self.storeArray = [NSArray arrayWithArray:children];
self.name = name;
}
return self;
}
+ (id)dataObjectWithName:(NSString *)name children:(NSArray *)children
{
return [[self alloc] initWithName:name children:children];
}
- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues{
Class cls = self.class;
for (NSString *key in keyedValues.allKeys) {
NSString *varName = [NSString stringWithFormat:@"_%@", key];
const char *c_key = [varName cStringUsingEncoding:NSUTF8StringEncoding];
Ivar var = class_getInstanceVariable(cls, c_key);
if (var) {
[self setValue:[keyedValues objectForKey:key] forKey:key];
}
}
}
@end
//
// StoreModel.h
// redstar
//
// Created by admin on 15/12/13.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface StoreModel : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, assign) BOOL isChoose;
- (id)initWithName:(NSString *)name;
+ (id)dataObjectWithName:(NSString *)name;
@end
//
// StoreModel.m
// redstar
//
// Created by admin on 15/12/13.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "StoreModel.h"
@implementation StoreModel
- (id)initWithName:(NSString *)name
{
self = [super init];
if (self) {
self.name = name;
}
return self;
}
+ (id)dataObjectWithName:(NSString *)name
{
return [[self alloc] initWithName:name];
}
- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues{
Class cls = self.class;
for (NSString *key in keyedValues.allKeys) {
NSString *varName = [NSString stringWithFormat:@"_%@", key];
const char *c_key = [varName cStringUsingEncoding:NSUTF8StringEncoding];
Ivar var = class_getInstanceVariable(cls, c_key);
if (var) {
[self setValue:[keyedValues objectForKey:key] forKey:key];
}
}
}
@end
//
// TreeNodeModel.h
// redstar
//
// Created by admin on 15/12/18.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface TreeNodeModel : NSObject
@property (nonatomic, copy) NSString *code;
/// 节点名称
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *path;
@property (nonatomic, copy) NSString *upper;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, assign) int level;
@property (nonatomic) BOOL isChoose;
/// 层级
@property (nonatomic, readonly) int levelDeep;
/// 节点是否展开
@property (nonatomic, getter=isExpand) BOOL expand;
/// 节点数,如果节点折叠则只算一个
@property (nonatomic, readonly) NSUInteger nodeCount;
/// 孩子节点
@property (nonatomic, readonly) NSMutableArray *child;
/// 父节点
@property (nonatomic, weak, readonly) TreeNodeModel *parent;
/// 兄弟节点
@property (nonatomic, weak, readonly) TreeNodeModel *brother;
-(instancetype)initWithName:(NSString *)name;
/**
* @brief 用于遍历时返回下一个展开的节点。
* @detail 如果自己是展开的并且有子节点,则返回第一个子节点;否则返回下一个兄弟节点,如果没有兄弟节点则递归往上返回父节点的兄弟节点,直至到根节点
* @return 下一个节点数据
*/
-(TreeNodeModel *)nextNode;
/**
* @brief 返回需要显示的节点数组
* @param includeRoot 是否包含根节点
* @return 节点数组
*/
-(NSArray*)nodeArray:(BOOL)includeRoot;
/**
* @brief 在最后位置插入一个子节点
* @param node 要插入的节点
* @return void
*/
-(void)insertChild:(TreeNodeModel *)node;
/**
* @brief 在指定位置插入一个子节点,如果indexes大于子节点数则插入在最后位置
* @param node 要插入的节点
* @param indexes 插入的位置
* @return void
*/
-(void)insertChild:(TreeNodeModel *)node index:(NSUInteger)indexes;
/**
* @brief 移除一个子节点
* @param node 要移除的子节点
* @return YES-成功移除,NO-移除失败(没有找到此子节点)
*/
-(BOOL)removeChild:(TreeNodeModel *)node;
/**
* @brief 移除指定位置的子节点
* @param indexes 要移除的子节点的索引
* @return YES-成功移除,NO-移除失败(不是有效索引)
*/
-(BOOL)removeChildAtIndexes:(NSUInteger)indexes;
/**
* @brief 根节点
*/
-(TreeNodeModel *)rootNode;
/**
* @brief 清除所有子节点
* @return void
*/
-(void)clear;
@end
//
// TreeNodeModel.m
// redstar
//
// Created by admin on 15/12/18.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "TreeNodeModel.h"
@interface TreeNodeModel ()
/// 层级
@property (nonatomic) int levelDeep;
/// 孩子节点
@property (nonatomic) NSMutableArray *child;
/// 父节点
@property (nonatomic, weak) TreeNodeModel *parent;
/// 兄弟节点
@property (nonatomic, weak) TreeNodeModel *brother;
@end
@implementation TreeNodeModel
- (instancetype)init {
self = [super init];
if (self) {
[self configSelf];
}
return self;
}
-(instancetype)initWithName:(NSString *)name {
self = [super init];
if (self) {
[self configSelf];
self.name = name;
}
return self;
}
-(void)configSelf {
self.expand = NO;
self.levelDeep = 0;
self.child = [NSMutableArray array];
self.parent = nil;
self.brother = nil;
}
-(NSUInteger)nodeCount {
NSUInteger count = 1;
if (self.isExpand) {
for (TreeNodeModel* node in self.child) {
count += node.nodeCount;
}
}
return count;
}
-(TreeNodeModel *)nextNode {
if (self.isExpand && self.child.count != 0) {
return self.child[0];
}
else {
for (TreeNodeModel *node = self; node != nil; node = node.parent) {
if (node.brother != nil) {
return node.brother;
}
}
return nil;
}
}
-(NSArray *)nodeArray:(BOOL)includeRoot {
NSMutableArray *array = [NSMutableArray array];
if (includeRoot) {
[array addObject:self];
for (TreeNodeModel *node = [self nextNode]; node != nil && node.levelDeep > self.levelDeep; node = [node nextNode]) {
[array addObject:node];
}
}
else {
if (self.child.count != 0) {
for (TreeNodeModel *node = self.child[0]; node != nil && node.levelDeep > self.levelDeep; node = [node nextNode]) {
[array addObject:node];
}
}
}
return [NSArray arrayWithArray:array];
}
-(void)insertChild:(TreeNodeModel *)node {
node.levelDeep = self.levelDeep + 1;
node.parent = self;
node.brother = nil;
if (self.child.count > 0) {
((TreeNodeModel*)self.child[self.child.count - 1]).brother = node;
}
[self.child addObject:node];
}
-(void)insertChild:(TreeNodeModel *)node index:(NSUInteger)indexes {
if (indexes >= self.child.count) {
indexes = self.child.count - 1;
}
node.levelDeep = self.levelDeep + 1;
node.parent = self;
node.brother = self.child[indexes];
if (indexes > 0) {
((TreeNodeModel*)self.child[indexes - 1]).brother = node;
}
[self.child insertObject:node atIndex:indexes];
}
-(BOOL)removeChild:(TreeNodeModel *)node {
for (int i = 0; i < self.child.count; i++) {
if ([node isEqual:self.child[i]]) {
return [self removeChildAtIndexes:i];
}
}
return NO;
}
-(BOOL)removeChildAtIndexes:(NSUInteger)indexes {
if (indexes < self.child.count) {
if (indexes > 0) {
if (indexes < self.child.count - 1) {
((TreeNodeModel *)self.child[indexes - 1]).brother = self.child[indexes + 1];
}
else {
((TreeNodeModel *)self.child[indexes - 1]).brother = nil;
}
}
[self.child removeObjectAtIndex:indexes];
return YES;
}
else {
return NO;
}
}
- (TreeNodeModel *)rootNode {
TreeNodeModel *node = self;
while (node.parent != nil) {
node = node.parent;
}
return node;
}
-(void)clear {
[self.child removeAllObjects];
}
-(NSString *)description
{
return [NSString stringWithFormat:@"11 level = %d-----22upper: %@ 33 code = %@ 44. levelDeep = %d",self.level, self.upper, self.code, self.levelDeep];
}
- (void)setIsChoose:(BOOL)isChoose
{
_isChoose = isChoose;
// 对当前的父类进行处理
for (TreeNodeModel *model in self.parent.child) {
if (model.isChoose == NO) {
self.parent.isChoose = NO;
break;
} else {
self.parent.isChoose = YES;
}
}
}
@end
//
// TreeView.h
// redstar
//
// Created by admin on 15/12/18.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TreeNodeModel.h"
#import "TreeNodeCell.h"
@class TreeView;
@protocol TreeDelegate <NSObject>
@optional
/**
* @brief 将要点击折叠图标,返回YES将执行,返回NO取消执行
* @param tree 所在树
* @param node 所在节点
* @return YES-执行折叠展开操作,NO-不执行折叠展开操作
*/
-(BOOL)tree:(TreeView *)tree shouldClickFoldButtonAtNode:(TreeNodeCell *)node;
/**
* @brief 点击折叠图标后要执行的操作
* @param tree 所在树
* @param node 所在节点
* @return void
*/
-(void)tree:(TreeView *)tree didClickFoldButtonAtNode:(TreeNodeCell *)node;
/**
* @brief 点击标题后要执行的操作
* @param tree 所在树
* @param node 所在节点
* @return void
*/
-(void)tree:(TreeView *)tree didClickTitleAtNode:(TreeNodeCell *)node;
@end
@interface TreeView : UITableView<UITableViewDelegate, UITableViewDataSource, TreeNodeDelegate>
/// 节点数据资源
@property (nonatomic) TreeNodeModel *nodeData;
/// 代理
@property (nonatomic, weak) id<TreeDelegate> treeDelegate;
@property (nonatomic, strong) NSMutableArray *selectTreeArray;
@end
//
// TreeView.m
// redstar
//
// Created by admin on 15/12/18.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "TreeView.h"
#import "TreeNodeCell.h"
#import "SelectYetTableViewCell.h"
@interface TreeView () <SelectYetDelegate>
@property (nonatomic) NSArray *nodeArray;
@end
@implementation TreeView
#pragma mark - 初始化函数
-(instancetype)init {
self = [super init];
if (self) {
[self configSelf];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[self configSelf];
}
return self;
}
-(instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self configSelf];
}
return self;
}
-(instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
self = [super initWithFrame:frame style:style];
if (self) {
[self configSelf];
}
return self;
}
-(void)configSelf {
self.dataSource = self;
self.delegate = self;
self.rowHeight = UITableViewAutomaticDimension;
self.estimatedRowHeight = 50.0;
}
#pragma mark - SelectYetDelegate
- (void)removeCurrentWithButton:(UIButton *)sender
{
UIButton *button = (UIButton *)sender.superview;
NSInteger index = button.tag - 6666687;
TreeNodeModel *treeM = _selectTreeArray[index];
treeM.isChoose = NO;
[button removeFromSuperview];
button = nil;
[self.selectTreeArray removeObject:treeM];
[self reloadData];
}
#pragma mark - 表格代理
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
self.nodeArray = [self.nodeData nodeArray:NO];
return self.nodeArray.count + 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
SelectYetTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"11nodeCell"];
if (cell == nil) {
cell = [[SelectYetTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"11nodeCell"];
}
cell.delegate = self;
cell.selectTreeArray = self.selectTreeArray;
cell.textLabel.text = @"已选:";
cell.textLabel.textColor = kLightGray;
cell.textLabel.font = [UIFont systemFontOfSize:15.0];
return cell;
} else {
TreeNodeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"nodeCell"];
if (cell == nil) {
cell = [[TreeNodeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"nodeCell"];
}
cell.nodeDelegate = self;
cell.nodeData = self.nodeArray[indexPath.row - 1];
// 强制刷新,主要是为了刷新那些自画线条
cell.titleButton.selected = cell.nodeData.isChoose;
[cell setNeedsDisplay];
return cell;
}
}
#pragma mark - node代理
-(BOOL)shouldClickFoldButtonAtNode:(TreeNodeCell *)node {
if ([self.treeDelegate respondsToSelector:@selector(tree:shouldClickFoldButtonAtNode:)]) {
return [self.treeDelegate tree:self shouldClickFoldButtonAtNode:node];
}
else {
return YES;
}
}
-(void)didClickFoldButtonAtNode:(TreeNodeCell *)node {
// 获取变动的行索引
NSUInteger beginIndex = [self.nodeArray indexOfObject:node.nodeData] + 2;
NSUInteger indexCount = [[node.nodeData nodeArray:NO] count];
NSMutableArray *indexArray = [NSMutableArray array];
for (int i = 0; i < indexCount; i++) {
[indexArray addObject:[NSIndexPath indexPathForRow:beginIndex + i inSection:0]];
}
// 用插入和删除函数就会产生动画
if (node.nodeData.isExpand == NO) {
[self deleteRowsAtIndexPaths:indexArray withRowAnimation:(UITableViewRowAnimationTop)];
}
else {
[self insertRowsAtIndexPaths:indexArray withRowAnimation:(UITableViewRowAnimationBottom)];
}
if (beginIndex == 1) {
[node setNeedsDisplay];
}
if ([self.treeDelegate respondsToSelector:@selector(tree:didClickFoldButtonAtNode:)]) {
[self.treeDelegate tree:self didClickFoldButtonAtNode:node];
}
}
- (void)didClickTitleAtNode:(TreeNodeCell *)node {
if ([self.treeDelegate respondsToSelector:@selector(tree:didClickTitleAtNode:)]) {
[self.treeDelegate tree:self didClickTitleAtNode:node];
}
}
@end
......@@ -8,6 +8,12 @@
#import <UIKit/UIKit.h>
@interface SelectStoreViewController : UIViewController
@protocol SelectStoreDelegate <NSObject>
- (void)deliverWithArray:(NSMutableArray *)array;
@end
@interface SelectStoreViewController : UIViewController
@property (nonatomic, assign) id <SelectStoreDelegate> delegate;
@end
......@@ -7,29 +7,23 @@
//
#import "SelectStoreViewController.h"
#import <RATreeView.h>
#import "SelectAreaTableCell.h"
#define kSelectAreaTableCell @"selectAreaTableCell"
#import "SelectProvinceTableCell.h"
#define kSelectProvinceTableCell @"selectProvinceTableCell"
#import "SelectStoreTableCell.h"
#define kSelectStoreTableCell @"selectStoreTableCell"
#import "AreaModel.h"
#import "ProvinceModel.h"
#import "StoreModel.h"
#import "SelectStoreHeadView.h"
#import "CheckBoxButton.h"
#import "HttpClient.h"
#import <MBProgressHUD.h>
#import "TreeView.h"
#import "TreeNodeModel.h"
@interface SelectStoreViewController () <RATreeViewDelegate, RATreeViewDataSource>
@property (nonatomic, strong) RATreeView *treeView;
@property (nonatomic, strong) NSMutableArray *allAreaData;
@interface SelectStoreViewController () <TreeDelegate>
@property (nonatomic, strong) SelectStoreHeadView *headerView;
@property (nonatomic, strong) TreeView *treeView;
@property (nonatomic, strong) UIButton *sureButton;
@property (nonatomic, strong) NSMutableArray *allTreeArray;
@property (nonatomic, strong) NSMutableArray *selectTreeArray;
@end
......@@ -39,7 +33,15 @@
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
self.view.backgroundColor = kFootViewBackGroundColor;
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
......@@ -47,7 +49,9 @@
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
self.allTreeArray = [NSMutableArray array];
self.selectTreeArray = [NSMutableArray array];
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
......@@ -58,16 +62,20 @@
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
[self loadData];
[self requestQueryLowerOrgs];
self.treeView.delegate = self;
self.treeView.dataSource = self;
[self.treeView registerClass:[UITableViewCell class] forCellReuseIdentifier:NSStringFromClass([UITableViewCell class])];
self.treeView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.treeView reloadData];
[self.sureButton addTarget:self action:@selector(sureClick:) forControlEvents:UIControlEventTouchUpInside];
[self requestQueryLowerOrgs];
}
- (void)sureClick:(UIButton *)sender
{
if (_delegate && [_delegate respondsToSelector:@selector(deliverWithArray:)]) {
[_delegate deliverWithArray:self.treeView.selectTreeArray];
}
[self.navigationController popViewControllerAnimated:YES];
}
- (void)doBack:(id)sender
......@@ -81,182 +89,130 @@
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"path":@"",
@"pageNumber":@(0),
@"pageSize":@(10)
@"pageSize":@(999)
};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[httpClient queryLowerOrgsWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"查询下级组织 reponse = %@,error = %@", response, error);
}];
}
- (void)loadData
{
StoreModel *notebook1 = [StoreModel dataObjectWithName:@"南京中央路店"];
StoreModel *notebook2 = [StoreModel dataObjectWithName:@"镇江新区店"];
StoreModel *notebook3 = [StoreModel dataObjectWithName:@"南京卡子门店"];
ProvinceModel *phone1 = [ProvinceModel dataObjectWithName:@"江苏" children:[NSArray arrayWithObjects:notebook1, notebook2, notebook3,nil]];
ProvinceModel *phone2 = [ProvinceModel dataObjectWithName:@"苏北" children:nil];
ProvinceModel *phone3 = [ProvinceModel dataObjectWithName:@"皖南" children:nil];
ProvinceModel *phone4 = [ProvinceModel dataObjectWithName:@"皖北" children:nil];
AreaModel *huadong = [AreaModel dataObjectWithName:@"华东大区"
children:[NSArray arrayWithObjects:phone1, phone2, phone3, phone4, nil]];
ProvinceModel *computer1 = [ProvinceModel dataObjectWithName:@"黑龙江"
children:nil];
ProvinceModel *computer2 = [ProvinceModel dataObjectWithName:@"吉林" children:nil];
ProvinceModel *computer3 = [ProvinceModel dataObjectWithName:@"哈尔滨" children:nil];
AreaModel *huabei = [AreaModel dataObjectWithName:@"华北东北大区"
children:[NSArray arrayWithObjects:computer1, computer2, computer3, nil]];
AreaModel *jinghu = [AreaModel dataObjectWithName:@"京沪西南"
children:[NSArray arrayWithObjects:computer1, computer2, computer3, nil]];
self.allAreaData = [NSMutableArray arrayWithObjects:huadong ,huabei, jinghu,nil];
}
#pragma mark - TreeView Cell Click
- (void)areaClick:(CheckBoxButton *)sender
{
sender.selected = !sender.selected;
NSLog(@"ender.title= %@", sender.titleLabel.text);
SelectAreaTableCell *cell = (SelectAreaTableCell *)sender.superview.superview;
id item = [_treeView itemForCell:cell];
AreaModel *area = cell.areaModel;
if (sender.selected) {
for (ProvinceModel *pro in area.provinceArray) {
pro.isChoose = YES;
NSDictionary *data = response[@"data"];
NSArray *dataArray = data[@"records"];
NSMutableArray *oneTree = [NSMutableArray array];
NSMutableArray *twoTree = [NSMutableArray array];
NSMutableArray *threeTree = [NSMutableArray array];
NSMutableArray *fourTree = [NSMutableArray array];
for (NSDictionary *dict in dataArray) {
TreeNodeModel *tree = [[TreeNodeModel alloc] init];
[tree setValuesForKeysWithDictionary:dict];
[_allTreeArray addObject:tree];
if (tree.level == 1) {
[oneTree addObject:tree];
} else if (tree.level == 2) {
[twoTree addObject:tree];
} else if (tree.level == 3){
[threeTree addObject:tree];
} else {
[fourTree addObject:tree];
}
}
} else {
for (ProvinceModel *pro in area.provinceArray) {
pro.isChoose = NO;
TreeNodeModel *tree1 = oneTree[0];
for (int k = 0; k < twoTree.count; k++) {
TreeNodeModel *tree2 = twoTree[k];
if ([tree2.upper isEqualToString:tree1.code]) {
[tree1 insertChild:tree2];
}
}
}
[_treeView reloadRowsForItems:@[item] withRowAnimation:RATreeViewRowAnimationNone];
// [_treeView expandRowForItem:item withRowAnimation:RATreeViewRowAnimationNone];
//[_treeView expandRowForItem:item expandChildren:YES withRowAnimation:RATreeViewRowAnimationFade];
}
for (int i = 0; i < twoTree.count; i++) {
TreeNodeModel *tree2 = twoTree[i];
for (int k = 0; k < threeTree.count; k++) {
TreeNodeModel *tree3 = threeTree[k];
if ([tree3.upper isEqualToString:tree2.code]) {
[tree2 insertChild:tree3];
}
}
- (void)provinceClick:(CheckBoxButton *)sender
{
sender.selected = !sender.selected;
SelectProvinceTableCell *cell = (SelectProvinceTableCell *)sender.superview.superview;
ProvinceModel *province = cell.provinceModel;
if (sender.selected) {
for (StoreModel *store in province.storeArray) {
store.isChoose = YES;
}
} else {
for (StoreModel *store in province.storeArray) {
store.isChoose = NO;
for (int i = 0; i < threeTree.count; i++) {
TreeNodeModel *tree3 = threeTree[i];
for (int k = 0; k < fourTree.count; k++) {
TreeNodeModel *tree4 = fourTree[k];
if ([tree4.upper isEqualToString:tree3.code]) {
[tree3 insertChild:tree4];
}
}
}
}
//[_treeView reloadData];
}
self.treeView.nodeData = tree1;
[MBProgressHUD hideHUDForView:self.view animated:YES];
- (void)storeClick:(CheckBoxButton *)sender
{
sender.selected = !sender.selected;
}];
}
#pragma mark - RAtreeView Delegate/DataSource
- (NSInteger)treeView:(RATreeView *)treeView numberOfChildrenOfItem:(id)item
#pragma mark - TreeDelegate
- (void)tree:(TreeView *)tree didClickTitleAtNode:(TreeNodeCell *)node
{
NSInteger level = [treeView levelForCellForItem:item];
if (level == -1) {
return [self.allAreaData count];
} else if (level == 0) {
AreaModel *data = item;
return data.provinceArray.count;
} else if (level == 1) {
ProvinceModel *data = item;
return data.storeArray.count;
node.titleButton.selected = !node.titleButton.selected;
node.nodeData.isChoose = node.titleButton.selected;
NSString *path = node.nodeData.path;
// 对子类做处理
if (node.nodeData.isChoose) {
for (TreeNodeModel *model in _allTreeArray) {
if (model.path.length < path.length) {
continue;
}
NSString *modelPath = [model.path substringToIndex:path.length];
if ([path isEqualToString:modelPath]) {
model.isChoose = YES;
}
}
} else {
return 0;
for (TreeNodeModel *model in _allTreeArray) {
if (model.path.length < path.length) {
continue;
}
NSString *modelPath = [model.path substringToIndex:path.length];
if ([path isEqualToString:modelPath]) {
model.isChoose = NO;
}
}
}
}
- (id)treeView:(RATreeView *)treeView child:(NSInteger)index ofItem:(id)item
{
NSInteger level = [treeView levelForCellForItem:item];
if (level == -1) {
return [self.allAreaData objectAtIndex:index];
} else if (level == 0) {
AreaModel *data = item;
return data.provinceArray[index];
} else if (level == 1) {
ProvinceModel *data = item;
return data.storeArray[index];
} else {
return nil;
NSMutableArray *chooseArray = [NSMutableArray array];
for (TreeNodeModel *model in _allTreeArray) {
if (model.isChoose == YES) {
[chooseArray addObject:model];
}
}
}
- (UITableViewCell *)treeView:(RATreeView *)treeView cellForItem:(id)item
{
NSInteger level = [self.treeView levelForCellForItem:item];
if (level == 0) {
AreaModel *data = item;
SelectAreaTableCell *cell = [self.treeView dequeueReusableCellWithIdentifier:kSelectAreaTableCell];
cell.areaModel = data;
[cell.checkBoxButton setTitle:data.name forState:UIControlStateNormal];
cell.iconImageView.image = [UIImage imageNamed:@"arrow_down"];
[cell.checkBoxButton addTarget:self action:@selector(areaClick:) forControlEvents:UIControlEventTouchUpInside];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else if (level == 1) {
ProvinceModel *data = item;
SelectProvinceTableCell *cell = [self.treeView dequeueReusableCellWithIdentifier:kSelectProvinceTableCell];
cell.provinceModel = data;
if (data.isChoose) {
cell.checkBoxButton.selected = YES;
} else {
cell.checkBoxButton.selected = NO;
NSMutableArray *repeatArray = [NSMutableArray array];
for (int i = 0; i < chooseArray.count; i++) {
TreeNodeModel *tree1 = chooseArray[i];
for (int j = 0; j < chooseArray.count; j++) {
TreeNodeModel *tree2 = chooseArray[j];
if ([tree1.code isEqualToString:tree2.upper]) {
[repeatArray addObject:tree2];
}
}
[cell.checkBoxButton setTitle:data.name forState:UIControlStateNormal];
[cell.checkBoxButton addTarget:self action:@selector(provinceClick:) forControlEvents:UIControlEventTouchUpInside];
cell.iconImageView.image = [UIImage imageNamed:@"grey-trilateral_down"];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else {
StoreModel *data = item;
SelectStoreTableCell *cell = [self.treeView dequeueReusableCellWithIdentifier:kSelectStoreTableCell];
cell.storeModel = data;
[cell.checkBoxButton setTitle:data.name forState:UIControlStateNormal];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell.checkBoxButton addTarget:self action:@selector(storeClick:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
[chooseArray removeObjectsInArray:repeatArray];
self.treeView.selectTreeArray = chooseArray;
[self.treeView reloadData];
}
- (BOOL)treeView:(RATreeView *)treeView canEditRowForItem:(id)item
{
return NO;
}
#pragma mark - Lazy loading
- (RATreeView *)treeView
- (TreeView *)treeView
{
if (!_treeView) {
_treeView = [[RATreeView alloc] initWithFrame:self.view.bounds];
_treeView.treeFooterView = [UIView new];
_treeView.rowHeight = UITableViewAutomaticDimension;
_treeView.estimatedRowHeight = 150.0;
_treeView.treeHeaderView = self.headerView;
[_treeView registerClass:[SelectAreaTableCell class] forCellReuseIdentifier:kSelectAreaTableCell];
[_treeView registerClass:[SelectProvinceTableCell class] forCellReuseIdentifier:kSelectProvinceTableCell];
[_treeView registerClass:[SelectStoreTableCell class] forCellReuseIdentifier:kSelectStoreTableCell];
_treeView = [[TreeView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - 64 - 70)];
_treeView.treeDelegate = self;
_treeView.tableHeaderView = self.headerView;
[self.view addSubview:_treeView];
}
return _treeView;
......@@ -270,14 +226,17 @@
return _headerView;
}
/*
#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.
- (UIButton *)sureButton
{
if (!_sureButton) {
_sureButton = [[UIButton alloc] initWithFrame:CGRectMake(20, kScreenHeight - 64 - 55, kScreenWidth - 40, 40)];
_sureButton.backgroundColor = kNavigationBarColor;
[_sureButton setTitle:@"确定" forState:UIControlStateNormal];
[self.view addSubview:_sureButton];
}
return _sureButton;
}
*/
@end
//
// AddButtonTableViewCell.h
// redstar
//
// Created by admin on 15/12/19.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AddButtonTableViewCell : UITableViewCell
@property (nonatomic, strong) UIButton *addButton;
@end
//
// AddButtonTableViewCell.m
// redstar
//
// Created by admin on 15/12/19.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "AddButtonTableViewCell.h"
@implementation AddButtonTableViewCell
- (UIButton *)addButton
{
if (!_addButton) {
_addButton = [[UIButton alloc] init];
_addButton.translatesAutoresizingMaskIntoConstraints = NO;
[_addButton setTitle:@"添加图片文字" forState:UIControlStateNormal];
[_addButton setTitleColor:kNavigationBarColor forState:UIControlStateNormal];
_addButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
[self.contentView addSubview:_addButton];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_addButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_addButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:kScreenWidth - 130];
[self.contentView addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_addButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_addButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.contentView addConstraint:contentHeight];
NSLayoutConstraint *contentBottom = [NSLayoutConstraint constraintWithItem:_addButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:contentBottom];
}
return _addButton;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// AddPicTextTableViewCell.h
// redstar
//
// Created by admin on 15/12/19.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AddPicTextTableViewCell : UITableViewCell
@property (nonatomic, strong) UIButton *photoButton;
@property (nonatomic, strong) UILabel *photoLabel;
@property (nonatomic, strong) UITextView *titleTextView;
@end
//
// AddPicTextTableViewCell.m
// redstar
//
// Created by admin on 15/12/19.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "AddPicTextTableViewCell.h"
@interface AddPicTextTableViewCell ()
@property (nonatomic, strong) UIImageView *backImageView1;
@property (nonatomic, strong) UILabel *placeholderLabel2;
@property (nonatomic, strong) UIView *lineView;
@end
@implementation AddPicTextTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
- (void)setup
{
self.contentView.backgroundColor = kFootViewBackGroundColor;
self.lineView.backgroundColor = kSeparateLineColor;
self.photoButton.backgroundColor = [UIColor whiteColor];
self.photoLabel.text = @"图片说明";
UIImage *image = [UIImage imageNamed:@"textbox"];
UIImage *resizingName = [image resizableImageWithCapInsets:UIEdgeInsetsMake(1, 1, 24, 24) resizingMode:UIImageResizingModeStretch];
self.backImageView1.image = resizingName;
self.titleTextView.backgroundColor = [UIColor clearColor];
self.placeholderLabel2.text = @"请输入图片说明...";
}
- (UIView *)lineView
{
if (!_lineView) {
_lineView = [[UIView alloc] init];
_lineView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_lineView];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0.5];
[self.contentView addConstraint:contentHeight];
}
return _lineView;
}
- (UIButton *)photoButton
{
if (!_photoButton) {
_photoButton = [[UIButton alloc] init];
_photoButton.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_photoButton];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_photoButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:10];
[self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_photoButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_photoButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-5];
[self.contentView addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_photoButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:100];
[self.contentView addConstraint:contentHeight];
}
return _photoButton;
}
- (UILabel *)photoLabel
{
if (!_photoLabel) {
_photoLabel= [[UILabel alloc] init];
_photoLabel.translatesAutoresizingMaskIntoConstraints = NO;
_photoLabel.font = [UIFont systemFontOfSize:15.0];
_photoLabel.textColor = kLightGray;
[self.contentView addSubview:_photoLabel];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_photoLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.photoButton attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_photoLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_photoLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_photoLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.contentView addConstraint:contentHeight];
}
return _photoLabel;
}
- (UIImageView *)backImageView1
{
if (!_backImageView1) {
_backImageView1 = [[UIImageView alloc] init];
_backImageView1.userInteractionEnabled = YES;
_backImageView1.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_backImageView1];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.photoLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:80];
[self.contentView addConstraint:contentHeight];
NSLayoutConstraint *contentBottom = [NSLayoutConstraint constraintWithItem:_backImageView1 attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-10];
[self.contentView addConstraint:contentBottom];
}
return _backImageView1;
}
- (UITextView *)titleTextView
{
if (!_titleTextView) {
_titleTextView = [[UITextView alloc] init];
_titleTextView.font = [UIFont systemFontOfSize:15.0];
_titleTextView.translatesAutoresizingMaskIntoConstraints = NO;
[self.backImageView1 addSubview:_titleTextView];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
[self.backImageView1 addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeLeft multiplier:1.0 constant:1];
[self.backImageView1 addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeRight multiplier:1.0 constant:-1];
[self.backImageView1 addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-1];
[self.backImageView1 addConstraint:contentHeight];
}
return _titleTextView;
}
- (UILabel *)placeholderLabel2
{
if (!_placeholderLabel2) {
_placeholderLabel2 = [[UILabel alloc] init];
_placeholderLabel2.translatesAutoresizingMaskIntoConstraints = NO;
_placeholderLabel2.font = [UIFont systemFontOfSize:15.0];
_placeholderLabel2.textColor = kOnLineCellDetailColor;
[self.titleTextView addSubview:_placeholderLabel2];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_placeholderLabel2 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeTop multiplier:1.0 constant:2];
[self.titleTextView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_placeholderLabel2 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:5];
[self.titleTextView addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_placeholderLabel2 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.titleTextView addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_placeholderLabel2 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.titleTextView addConstraint:contentHeight];
}
return _placeholderLabel2;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -8,22 +8,23 @@
#import "AddPictureViewController.h"
#import "AddPictureTableCell.h"
#import "InspectPicAddCell.h"
#import "InspectAddCell.h"
#import "InpectPictureCell.h"
#import "AddButtonTableViewCell.h"
#import "AddPicTextTableViewCell.h"
#import "HttpClient.h"
#define kAddPicTableViewCell @"addPicTableCell"
#define kAddAndPicCell @"inspectPictureAndAddCell"
#define kAddTableViewCell @"inspectAddCell"
#define kPicTableViewCell @"inspectPictureCell"
#define kAddPicTextTableViewCell @"addPicTextTableCell"
#define kAddButtonCell @"addButtonTableViewCell"
@interface AddPictureViewController () <UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@interface AddPictureViewController () <UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *imageNameArray;
@property (nonatomic, assign) int rowNumber;
@property (nonatomic, strong) UIView *footView;
@property (nonatomic, strong) UIButton *reportButton;
@property (nonatomic, strong) UIActionSheet *selectActionSheet;
@end
......@@ -58,7 +59,7 @@
[self.reportButton addTarget:self action:@selector(uploadInspect:) forControlEvents:UIControlEventTouchUpInside];
_rowNumber = 2;
self.imageNameArray = [NSMutableArray array];
}
#pragma mark - Private Mothods
......@@ -74,29 +75,56 @@
- (void)createImagePicker:(UIButton *)sender
{
self.selectActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"直接拍照上传", @"从本地相册选择", nil];
_selectActionSheet.delegate = self;
_selectActionSheet.tag = 999283;
[_selectActionSheet showInView:self.view];
if (sender.tag == 2201) {
_rowNumber++;
}
}
- (void)addPicText:(UIButton *)sender
{
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"找不到相机" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
} else {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
picker.videoQuality = UIImagePickerControllerQualityTypeLow;
[self presentViewController:picker animated:YES completion:nil];
NSDate *date = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:date];
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
if (_rowNumber == 2) {
AddPictureTableCell *cell = [_tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
if (cell.titleTextView.text.length == 0 || cell.contentTextView.text.length == 0) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"标题、问题与建议描述不能为空!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
} else {
NSString *url = [NSString stringWithFormat:@"%@%@%@&operId=%@&operName=%@", kRedStarURL, kSavePicturePraiseURL,dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *http1 = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"title":cell.contentTextView.text,
@"content":cell.titleTextView.text
};
[http1 savePicturePraiseWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"6.1保存图说口碑 resp = %@, error = %@", response, error);
}];
}
}
_rowNumber++;
[self.tableView reloadData];
}
- (void)saveImage:(UIImage *)currentImage {
NSData *imageData = UIImageJPEGRepresentation(currentImage, 0.5);
NSString *imageName = [NSString stringWithFormat:@"imageName%d", (int)_imageNameArray.count];
NSString *imageName = [NSString stringWithFormat:@"picture%d", (int)_imageNameArray.count];
[_imageNameArray addObject:imageName];
......@@ -119,6 +147,37 @@
}
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (actionSheet.tag == 999283) {
if (buttonIndex == 0) {
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"找不到相机" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
} else {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
picker.videoQuality = UIImagePickerControllerQualityTypeLow;
[self presentViewController:picker animated:YES completion:nil];
}
} else if (buttonIndex == 1){
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
//设置选择后的图片可被编辑
picker.allowsEditing = YES;
[self presentViewController:picker animated:YES completion:nil];
}
}
}
#pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
......@@ -128,7 +187,6 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
AddPictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kAddPicTableViewCell];
if (!cell) {
cell = [[AddPictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAddPicTableViewCell];
......@@ -136,98 +194,60 @@
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else if (indexPath.row == _rowNumber - 1) {
if ((_imageNameArray.count + 1) % 2 == 0) {
InspectPicAddCell *cell=[tableView dequeueReusableCellWithIdentifier:kAddAndPicCell];
if (!cell) {
cell = [[InspectPicAddCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAddAndPicCell];
}
NSString *imageName = _imageNameArray[_imageNameArray.count - 1];
NSLog(@"imageName = %@", imageName);
AddButtonTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAddButtonCell];
if (!cell) {
cell = [[AddButtonTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAddButtonCell];
}
[cell.addButton addTarget:self action:@selector(addPicText:) forControlEvents:UIControlEventTouchUpInside];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else {
AddPicTextTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAddPicTextTableViewCell];
if (!cell) {
cell = [[AddPicTextTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAddPicTextTableViewCell];
}
if (_imageNameArray.count != 0) {
NSString *imageName = _imageNameArray[indexPath.row - 1];
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
//UIImage *image00 = [self cutImage:image];
[cell.photoButton1 setImage:image forState:UIControlStateNormal];
cell.photoButton2.tag = 2201;
[cell.photoButton2 addTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
UIImage *image00 = [self cutImage:image];
[cell.photoButton setImage:image00 forState:UIControlStateNormal];
} else {
InspectAddCell *cell=[tableView dequeueReusableCellWithIdentifier:kAddTableViewCell];
if (!cell) {
cell = [[InspectAddCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAddTableViewCell];
}
cell.photoButton.tag = 2200;
[cell.photoButton addTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
[cell.photoButton setImage:[UIImage imageNamed:@"add-photo_icon"] forState:UIControlStateNormal];
}
[cell.photoButton addTarget:self action:@selector(createImagePicker:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
}
//裁剪图片
- (UIImage *)cutImage:(UIImage*)image
{
//压缩图片
CGSize newSize;
CGImageRef imageRef = nil;
if ((image.size.width / image.size.height) < (((kScreenWidth - 20 * 3) / 2) / 90)) {
newSize.width = image.size.width;
newSize.height = image.size.width * 90 / ((kScreenWidth - 20 * 3) / 2);
imageRef = CGImageCreateWithImageInRect([image CGImage], CGRectMake(0, fabs(image.size.height - newSize.height) / 2, newSize.width, newSize.height));
} else {
newSize.height = image.size.height;
newSize.width = image.size.height * ((kScreenWidth - 20 * 3) / 2) / 90;
InpectPictureCell *cell=[tableView dequeueReusableCellWithIdentifier:kPicTableViewCell];
if (!cell) {
cell = [[InpectPictureCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kPicTableViewCell];
}
NSString *imageName0 = _imageNameArray[(indexPath.row - 3) * 2];
NSString *fullPath0 = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName0];
UIImage *image0 = [UIImage imageWithContentsOfFile:fullPath0];
UIImage *image00 = [self image:image0 scaledToSize:CGSizeMake((kScreenWidth - 3 * 20) / 2, 90)];
[cell.photoButton1 setImage:image00 forState:UIControlStateNormal];
imageRef = CGImageCreateWithImageInRect([image CGImage], CGRectMake(fabs(image.size.width - newSize.width) / 2, 0, newSize.width, newSize.height));
NSString *imageName1 = _imageNameArray[(indexPath.row - 3) * 2 + 1];
NSLog(@"imageName = %@", imageName1);
NSString *fullPath1 = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName1];
UIImage *image1 = [UIImage imageWithContentsOfFile:fullPath1];
UIImage *image11 = [self image:image1 scaledToSize:CGSizeMake((kScreenWidth - 3 * 20) / 2, 90)];
[cell.photoButton2 setImage:image11 forState:UIControlStateNormal];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
return [UIImage imageWithCGImage:imageRef];
}
- (UIImage *)image:(UIImage*)image scaledToSize:(CGSize)newSize
{
// Create a graphics image context
UIGraphicsBeginImageContext(newSize);
// Tell the old image to draw in this new context, with the desired
// new size
[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
// Get the new image from the context
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
// End the context
UIGraphicsEndImageContext();
// Return the new image.
return newImage;
}
////裁剪图片
//- (UIImage *)cutImage:(UIImage*)image
//{
// //压缩图片
// CGSize newSize;
// CGImageRef imageRef = nil;
//
// if ((image.size.width / image.size.height) < (((kScreenWidth - 20 * 3) / 2) / 90)) {
// newSize.width = image.size.width;
// newSize.height = image.size.width * 90 / ((kScreenWidth - 20 * 3) / 2);
//
// imageRef = CGImageCreateWithImageInRect([image CGImage], CGRectMake(0, fabs(image.size.height - newSize.height) / 2, newSize.width, newSize.height));
//
// } else {
// newSize.height = image.size.height;
// newSize.width = image.size.height * ((kScreenWidth - 20 * 3) / 2) / 90;
//
// imageRef = CGImageCreateWithImageInRect([image CGImage], CGRectMake(fabs(image.size.width - newSize.width) / 2, 0, newSize.width, newSize.height));
//
// }
//
// return [UIImage imageWithCGImage:imageRef];
//}
#pragma mark - lazy loading
......@@ -243,9 +263,8 @@
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 100.0;
[_tableView registerClass:[AddPictureTableCell class] forCellReuseIdentifier:kAddPicTableViewCell];
[_tableView registerClass:[InspectAddCell class] forCellReuseIdentifier:kAddTableViewCell];
[_tableView registerClass:[InpectPictureCell class] forCellReuseIdentifier:kPicTableViewCell];
[_tableView registerClass:[InspectPicAddCell class] forCellReuseIdentifier:kAddAndPicCell];
[_tableView registerClass:[AddPicTextTableViewCell class] forCellReuseIdentifier:kAddPicTextTableViewCell];
[_tableView registerClass:[AddButtonTableViewCell class] forCellReuseIdentifier:kAddButtonCell];
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
......
......@@ -406,7 +406,6 @@
cell = [[InspectPicAddCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
}
NSString *imageName = _imageNameArray[_imageNameArray.count - 1];
NSLog(@"imageName = %@", imageName);
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
UIImage *image00 = [self cutImage:image];
......
......@@ -64,8 +64,6 @@
} else {
self.rankDetailView.scoreLabel.text = [NSString stringWithFormat:@"%.1f",taskDetail.score];
}
}
......
......@@ -26,7 +26,7 @@
#import "SelectStoreViewController.h"
#import "RankPickView.h"
#import "TreeNodeModel.h"
#define konlineCell @"onlinesTableViewCell"
#define kRankingCell @"RankingTableViewCell"
......@@ -34,7 +34,7 @@
#define kRankScreenTableViewCell @"rankingScreenCell"
#define kShopNameBtnTag 15000
@interface RankingListViewController () <UITableViewDataSource, UITableViewDelegate, RankListHeaderDelegate, UIPickerViewDelegate, UIPickerViewDataSource>
@interface RankingListViewController () <UITableViewDataSource, UITableViewDelegate, RankListHeaderDelegate, UIPickerViewDelegate, UIPickerViewDataSource, SelectStoreDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *allRankListArray;
......@@ -54,6 +54,8 @@
@property (nonatomic, strong) NSMutableArray *titleArray;
@property (nonatomic, assign) NSInteger pickRow;
@property (nonatomic, strong) NSMutableArray *uuidArray;
@end
@implementation RankingListViewController
......@@ -63,7 +65,7 @@
[super viewDidLoad];
self.allTitleArray = [NSArray arrayWithObjects:@"口碑巡检", @"选择范围", @"统计方式" ,nil];
self.uuidArray = [NSMutableArray array];
self.titleArray = [NSMutableArray array];
self.tableView.delegate = self;
......@@ -198,6 +200,7 @@
NSDictionary *dict = _titleArray[_pickRow];
NSDictionary *parameters = @{@"praiseUuid":dict[@"uuid"],
@"statisMode":@(statisMode),
@"orgUuids":_uuidArray
};
NSLog(@"parrrrrters = %@", parameters);
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
......@@ -287,6 +290,18 @@
[self closeBackGroundView];
}
#pragma mark - SelectStoreDelegate
- (void)deliverWithArray:(NSMutableArray *)array
{
NSString *nameStr = @"";
for (TreeNodeModel *model in array) {
nameStr = [nameStr stringByAppendingString:model.name];
[_uuidArray addObject:model.uuid];
}
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:0];
OnLineTableViewCell *cell = (OnLineTableViewCell *)[_tableView cellForRowAtIndexPath:indexPath];
cell.selectLabel.text = nameStr;
}
#pragma mark - UITableView DataSource/Delegate
......@@ -404,6 +419,7 @@
} else if (indexPath.row == 1) {
SelectStoreViewController *select = [[SelectStoreViewController alloc] init];
select.delegate = self;
[self.navigationController pushViewController:select animated:YES];
} else {
return;
......
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