Commit f69d1d50 authored by Sandy's avatar Sandy

添加商品模块完成

parent 6cf9cecc
...@@ -33,12 +33,21 @@ ...@@ -33,12 +33,21 @@
191AEE2E1CBB86C600F5E535 /* CommotityListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE241CBB86C600F5E535 /* CommotityListModel.m */; }; 191AEE2E1CBB86C600F5E535 /* CommotityListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE241CBB86C600F5E535 /* CommotityListModel.m */; };
191AEE2F1CBB86C600F5E535 /* CommotityListOperator.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE261CBB86C600F5E535 /* CommotityListOperator.m */; }; 191AEE2F1CBB86C600F5E535 /* CommotityListOperator.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE261CBB86C600F5E535 /* CommotityListOperator.m */; };
191AEE301CBB86C600F5E535 /* CommotityListUpper.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE281CBB86C600F5E535 /* CommotityListUpper.m */; }; 191AEE301CBB86C600F5E535 /* CommotityListUpper.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE281CBB86C600F5E535 /* CommotityListUpper.m */; };
191AEE3D1CBB937200F5E535 /* Conditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE331CBB937200F5E535 /* Conditions.m */; }; 191AEE5C1CBCC6D100F5E535 /* addCommodityRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE4A1CBCC6D100F5E535 /* addCommodityRequestModel.m */; };
191AEE3E1CBB937200F5E535 /* Defintion.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE361CBB937200F5E535 /* Defintion.m */; }; 191AEE5D1CBCC6D100F5E535 /* CommotityRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE4C1CBCC6D100F5E535 /* CommotityRequestModel.m */; };
191AEE3F1CBB937200F5E535 /* Orders.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE381CBB937200F5E535 /* Orders.m */; }; 191AEE5E1CBCC6D100F5E535 /* Conditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE4E1CBCC6D100F5E535 /* Conditions.m */; };
191AEE401CBB937200F5E535 /* Parameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE3A1CBB937200F5E535 /* Parameter.m */; }; 191AEE5F1CBCC6D100F5E535 /* Defintion.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE511CBCC6D100F5E535 /* Defintion.m */; };
191AEE411CBB937200F5E535 /* Parameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE3C1CBB937200F5E535 /* Parameters.m */; }; 191AEE601CBCC6D100F5E535 /* Operator.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE531CBCC6D100F5E535 /* Operator.m */; };
191AEE471CBB9E5A00F5E535 /* CommotityRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE461CBB9E5A00F5E535 /* CommotityRequestModel.m */; }; 191AEE611CBCC6D100F5E535 /* OperCtx.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE551CBCC6D100F5E535 /* OperCtx.m */; };
191AEE621CBCC6D100F5E535 /* Orders.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE571CBCC6D100F5E535 /* Orders.m */; };
191AEE631CBCC6D100F5E535 /* Parameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE591CBCC6D100F5E535 /* Parameter.m */; };
191AEE641CBCC6D100F5E535 /* Parameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE5B1CBCC6D100F5E535 /* Parameters.m */; };
191AEE7E1CBCEE6B00F5E535 /* JavenCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE771CBCEE6B00F5E535 /* JavenCategory.m */; };
191AEE7F1CBCEE6B00F5E535 /* JavenCreateInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE791CBCEE6B00F5E535 /* JavenCreateInfo.m */; };
191AEE801CBCEE6B00F5E535 /* JavenLastModifyInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE7B1CBCEE6B00F5E535 /* JavenLastModifyInfo.m */; };
191AEE811CBCEE6B00F5E535 /* JavenOperator.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE7D1CBCEE6B00F5E535 /* JavenOperator.m */; };
191AEE841CBCEE8C00F5E535 /* JavenHotTagsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE831CBCEE8C00F5E535 /* JavenHotTagsModel.m */; };
191AEE881CBCF8E000F5E535 /* CommoditySearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 191AEE861CBCF8E000F5E535 /* CommoditySearchViewController.m */; };
1929F16D1C9FCB62000E9B26 /* NSDictionary+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929F16C1C9FCB62000E9B26 /* NSDictionary+Category.m */; }; 1929F16D1C9FCB62000E9B26 /* NSDictionary+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929F16C1C9FCB62000E9B26 /* NSDictionary+Category.m */; };
1929F16F1C9FCFA6000E9B26 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1929F16E1C9FCFA6000E9B26 /* Assets.xcassets */; }; 1929F16F1C9FCFA6000E9B26 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1929F16E1C9FCFA6000E9B26 /* Assets.xcassets */; };
1929F17C1CA0DD77000E9B26 /* HomeTopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929F17B1CA0DD77000E9B26 /* HomeTopView.m */; }; 1929F17C1CA0DD77000E9B26 /* HomeTopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929F17B1CA0DD77000E9B26 /* HomeTopView.m */; };
...@@ -265,19 +274,37 @@ ...@@ -265,19 +274,37 @@
191AEE261CBB86C600F5E535 /* CommotityListOperator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListOperator.m; sourceTree = "<group>"; }; 191AEE261CBB86C600F5E535 /* CommotityListOperator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListOperator.m; sourceTree = "<group>"; };
191AEE271CBB86C600F5E535 /* CommotityListUpper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityListUpper.h; sourceTree = "<group>"; }; 191AEE271CBB86C600F5E535 /* CommotityListUpper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityListUpper.h; sourceTree = "<group>"; };
191AEE281CBB86C600F5E535 /* CommotityListUpper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListUpper.m; sourceTree = "<group>"; }; 191AEE281CBB86C600F5E535 /* CommotityListUpper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityListUpper.m; sourceTree = "<group>"; };
191AEE321CBB937200F5E535 /* Conditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Conditions.h; sourceTree = "<group>"; }; 191AEE491CBCC6D100F5E535 /* addCommodityRequestModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = addCommodityRequestModel.h; sourceTree = "<group>"; };
191AEE331CBB937200F5E535 /* Conditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Conditions.m; sourceTree = "<group>"; }; 191AEE4A1CBCC6D100F5E535 /* addCommodityRequestModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = addCommodityRequestModel.m; sourceTree = "<group>"; };
191AEE341CBB937200F5E535 /* DataModels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataModels.h; sourceTree = "<group>"; }; 191AEE4B1CBCC6D100F5E535 /* CommotityRequestModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityRequestModel.h; sourceTree = "<group>"; };
191AEE351CBB937200F5E535 /* Defintion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Defintion.h; sourceTree = "<group>"; }; 191AEE4C1CBCC6D100F5E535 /* CommotityRequestModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityRequestModel.m; sourceTree = "<group>"; };
191AEE361CBB937200F5E535 /* Defintion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Defintion.m; sourceTree = "<group>"; }; 191AEE4D1CBCC6D100F5E535 /* Conditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Conditions.h; sourceTree = "<group>"; };
191AEE371CBB937200F5E535 /* Orders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Orders.h; sourceTree = "<group>"; }; 191AEE4E1CBCC6D100F5E535 /* Conditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Conditions.m; sourceTree = "<group>"; };
191AEE381CBB937200F5E535 /* Orders.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Orders.m; sourceTree = "<group>"; }; 191AEE4F1CBCC6D100F5E535 /* DataModels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataModels.h; sourceTree = "<group>"; };
191AEE391CBB937200F5E535 /* Parameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parameter.h; sourceTree = "<group>"; }; 191AEE501CBCC6D100F5E535 /* Defintion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Defintion.h; sourceTree = "<group>"; };
191AEE3A1CBB937200F5E535 /* Parameter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Parameter.m; sourceTree = "<group>"; }; 191AEE511CBCC6D100F5E535 /* Defintion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Defintion.m; sourceTree = "<group>"; };
191AEE3B1CBB937200F5E535 /* Parameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parameters.h; sourceTree = "<group>"; }; 191AEE521CBCC6D100F5E535 /* Operator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Operator.h; sourceTree = "<group>"; };
191AEE3C1CBB937200F5E535 /* Parameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Parameters.m; sourceTree = "<group>"; }; 191AEE531CBCC6D100F5E535 /* Operator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Operator.m; sourceTree = "<group>"; };
191AEE451CBB9E5A00F5E535 /* CommotityRequestModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommotityRequestModel.h; sourceTree = "<group>"; }; 191AEE541CBCC6D100F5E535 /* OperCtx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperCtx.h; sourceTree = "<group>"; };
191AEE461CBB9E5A00F5E535 /* CommotityRequestModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommotityRequestModel.m; sourceTree = "<group>"; }; 191AEE551CBCC6D100F5E535 /* OperCtx.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OperCtx.m; sourceTree = "<group>"; };
191AEE561CBCC6D100F5E535 /* Orders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Orders.h; sourceTree = "<group>"; };
191AEE571CBCC6D100F5E535 /* Orders.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Orders.m; sourceTree = "<group>"; };
191AEE581CBCC6D100F5E535 /* Parameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parameter.h; sourceTree = "<group>"; };
191AEE591CBCC6D100F5E535 /* Parameter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Parameter.m; sourceTree = "<group>"; };
191AEE5A1CBCC6D100F5E535 /* Parameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parameters.h; sourceTree = "<group>"; };
191AEE5B1CBCC6D100F5E535 /* Parameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Parameters.m; sourceTree = "<group>"; };
191AEE761CBCEE6B00F5E535 /* JavenCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenCategory.h; sourceTree = "<group>"; };
191AEE771CBCEE6B00F5E535 /* JavenCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenCategory.m; sourceTree = "<group>"; };
191AEE781CBCEE6B00F5E535 /* JavenCreateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenCreateInfo.h; sourceTree = "<group>"; };
191AEE791CBCEE6B00F5E535 /* JavenCreateInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenCreateInfo.m; sourceTree = "<group>"; };
191AEE7A1CBCEE6B00F5E535 /* JavenLastModifyInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenLastModifyInfo.h; sourceTree = "<group>"; };
191AEE7B1CBCEE6B00F5E535 /* JavenLastModifyInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenLastModifyInfo.m; sourceTree = "<group>"; };
191AEE7C1CBCEE6B00F5E535 /* JavenOperator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenOperator.h; sourceTree = "<group>"; };
191AEE7D1CBCEE6B00F5E535 /* JavenOperator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenOperator.m; sourceTree = "<group>"; };
191AEE821CBCEE8C00F5E535 /* JavenHotTagsModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenHotTagsModel.h; sourceTree = "<group>"; };
191AEE831CBCEE8C00F5E535 /* JavenHotTagsModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenHotTagsModel.m; sourceTree = "<group>"; };
191AEE851CBCF8E000F5E535 /* CommoditySearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommoditySearchViewController.h; sourceTree = "<group>"; };
191AEE861CBCF8E000F5E535 /* CommoditySearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommoditySearchViewController.m; sourceTree = "<group>"; };
1929F16B1C9FCB62000E9B26 /* NSDictionary+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Category.h"; sourceTree = "<group>"; }; 1929F16B1C9FCB62000E9B26 /* NSDictionary+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Category.h"; sourceTree = "<group>"; };
1929F16C1C9FCB62000E9B26 /* NSDictionary+Category.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Category.m"; sourceTree = "<group>"; }; 1929F16C1C9FCB62000E9B26 /* NSDictionary+Category.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Category.m"; sourceTree = "<group>"; };
1929F16E1C9FCFA6000E9B26 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 1929F16E1C9FCFA6000E9B26 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
...@@ -629,6 +656,8 @@ ...@@ -629,6 +656,8 @@
1900A3441CB6305100B2B7C4 /* Commodity */ = { 1900A3441CB6305100B2B7C4 /* Commodity */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
191AEE821CBCEE8C00F5E535 /* JavenHotTagsModel.h */,
191AEE831CBCEE8C00F5E535 /* JavenHotTagsModel.m */,
191AEE1A1CBB86C600F5E535 /* CommodityListModel */, 191AEE1A1CBB86C600F5E535 /* CommodityListModel */,
1900A3481CB6306600B2B7C4 /* HotBrandModel.h */, 1900A3481CB6306600B2B7C4 /* HotBrandModel.h */,
1900A3491CB6306600B2B7C4 /* HotBrandModel.m */, 1900A3491CB6306600B2B7C4 /* HotBrandModel.m */,
...@@ -726,24 +755,45 @@ ...@@ -726,24 +755,45 @@
path = CommodityListModel; path = CommodityListModel;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
191AEE311CBB936A00F5E535 /* RequestModels */ = { 191AEE481CBCC6D100F5E535 /* RequestModels */ = {
isa = PBXGroup;
children = (
191AEE491CBCC6D100F5E535 /* addCommodityRequestModel.h */,
191AEE4A1CBCC6D100F5E535 /* addCommodityRequestModel.m */,
191AEE4B1CBCC6D100F5E535 /* CommotityRequestModel.h */,
191AEE4C1CBCC6D100F5E535 /* CommotityRequestModel.m */,
191AEE4D1CBCC6D100F5E535 /* Conditions.h */,
191AEE4E1CBCC6D100F5E535 /* Conditions.m */,
191AEE4F1CBCC6D100F5E535 /* DataModels.h */,
191AEE501CBCC6D100F5E535 /* Defintion.h */,
191AEE511CBCC6D100F5E535 /* Defintion.m */,
191AEE521CBCC6D100F5E535 /* Operator.h */,
191AEE531CBCC6D100F5E535 /* Operator.m */,
191AEE541CBCC6D100F5E535 /* OperCtx.h */,
191AEE551CBCC6D100F5E535 /* OperCtx.m */,
191AEE561CBCC6D100F5E535 /* Orders.h */,
191AEE571CBCC6D100F5E535 /* Orders.m */,
191AEE581CBCC6D100F5E535 /* Parameter.h */,
191AEE591CBCC6D100F5E535 /* Parameter.m */,
191AEE5A1CBCC6D100F5E535 /* Parameters.h */,
191AEE5B1CBCC6D100F5E535 /* Parameters.m */,
);
path = RequestModels;
sourceTree = "<group>";
};
191AEE651CBCEB7B00F5E535 /* ModelsFiles */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
191AEE451CBB9E5A00F5E535 /* CommotityRequestModel.h */, 191AEE761CBCEE6B00F5E535 /* JavenCategory.h */,
191AEE461CBB9E5A00F5E535 /* CommotityRequestModel.m */, 191AEE771CBCEE6B00F5E535 /* JavenCategory.m */,
191AEE321CBB937200F5E535 /* Conditions.h */, 191AEE781CBCEE6B00F5E535 /* JavenCreateInfo.h */,
191AEE331CBB937200F5E535 /* Conditions.m */, 191AEE791CBCEE6B00F5E535 /* JavenCreateInfo.m */,
191AEE341CBB937200F5E535 /* DataModels.h */, 191AEE7A1CBCEE6B00F5E535 /* JavenLastModifyInfo.h */,
191AEE351CBB937200F5E535 /* Defintion.h */, 191AEE7B1CBCEE6B00F5E535 /* JavenLastModifyInfo.m */,
191AEE361CBB937200F5E535 /* Defintion.m */, 191AEE7C1CBCEE6B00F5E535 /* JavenOperator.h */,
191AEE371CBB937200F5E535 /* Orders.h */, 191AEE7D1CBCEE6B00F5E535 /* JavenOperator.m */,
191AEE381CBB937200F5E535 /* Orders.m */,
191AEE391CBB937200F5E535 /* Parameter.h */,
191AEE3A1CBB937200F5E535 /* Parameter.m */,
191AEE3B1CBB937200F5E535 /* Parameters.h */,
191AEE3C1CBB937200F5E535 /* Parameters.m */,
); );
path = RequestModels; path = ModelsFiles;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
1940D2DE1C9A56730080678C = { 1940D2DE1C9A56730080678C = {
...@@ -1058,7 +1108,8 @@ ...@@ -1058,7 +1108,8 @@
19A1C83E1CA27403003E5DD9 /* Global */ = { 19A1C83E1CA27403003E5DD9 /* Global */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
191AEE311CBB936A00F5E535 /* RequestModels */, 191AEE651CBCEB7B00F5E535 /* ModelsFiles */,
191AEE481CBCC6D100F5E535 /* RequestModels */,
191AEDFD1CBB818600F5E535 /* UserInfoModel */, 191AEDFD1CBB818600F5E535 /* UserInfoModel */,
19ADD3651CA3A16C00EE6E5A /* CoverShadowView.h */, 19ADD3651CA3A16C00EE6E5A /* CoverShadowView.h */,
19ADD3661CA3A16C00EE6E5A /* CoverShadowView.m */, 19ADD3661CA3A16C00EE6E5A /* CoverShadowView.m */,
...@@ -1079,6 +1130,8 @@ ...@@ -1079,6 +1130,8 @@
19ADD3761CA4D19F00EE6E5A /* AddCommodityViewController.m */, 19ADD3761CA4D19F00EE6E5A /* AddCommodityViewController.m */,
197975201CA8DA8200407E3F /* CommodityDetailViewController.h */, 197975201CA8DA8200407E3F /* CommodityDetailViewController.h */,
197975211CA8DA8200407E3F /* CommodityDetailViewController.m */, 197975211CA8DA8200407E3F /* CommodityDetailViewController.m */,
191AEE851CBCF8E000F5E535 /* CommoditySearchViewController.h */,
191AEE861CBCF8E000F5E535 /* CommoditySearchViewController.m */,
); );
path = Commodity; path = Commodity;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1706,6 +1759,7 @@ ...@@ -1706,6 +1759,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
191AEE611CBCC6D100F5E535 /* OperCtx.m in Sources */,
191AEE101CBB818600F5E535 /* UserInfoCertificate.m in Sources */, 191AEE101CBB818600F5E535 /* UserInfoCertificate.m in Sources */,
19DCCBC91C9AA0450072C3BF /* NSNull+OVNatural.m in Sources */, 19DCCBC91C9AA0450072C3BF /* NSNull+OVNatural.m in Sources */,
191AEE141CBB818600F5E535 /* UserInfoOwnerOrg.m in Sources */, 191AEE141CBB818600F5E535 /* UserInfoOwnerOrg.m in Sources */,
...@@ -1720,7 +1774,6 @@ ...@@ -1720,7 +1774,6 @@
1979752E1CA90D6C00407E3F /* CommodityManagementViewController.m in Sources */, 1979752E1CA90D6C00407E3F /* CommodityManagementViewController.m in Sources */,
19DCCBE21C9AA0450072C3BF /* JTOptionsViewController.m in Sources */, 19DCCBE21C9AA0450072C3BF /* JTOptionsViewController.m in Sources */,
1940D31D1C9A57640080678C /* AppDelegate.m in Sources */, 1940D31D1C9A57640080678C /* AppDelegate.m in Sources */,
191AEE411CBB937200F5E535 /* Parameters.m in Sources */,
191AEE131CBB818600F5E535 /* UserInfoLoginControl.m in Sources */, 191AEE131CBB818600F5E535 /* UserInfoLoginControl.m in Sources */,
1929F17C1CA0DD77000E9B26 /* HomeTopView.m in Sources */, 1929F17C1CA0DD77000E9B26 /* HomeTopView.m in Sources */,
19DCCBD21C9AA0450072C3BF /* UIResponder+FirstResponder.m in Sources */, 19DCCBD21C9AA0450072C3BF /* UIResponder+FirstResponder.m in Sources */,
...@@ -1732,6 +1785,7 @@ ...@@ -1732,6 +1785,7 @@
199B4D741CABE4B300451E0E /* NSString+Category.m in Sources */, 199B4D741CABE4B300451E0E /* NSString+Category.m in Sources */,
19DCCBE31C9AA0450072C3BF /* ICRFunctionBaseView.m in Sources */, 19DCCBE31C9AA0450072C3BF /* ICRFunctionBaseView.m in Sources */,
1900A34A1CB6306600B2B7C4 /* HotBrandModel.m in Sources */, 1900A34A1CB6306600B2B7C4 /* HotBrandModel.m in Sources */,
191AEE811CBCEE6B00F5E535 /* JavenOperator.m in Sources */,
19DCCB6A1C9A9EB30072C3BF /* IBTSegmentContainer.m in Sources */, 19DCCB6A1C9A9EB30072C3BF /* IBTSegmentContainer.m in Sources */,
19DCCB5F1C9A9EB30072C3BF /* IBTRefreshTableView.m in Sources */, 19DCCB5F1C9A9EB30072C3BF /* IBTRefreshTableView.m in Sources */,
1979751F1CA8D51700407E3F /* CommodityDetailBottomView.m in Sources */, 1979751F1CA8D51700407E3F /* CommodityDetailBottomView.m in Sources */,
...@@ -1739,18 +1793,17 @@ ...@@ -1739,18 +1793,17 @@
19DCCBFB1C9AA2180072C3BF /* UIAlertView+Blocks.m in Sources */, 19DCCBFB1C9AA2180072C3BF /* UIAlertView+Blocks.m in Sources */,
19DCCBDE1C9AA0450072C3BF /* ICRBaseViewController.m in Sources */, 19DCCBDE1C9AA0450072C3BF /* ICRBaseViewController.m in Sources */,
19DCCBDA1C9AA0450072C3BF /* GXFBottomView.m in Sources */, 19DCCBDA1C9AA0450072C3BF /* GXFBottomView.m in Sources */,
191AEE471CBB9E5A00F5E535 /* CommotityRequestModel.m in Sources */,
191AEE2B1CBB86C600F5E535 /* CommotityListCategory.m in Sources */, 191AEE2B1CBB86C600F5E535 /* CommotityListCategory.m in Sources */,
19DCCBCF1C9AA0450072C3BF /* UIImage+Helper.m in Sources */, 19DCCBCF1C9AA0450072C3BF /* UIImage+Helper.m in Sources */,
19DCCB721C9A9EB30072C3BF /* IBTUINavigationController.m in Sources */, 19DCCB721C9A9EB30072C3BF /* IBTUINavigationController.m in Sources */,
19DCCB641C9A9EB30072C3BF /* IBTTableViewUserInfo.m in Sources */, 19DCCB641C9A9EB30072C3BF /* IBTTableViewUserInfo.m in Sources */,
19DCCBD91C9AA0450072C3BF /* IBTTextFieldCell.m in Sources */, 19DCCBD91C9AA0450072C3BF /* IBTTextFieldCell.m in Sources */,
191AEE3E1CBB937200F5E535 /* Defintion.m in Sources */,
19DCCB741C9A9EB30072C3BF /* IBTUISearchBar.m in Sources */, 19DCCB741C9A9EB30072C3BF /* IBTUISearchBar.m in Sources */,
19DCCBDB1C9AA0450072C3BF /* GXFButtonAndLineView.m in Sources */, 19DCCBDB1C9AA0450072C3BF /* GXFButtonAndLineView.m in Sources */,
1929F1841CA0EA64000E9B26 /* MoneyView.m in Sources */, 1929F1841CA0EA64000E9B26 /* MoneyView.m in Sources */,
191AEE111CBB818600F5E535 /* UserInfoCreateInfo.m in Sources */, 191AEE111CBB818600F5E535 /* UserInfoCreateInfo.m in Sources */,
19ADD3801CA4D38B00EE6E5A /* SortView.m in Sources */, 19ADD3801CA4D38B00EE6E5A /* SortView.m in Sources */,
191AEE881CBCF8E000F5E535 /* CommoditySearchViewController.m in Sources */,
19DCCBC81C9AA0450072C3BF /* NSMutableArray+SafeInsert.m in Sources */, 19DCCBC81C9AA0450072C3BF /* NSMutableArray+SafeInsert.m in Sources */,
19DCCBFA1C9AA2180072C3BF /* UIActionSheet+Blocks.m in Sources */, 19DCCBFA1C9AA2180072C3BF /* UIActionSheet+Blocks.m in Sources */,
19DCCBCA1C9AA0450072C3BF /* NSString+TrimmingAdditions.m in Sources */, 19DCCBCA1C9AA0450072C3BF /* NSString+TrimmingAdditions.m in Sources */,
...@@ -1774,7 +1827,6 @@ ...@@ -1774,7 +1827,6 @@
199B4D971CAE701F00451E0E /* StoreManagermentViewController.m in Sources */, 199B4D971CAE701F00451E0E /* StoreManagermentViewController.m in Sources */,
1913833A1CAB96D4005F6440 /* OrderTableViewCell.m in Sources */, 1913833A1CAB96D4005F6440 /* OrderTableViewCell.m in Sources */,
191383401CAB9DD4005F6440 /* OrderCellView.m in Sources */, 191383401CAB9DD4005F6440 /* OrderCellView.m in Sources */,
191AEE3F1CBB937200F5E535 /* Orders.m in Sources */,
199BC7C71C9BA2A300E4E0B8 /* ResetPasswordViewController.m in Sources */, 199BC7C71C9BA2A300E4E0B8 /* ResetPasswordViewController.m in Sources */,
19DCCB5B1C9A9EB30072C3BF /* IBTAudioServicesManager.m in Sources */, 19DCCB5B1C9A9EB30072C3BF /* IBTAudioServicesManager.m in Sources */,
199BC7C31C9B9B7700E4E0B8 /* UIButton+countDown.m in Sources */, 199BC7C31C9B9B7700E4E0B8 /* UIButton+countDown.m in Sources */,
...@@ -1782,15 +1834,18 @@ ...@@ -1782,15 +1834,18 @@
19DCCBE61C9AA0450072C3BF /* ICRCheckBox.m in Sources */, 19DCCBE61C9AA0450072C3BF /* ICRCheckBox.m in Sources */,
1929F1921CA11472000E9B26 /* HomeCollectionViewCell.m in Sources */, 1929F1921CA11472000E9B26 /* HomeCollectionViewCell.m in Sources */,
19ADD38A1CA4E4BD00EE6E5A /* AddCommodityHeaderView.m in Sources */, 19ADD38A1CA4E4BD00EE6E5A /* AddCommodityHeaderView.m in Sources */,
191AEE5F1CBCC6D100F5E535 /* Defintion.m in Sources */,
191AEE2A1CBB86C600F5E535 /* CommotityListBrand.m in Sources */, 191AEE2A1CBB86C600F5E535 /* CommotityListBrand.m in Sources */,
199BC7CC1C9BA5BA00E4E0B8 /* NextResetPasswordViewController.m in Sources */, 199BC7CC1C9BA5BA00E4E0B8 /* NextResetPasswordViewController.m in Sources */,
19DCCB591C9A9EB30072C3BF /* IBTAudioController.m in Sources */, 19DCCB591C9A9EB30072C3BF /* IBTAudioController.m in Sources */,
191AEE641CBCC6D100F5E535 /* Parameters.m in Sources */,
199BC7B61C9AD52200E4E0B8 /* ToLoginViewController.m in Sources */, 199BC7B61C9AD52200E4E0B8 /* ToLoginViewController.m in Sources */,
19DCCBCC1C9AA0450072C3BF /* UIColor+Helper.m in Sources */, 19DCCBCC1C9AA0450072C3BF /* UIColor+Helper.m in Sources */,
19DCCB661C9A9EB30072C3BF /* IBTCommon.m in Sources */, 19DCCB661C9A9EB30072C3BF /* IBTCommon.m in Sources */,
197975421CAA23BC00407E3F /* UITableView+Category.m in Sources */, 197975421CAA23BC00407E3F /* UITableView+Category.m in Sources */,
19DCCB611C9A9EB30072C3BF /* IBTTableViewCellInfo.m in Sources */, 19DCCB611C9A9EB30072C3BF /* IBTTableViewCellInfo.m in Sources */,
191AEE121CBB818600F5E535 /* UserInfoLastModifyInfo.m in Sources */, 191AEE121CBB818600F5E535 /* UserInfoLastModifyInfo.m in Sources */,
191AEE5E1CBCC6D100F5E535 /* Conditions.m in Sources */,
1979753A1CA9260C00407E3F /* CommodityManagementSortView.m in Sources */, 1979753A1CA9260C00407E3F /* CommodityManagementSortView.m in Sources */,
19DCCB701C9A9EB30072C3BF /* IBTUIControl.m in Sources */, 19DCCB701C9A9EB30072C3BF /* IBTUIControl.m in Sources */,
199B4D8C1CAE688400451E0E /* SeeLogistics.m in Sources */, 199B4D8C1CAE688400451E0E /* SeeLogistics.m in Sources */,
...@@ -1799,10 +1854,11 @@ ...@@ -1799,10 +1854,11 @@
197975271CA8FAE500407E3F /* CommodityDetailTopView.m in Sources */, 197975271CA8FAE500407E3F /* CommodityDetailTopView.m in Sources */,
197975221CA8DA8200407E3F /* CommodityDetailViewController.m in Sources */, 197975221CA8DA8200407E3F /* CommodityDetailViewController.m in Sources */,
19DCCB771C9A9EB30072C3BF /* IBTUIViewController.m in Sources */, 19DCCB771C9A9EB30072C3BF /* IBTUIViewController.m in Sources */,
191AEE5C1CBCC6D100F5E535 /* addCommodityRequestModel.m in Sources */,
19632DAE1CB38FFC0024A8A1 /* HTTPCilent.m in Sources */, 19632DAE1CB38FFC0024A8A1 /* HTTPCilent.m in Sources */,
19DCCB6D1C9A9EB30072C3BF /* IBTTableView.m in Sources */, 19DCCB6D1C9A9EB30072C3BF /* IBTTableView.m in Sources */,
191AEE7F1CBCEE6B00F5E535 /* JavenCreateInfo.m in Sources */,
191AEE2D1CBB86C600F5E535 /* CommotityListLastModifyInfo.m in Sources */, 191AEE2D1CBB86C600F5E535 /* CommotityListLastModifyInfo.m in Sources */,
191AEE3D1CBB937200F5E535 /* Conditions.m in Sources */,
19DCCB731C9A9EB30072C3BF /* IBTUIScrollView.m in Sources */, 19DCCB731C9A9EB30072C3BF /* IBTUIScrollView.m in Sources */,
199BC7D91C9BBE1A00E4E0B8 /* MassageViewController.m in Sources */, 199BC7D91C9BBE1A00E4E0B8 /* MassageViewController.m in Sources */,
1979754D1CAB6E1300407E3F /* JavenMultipleViewWithHeader.m in Sources */, 1979754D1CAB6E1300407E3F /* JavenMultipleViewWithHeader.m in Sources */,
...@@ -1813,7 +1869,10 @@ ...@@ -1813,7 +1869,10 @@
19DCCB601C9A9EB30072C3BF /* IBTScrollLoadMoreView.m in Sources */, 19DCCB601C9A9EB30072C3BF /* IBTScrollLoadMoreView.m in Sources */,
1979753E1CAA15C700407E3F /* CommodityTableViewCell.m in Sources */, 1979753E1CAA15C700407E3F /* CommodityTableViewCell.m in Sources */,
19DCCB671C9A9EB30072C3BF /* IBTCustomButtom.m in Sources */, 19DCCB671C9A9EB30072C3BF /* IBTCustomButtom.m in Sources */,
191AEE7E1CBCEE6B00F5E535 /* JavenCategory.m in Sources */,
191AEE621CBCC6D100F5E535 /* Orders.m in Sources */,
195EB1DB1CA516CE00E298BB /* HotCommodityCell.m in Sources */, 195EB1DB1CA516CE00E298BB /* HotCommodityCell.m in Sources */,
191AEE841CBCEE8C00F5E535 /* JavenHotTagsModel.m in Sources */,
19DCCB711C9A9EB30072C3BF /* IBTUILabel.m in Sources */, 19DCCB711C9A9EB30072C3BF /* IBTUILabel.m in Sources */,
19DCCB651C9A9EB30072C3BF /* IBTBadgeView.m in Sources */, 19DCCB651C9A9EB30072C3BF /* IBTBadgeView.m in Sources */,
19DCCBEF1C9AA1D50072C3BF /* QueryOrder.m in Sources */, 19DCCBEF1C9AA1D50072C3BF /* QueryOrder.m in Sources */,
...@@ -1825,6 +1884,7 @@ ...@@ -1825,6 +1884,7 @@
19ADD36A1CA3AC9D00EE6E5A /* UIButton+Category.m in Sources */, 19ADD36A1CA3AC9D00EE6E5A /* UIButton+Category.m in Sources */,
1940D2EC1C9A56730080678C /* main.m in Sources */, 1940D2EC1C9A56730080678C /* main.m in Sources */,
19DCCBF91C9AA2180072C3BF /* RIButtonItem.m in Sources */, 19DCCBF91C9AA2180072C3BF /* RIButtonItem.m in Sources */,
191AEE631CBCC6D100F5E535 /* Parameter.m in Sources */,
191AEE151CBB818600F5E535 /* UserInfoPasswordControl.m in Sources */, 191AEE151CBB818600F5E535 /* UserInfoPasswordControl.m in Sources */,
19DCCBD61C9AA0450072C3BF /* UIView+FindUIViewController.m in Sources */, 19DCCBD61C9AA0450072C3BF /* UIView+FindUIViewController.m in Sources */,
199BC7A11C9AA7DF00E4E0B8 /* HomeViewController.m in Sources */, 199BC7A11C9AA7DF00E4E0B8 /* HomeViewController.m in Sources */,
...@@ -1834,7 +1894,6 @@ ...@@ -1834,7 +1894,6 @@
19DCCBF11C9AA1D50072C3BF /* ICRUserUtil.m in Sources */, 19DCCBF11C9AA1D50072C3BF /* ICRUserUtil.m in Sources */,
191AEE2E1CBB86C600F5E535 /* CommotityListModel.m in Sources */, 191AEE2E1CBB86C600F5E535 /* CommotityListModel.m in Sources */,
19DCCB6C1C9A9EB30072C3BF /* IBTTabBarController.m in Sources */, 19DCCB6C1C9A9EB30072C3BF /* IBTTabBarController.m in Sources */,
191AEE401CBB937200F5E535 /* Parameter.m in Sources */,
19632DB11CB39B190024A8A1 /* SelectPhotoView.m in Sources */, 19632DB11CB39B190024A8A1 /* SelectPhotoView.m in Sources */,
19DCCB621C9A9EB30072C3BF /* IBTTableViewInfo.m in Sources */, 19DCCB621C9A9EB30072C3BF /* IBTTableViewInfo.m in Sources */,
19ADD38E1CA4EC1000EE6E5A /* AddCommodityHeaderCollectionReusableView.m in Sources */, 19ADD38E1CA4EC1000EE6E5A /* AddCommodityHeaderCollectionReusableView.m in Sources */,
...@@ -1853,14 +1912,17 @@ ...@@ -1853,14 +1912,17 @@
19DCCB6E1C9A9EB30072C3BF /* IBTTableViewCell.m in Sources */, 19DCCB6E1C9A9EB30072C3BF /* IBTTableViewCell.m in Sources */,
1929F16D1C9FCB62000E9B26 /* NSDictionary+Category.m in Sources */, 1929F16D1C9FCB62000E9B26 /* NSDictionary+Category.m in Sources */,
19ADD37E1CA4D38B00EE6E5A /* CommodityListCollectionViewCell.m in Sources */, 19ADD37E1CA4D38B00EE6E5A /* CommodityListCollectionViewCell.m in Sources */,
191AEE801CBCEE6B00F5E535 /* JavenLastModifyInfo.m in Sources */,
19DCCBDC1C9AA0450072C3BF /* IBTDatePickerViewController.m in Sources */, 19DCCBDC1C9AA0450072C3BF /* IBTDatePickerViewController.m in Sources */,
19DCCB781C9A9EB30072C3BF /* IBTWebProgressBar.m in Sources */, 19DCCB781C9A9EB30072C3BF /* IBTWebProgressBar.m in Sources */,
19DCCBFE1C9AA2A90072C3BF /* ICRDataBaseController.m in Sources */, 19DCCBFE1C9AA2A90072C3BF /* ICRDataBaseController.m in Sources */,
191AEE5D1CBCC6D100F5E535 /* CommotityRequestModel.m in Sources */,
191AEE2F1CBB86C600F5E535 /* CommotityListOperator.m in Sources */, 191AEE2F1CBB86C600F5E535 /* CommotityListOperator.m in Sources */,
19ADD36E1CA3B88A00EE6E5A /* CommodityListViewController.m in Sources */, 19ADD36E1CA3B88A00EE6E5A /* CommodityListViewController.m in Sources */,
19DCCBD41C9AA0450072C3BF /* UITabBarItem+Universal.m in Sources */, 19DCCBD41C9AA0450072C3BF /* UITabBarItem+Universal.m in Sources */,
19DCCBE51C9AA0450072C3BF /* ICRFunctionItemControl.m in Sources */, 19DCCBE51C9AA0450072C3BF /* ICRFunctionItemControl.m in Sources */,
1929F18E1CA10C94000E9B26 /* HomeCollectionViewController.m in Sources */, 1929F18E1CA10C94000E9B26 /* HomeCollectionViewController.m in Sources */,
191AEE601CBCC6D100F5E535 /* Operator.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
//
// JavenHotTagsModel.h
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class JavenCategory, JavenLastModifyInfo, JavenCreateInfo;
@interface JavenHotTagsModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *domain;
@property (nonatomic, strong) JavenCategory *category;
@property (nonatomic, strong) JavenLastModifyInfo *lastModifyInfo;
@property (nonatomic, assign) double order;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) JavenCreateInfo *createInfo;
@property (nonatomic, assign) double version;
@property (nonatomic, assign) id internalBaseClassDescription;
@property (nonatomic, strong) NSString *name;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenHotTagsModel.m
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenHotTagsModel.h"
#import "JavenCategory.h"
#import "JavenLastModifyInfo.h"
#import "JavenCreateInfo.h"
NSString *const kJavenHotTagsModelDomain = @"domain";
NSString *const kJavenHotTagsModelCategory = @"category";
NSString *const kJavenHotTagsModelLastModifyInfo = @"lastModifyInfo";
NSString *const kJavenHotTagsModelOrder = @"order";
NSString *const kJavenHotTagsModelUuid = @"uuid";
NSString *const kJavenHotTagsModelCreateInfo = @"createInfo";
NSString *const kJavenHotTagsModelVersion = @"version";
NSString *const kJavenHotTagsModelDescription = @"description";
NSString *const kJavenHotTagsModelName = @"name";
@interface JavenHotTagsModel ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenHotTagsModel
@synthesize domain = _domain;
@synthesize category = _category;
@synthesize lastModifyInfo = _lastModifyInfo;
@synthesize order = _order;
@synthesize uuid = _uuid;
@synthesize createInfo = _createInfo;
@synthesize version = _version;
@synthesize internalBaseClassDescription = _internalBaseClassDescription;
@synthesize name = _name;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.domain = [self objectOrNilForKey:kJavenHotTagsModelDomain fromDictionary:dict];
self.category = [JavenCategory modelObjectWithDictionary:[dict objectForKey:kJavenHotTagsModelCategory]];
self.lastModifyInfo = [JavenLastModifyInfo modelObjectWithDictionary:[dict objectForKey:kJavenHotTagsModelLastModifyInfo]];
self.order = [[self objectOrNilForKey:kJavenHotTagsModelOrder fromDictionary:dict] doubleValue];
self.uuid = [self objectOrNilForKey:kJavenHotTagsModelUuid fromDictionary:dict];
self.createInfo = [JavenCreateInfo modelObjectWithDictionary:[dict objectForKey:kJavenHotTagsModelCreateInfo]];
self.version = [[self objectOrNilForKey:kJavenHotTagsModelVersion fromDictionary:dict] doubleValue];
self.internalBaseClassDescription = [self objectOrNilForKey:kJavenHotTagsModelDescription fromDictionary:dict];
self.name = [self objectOrNilForKey:kJavenHotTagsModelName fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.domain forKey:kJavenHotTagsModelDomain];
[mutableDict setValue:[self.category dictionaryRepresentation] forKey:kJavenHotTagsModelCategory];
[mutableDict setValue:[self.lastModifyInfo dictionaryRepresentation] forKey:kJavenHotTagsModelLastModifyInfo];
[mutableDict setValue:[NSNumber numberWithDouble:self.order] forKey:kJavenHotTagsModelOrder];
[mutableDict setValue:self.uuid forKey:kJavenHotTagsModelUuid];
[mutableDict setValue:[self.createInfo dictionaryRepresentation] forKey:kJavenHotTagsModelCreateInfo];
[mutableDict setValue:[NSNumber numberWithDouble:self.version] forKey:kJavenHotTagsModelVersion];
[mutableDict setValue:self.internalBaseClassDescription forKey:kJavenHotTagsModelDescription];
[mutableDict setValue:self.name forKey:kJavenHotTagsModelName];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.domain = [aDecoder decodeObjectForKey:kJavenHotTagsModelDomain];
self.category = [aDecoder decodeObjectForKey:kJavenHotTagsModelCategory];
self.lastModifyInfo = [aDecoder decodeObjectForKey:kJavenHotTagsModelLastModifyInfo];
self.order = [aDecoder decodeDoubleForKey:kJavenHotTagsModelOrder];
self.uuid = [aDecoder decodeObjectForKey:kJavenHotTagsModelUuid];
self.createInfo = [aDecoder decodeObjectForKey:kJavenHotTagsModelCreateInfo];
self.version = [aDecoder decodeDoubleForKey:kJavenHotTagsModelVersion];
self.internalBaseClassDescription = [aDecoder decodeObjectForKey:kJavenHotTagsModelDescription];
self.name = [aDecoder decodeObjectForKey:kJavenHotTagsModelName];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_domain forKey:kJavenHotTagsModelDomain];
[aCoder encodeObject:_category forKey:kJavenHotTagsModelCategory];
[aCoder encodeObject:_lastModifyInfo forKey:kJavenHotTagsModelLastModifyInfo];
[aCoder encodeDouble:_order forKey:kJavenHotTagsModelOrder];
[aCoder encodeObject:_uuid forKey:kJavenHotTagsModelUuid];
[aCoder encodeObject:_createInfo forKey:kJavenHotTagsModelCreateInfo];
[aCoder encodeDouble:_version forKey:kJavenHotTagsModelVersion];
[aCoder encodeObject:_internalBaseClassDescription forKey:kJavenHotTagsModelDescription];
[aCoder encodeObject:_name forKey:kJavenHotTagsModelName];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenHotTagsModel *copy = [[JavenHotTagsModel alloc] init];
if (copy) {
copy.domain = [self.domain copyWithZone:zone];
copy.category = [self.category copyWithZone:zone];
copy.lastModifyInfo = [self.lastModifyInfo copyWithZone:zone];
copy.order = self.order;
copy.uuid = [self.uuid copyWithZone:zone];
copy.createInfo = [self.createInfo copyWithZone:zone];
copy.version = self.version;
copy.internalBaseClassDescription = [self.internalBaseClassDescription copyWithZone:zone];
copy.name = [self.name copyWithZone:zone];
}
return copy;
}
@end
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CatgoryModel.h" #import "CatgoryModel.h"
#import "JavenHotTagsModel.h"
@interface AddCommodityCollectionViewCell : UICollectionViewCell @interface AddCommodityCollectionViewCell : UICollectionViewCell
- (void)cellWithModel:(CatgoryModel *)model indexPath:(NSIndexPath *)indexPath; - (void)cellWithModel:(CatgoryModel *)model indexPath:(NSIndexPath *)indexPath;
- (void)cellWithHotTagsModel:(JavenHotTagsModel *)model indexPath:(NSIndexPath *)indexPath;
- (void)hideTopLine; - (void)hideTopLine;
- (void)showTopLine; - (void)showTopLine;
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
self.labelDsc.text = model.adescription; self.labelDsc.text = model.adescription;
self.labelTItle.text = model.name; self.labelTItle.text = model.name;
if ((int)indexPath.row / 4 == 0) { if ((int)indexPath.row / 4 == 0) {
[self showTopLine]; [self showTopLine];
}else{ }else{
...@@ -40,6 +39,25 @@ ...@@ -40,6 +39,25 @@
} }
- (void)cellWithHotTagsModel:(JavenHotTagsModel *)model indexPath:(NSIndexPath *)indexPath
{
//[self.imgView sd_setImageWithURL:[NSURL URLWithString:model.pictures] placeholderImage:nil];
//self.labelDsc.text = model.adescription;
self.labelTItle.text = model.name;
if ((int)indexPath.row / 4 == 0) {
[self showTopLine];
}else{
[self hideTopLine];
}
if ((int)indexPath.row % 4 == 0) {
[self showLeftLine];
}else{
[self hideLeftLine];
}
}
- (void)hideTopLine { - (void)hideTopLine {
self.viewTopLine.hidden = YES; self.viewTopLine.hidden = YES;
} }
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="简单说明文字" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JTo-s2-j2V"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="简单说明文字" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JTo-s2-j2V">
<rect key="frame" x="71" y="226" width="84" height="17"/> <rect key="frame" x="3" y="226" width="220" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
......
...@@ -8,9 +8,12 @@ ...@@ -8,9 +8,12 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CommodityListModel/CommotityListModel.h" #import "CommodityListModel/CommotityListModel.h"
typedef void (^addSuccessBlock)(void);
@interface CommodityListCollectionViewCell : UICollectionViewCell @interface CommodityListCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UILabel *labelRealPrice; @property (weak, nonatomic) IBOutlet UILabel *labelRealPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelSalePrice; @property (weak, nonatomic) IBOutlet UILabel *labelSalePrice;
@property (nonatomic, copy) addSuccessBlock successBlock;
- (void)cellWithModel:(CommotityListModel *)model; - (void)cellWithModel:(CommotityListModel *)model;
@end @end
...@@ -7,15 +7,16 @@ ...@@ -7,15 +7,16 @@
// //
#import "CommodityListCollectionViewCell.h" #import "CommodityListCollectionViewCell.h"
#import "NSDate+FormatterAdditions.h"
#import "addCommodityRequestModel.h"
@interface CommodityListCollectionViewCell () @interface CommodityListCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageViewTop; @property (weak, nonatomic) IBOutlet UIImageView *imageViewTop;
@property (weak, nonatomic) IBOutlet UILabel *labelTitle; @property (weak, nonatomic) IBOutlet UILabel *labelTitle;
@property (weak, nonatomic) IBOutlet UILabel *labelCommission; @property (weak, nonatomic) IBOutlet UILabel *labelCommission;
@property (weak, nonatomic) IBOutlet UILabel *labelPrice; @property (weak, nonatomic) IBOutlet UILabel *labelPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelOriginalPrice; @property (weak, nonatomic) IBOutlet UILabel *labelOriginalPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelBrokerageRate; @property (weak, nonatomic) IBOutlet UILabel *labelBrokerageRate;
@property (nonatomic, strong) CommotityListModel *model;
@end @end
...@@ -26,9 +27,54 @@ ...@@ -26,9 +27,54 @@
[self.imageViewTop sd_setImageWithURL:[NSURL URLWithString:model.pictures] placeholderImage:nil]; [self.imageViewTop sd_setImageWithURL:[NSURL URLWithString:model.pictures] placeholderImage:nil];
self.labelOriginalPrice.text = [NSString stringWithFormat:@"%.0f", model.originalPrice]; self.labelOriginalPrice.text = [NSString stringWithFormat:@"%.0f", model.originalPrice];
self.labelBrokerageRate.text = [NSString stringWithFormat:@"%.2f", model.brokerageRate]; self.labelBrokerageRate.text = [NSString stringWithFormat:@"%.2f", model.brokerageRate];
self.labelTitle.text = model.name; self.labelTitle.text = model.name;
self.model = model;
} }
- (IBAction)actionAdd:(id)sender {
CLog(@"添加商品");
UserInfo *info = [UserInfo shareInstance];
NSDictionary *param = @{
@"operCtx": @{
@"time": [[NSDate date] timeStampNumber],
@"domain": info.domain,
@"operator": @{
@"id": info.uuid,
@"fullName": info.name
}
},
@"shopUuid": info.shop.uuid,
@"goodsUuid":self.model.uuid
};
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"shop/addGoods" parameters:param success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber: @0]) {
weakSelf.successBlock();
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)addSUccess {
//添加成功提示框
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self.window];
[self.window addSubview:hud];
hud.animationType = MBProgressHUDAnimationFade;
hud.removeFromSuperViewOnHide = YES;
hud.labelText = @"添加成功!";
hud.mode = MBProgressHUDModeText;
[hud show:YES];
[hud hide:YES afterDelay:1];
}
- (void)awakeFromNib { - (void)awakeFromNib {
// Initialization code // Initialization code
......
...@@ -62,19 +62,14 @@ ...@@ -62,19 +62,14 @@
<constraint firstAttribute="height" constant="1" id="qzP-Z6-Apx"/> <constraint firstAttribute="height" constant="1" id="qzP-Z6-Apx"/>
</constraints> </constraints>
</view> </view>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="commodityUnAdded" translatesAutoresizingMaskIntoConstraints="NO" id="UMJ-W9-mQo"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aRu-lu-Ec8">
<rect key="frame" x="6" y="10" width="40" height="25"/> <rect key="frame" x="6" y="9" width="115" height="25"/>
<constraints> <state key="normal" title="添加到店铺" image="commodityUnAdded">
<constraint firstAttribute="width" constant="40" id="8Hd-Aq-z5g"/>
<constraint firstAttribute="height" constant="25" id="WZz-YI-6s0"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aRu-lu-Ec8">
<rect key="frame" x="43" y="6" width="64" height="32"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="添加商品">
<color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/> <color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</state> </state>
<connections>
<action selector="actionAdd:" destination="gTV-IL-0wX" eventType="touchUpInside" id="pkV-cN-vIR"/>
</connections>
</button> </button>
<button opaque="NO" contentMode="scaleAspectFit" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dLe-Tm-qm6"> <button opaque="NO" contentMode="scaleAspectFit" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dLe-Tm-qm6">
<rect key="frame" x="161" y="11" width="22" height="23"/> <rect key="frame" x="161" y="11" width="22" height="23"/>
...@@ -87,16 +82,14 @@ ...@@ -87,16 +82,14 @@
</subviews> </subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstItem="UMJ-W9-mQo" firstAttribute="leading" secondItem="pU7-bv-8QS" secondAttribute="leading" constant="6" id="1rW-qL-mOd"/>
<constraint firstItem="aRu-lu-Ec8" firstAttribute="leading" secondItem="UMJ-W9-mQo" secondAttribute="trailing" constant="-3" id="2H2-RG-05O"/>
<constraint firstAttribute="height" constant="44" id="92V-hY-tjv"/> <constraint firstAttribute="height" constant="44" id="92V-hY-tjv"/>
<constraint firstItem="IC1-ZB-9GI" firstAttribute="top" secondItem="pU7-bv-8QS" secondAttribute="top" id="Bup-dM-Axi"/> <constraint firstItem="IC1-ZB-9GI" firstAttribute="top" secondItem="pU7-bv-8QS" secondAttribute="top" id="Bup-dM-Axi"/>
<constraint firstAttribute="trailing" secondItem="dLe-Tm-qm6" secondAttribute="trailing" constant="12" id="DMY-ta-tB1"/> <constraint firstAttribute="trailing" secondItem="dLe-Tm-qm6" secondAttribute="trailing" constant="12" id="DMY-ta-tB1"/>
<constraint firstItem="IC1-ZB-9GI" firstAttribute="leading" secondItem="pU7-bv-8QS" secondAttribute="leading" id="JVz-Qb-8fs"/> <constraint firstItem="IC1-ZB-9GI" firstAttribute="leading" secondItem="pU7-bv-8QS" secondAttribute="leading" id="JVz-Qb-8fs"/>
<constraint firstItem="aRu-lu-Ec8" firstAttribute="centerY" secondItem="pU7-bv-8QS" secondAttribute="centerY" id="KdK-b2-Phl"/> <constraint firstItem="aRu-lu-Ec8" firstAttribute="centerY" secondItem="pU7-bv-8QS" secondAttribute="centerY" id="KdK-b2-Phl"/>
<constraint firstItem="aRu-lu-Ec8" firstAttribute="leading" secondItem="pU7-bv-8QS" secondAttribute="leading" constant="6" id="Sk9-53-nyg"/>
<constraint firstItem="dLe-Tm-qm6" firstAttribute="centerY" secondItem="pU7-bv-8QS" secondAttribute="centerY" id="XM2-R2-Z3p"/> <constraint firstItem="dLe-Tm-qm6" firstAttribute="centerY" secondItem="pU7-bv-8QS" secondAttribute="centerY" id="XM2-R2-Z3p"/>
<constraint firstAttribute="trailing" secondItem="IC1-ZB-9GI" secondAttribute="trailing" id="dzj-Dv-VRD"/> <constraint firstAttribute="trailing" secondItem="IC1-ZB-9GI" secondAttribute="trailing" id="dzj-Dv-VRD"/>
<constraint firstItem="UMJ-W9-mQo" firstAttribute="centerY" secondItem="pU7-bv-8QS" secondAttribute="centerY" id="u1M-N2-xp5"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DLG-sh-uU2"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DLG-sh-uU2">
...@@ -156,7 +149,7 @@ ...@@ -156,7 +149,7 @@
<outlet property="labelSalePrice" destination="ig6-43-sUi" id="NaO-uj-sLU"/> <outlet property="labelSalePrice" destination="ig6-43-sUi" id="NaO-uj-sLU"/>
<outlet property="labelTitle" destination="vlk-5l-QDd" id="FAQ-2a-zdq"/> <outlet property="labelTitle" destination="vlk-5l-QDd" id="FAQ-2a-zdq"/>
</connections> </connections>
<point key="canvasLocation" x="227" y="355.5"/> <point key="canvasLocation" x="-105" y="369.5"/>
</collectionViewCell> </collectionViewCell>
</objects> </objects>
<resources> <resources>
......
...@@ -8,10 +8,9 @@ ...@@ -8,10 +8,9 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
typedef void (^sortBlock)(BOOL); typedef void (^sortBlock)(void);
typedef void (^selectedRow)(NSInteger); typedef void (^selectedRow)(NSInteger);
@interface SortView : UIView @interface SortView : UIView
@property (nonatomic, copy) sortBlock leftSortAction;
@property (nonatomic, copy) sortBlock rightAction; @property (nonatomic, copy) sortBlock rightAction;
@property (nonatomic, copy) selectedRow selecedBlock; @property (nonatomic, copy) selectedRow selecedBlock;
......
...@@ -61,6 +61,9 @@ ...@@ -61,6 +61,9 @@
} }
- (void)rightBtnAction { - (void)rightBtnAction {
self.rightAction();
[self.rightBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal]; [self.rightBtn setTitleColor:kCustomGreenColor forState:UIControlStateNormal];
[self.leftBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal]; [self.leftBtn setTitleColor:kTextColorBlack forState:UIControlStateNormal];
if (self.isTableOpen == YES) { if (self.isTableOpen == YES) {
...@@ -90,7 +93,13 @@ ...@@ -90,7 +93,13 @@
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.bottom + 64, ScreenSize.width, 0) style:UITableViewStylePlain]; _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.bottom + 64, ScreenSize.width, 0) style:UITableViewStylePlain];
_tableView.delegate = self; _tableView.delegate = self;
_tableView.dataSource = self; _tableView.dataSource = self;
_arrTitles = @[@"综合排序",@"新品排序",@"收藏排序",@"价格从低到高",@"价格从高到低",@"佣金从低到高",@"佣金从高到低"]; _arrTitles = @[@"综合排序",
@"价格从高到低",
@"价格从低到高",
@"佣金从高到低",
@"佣金从低到高",
@"点击量从高到低",
@"点击量从低到高"];
_arrSelectedMark = [NSMutableArray array]; _arrSelectedMark = [NSMutableArray array];
for (int i = 0; i < self.arrTitles.count; i++) { for (int i = 0; i < self.arrTitles.count; i++) {
[self.arrSelectedMark addObject:@"NO"]; [self.arrSelectedMark addObject:@"NO"];
...@@ -110,7 +119,6 @@ ...@@ -110,7 +119,6 @@
#pragma mark ==============animate============== #pragma mark ==============animate==============
- (void)showTableView { - (void)showTableView {
[self.coverView show]; [self.coverView show];
//self.leftSortAction(YES);
WS(weakSelf) WS(weakSelf)
self.isTableOpen = YES; self.isTableOpen = YES;
...@@ -121,7 +129,6 @@ ...@@ -121,7 +129,6 @@
- (void)hideTableView { - (void)hideTableView {
[self.coverView hide]; [self.coverView hide];
// self.leftSortAction(NO);
self.isTableOpen = NO; self.isTableOpen = NO;
WS(weakSelf) WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
......
...@@ -15,13 +15,15 @@ ...@@ -15,13 +15,15 @@
#import "CommodityListViewController.h" #import "CommodityListViewController.h"
#import "HotBrandModel.h" #import "HotBrandModel.h"
#import "CatgoryModel.h" #import "CatgoryModel.h"
#import "JavenHotTagsModel.h"
#import "CommoditySearchViewController.h"
#define kHotCellId @"addCommodityCellHot" #define kHotCellId @"addCommodityCellHot"
#define kCellId @"addCommodityCell" #define kCellId @"addCommodityCell"
#define kHeaderId @"headerId" #define kHeaderId @"headerId"
#define kFooterId @"footerId" #define kFooterId @"footerId"
#define kMargin 0 #define kMargin 0
@interface AddCommodityViewController ()<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout> @interface AddCommodityViewController ()<UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UISearchBarDelegate>
@property (nonatomic, strong) NSMutableArray *arrData; @property (nonatomic, strong) NSMutableArray *arrData;
@property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) UICollectionView *collectionView;
@end @end
...@@ -30,7 +32,12 @@ ...@@ -30,7 +32,12 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.navigationItem.title = @"添加商品"; self.navigationItem.title = @"添加商品";
UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"searchIcon"] style:UIBarButtonItemStyleDone target:self action:@selector(searchAct)];
rightBtn.tintColor = kTextColorDarkGray;
self.navigationItem.rightBarButtonItem = rightBtn;
[self setUpCollectionView]; [self setUpCollectionView];
[self updateStatueBarAppearance]; [self updateStatueBarAppearance];
[self setUpdata]; [self setUpdata];
...@@ -43,6 +50,19 @@ ...@@ -43,6 +50,19 @@
return _arrData; return _arrData;
} }
- (void)searchAct {
CLog(@"搜索");
CommoditySearchViewController *searchVC = [[CommoditySearchViewController alloc] init];
searchVC.isShowNavigationBar = YES;
IBTUINavigationController *nc = [[IBTUINavigationController alloc] initWithRootViewController:searchVC];
// [self.navigationController presentModalViewController:nc animated:NO];
[self.navigationController presentViewController:nc animated:YES completion:nil];
}
- (void)setUpdata { - (void)setUpdata {
WS(weakSelf) WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"app/getGoodsFilter/%@", @"0001"] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { [[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"app/getGoodsFilter/%@", @"0001"] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
...@@ -60,6 +80,16 @@ ...@@ -60,6 +80,16 @@
} }
[weakSelf.arrData addObject:arrHotBrand]; [weakSelf.arrData addObject:arrHotBrand];
//热门标签
NSMutableArray *arrHotTags = [NSMutableArray array];
for (NSDictionary *dic in responseObject[@"hotTags"]) {
JavenHotTagsModel *model = [JavenHotTagsModel modelObjectWithDictionary:dic];
[arrHotTags addObject:model];
}
[weakSelf.arrData addObject:arrHotTags];
//品牌
NSMutableArray *arrCategory = [NSMutableArray array]; NSMutableArray *arrCategory = [NSMutableArray array];
for (NSDictionary *dic in responseObject[@"categories"]) { for (NSDictionary *dic in responseObject[@"categories"]) {
[CatgoryModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{ [CatgoryModel mj_setupReplacedKeyFromPropertyName:^NSDictionary *{
...@@ -126,6 +156,8 @@ ...@@ -126,6 +156,8 @@
AddCommodityHeaderCollectionReusableView *reuseHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:kHeaderId forIndexPath:indexPath]; AddCommodityHeaderCollectionReusableView *reuseHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:kHeaderId forIndexPath:indexPath];
if (indexPath.section == 0) { if (indexPath.section == 0) {
[reuseHeaderView sectionHot]; [reuseHeaderView sectionHot];
}else if(indexPath.section == 1){
[reuseHeaderView sectionNormalWithTitle:@"标签"];
}else{ }else{
[reuseHeaderView sectionNormalWithTitle:@"分类"]; [reuseHeaderView sectionNormalWithTitle:@"分类"];
} }
...@@ -176,7 +208,7 @@ ...@@ -176,7 +208,7 @@
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return [self.arrData[section] count]; return section == 1 ? 4 : [self.arrData[section] count];
} }
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
...@@ -188,18 +220,25 @@ ...@@ -188,18 +220,25 @@
return cell; return cell;
//分类 //标签
}else if(indexPath.section == 1){ }else if(indexPath.section == 1){
AddCommodityCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellId forIndexPath:indexPath]; AddCommodityCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellId forIndexPath:indexPath];
[cell cellWithHotTagsModel:self.arrData[indexPath.section][indexPath.row] indexPath:indexPath];
return cell;
//分类
}else{
AddCommodityCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellId forIndexPath:indexPath];
[cell cellWithModel:self.arrData[indexPath.section][indexPath.row] indexPath:indexPath]; [cell cellWithModel:self.arrData[indexPath.section][indexPath.row] indexPath:indexPath];
return cell; return cell;
} }
return nil; return nil;
} }
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityListViewController *commodityVC = [[CommodityListViewController alloc] init]; CommodityListViewController *commodityVC = [[CommodityListViewController alloc] init];
commodityVC.hidesBottomBarWhenPushed = YES; commodityVC.hidesBottomBarWhenPushed = YES;
......
...@@ -13,14 +13,18 @@ ...@@ -13,14 +13,18 @@
#import "CommotityRequestModel.h" #import "CommotityRequestModel.h"
#import "HotBrandModel.h" #import "HotBrandModel.h"
#import "CatgoryModel.h" #import "CatgoryModel.h"
#import "JavenHotTagsModel.h"
#import "CommodityListModel/CommotityListModel.h" #import "CommodityListModel/CommotityListModel.h"
#define kCellID @"commodityCell" #define kCellID @"commodityCell"
#define kPageSize @10
@interface CommodityListViewController ()<UICollectionViewDataSource, UICollectionViewDelegate> @interface CommodityListViewController ()<UICollectionViewDataSource, UICollectionViewDelegate>
@property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) SortView *sortView; @property (nonatomic, strong) SortView *sortView;
@property (nonatomic, strong) NSMutableArray *arrItemDatas; @property (nonatomic, strong) NSMutableArray *arrItemDatas;
@property (nonatomic, assign) NSInteger page; @property (nonatomic, assign) NSInteger page;
@property (nonatomic, copy) NSString *field; //排序的字段
@property (nonatomic, copy) NSString *direction; //排序的顺序 升序或降序
@end @end
...@@ -29,6 +33,8 @@ ...@@ -29,6 +33,8 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
//配置navigationbar
self.navigationItem.title = @"商品列表"; self.navigationItem.title = @"商品列表";
self.view.backgroundColor = kBacroundColor; self.view.backgroundColor = kBacroundColor;
[self setUpSortView]; [self setUpSortView];
...@@ -46,30 +52,34 @@ ...@@ -46,30 +52,34 @@
- (void)setUpData { - (void)setUpData {
//前期发送请求生成参数的方式,后来不这么做了
NSString *jsonString = @"{\"defintion\":{\"conditions\":[{\"operation\":\"string\",\"parameter\":{},\"parameters\":[{}]}],\"orders\":[{\"field\":\"string\",\"direction\":\"asc\"}],\"pageSize\":0,\"page\":0,\"probePages\":0},\"fetchParts\":[\"string\"]}"; NSString *jsonString = @"{\"defintion\":{\"conditions\":[{\"operation\":\"string\",\"parameter\":{},\"parameters\":[{}]}],\"orders\":[{\"field\":\"string\",\"direction\":\"asc\"}],\"pageSize\":0,\"page\":0,\"probePages\":0},\"fetchParts\":[\"string\"]}";
NSDictionary *dic = [jsonString mj_JSONObject]; NSDictionary *dic = [jsonString mj_JSONObject];
CommotityRequestModel *requstBody = [CommotityRequestModel modelObjectWithDictionary:dic]; CommotityRequestModel *requstBody = [CommotityRequestModel modelObjectWithDictionary:dic];
requstBody.defintion.pageSize = kPageSize;
requstBody.defintion.page = @0;
requstBody.defintion.probePages = @0;
requstBody.defintion.orders[0].field = self.field;
requstBody.defintion.orders[0].direction = self.direction;
if ([self.model isKindOfClass:[HotBrandModel class]]) {//热门品牌 if ([self.model isKindOfClass:[HotBrandModel class]]) {//热门品牌
//设置请求模型 //设置请求模型
HotBrandModel *model = self.model; HotBrandModel *model = self.model;
requstBody.defintion.conditions[0].operation = [NSString stringWithFormat:@"goodsData brand %@ equals", model.uuid]; requstBody.defintion.conditions[0].operation = @"goodsData brand uuid equals";
requstBody.defintion.conditions[0].parameters = @[model.uuid]; requstBody.defintion.conditions[0].parameters = @[model.uuid];
requstBody.defintion.pageSize = 10;
requstBody.defintion.page = 0;
requstBody.defintion.probePages = 0;
}else if([self.model isKindOfClass:[CatgoryModel class]]){ }else if([self.model isKindOfClass:[CatgoryModel class]]){//分类
CatgoryModel *model = self.model; CatgoryModel *model = self.model;
requstBody.defintion.conditions[0].operation = [NSString stringWithFormat:@"goodsData brand %@ equals", model.uuid]; requstBody.defintion.conditions[0].operation = @"goodsData category uuid equals";
requstBody.defintion.conditions[0].parameters = @[model.uuid];
}else if ([self.model isKindOfClass:[JavenHotTagsModel class]]){//热门标签
CatgoryModel *model = self.model;
requstBody.defintion.conditions[0].operation = @"goodsData category uuid equals";
requstBody.defintion.conditions[0].parameters = @[model.uuid]; requstBody.defintion.conditions[0].parameters = @[model.uuid];
requstBody.defintion.pageSize = 10;
requstBody.defintion.page = 0;
requstBody.defintion.probePages = 0;
} }
//请求模型转化为字典 //请求模型转化为字典
NSDictionary *params = requstBody.mj_keyValues; NSDictionary *params = requstBody.mj_keyValues;
...@@ -103,11 +113,78 @@ ...@@ -103,11 +113,78 @@
_sortView.backgroundColor = [UIColor whiteColor]; _sortView.backgroundColor = [UIColor whiteColor];
//点击排序列表之后回调传入选中行数 //点击排序列表之后回调传入选中行数 筛选
WS(weakSelf)
_sortView.selecedBlock = ^(NSInteger row){ _sortView.selecedBlock = ^(NSInteger row){
[weakSelf sortAction:row];
CLog(@"%ld", (long)row); CLog(@"%ld", (long)row);
}; };
_sortView.rightAction = ^(){
weakSelf.field = @"salesvolume";
weakSelf.direction = @"desc";
[weakSelf resetReloadData];
};
}
//排序
- (void)sortAction:(NSInteger)row {
switch (row) {
case 0:
{
self.field = nil;
self.direction = nil;
}
break;
case 1://价格 高-低
{
self.field = @" spec price";
self.direction = @"desc";
}
break;
case 2://价格 低-高
{
self.field = @" spec price";
self.direction = @"asc";
}
break;
case 3://佣金
{
self.field = @"brokerageRate";
self.direction = @"desc";
}
break;
case 4:
{
self.field = @"brokerageRate";
self.direction = @"asc";
}
break;
case 5://点击量
{
self.field = @"visited";
self.direction = @"desc";
}
break;
case 6:
{
self.field = @"visited";
self.direction = @"asc";
}
break;
default:
break;
}
[self resetReloadData];
}
//改变排序条件之后重新请求数据
- (void)resetReloadData {
[self.arrItemDatas removeAllObjects];
[self setUpData];
} }
...@@ -146,7 +223,6 @@ ...@@ -146,7 +223,6 @@
CommodityListCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellID forIndexPath:indexPath]; CommodityListCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellID forIndexPath:indexPath];
[cell cellWithModel:self.arrItemDatas[indexPath.row]]; [cell cellWithModel:self.arrItemDatas[indexPath.row]];
return cell; return cell;
} }
......
//
// CommoditySearchViewController.h
// ALand
//
// Created by Z on 16/4/12.
// Copyright © 2016年 Z. All rights reserved.
//
#import "IBTUIViewController.h"
@interface CommoditySearchViewController : IBTUIViewController
@end
//
// CommoditySearchViewController.m
// ALand
//
// Created by Z on 16/4/12.
// Copyright © 2016年 Z. All rights reserved.
//
#import "CommoditySearchViewController.h"
#import "CommodityListCollectionViewCell.h"
#import "SortView.h"
#import "CommodityDetailViewController.h"
#import "CommotityRequestModel.h"
#import "HotBrandModel.h"
#import "CatgoryModel.h"
#import "JavenHotTagsModel.h"
#import "CommodityListModel/CommotityListModel.h"
#define kCellID @"commodityCell"
#define kPageSize @10
@interface CommoditySearchViewController ()<UISearchBarDelegate,UICollectionViewDataSource, UICollectionViewDelegate>
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) SortView *sortView;
@property (nonatomic, strong) NSMutableArray *arrItemDatas;
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, copy) NSString *field; //排序的字段
@property (nonatomic, copy) NSString *direction; //排序的顺序 升序或降序
@property (nonatomic, copy) NSString *searchText; //正在搜索的字段
@end
@implementation CommoditySearchViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setUpSearchBar];
[self setUpSortView];
[self setUpCollectionView];
// Do any additional setup after loading the view from its nib.
}
- (void)popAction
{
[self.navigationController.navigationBar endEditing:YES];
[self DismissModalViewControllerAnimated:YES];
}
- (void)setUpSearchBar {
UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 280, 35)];//allocate titleView
UIColor *color = self.navigationController.navigationBar.barTintColor;
[titleView setBackgroundColor:color];
UISearchBar *searchBar = [[UISearchBar alloc] init];
searchBar.delegate = self;
searchBar.frame = CGRectMake(0, 0, 260, 35);
searchBar.centerX = titleView.centerX;
searchBar.backgroundImage = [UIImage imageWithColor:color];
[searchBar setAutocapitalizationType:UITextAutocapitalizationTypeNone];
[titleView addSubview:searchBar];
self.navigationItem.titleView = titleView;
[searchBar becomeFirstResponder];
}
- (NSMutableArray *)arrItemDatas {
if (!_arrItemDatas) {
_arrItemDatas = [NSMutableArray array];
}
return _arrItemDatas;
}
- (void)setUpData {
//前期发送请求生成参数的方式,后来不这么做了
NSString *jsonString = @"{\"defintion\":{\"conditions\":[{\"operation\":\"string\",\"parameter\":{},\"parameters\":[{}]}],\"orders\":[{\"field\":\"string\",\"direction\":\"asc\"}],\"pageSize\":0,\"page\":0,\"probePages\":0},\"fetchParts\":[\"string\"]}";
NSDictionary *dic = [jsonString mj_JSONObject];
CommotityRequestModel *requstBody = [CommotityRequestModel modelObjectWithDictionary:dic];
requstBody.defintion.conditions[0].operation = @"goodsData name like";
requstBody.defintion.conditions[0].parameters = @[self.searchText];
requstBody.defintion.pageSize = kPageSize;
requstBody.defintion.page = @0;
requstBody.defintion.probePages = @0;
requstBody.defintion.orders[0].field = self.field;
requstBody.defintion.orders[0].direction = self.direction;
//请求模型转化为字典
NSDictionary *params = requstBody.mj_keyValues;
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"goods/query2" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
for (NSDictionary *dic in responseObject[@"queryResult"]) {
CommotityListModel *model = [CommotityListModel modelObjectWithDictionary:dic];
[weakSelf.arrItemDatas addObject:model];
}
[weakSelf.collectionView reloadData];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)setUpSortView {
_sortView = [[[SortView alloc] init] customNew];
[self.view addSubview:_sortView];
_sortView.sd_layout.topSpaceToView(self.view,1).leftEqualToView(self.view).rightEqualToView(self.view).heightIs(44);
_sortView.backgroundColor = [UIColor whiteColor];
//点击排序列表之后回调传入选中行数 筛选
WS(weakSelf)
_sortView.selecedBlock = ^(NSInteger row){
[weakSelf sortAction:row];
CLog(@"%ld", (long)row);
};
_sortView.rightAction = ^(){
weakSelf.field = @"salesvolume";
weakSelf.direction = @"desc";
[weakSelf resetReloadData];
};
}
//排序
- (void)sortAction:(NSInteger)row {
switch (row) {
case 0:
{
self.field = nil;
self.direction = nil;
}
break;
case 1://价格 高-低
{
self.field = @" spec price";
self.direction = @"desc";
}
break;
case 2://价格 低-高
{
self.field = @" spec price";
self.direction = @"asc";
}
break;
case 3://佣金
{
self.field = @"brokerageRate";
self.direction = @"desc";
}
break;
case 4:
{
self.field = @"brokerageRate";
self.direction = @"asc";
}
break;
case 5://点击量
{
self.field = @"visited";
self.direction = @"desc";
}
break;
case 6:
{
self.field = @"visited";
self.direction = @"asc";
}
break;
default:
break;
}
[self resetReloadData];
}
//改变排序条件之后重新请求数据
- (void)resetReloadData {
[self.arrItemDatas removeAllObjects];
[self setUpData];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[self.sortView hide];
}
- (void)setUpCollectionView {
UICollectionViewFlowLayout *layOut = [[UICollectionViewFlowLayout alloc] init];
layOut.minimumLineSpacing = 10;
layOut.itemSize = CGSizeMake((ScreenSize.width - 30)/2, ScreenSize.height / 2.2);
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layOut];
[self.view addSubview:_collectionView];
_collectionView.sd_layout.topSpaceToView(self.view, 50).leftEqualToView(self.view).bottomEqualToView(self.view).rightEqualToView(self.view);
_collectionView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
_collectionView.delegate = self;
_collectionView.dataSource = self;
_collectionView.backgroundColor = kBacroundColor;
[_collectionView registerNib:[UINib nibWithNibName:@"CommodityListCollectionViewCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:kCellID];
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.arrItemDatas.count;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityDetailViewController *detailVC = [[CommodityDetailViewController alloc] init];
[self.navigationController pushViewController:detailVC animated:YES];
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
CommodityListCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellID forIndexPath:indexPath];
[cell cellWithModel:self.arrItemDatas[indexPath.row]];
return cell;
}
#pragma mark =========== searchBar Delegate ===========
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
CLog(@"点击搜索");
[self.navigationController.navigationBar endEditing:YES];
[self setUpData];
}
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
self.searchText = searchText;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
// }]; // }];
// info = [UserInfo mj_objectWithKeyValues:responseObject[@"reseller"]]; // info = [UserInfo mj_objectWithKeyValues:responseObject[@"reseller"]];
info = [UserInfo modelObjectWithDictionary:responseObject[@"reseller"]]; [info UserInfoWithDictionary:responseObject[@"reseller"]];
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
} failure:^(NSURLSessionDataTask *task, NSError *error) { } failure:^(NSURLSessionDataTask *task, NSError *error) {
......
...@@ -58,6 +58,14 @@ ...@@ -58,6 +58,14 @@
- (NSDate *)endOfTheDay; - (NSDate *)endOfTheDay;
/**
* 生成十位数的number类型的时间戳
*
* @return timestamp
*/
- (NSNumber *)timeStampNumber;
///-------------------- ///--------------------
/// @name Time In Words /// @name Time In Words
///-------------------- ///--------------------
......
...@@ -379,6 +379,16 @@ ...@@ -379,6 +379,16 @@
return result; return result;
} }
- (NSNumber *)timeStampNumber
{
NSString *timeStampString = [self timeStampStr];
NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
[f setNumberStyle:NSNumberFormatterDecimalStyle];
NSNumber * time = [f numberFromString:timeStampString];
return time;
}
+ (NSString *)curTimeStamp { + (NSString *)curTimeStamp {
return [[NSDate date] timeStampStr]; return [[NSDate date] timeStampStr];
} }
......
//
// JavenCategory.h
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface JavenCategory : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *name;
@property (nonatomic, assign) id code;
@property (nonatomic, strong) NSString *uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenCategory.m
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenCategory.h"
NSString *const kJavenCategoryName = @"name";
NSString *const kJavenCategoryCode = @"code";
NSString *const kJavenCategoryUuid = @"uuid";
@interface JavenCategory ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenCategory
@synthesize name = _name;
@synthesize code = _code;
@synthesize uuid = _uuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.name = [self objectOrNilForKey:kJavenCategoryName fromDictionary:dict];
self.code = [self objectOrNilForKey:kJavenCategoryCode fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kJavenCategoryUuid fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.name forKey:kJavenCategoryName];
[mutableDict setValue:self.code forKey:kJavenCategoryCode];
[mutableDict setValue:self.uuid forKey:kJavenCategoryUuid];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.name = [aDecoder decodeObjectForKey:kJavenCategoryName];
self.code = [aDecoder decodeObjectForKey:kJavenCategoryCode];
self.uuid = [aDecoder decodeObjectForKey:kJavenCategoryUuid];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_name forKey:kJavenCategoryName];
[aCoder encodeObject:_code forKey:kJavenCategoryCode];
[aCoder encodeObject:_uuid forKey:kJavenCategoryUuid];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenCategory *copy = [[JavenCategory alloc] init];
if (copy) {
copy.name = [self.name copyWithZone:zone];
copy.code = [self.code copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
}
return copy;
}
@end
//
// JavenCreateInfo.h
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class JavenOperator;
@interface JavenCreateInfo : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) JavenOperator *operator;
@property (nonatomic, assign) double time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenCreateInfo.m
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenCreateInfo.h"
#import "JavenOperator.h"
NSString *const kJavenCreateInfoOperator = @"operator";
NSString *const kJavenCreateInfoTime = @"time";
@interface JavenCreateInfo ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenCreateInfo
@synthesize operator = _operator;
@synthesize time = _time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operator = [JavenOperator modelObjectWithDictionary:[dict objectForKey:kJavenCreateInfoOperator]];
self.time = [[self objectOrNilForKey:kJavenCreateInfoTime fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.operator dictionaryRepresentation] forKey:kJavenCreateInfoOperator];
[mutableDict setValue:[NSNumber numberWithDouble:self.time] forKey:kJavenCreateInfoTime];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operator = [aDecoder decodeObjectForKey:kJavenCreateInfoOperator];
self.time = [aDecoder decodeDoubleForKey:kJavenCreateInfoTime];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operator forKey:kJavenCreateInfoOperator];
[aCoder encodeDouble:_time forKey:kJavenCreateInfoTime];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenCreateInfo *copy = [[JavenCreateInfo alloc] init];
if (copy) {
copy.operator = [self.operator copyWithZone:zone];
copy.time = self.time;
}
return copy;
}
@end
//
// JavenLastModifyInfo.h
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class JavenOperator;
@interface JavenLastModifyInfo : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) JavenOperator *operator;
@property (nonatomic, assign) double time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenLastModifyInfo.m
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenLastModifyInfo.h"
#import "JavenOperator.h"
NSString *const kJavenLastModifyInfoOperator = @"operator";
NSString *const kJavenLastModifyInfoTime = @"time";
@interface JavenLastModifyInfo ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenLastModifyInfo
@synthesize operator = _operator;
@synthesize time = _time;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operator = [JavenOperator modelObjectWithDictionary:[dict objectForKey:kJavenLastModifyInfoOperator]];
self.time = [[self objectOrNilForKey:kJavenLastModifyInfoTime fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.operator dictionaryRepresentation] forKey:kJavenLastModifyInfoOperator];
[mutableDict setValue:[NSNumber numberWithDouble:self.time] forKey:kJavenLastModifyInfoTime];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operator = [aDecoder decodeObjectForKey:kJavenLastModifyInfoOperator];
self.time = [aDecoder decodeDoubleForKey:kJavenLastModifyInfoTime];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operator forKey:kJavenLastModifyInfoOperator];
[aCoder encodeDouble:_time forKey:kJavenLastModifyInfoTime];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenLastModifyInfo *copy = [[JavenLastModifyInfo alloc] init];
if (copy) {
copy.operator = [self.operator copyWithZone:zone];
copy.time = self.time;
}
return copy;
}
@end
//
// JavenOperator.h
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface JavenOperator : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *operatorIdentifier;
@property (nonatomic, strong) NSString *fullName;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// JavenOperator.m
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "JavenOperator.h"
NSString *const kJavenOperatorId = @"id";
NSString *const kJavenOperatorFullName = @"fullName";
@interface JavenOperator ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation JavenOperator
@synthesize operatorIdentifier = _operatorIdentifier;
@synthesize fullName = _fullName;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operatorIdentifier = [self objectOrNilForKey:kJavenOperatorId fromDictionary:dict];
self.fullName = [self objectOrNilForKey:kJavenOperatorFullName fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.operatorIdentifier forKey:kJavenOperatorId];
[mutableDict setValue:self.fullName forKey:kJavenOperatorFullName];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operatorIdentifier = [aDecoder decodeObjectForKey:kJavenOperatorId];
self.fullName = [aDecoder decodeObjectForKey:kJavenOperatorFullName];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operatorIdentifier forKey:kJavenOperatorId];
[aCoder encodeObject:_fullName forKey:kJavenOperatorFullName];
}
- (id)copyWithZone:(NSZone *)zone
{
JavenOperator *copy = [[JavenOperator alloc] init];
if (copy) {
copy.operatorIdentifier = [self.operatorIdentifier copyWithZone:zone];
copy.fullName = [self.fullName copyWithZone:zone];
}
return copy;
}
@end
...@@ -7,15 +7,15 @@ ...@@ -7,15 +7,15 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "Conditions.h" #import "Conditions.h"
#import "Orders.h"
@interface Defintion : NSObject <NSCoding, NSCopying> @interface Defintion : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double pageSize; @property (nonatomic, strong) NSNumber *pageSize;
@property (nonatomic, strong) NSArray *orders; @property (nonatomic, strong) NSArray<Orders *> *orders;
@property (nonatomic, strong) NSArray<Conditions *> *conditions; @property (nonatomic, strong) NSArray<Conditions *> *conditions;
@property (nonatomic, assign) double probePages; @property (nonatomic, assign) NSNumber *probePages;
@property (nonatomic, assign) double page; @property (nonatomic, strong) NSNumber *page;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict; - (instancetype)initWithDictionary:(NSDictionary *)dict;
......
...@@ -44,7 +44,7 @@ NSString *const kDefintionPage = @"page"; ...@@ -44,7 +44,7 @@ NSString *const kDefintionPage = @"page";
// This check serves to make sure that a non-NSDictionary object // This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing. // passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) { if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.pageSize = [[self objectOrNilForKey:kDefintionPageSize fromDictionary:dict] doubleValue]; self.pageSize = [self objectOrNilForKey:kDefintionPageSize fromDictionary:dict];
NSObject *receivedOrders = [dict objectForKey:kDefintionOrders]; NSObject *receivedOrders = [dict objectForKey:kDefintionOrders];
NSMutableArray *parsedOrders = [NSMutableArray array]; NSMutableArray *parsedOrders = [NSMutableArray array];
if ([receivedOrders isKindOfClass:[NSArray class]]) { if ([receivedOrders isKindOfClass:[NSArray class]]) {
...@@ -71,8 +71,8 @@ NSString *const kDefintionPage = @"page"; ...@@ -71,8 +71,8 @@ NSString *const kDefintionPage = @"page";
} }
self.conditions = [NSArray arrayWithArray:parsedConditions]; self.conditions = [NSArray arrayWithArray:parsedConditions];
self.probePages = [[self objectOrNilForKey:kDefintionProbePages fromDictionary:dict] doubleValue]; self.probePages = [self objectOrNilForKey:kDefintionProbePages fromDictionary:dict];
self.page = [[self objectOrNilForKey:kDefintionPage fromDictionary:dict] doubleValue]; self.page = [self objectOrNilForKey:kDefintionPage fromDictionary:dict];
} }
...@@ -83,7 +83,7 @@ NSString *const kDefintionPage = @"page"; ...@@ -83,7 +83,7 @@ NSString *const kDefintionPage = @"page";
- (NSDictionary *)dictionaryRepresentation - (NSDictionary *)dictionaryRepresentation
{ {
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[NSNumber numberWithDouble:self.pageSize] forKey:kDefintionPageSize]; [mutableDict setValue:self.pageSize forKey:kDefintionPageSize];
NSMutableArray *tempArrayForOrders = [NSMutableArray array]; NSMutableArray *tempArrayForOrders = [NSMutableArray array];
for (NSObject *subArrayObject in self.orders) { for (NSObject *subArrayObject in self.orders) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) { if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
...@@ -106,8 +106,8 @@ NSString *const kDefintionPage = @"page"; ...@@ -106,8 +106,8 @@ NSString *const kDefintionPage = @"page";
} }
} }
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForConditions] forKey:kDefintionConditions]; [mutableDict setValue:[NSArray arrayWithArray:tempArrayForConditions] forKey:kDefintionConditions];
[mutableDict setValue:[NSNumber numberWithDouble:self.probePages] forKey:kDefintionProbePages]; [mutableDict setValue:self.probePages forKey:kDefintionProbePages];
[mutableDict setValue:[NSNumber numberWithDouble:self.page] forKey:kDefintionPage]; [mutableDict setValue:self.page forKey:kDefintionPage];
return [NSDictionary dictionaryWithDictionary:mutableDict]; return [NSDictionary dictionaryWithDictionary:mutableDict];
} }
...@@ -131,22 +131,22 @@ NSString *const kDefintionPage = @"page"; ...@@ -131,22 +131,22 @@ NSString *const kDefintionPage = @"page";
{ {
self = [super init]; self = [super init];
self.pageSize = [aDecoder decodeDoubleForKey:kDefintionPageSize]; self.pageSize = [aDecoder decodeObjectForKey:kDefintionPageSize];
self.orders = [aDecoder decodeObjectForKey:kDefintionOrders]; self.orders = [aDecoder decodeObjectForKey:kDefintionOrders];
self.conditions = [aDecoder decodeObjectForKey:kDefintionConditions]; self.conditions = [aDecoder decodeObjectForKey:kDefintionConditions];
self.probePages = [aDecoder decodeDoubleForKey:kDefintionProbePages]; self.probePages = [aDecoder decodeObjectForKey:kDefintionProbePages];
self.page = [aDecoder decodeDoubleForKey:kDefintionPage]; self.page = [aDecoder decodeObjectForKey:kDefintionPage];
return self; return self;
} }
- (void)encodeWithCoder:(NSCoder *)aCoder - (void)encodeWithCoder:(NSCoder *)aCoder
{ {
[aCoder encodeDouble:_pageSize forKey:kDefintionPageSize]; [aCoder encodeObject:_pageSize forKey:kDefintionPageSize];
[aCoder encodeObject:_orders forKey:kDefintionOrders]; [aCoder encodeObject:_orders forKey:kDefintionOrders];
[aCoder encodeObject:_conditions forKey:kDefintionConditions]; [aCoder encodeObject:_conditions forKey:kDefintionConditions];
[aCoder encodeDouble:_probePages forKey:kDefintionProbePages]; [aCoder encodeObject:_probePages forKey:kDefintionProbePages];
[aCoder encodeDouble:_page forKey:kDefintionPage]; [aCoder encodeObject:_page forKey:kDefintionPage];
} }
- (id)copyWithZone:(NSZone *)zone - (id)copyWithZone:(NSZone *)zone
......
//
// OperCtx.h
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@class Operator;
@interface OperCtx : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) Operator *operator;
@property (nonatomic, strong) NSDate *time;
@property (nonatomic, strong) NSString *domain;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// OperCtx.m
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "OperCtx.h"
#import "Operator.h"
NSString *const kOperCtxOperator = @"operator";
NSString *const kOperCtxTime = @"time";
NSString *const kOperCtxDomain = @"domain";
@interface OperCtx ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation OperCtx
@synthesize operator = _operator;
@synthesize time = _time;
@synthesize domain = _domain;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operator = [Operator modelObjectWithDictionary:[dict objectForKey:kOperCtxOperator]];
self.time = [self objectOrNilForKey:kOperCtxTime fromDictionary:dict];
self.domain = [self objectOrNilForKey:kOperCtxDomain fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.operator dictionaryRepresentation] forKey:kOperCtxOperator];
[mutableDict setValue:self.time forKey:kOperCtxTime];
[mutableDict setValue:self.domain forKey:kOperCtxDomain];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operator = [aDecoder decodeObjectForKey:kOperCtxOperator];
self.time = [aDecoder decodeObjectForKey:kOperCtxTime];
self.domain = [aDecoder decodeObjectForKey:kOperCtxDomain];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operator forKey:kOperCtxOperator];
[aCoder encodeObject:_time forKey:kOperCtxTime];
[aCoder encodeObject:_domain forKey:kOperCtxDomain];
}
- (id)copyWithZone:(NSZone *)zone
{
OperCtx *copy = [[OperCtx alloc] init];
if (copy) {
copy.operator = [self.operator copyWithZone:zone];
copy.time = self.time;
copy.domain = [self.domain copyWithZone:zone];
}
return copy;
}
@end
//
// Operator.h
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Operator : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) NSString *operatorIdentifier;
@property (nonatomic, strong) NSString *fullName;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// Operator.m
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "Operator.h"
NSString *const kOperatorId = @"id";
NSString *const kOperatorFullName = @"fullName";
@interface Operator ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation Operator
@synthesize operatorIdentifier = _operatorIdentifier;
@synthesize fullName = _fullName;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operatorIdentifier = [self objectOrNilForKey:kOperatorId fromDictionary:dict];
self.fullName = [self objectOrNilForKey:kOperatorFullName fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:self.operatorIdentifier forKey:kOperatorId];
[mutableDict setValue:self.fullName forKey:kOperatorFullName];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operatorIdentifier = [aDecoder decodeObjectForKey:kOperatorId];
self.fullName = [aDecoder decodeObjectForKey:kOperatorFullName];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operatorIdentifier forKey:kOperatorId];
[aCoder encodeObject:_fullName forKey:kOperatorFullName];
}
- (id)copyWithZone:(NSZone *)zone
{
Operator *copy = [[Operator alloc] init];
if (copy) {
copy.operatorIdentifier = [self.operatorIdentifier copyWithZone:zone];
copy.fullName = [self.fullName copyWithZone:zone];
}
return copy;
}
@end
//
// addCommodityRequestModel.h
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "OperCtx.h"
@class OperCtx;
@interface addCommodityRequestModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, strong) OperCtx *operCtx;
@property (nonatomic, strong) NSString *shopUuid;
@property (nonatomic, strong) NSString *goodsUuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// addCommodityRequestModel.m
//
// Created by Z on 16/4/12
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "addCommodityRequestModel.h"
#import "OperCtx.h"
NSString *const kaddCommodityRequestModelOperCtx = @"operCtx";
NSString *const kaddCommodityRequestModelShopUuid = @"shopUuid";
NSString *const kaddCommodityRequestModelGoodsUuid = @"goodsUuid";
@interface addCommodityRequestModel ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation addCommodityRequestModel
@synthesize operCtx = _operCtx;
@synthesize shopUuid = _shopUuid;
@synthesize goodsUuid = _goodsUuid;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.operCtx = [OperCtx modelObjectWithDictionary:[dict objectForKey:kaddCommodityRequestModelOperCtx]];
self.shopUuid = [self objectOrNilForKey:kaddCommodityRequestModelShopUuid fromDictionary:dict];
self.goodsUuid = [self objectOrNilForKey:kaddCommodityRequestModelGoodsUuid fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[self.operCtx dictionaryRepresentation] forKey:kaddCommodityRequestModelOperCtx];
[mutableDict setValue:self.shopUuid forKey:kaddCommodityRequestModelShopUuid];
[mutableDict setValue:self.goodsUuid forKey:kaddCommodityRequestModelGoodsUuid];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.operCtx = [aDecoder decodeObjectForKey:kaddCommodityRequestModelOperCtx];
self.shopUuid = [aDecoder decodeObjectForKey:kaddCommodityRequestModelShopUuid];
self.goodsUuid = [aDecoder decodeObjectForKey:kaddCommodityRequestModelGoodsUuid];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:_operCtx forKey:kaddCommodityRequestModelOperCtx];
[aCoder encodeObject:_shopUuid forKey:kaddCommodityRequestModelShopUuid];
[aCoder encodeObject:_goodsUuid forKey:kaddCommodityRequestModelGoodsUuid];
}
- (id)copyWithZone:(NSZone *)zone
{
addCommodityRequestModel *copy = [[addCommodityRequestModel alloc] init];
if (copy) {
copy.operCtx = [self.operCtx copyWithZone:zone];
copy.shopUuid = [self.shopUuid copyWithZone:zone];
copy.goodsUuid = [self.goodsUuid copyWithZone:zone];
}
return copy;
}
@end
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "UserInfoShop.h"
@class UserInfoOwnerOrg, UserInfoLastModifyInfo, UserInfoCertificate, UserInfoPasswordControl, UserInfoShop, UserInfoCreateInfo, UserInfoLoginControl; @class UserInfoOwnerOrg, UserInfoLastModifyInfo, UserInfoCertificate, UserInfoPasswordControl, UserInfoShop, UserInfoCreateInfo, UserInfoLoginControl;
@interface UserInfoBaseClass : NSObject <NSCoding, NSCopying> @interface UserInfoBaseClass : NSObject <NSCoding, NSCopying>
...@@ -41,5 +41,6 @@ ...@@ -41,5 +41,6 @@
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict; - (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation; - (NSDictionary *)dictionaryRepresentation;
- (void)UserInfoWithDictionary:(NSDictionary *)dict;
@end @end
...@@ -167,7 +167,43 @@ NSString *const kUserInfoBaseClassDescription = @"description"; ...@@ -167,7 +167,43 @@ NSString *const kUserInfoBaseClassDescription = @"description";
return [NSDictionary dictionaryWithDictionary:mutableDict]; return [NSDictionary dictionaryWithDictionary:mutableDict];
} }
- (NSString *)description - (void)UserInfoWithDictionary:(NSDictionary *)dict
{
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.birthday = [self objectOrNilForKey:kUserInfoBaseClassBirthday fromDictionary:dict];
self.portrait = [self objectOrNilForKey:kUserInfoBaseClassPortrait fromDictionary:dict];
self.ownerOrg = [UserInfoOwnerOrg modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassOwnerOrg]];
self.code = [self objectOrNilForKey:kUserInfoBaseClassCode fromDictionary:dict];
self.telephone = [self objectOrNilForKey:kUserInfoBaseClassTelephone fromDictionary:dict];
self.mobilephone = [self objectOrNilForKey:kUserInfoBaseClassMobilephone fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kUserInfoBaseClassUuid fromDictionary:dict];
self.lastModifyInfo = [UserInfoLastModifyInfo modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassLastModifyInfo]];
self.socialContact = [self objectOrNilForKey:kUserInfoBaseClassSocialContact fromDictionary:dict];
self.certificate = [UserInfoCertificate modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassCertificate]];
self.version = [[self objectOrNilForKey:kUserInfoBaseClassVersion fromDictionary:dict] doubleValue];
self.name = [self objectOrNilForKey:kUserInfoBaseClassName fromDictionary:dict];
self.invitationCode = [self objectOrNilForKey:kUserInfoBaseClassInvitationCode fromDictionary:dict];
self.state = [self objectOrNilForKey:kUserInfoBaseClassState fromDictionary:dict];
self.domain = [self objectOrNilForKey:kUserInfoBaseClassDomain fromDictionary:dict];
self.passwordControl = [UserInfoPasswordControl modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassPasswordControl]];
self.gender = [self objectOrNilForKey:kUserInfoBaseClassGender fromDictionary:dict];
self.roles = [self objectOrNilForKey:kUserInfoBaseClassRoles fromDictionary:dict];
self.postalAddresses = [self objectOrNilForKey:kUserInfoBaseClassPostalAddresses fromDictionary:dict];
self.idCard = [self objectOrNilForKey:kUserInfoBaseClassIdCard fromDictionary:dict];
self.referrer = [self objectOrNilForKey:kUserInfoBaseClassReferrer fromDictionary:dict];
self.shop = [UserInfoShop modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassShop]];
self.createInfo = [UserInfoCreateInfo modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassCreateInfo]];
self.order = [[self objectOrNilForKey:kUserInfoBaseClassOrder fromDictionary:dict] doubleValue];
self.loginControl = [UserInfoLoginControl modelObjectWithDictionary:[dict objectForKey:kUserInfoBaseClassLoginControl]];
self.internalBaseClassDescription = [self objectOrNilForKey:kUserInfoBaseClassDescription fromDictionary:dict];
}
}
- (NSString *)description
{ {
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
- (BOOL)isPresentedIn; - (BOOL)isPresentedIn;
- (BOOL)isPushedIn; - (BOOL)isPushedIn;
- (void)popAction;
- (void)disMissSelf; - (void)disMissSelf;
......
...@@ -175,4 +175,8 @@ ...@@ -175,4 +175,8 @@
} }
- (void)dealloc {
CLog(@"%@注销了",[NSString stringWithUTF8String:object_getClassName(self)]);
}
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment