Commit 942e6a36 by lee

Merge branch 'master' of git.oschina.net:kollway-kollway/newcemarose

parents 631bbb4f 2664fe89
...@@ -82,6 +82,8 @@ ...@@ -82,6 +82,8 @@
C0028EC51F0DD19C00744C14 /* KWMAdditionalResult.m in Sources */ = {isa = PBXBuildFile; fileRef = C0028EC41F0DD19C00744C14 /* KWMAdditionalResult.m */; }; C0028EC51F0DD19C00744C14 /* KWMAdditionalResult.m in Sources */ = {isa = PBXBuildFile; fileRef = C0028EC41F0DD19C00744C14 /* KWMAdditionalResult.m */; };
C0028EC81F0DE80500744C14 /* KWMWish.m in Sources */ = {isa = PBXBuildFile; fileRef = C0028EC71F0DE80500744C14 /* KWMWish.m */; }; C0028EC81F0DE80500744C14 /* KWMWish.m in Sources */ = {isa = PBXBuildFile; fileRef = C0028EC71F0DE80500744C14 /* KWMWish.m */; };
C0028ECB1F0E2B3500744C14 /* KWMAdditionalListResult.m in Sources */ = {isa = PBXBuildFile; fileRef = C0028ECA1F0E2B3500744C14 /* KWMAdditionalListResult.m */; }; C0028ECB1F0E2B3500744C14 /* KWMAdditionalListResult.m in Sources */ = {isa = PBXBuildFile; fileRef = C0028ECA1F0E2B3500744C14 /* KWMAdditionalListResult.m */; };
C00D40941F187C9500DEA685 /* KWMCategoryTitleView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C00D40931F187C9500DEA685 /* KWMCategoryTitleView.xib */; };
C00D40971F187CAB00DEA685 /* KWMCategoryTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = C00D40961F187CAB00DEA685 /* KWMCategoryTitleView.m */; };
C0219A951DF53EB200711099 /* KWMExchangeRateResult.m in Sources */ = {isa = PBXBuildFile; fileRef = C0219A941DF53EB200711099 /* KWMExchangeRateResult.m */; }; C0219A951DF53EB200711099 /* KWMExchangeRateResult.m in Sources */ = {isa = PBXBuildFile; fileRef = C0219A941DF53EB200711099 /* KWMExchangeRateResult.m */; };
C0243BBD1EFBD5A10013CFA7 /* Category.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C0243BAF1EFBD5A10013CFA7 /* Category.storyboard */; }; C0243BBD1EFBD5A10013CFA7 /* Category.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C0243BAF1EFBD5A10013CFA7 /* Category.storyboard */; };
C0243BBE1EFBD5A10013CFA7 /* KWMLeftCategoryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C0243BB21EFBD5A10013CFA7 /* KWMLeftCategoryCell.m */; }; C0243BBE1EFBD5A10013CFA7 /* KWMLeftCategoryCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C0243BB21EFBD5A10013CFA7 /* KWMLeftCategoryCell.m */; };
...@@ -508,6 +510,9 @@ ...@@ -508,6 +510,9 @@
C0028EC71F0DE80500744C14 /* KWMWish.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMWish.m; sourceTree = "<group>"; }; C0028EC71F0DE80500744C14 /* KWMWish.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMWish.m; sourceTree = "<group>"; };
C0028EC91F0E2B3500744C14 /* KWMAdditionalListResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMAdditionalListResult.h; sourceTree = "<group>"; }; C0028EC91F0E2B3500744C14 /* KWMAdditionalListResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMAdditionalListResult.h; sourceTree = "<group>"; };
C0028ECA1F0E2B3500744C14 /* KWMAdditionalListResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMAdditionalListResult.m; sourceTree = "<group>"; }; C0028ECA1F0E2B3500744C14 /* KWMAdditionalListResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMAdditionalListResult.m; sourceTree = "<group>"; };
C00D40931F187C9500DEA685 /* KWMCategoryTitleView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KWMCategoryTitleView.xib; sourceTree = "<group>"; };
C00D40951F187CAB00DEA685 /* KWMCategoryTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMCategoryTitleView.h; sourceTree = "<group>"; };
C00D40961F187CAB00DEA685 /* KWMCategoryTitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMCategoryTitleView.m; sourceTree = "<group>"; };
C0219A931DF53EB200711099 /* KWMExchangeRateResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMExchangeRateResult.h; sourceTree = "<group>"; }; C0219A931DF53EB200711099 /* KWMExchangeRateResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMExchangeRateResult.h; sourceTree = "<group>"; };
C0219A941DF53EB200711099 /* KWMExchangeRateResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMExchangeRateResult.m; sourceTree = "<group>"; }; C0219A941DF53EB200711099 /* KWMExchangeRateResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMExchangeRateResult.m; sourceTree = "<group>"; };
C0243BAF1EFBD5A10013CFA7 /* Category.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Category.storyboard; sourceTree = "<group>"; }; C0243BAF1EFBD5A10013CFA7 /* Category.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Category.storyboard; sourceTree = "<group>"; };
...@@ -1209,6 +1214,9 @@ ...@@ -1209,6 +1214,9 @@
C0243BB41EFBD5A10013CFA7 /* KWMRightProductCell.h */, C0243BB41EFBD5A10013CFA7 /* KWMRightProductCell.h */,
C0243BB51EFBD5A10013CFA7 /* KWMRightProductCell.m */, C0243BB51EFBD5A10013CFA7 /* KWMRightProductCell.m */,
C0243BB61EFBD5A10013CFA7 /* KWMRightProductCell.xib */, C0243BB61EFBD5A10013CFA7 /* KWMRightProductCell.xib */,
C00D40951F187CAB00DEA685 /* KWMCategoryTitleView.h */,
C00D40961F187CAB00DEA685 /* KWMCategoryTitleView.m */,
C00D40931F187C9500DEA685 /* KWMCategoryTitleView.xib */,
); );
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2392,6 +2400,7 @@ ...@@ -2392,6 +2400,7 @@
C0F5869D1E25D3B6001248E2 /* KWMProductDetailView.xib in Resources */, C0F5869D1E25D3B6001248E2 /* KWMProductDetailView.xib in Resources */,
C034E69D1D6AEB12006EE129 /* LaunchScreen.storyboard in Resources */, C034E69D1D6AEB12006EE129 /* LaunchScreen.storyboard in Resources */,
C0A6B3C11F01FC5300D85673 /* KWMProductColorCell.xib in Resources */, C0A6B3C11F01FC5300D85673 /* KWMProductColorCell.xib in Resources */,
C00D40941F187C9500DEA685 /* KWMCategoryTitleView.xib in Resources */,
C048344C1F13393D00A5BFB4 /* KWMHotSalesHeader.xib in Resources */, C048344C1F13393D00A5BFB4 /* KWMHotSalesHeader.xib in Resources */,
80E844291D7FB1130042AED2 /* KWMRuleView.xib in Resources */, 80E844291D7FB1130042AED2 /* KWMRuleView.xib in Resources */,
C034E6F61D6AF197006EE129 /* KWMPickView.xib in Resources */, C034E6F61D6AF197006EE129 /* KWMPickView.xib in Resources */,
...@@ -2562,6 +2571,7 @@ ...@@ -2562,6 +2571,7 @@
C0028EC51F0DD19C00744C14 /* KWMAdditionalResult.m in Sources */, C0028EC51F0DD19C00744C14 /* KWMAdditionalResult.m in Sources */,
C03943C01DD1FCE900141475 /* KWMProductType.m in Sources */, C03943C01DD1FCE900141475 /* KWMProductType.m in Sources */,
C0CC140C1D7829FC007B5986 /* KWMSelectSizeVC.m in Sources */, C0CC140C1D7829FC007B5986 /* KWMSelectSizeVC.m in Sources */,
C00D40971F187CAB00DEA685 /* KWMCategoryTitleView.m in Sources */,
C034E7B31D6AFC3B006EE129 /* KWMMainVC.m in Sources */, C034E7B31D6AFC3B006EE129 /* KWMMainVC.m in Sources */,
C08FDA2A1D9B583400EBDB0D /* KWMGiftCardVC.m in Sources */, C08FDA2A1D9B583400EBDB0D /* KWMGiftCardVC.m in Sources */,
804771801D6D326D0086B4DC /* KWMLoginVC.m in Sources */, 804771801D6D326D0086B4DC /* KWMLoginVC.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_Acc_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_Acc_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_Acc_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_Acc_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_coat_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_coat_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_coat_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_coat_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_jumpsuits_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_jumpsuits_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_jumpsuits_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_jumpsuits_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_kilt_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_kilt_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_kilt_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_kilt_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_leggings_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_leggings_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_leggings_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_leggings_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_pantyhose_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_pantyhose_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_pantyhose_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_pantyhose_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_raincoat_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_raincoat_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_raincoat_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_raincoat_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_shoe_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_shoe_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_shoe_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_shoe_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_skirt_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_skirt_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_skirt_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_skirt_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_suit_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_suit_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_suit_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_suit_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_swimsuit_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_swimsuit_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_swimsuit_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_swimsuit_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_tops_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_tops_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_tops_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_tops_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_toy_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_toy_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_toy_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_toy_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_trousers_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_trousers_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_trousers_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_trousers_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_underwear_nor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_underwear_nor@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_type_underwear_pre@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_type_underwear_pre@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
@property (nonatomic) NSString* title; @property (nonatomic) NSString* title;
@property (nonatomic) NSNumber* collection_id; @property (nonatomic) NSNumber* collection_id;
@property (nonatomic) NSString* image; @property (nonatomic) NSString* image;
@property (nonatomic) NSString* focusImage;
@property (nonatomic) NSInteger page; @property (nonatomic) NSInteger page;
@property (nonatomic) NSMutableArray *products; @property (nonatomic) NSMutableArray *products;
@property (nonatomic) BUYCollectionSort sort; @property (nonatomic) BUYCollectionSort sort;
......
//
// KWMCategoryTitleView.h
// iCemarose
//
// Created by HouWeiBin on 2017/7/14.
// Copyright © 2017年 kollway. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol KWMCategoryTitleDelegate <NSObject>
- (void)kwm_onClickSearch;
- (void)kwm_onClickShopCart;
@end
@interface KWMCategoryTitleView : UIView
@property(nonatomic,weak) id<KWMCategoryTitleDelegate> delegate;
@property(nonatomic) NSNumber *count;
@end
//
// KWMCategoryTitleView.m
// iCemarose
//
// Created by HouWeiBin on 2017/7/14.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "KWMCategoryTitleView.h"
@interface KWMCategoryTitleView()
@property(nonatomic,weak) IBOutlet UIView *vView;
@property(nonatomic,weak) IBOutlet UISearchBar *searchBar;
@property(nonatomic,weak) IBOutlet UILabel *lbCount;
@end
@implementation KWMCategoryTitleView
- (id)init{
if (self=[super init]){
[self addView];
}
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[self addView];
}
return self;
}
-(instancetype)initWithFrame:(CGRect)frame{
if (self =[super initWithFrame:frame]) {
[self addView];
}
return self;
}
-(void)awakeFromNib{
[super awakeFromNib];
[self addView];
}
-(void) addView{
[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class])
owner:self
options:nil];
self.vView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
[self addSubview:self.vView];
[self initView];
}
-(void)initView{
}
-(void)setCount:(NSNumber *)count{
_count = count;
self.lbCount.text = count.stringValue;
}
-(IBAction)onClickSearchBar:(id)sender{
if(self.delegate){
[self.delegate kwm_onClickSearch];
}
}
-(IBAction)onClickShopCart:(id)sender{
if(self.delegate){
[self.delegate kwm_onClickShopCart];
}
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMCategoryTitleView">
<connections>
<outlet property="lbCount" destination="y0m-sW-G7x" id="svw-DK-ZPg"/>
<outlet property="searchBar" destination="mzZ-Oc-Ztf" id="Kdx-g8-ibf"/>
<outlet property="vView" destination="iN0-l3-epB" id="ndu-9n-FK3"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="375" height="64"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hKF-vD-6Tp">
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="fZ2-lU-6fn"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fl4-ro-VaX" userLabel="vContent">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Cc-is-gm9" userLabel="btn_shop_cart">
<rect key="frame" x="321" y="0.0" width="44" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="44" id="AJf-LC-RBn"/>
<constraint firstAttribute="height" constant="44" id="L6M-UC-Sgm"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<state key="normal" image="btn_ nav_shop cart"/>
<connections>
<action selector="onClickShopCart:" destination="-1" eventType="touchUpInside" id="yWa-X1-P3K"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cX3-qt-ofW" userLabel="vCount">
<rect key="frame" x="340" y="17" width="14" height="14"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="y0m-sW-G7x">
<rect key="frame" x="7" y="7" width="0.0" height="0.0"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" staticText="YES" notEnabled="YES"/>
</accessibility>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" notEnabled="YES"/>
</accessibility>
<constraints>
<constraint firstAttribute="height" constant="14" id="2uu-6U-qdc"/>
<constraint firstAttribute="width" constant="14" id="gK4-eL-g4z"/>
<constraint firstItem="y0m-sW-G7x" firstAttribute="centerX" secondItem="cX3-qt-ofW" secondAttribute="centerX" id="gqE-UJ-NLd"/>
<constraint firstItem="y0m-sW-G7x" firstAttribute="centerY" secondItem="cX3-qt-ofW" secondAttribute="centerY" id="wzb-Ju-Mir"/>
</constraints>
</view>
<searchBar contentMode="redraw" searchBarStyle="minimal" placeholder="搜索" translatesAutoresizingMaskIntoConstraints="NO" id="mzZ-Oc-Ztf">
<rect key="frame" x="0.0" y="0.0" width="321" height="44"/>
<textInputTraits key="textInputTraits"/>
</searchBar>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Iiv-qH-KSw">
<rect key="frame" x="0.0" y="0.0" width="321" height="44"/>
<connections>
<action selector="onClickSearchBar:" destination="-1" eventType="touchUpInside" id="WTJ-bE-BuQ"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="mzZ-Oc-Ztf" secondAttribute="bottom" id="CWv-py-5v4"/>
<constraint firstItem="7Cc-is-gm9" firstAttribute="centerY" secondItem="fl4-ro-VaX" secondAttribute="centerY" id="HRV-Pg-tR7"/>
<constraint firstItem="mzZ-Oc-Ztf" firstAttribute="leading" secondItem="fl4-ro-VaX" secondAttribute="leading" id="N7h-jj-ByO"/>
<constraint firstItem="7Cc-is-gm9" firstAttribute="leading" secondItem="mzZ-Oc-Ztf" secondAttribute="trailing" id="XUo-Xu-TIQ"/>
<constraint firstItem="Iiv-qH-KSw" firstAttribute="top" secondItem="fl4-ro-VaX" secondAttribute="top" id="YRc-Wl-O6W"/>
<constraint firstAttribute="trailing" secondItem="7Cc-is-gm9" secondAttribute="trailing" constant="10" id="ZoT-Bp-EIt"/>
<constraint firstItem="mzZ-Oc-Ztf" firstAttribute="top" secondItem="fl4-ro-VaX" secondAttribute="top" id="bEP-gT-X0I"/>
<constraint firstItem="Iiv-qH-KSw" firstAttribute="leading" secondItem="fl4-ro-VaX" secondAttribute="leading" id="cBr-bG-P6n"/>
<constraint firstAttribute="bottom" secondItem="Iiv-qH-KSw" secondAttribute="bottom" id="hfA-3K-TyT"/>
<constraint firstItem="7Cc-is-gm9" firstAttribute="leading" secondItem="Iiv-qH-KSw" secondAttribute="trailing" id="kLf-i6-xsT"/>
<constraint firstItem="cX3-qt-ofW" firstAttribute="trailing" secondItem="7Cc-is-gm9" secondAttribute="trailing" constant="-11" id="ml8-u3-zgZ"/>
<constraint firstItem="cX3-qt-ofW" firstAttribute="bottom" secondItem="7Cc-is-gm9" secondAttribute="bottom" constant="-13" id="xom-ON-VI4"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="fl4-ro-VaX" secondAttribute="bottom" id="GSh-cL-fgg"/>
<constraint firstItem="hKF-vD-6Tp" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="N7h-nQ-HhT"/>
<constraint firstAttribute="trailing" secondItem="fl4-ro-VaX" secondAttribute="trailing" id="cdF-k1-fAh"/>
<constraint firstItem="fl4-ro-VaX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="dpf-n6-oZa"/>
<constraint firstItem="hKF-vD-6Tp" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="idR-Oz-uaR"/>
<constraint firstItem="fl4-ro-VaX" firstAttribute="top" secondItem="hKF-vD-6Tp" secondAttribute="bottom" id="piK-Od-hX4"/>
<constraint firstAttribute="trailing" secondItem="hKF-vD-6Tp" secondAttribute="trailing" id="qxW-H4-P9d"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="33.5" y="96"/>
</view>
</objects>
<resources>
<image name="btn_ nav_shop cart" width="21" height="22"/>
</resources>
</document>
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
@property (nonatomic,weak) IBOutlet UILabel *lbTitle; @property (nonatomic,weak) IBOutlet UILabel *lbTitle;
@property (nonatomic) KWMCategoryModel *category;
@end @end
@implementation KWMLeftCategoryCell @implementation KWMLeftCategoryCell
...@@ -26,6 +28,7 @@ ...@@ -26,6 +28,7 @@
} }
- (void)fillData:(KWMCategoryModel *)model { - (void)fillData:(KWMCategoryModel *)model {
_category = model;
_lbTitle.text = model.title; _lbTitle.text = model.title;
_ivCategory.image = [UIImage imageNamed:model.image]; _ivCategory.image = [UIImage imageNamed:model.image];
} }
...@@ -33,8 +36,10 @@ ...@@ -33,8 +36,10 @@
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
UIColor *textColor = selected?[UIColor sam_colorWithHex:@"#F1929A"]:[UIColor sam_colorWithHex:@"#545454"]; UIColor *textColor = selected?[UIColor sam_colorWithHex:@"#F1929A"]:[UIColor sam_colorWithHex:@"#545454"];
UIImage *image = selected?[UIImage imageNamed:@"test_category_s"]:[UIImage imageNamed:@"test_category"]; if(self.category){
self.ivCategory.image = image; UIImage *image = selected?[UIImage imageNamed:self.category.focusImage]:[UIImage imageNamed:self.category.image];
self.ivCategory.image = image;
}
self.lbTitle.textColor = textColor; self.lbTitle.textColor = textColor;
} }
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
}]; }];
} }
-(IBAction)onClickBlank:(id)sender{ -(IBAction)onClickBlank:(id)sender{
if(self.delegate){ if(self.delegate){
[self.delegate kwm_onCancelBrandFilter]; [self.delegate kwm_onCancelBrandFilter];
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
#import "KWMCategoryFilterTab.h" #import "KWMCategoryFilterTab.h"
#import "KWMProductFilterVC.h" #import "KWMProductFilterVC.h"
#import "KWMBrandFilterVC.h" #import "KWMBrandFilterVC.h"
#import "KWMCategoryTitleView.h"
@interface KWMCategoryVC : KWMBaseVC<UICollectionViewDataSource,UICollectionViewDelegate,UITableViewDataSource,UITableViewDelegate,KWMCollectionRefreshDelegate,CategoryFilterTabDelegate,KWMProductFilterDelegate,KWMBrandFilterDelegate>
@interface KWMCategoryVC : KWMBaseVC<UICollectionViewDataSource,UICollectionViewDelegate,UITableViewDataSource,UITableViewDelegate,KWMCollectionRefreshDelegate,CategoryFilterTabDelegate,KWMProductFilterDelegate,KWMBrandFilterDelegate,KWMCategoryTitleDelegate>
@end @end
...@@ -8,14 +8,16 @@ ...@@ -8,14 +8,16 @@
#import "KWMCategoryVC.h" #import "KWMCategoryVC.h"
#import "KWMProductDetailVC.h" #import "KWMProductDetailVC.h"
#import "KWMShopCartVC.h"
#import "KWMNewProductVC.h" #import "KWMNewProductVC.h"
#import "KWMSearchFeedbackVC.h"
#import "KWMLeftCategoryCell.h" #import "KWMLeftCategoryCell.h"
#import "KWMRightProductCell.h" #import "KWMRightProductCell.h"
#import "KWMBrandsTypeModel.h" #import "KWMBrandsTypeModel.h"
#import "KWMSearchBar.h"
#import "KWMStringUtil.h" #import "KWMStringUtil.h"
#import "KWMFilterUtil.h" #import "KWMFilterUtil.h"
#import "MJRefresh.h" #import "MJRefresh.h"
#import "KWMShoppingCart.h"
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
@property(nonatomic) KWMCollectionRefreshUtil *refreshUtil; @property(nonatomic) KWMCollectionRefreshUtil *refreshUtil;
@property (nonatomic) KWMSearchBar *searchBar; @property (nonatomic) KWMCategoryTitleView *titleView;
@property (nonatomic) NSArray *allBrands; @property (nonatomic) NSArray *allBrands;
...@@ -63,6 +65,20 @@ ...@@ -63,6 +65,20 @@
// [self.cvRightProduct.mj_header beginRefreshing]; // [self.cvRightProduct.mj_header beginRefreshing];
} }
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES];
if(self.titleView){
NSNumber *count = [[KWMShoppingCart sharedInstance] count];
self.titleView.count = count;
}
}
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[self.navigationController setNavigationBarHidden:NO];
}
-(KWMCollectionRefreshUtil *)refreshUtil{ -(KWMCollectionRefreshUtil *)refreshUtil{
if(!_refreshUtil){ if(!_refreshUtil){
_refreshUtil = [KWMCollectionRefreshUtil new]; _refreshUtil = [KWMCollectionRefreshUtil new];
...@@ -75,32 +91,37 @@ ...@@ -75,32 +91,37 @@
-(void) initData { -(void) initData {
self.categories = [@[ self.categories = [@[
@{@"title":@"上装",@"collection_id":@"192437702",@"image":@""}, @{@"title":@"上装",@"collection_id":@"192437702",@"image":@"ic_type_tops"},
@{@"title":@"连体衣",@"collection_id":@"192438342",@"image":@""}, @{@"title":@"连体衣",@"collection_id":@"192438342",@"image":@"ic_type_jumpsuits"},
@{@"title":@"外套",@"collection_id":@"192438790",@"image":@""}, @{@"title":@"外套",@"collection_id":@"192438790",@"image":@"ic_type_coat"},
@{@"title":@"裙子",@"collection_id":@"191377286",@"image":@""}, @{@"title":@"裙子",@"collection_id":@"191377286",@"image":@"ic_type_skirt"},
@{@"title":@"裤子",@"collection_id":@"333026630",@"image":@""}, @{@"title":@"裤子",@"collection_id":@"333026630",@"image":@"ic_type_trousers"},
@{@"title":@"短裙",@"collection_id":@"192434950",@"image":@""}, @{@"title":@"短裙",@"collection_id":@"192434950",@"image":@"ic_type_kilt"},
@{@"title":@"套装",@"collection_id":@"192438150",@"image":@""}, @{@"title":@"套装",@"collection_id":@"192438150",@"image":@"ic_type_suit"},
@{@"title":@"泳衣",@"collection_id":@"333026438",@"image":@""}, @{@"title":@"泳衣",@"collection_id":@"333026438",@"image":@"ic_type_swimsuit"},
@{@"title":@"连裤袜",@"collection_id":@"192437830",@"image":@""}, @{@"title":@"连裤袜",@"collection_id":@"192437830",@"image":@"ic_type_pantyhose"},
@{@"title":@"打底裤",@"collection_id":@"192435334",@"image":@""}, @{@"title":@"打底裤",@"collection_id":@"192435334",@"image":@"ic_type_leggings"},
@{@"title":@"内衣",@"collection_id":@"333026694",@"image":@""}, @{@"title":@"内衣",@"collection_id":@"333026694",@"image":@"ic_type_underwear"},
@{@"title":@"雨衣",@"collection_id":@"423509068",@"image":@""}, @{@"title":@"雨衣",@"collection_id":@"423509068",@"image":@"ic_type_raincoat"},
@{@"title":@"鞋子",@"collection_id":@"171856134",@"image":@""}, @{@"title":@"鞋子",@"collection_id":@"171856134",@"image":@"ic_type_shoe"},
@{@"title":@"玩具",@"collection_id":@"332990918",@"image":@""}, @{@"title":@"玩具",@"collection_id":@"332990918",@"image":@"ic_type_toy"},
@{@"title":@"饰品",@"collection_id":@"191376966",@"image":@""}, @{@"title":@"饰品",@"collection_id":@"191376966",@"image":@"ic_type_Acc"},
] rx_mapWithBlock:^id(id each) { ] rx_mapWithBlock:^id(id each) {
NSString *image = each[@"image"];
KWMCategoryModel *m = [KWMCategoryModel new]; KWMCategoryModel *m = [KWMCategoryModel new];
m.title = each[@"title"]; m.title = each[@"title"];
m.collection_id = @([each[@"collection_id"] integerValue]); m.collection_id = @([each[@"collection_id"] integerValue]);
m.image = each[@"image"]; m.image = [NSString stringWithFormat:@"%@_nor",image];
m.focusImage = [NSString stringWithFormat:@"%@_pre",image];
m.page = 1; m.page = 1;
m.products = [NSMutableArray new]; m.products = [NSMutableArray new];
m.sort = BUYCollectionSortCollectionDefault; m.sort = BUYCollectionSortCollectionDefault;
return m; return m;
}]; }];
self.selectedCategory = self.categories.firstObject; self.selectedCategory = self.categories.firstObject;
NSIndexPath * path = [NSIndexPath indexPathForItem:1 inSection:0];
[self.tbvLeftCategory selectRowAtIndexPath:path animated:YES scrollPosition:UITableViewScrollPositionTop];
} }
-(void)initView{ -(void)initView{
...@@ -124,10 +145,23 @@ ...@@ -124,10 +145,23 @@
- (void)initTitleView{ - (void)initTitleView{
[self.navigationController setNavigationBarHidden:YES]; [self.navigationController setNavigationBarHidden:YES];
//添加頭部header NSNumber *count = [[KWMShoppingCart sharedInstance] count];
self.searchBar = [[KWMSearchBar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 64)];
// self.searchBar.delegate = self; self.titleView = [[KWMCategoryTitleView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 64)];
[self.view addSubview:_searchBar]; self.titleView.delegate = self;
self.titleView.count = count;
[self.view addSubview:self.titleView];
}
#pragma mark -- KWMCategoryTitleDelegate
-(void)kwm_onClickShopCart{
KWMShopCartVC * shopCartVC = (KWMShopCartVC*)[KWMBaseVC findControllerBy:[KWMShopCartVC kwmTag] fromStoryboard:@"ShopCart"];
[self.navigationController pushViewController:shopCartVC animated:YES];
}
-(void)kwm_onClickSearch{
KWMSearchFeedbackVC *vc = (KWMSearchFeedbackVC *)[KWMBaseVC findControllerBy:[KWMSearchFeedbackVC kwmTag] fromStoryboard:@"New"];
[self.navigationController pushViewController:vc animated:YES];
} }
#pragma mark - UITableViewDataSource #pragma mark - UITableViewDataSource
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
- (void)reLoadData; - (void)reLoadData;
- (void)loadData; - (void)loadData;
- (BOOL)checkLogin;
- (void)transparentNavigationBar; - (void)transparentNavigationBar;
- (void)unTransparentNavigationBar; - (void)unTransparentNavigationBar;
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#import "PSPDFAlertView.h" #import "PSPDFAlertView.h"
#import "KWMStringUtil.h" #import "KWMStringUtil.h"
#import "KWMSuperLoadingView.h" #import "KWMSuperLoadingView.h"
#import "KWMLoginVC.h"
#import "KWMUserModel.h"
@interface KWMBaseVC () @interface KWMBaseVC ()
...@@ -296,6 +298,19 @@ ...@@ -296,6 +298,19 @@
NSAssert(NO, @"调用尚未实现的方法"); NSAssert(NO, @"调用尚未实现的方法");
} }
-(BOOL)checkLogin{
KWMUserModel *user = [KWMUserModel shareUser];
if (user.status != 1) {
//登录
KWMLoginVC *loginVc = (KWMLoginVC *)[KWMBaseVC findControllerBy:[KWMLoginVC kwmTag] fromStoryboard:@"Login"];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:loginVc];
[self presentViewController:nav animated:YES completion:nil];
return NO;
}else{
return YES;
}
}
//显示错误信息 //显示错误信息
- (void)showError:(NSError *)error{ - (void)showError:(NSError *)error{
if ([error.domain isEqualToString:NSURLErrorDomain]) { if ([error.domain isEqualToString:NSURLErrorDomain]) {
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
- (void)kwm_onClickProduct:(BUYProduct *)product; - (void)kwm_onClickProduct:(BUYProduct *)product;
- (void)kwm_gotoRecommendPage;
@end @end
@interface KWMRecommendHeader : UIView<UICollectionViewDataSource,UICollectionViewDelegate> @interface KWMRecommendHeader : UIView<UICollectionViewDataSource,UICollectionViewDelegate>
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
BUYProduct *product = [self.productArray objectAtIndex:indexPath.row]; BUYProduct *product = [self.productArray objectAtIndex:indexPath.row];
[cell setData:product]; [cell setData:product];
cell.isMore = indexPath.row == 9;
return cell; return cell;
} }
...@@ -93,15 +93,25 @@ ...@@ -93,15 +93,25 @@
} }
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
if(self.productArray && self.productArray.count > 9){
return 10;
}
return self.productArray?self.productArray.count:0; return self.productArray?self.productArray.count:0;
} }
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
[collectionView deselectItemAtIndexPath:indexPath animated:YES]; [collectionView deselectItemAtIndexPath:indexPath animated:YES];
BUYProduct *product = [self.productArray objectAtIndex:indexPath.row]; if(indexPath.row == 9){
if(self.delegate){ if(self.delegate){
[self.delegate kwm_onClickProduct:product]; [self.delegate kwm_gotoRecommendPage];
}
}else{
BUYProduct *product = [self.productArray objectAtIndex:indexPath.row];
if(self.delegate){
[self.delegate kwm_onClickProduct:product];
}
} }
} }
@end @end
...@@ -164,6 +164,9 @@ typedef enum{ ...@@ -164,6 +164,9 @@ typedef enum{
-(void)kwm_onClickWishMenu{ -(void)kwm_onClickWishMenu{
NSLog(@"wishmenu"); NSLog(@"wishmenu");
if(![self checkLogin]){
return;
}
KWMWishListVC* vc= (KWMWishListVC *)[KWMBaseVC findControllerBy:[KWMWishListVC kwmTag] fromStoryboard:@"NewProduct"]; KWMWishListVC* vc= (KWMWishListVC *)[KWMBaseVC findControllerBy:[KWMWishListVC kwmTag] fromStoryboard:@"NewProduct"];
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }
...@@ -173,13 +176,17 @@ typedef enum{ ...@@ -173,13 +176,17 @@ typedef enum{
[self openURLWithString:@"https://www.cemarose.com/pages/service-description/"]; [self openURLWithString:@"https://www.cemarose.com/pages/service-description/"];
} }
#pragma makr - KWMRecommendDelegate KWMClothingSetsDelegate KWMHotSalesDelegate #pragma mark - KWMRecommendDelegate
-(void)kwm_gotoRecommendPage{
[self openURLWithString:@"https://cemarose.myshopify.com/collections/hot-sell-app"];
}
#pragma mark - KWMRecommendDelegate KWMClothingSetsDelegate KWMHotSalesDelegate
-(void)kwm_onClickProduct:(BUYProduct *)product{ -(void)kwm_onClickProduct:(BUYProduct *)product{
// NSLog(@"product"); // NSLog(@"product");
[self openURLWithString:[NSString stringWithFormat:@"https://cemarose.myshopify.com/products/%@",product.handle]]; [self openURLWithString:[NSString stringWithFormat:@"https://cemarose.myshopify.com/products/%@",product.handle]];
} }
#pragma mark - UICollectionViewDataSource #pragma mark - UICollectionViewDataSource
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{ -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
return 5; return 5;
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<constraint firstItem="LIh-x6-zk9" firstAttribute="leading" secondItem="jxm-XE-ewW" secondAttribute="trailing" constant="10" id="yLr-ro-h9P"/> <constraint firstItem="LIh-x6-zk9" firstAttribute="leading" secondItem="jxm-XE-ewW" secondAttribute="trailing" constant="10" id="yLr-ro-h9P"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KO2-yq-cZe" userLabel="2000元包邮"> <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KO2-yq-cZe" userLabel="2000元包邮">
<rect key="frame" x="221" y="98" width="100" height="30"/> <rect key="frame" x="221" y="98" width="100" height="30"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_product_gift" translatesAutoresizingMaskIntoConstraints="NO" id="jgV-JY-DP2"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_product_gift" translatesAutoresizingMaskIntoConstraints="NO" id="jgV-JY-DP2">
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
-(void)kwm_clickCollectionCell:(BUYProduct *)product; -(void)kwm_clickCollectionCell:(BUYProduct *)product;
@optional -(void)kwm_clickMore:(BOOL)isSameBrand;
-(void)kwm_loadNewPage:(BOOL)isSameBrand;
@end @end
......
...@@ -126,9 +126,9 @@ static NSString *idStr = @"KWMNewGoodsCell"; ...@@ -126,9 +126,9 @@ static NSString *idStr = @"KWMNewGoodsCell";
} }
} }
-(void)kwm_onNexPage:(BOOL)isNewBrand{ -(void)kwm_onClickMore:(BOOL)isNewBrand{
if ([self.delegate respondsToSelector:@selector(kwm_loadNewPage:)]) { if ([self.delegate respondsToSelector:@selector(kwm_clickMore:)]) {
[self.delegate kwm_loadNewPage:isNewBrand]; [self.delegate kwm_clickMore:isNewBrand];
} }
} }
......
...@@ -77,8 +77,8 @@ ...@@ -77,8 +77,8 @@
-(void)setVariant:(BUYProductVariant *)variant{ -(void)setVariant:(BUYProductVariant *)variant{
_variant = variant; _variant = variant;
if(_variant){ if(variant){
self.lbPrice.text = _variant.price.stringValue; self.lbPrice.text = variant.price.priceValueFormatted;
} }
} }
......
...@@ -276,6 +276,14 @@ ...@@ -276,6 +276,14 @@
[self clearSelect]; [self clearSelect];
} }
-(void)kwm_clickMore:(BOOL)isSameBrand{
if(!self.product){
return;
}
NSString *handle = isSameBrand?[KWMStringUtil deleteOtherCharExceptLetterWithLine:self.product.vendor]:self.product.productType;
[self openURLWithString:[NSString stringWithFormat:@"https://cemarose.myshopify.com/collections/%@",handle]];
}
#pragma mark -- KWMFirstDetailViewDelegate #pragma mark -- KWMFirstDetailViewDelegate
-(void)kwm_onClickSizeBtn{ -(void)kwm_onClickSizeBtn{
...@@ -461,7 +469,7 @@ ...@@ -461,7 +469,7 @@
__weak KWMNewProductVC *weakSelf = self; __weak KWMNewProductVC *weakSelf = self;
NSDictionary *customerDict = [[NSUserDefaults standardUserDefaults] objectForKey:@"customer"]; NSDictionary *customerDict = [[NSUserDefaults standardUserDefaults] objectForKey:@"customer"];
BUYCustomer *customer = [[BUYCustomer alloc] initWithModelManager:self.client.modelManager JSONDictionary:customerDict]; BUYCustomer *customer = [[BUYCustomer alloc] initWithModelManager:self.client.modelManager JSONDictionary:customerDict];
BUYProductVariant *variant = self.detailView1.variant; BUYProductVariant *variant = self.variant;
if(!customer || !variant){ if(!customer || !variant){
return; return;
} }
...@@ -530,16 +538,17 @@ ...@@ -530,16 +538,17 @@
if(!customer || !self.variant){ if(!customer || !self.variant){
return; return;
} }
BUYProduct *product = (self.color && self.color.product)?self.color.product:self.product;
NSDictionary *parament = @{ NSDictionary *parament = @{
@"customer_id":customer.identifier.stringValue, @"customer_id":customer.identifier.stringValue,
@"customer_email":customer.email, @"customer_email":customer.email,
@"customer_name":customer.lastName, @"customer_name":customer.lastName,
@"product_title":self.product.title, @"product_title":product.title,
@"product_id":self.product.identifier.stringValue, @"product_id":product.identifier.stringValue,
@"variant_id":self.variant.identifier.stringValue, @"variant_id":self.variant.identifier.stringValue,
@"variant_sku":self.variant.sku, @"variant_sku":self.variant.sku,
@"variant_title":self.variant.title, @"variant_title":self.variant.title,
@"product_handle":self.product.handle, @"product_handle":product.handle,
@"shop":Shopify_SHOP_DOMAIN @"shop":Shopify_SHOP_DOMAIN
}; };
void(^failure)(NSURLSessionDataTask *,NSError *) = ^(NSURLSessionDataTask *task,NSError *error){ void(^failure)(NSURLSessionDataTask *,NSError *) = ^(NSURLSessionDataTask *task,NSError *error){
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
@property(nonatomic) IBOutlet UILabel *lbCount; @property(nonatomic) IBOutlet UILabel *lbCount;
@property(weak,nonatomic) IBOutlet UIView *vCount;
@property(nonatomic) NSInteger count; @property(nonatomic) NSInteger count;
@property(nonatomic) NSDecimalNumber *totalPrice; @property(nonatomic) NSDecimalNumber *totalPrice;
...@@ -140,6 +142,7 @@ ...@@ -140,6 +142,7 @@
if(self.selectVariant){ if(self.selectVariant){
self.totalPrice = [self.selectVariant.price decimalNumberByMultiplyingBy:[NSDecimalNumber decimalNumberWithDecimal:@(self.count).decimalValue]]; self.totalPrice = [self.selectVariant.price decimalNumberByMultiplyingBy:[NSDecimalNumber decimalNumberWithDecimal:@(self.count).decimalValue]];
} }
self.vCount.hidden = self.wish?YES:NO;
self.lbCount.text = [NSString stringWithFormat:@"%ld",(long)self.count]; self.lbCount.text = [NSString stringWithFormat:@"%ld",(long)self.count];
self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:self.totalPrice]; self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:self.totalPrice];
} }
...@@ -193,10 +196,13 @@ ...@@ -193,10 +196,13 @@
* @param sender <#sender description#> * @param sender <#sender description#>
*/ */
-(IBAction)onClickComplete:(UIButton *)sender{ -(IBAction)onClickComplete:(UIButton *)sender{
if (self.selectVariant == nil || self.count==0) { if (self.selectVariant == nil) {
[self showToast:@"请选择您想要的规格"]; [self showToast:@"请选择您想要的规格"];
return; return;
} }
if (self.count <= 0 && self.wish){
[self showToast:@"商品数量不能为0"];
}
//购物车页面 //购物车页面
if ([self.delegate respondsToSelector:@selector(kwm_addShopWithVariantId:quantity:variant:buyNow:callback:)]){ if ([self.delegate respondsToSelector:@selector(kwm_addShopWithVariantId:quantity:variant:buyNow:callback:)]){
__weak id this = self; __weak id this = self;
...@@ -387,6 +393,12 @@ ...@@ -387,6 +393,12 @@
if(variant && self.selectVariant){ if(variant && self.selectVariant){
return [variant.identifier isEqualToNumber:self.selectVariant.identifier]; return [variant.identifier isEqualToNumber:self.selectVariant.identifier];
}; };
if(variant && self.wish && !self.selectVariant){
if([variant.identifier isEqualToNumber:self.wish.variantId]){
self.selectVariant = variant;
return YES;
}
}
return NO; return NO;
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "KWMImageUtil.h" #import "KWMImageUtil.h"
#import "KWMStringUtil.h" #import "KWMStringUtil.h"
#import "KWMShopCartModel.h" #import "KWMShopCartModel.h"
#import "KWMShopCartVC.h"
@interface KWMWishListVC () @interface KWMWishListVC ()
...@@ -41,21 +42,32 @@ ...@@ -41,21 +42,32 @@
[self.navigationController setNavigationBarHidden:NO]; [self.navigationController setNavigationBarHidden:NO];
} }
- (IBAction)onClickComplete:(id)sender{
KWMShopCartVC *ShopCartVC = (KWMShopCartVC *)[KWMBaseVC findControllerBy:[KWMShopCartVC kwmTag] fromStoryboard:@"ShopCart"];
[self.navigationController pushViewController:ShopCartVC animated:YES];
}
- (void)initView{ - (void)initView{
self.title = @"我喜欢的"; self.title = @"我喜欢的";
[self.tbvWish registerNib:[UINib nibWithNibName:NSStringFromClass([KWMWishCell class]) bundle:nil] forCellReuseIdentifier:NSStringFromClass([KWMWishCell class])]; [self.tbvWish registerNib:[UINib nibWithNibName:NSStringFromClass([KWMWishCell class]) bundle:nil] forCellReuseIdentifier:NSStringFromClass([KWMWishCell class])];
self.wishArray = [NSMutableArray array]; self.wishArray = [NSMutableArray array];
self.productArray = [NSMutableArray array]; self.productArray = [NSMutableArray array];
[self setTotalPrice]; [self setTotalPrice];
} }
-(void)removeWish:(NSNumber *)variantId{ -(void)removeWish:(NSNumber *)variantId{
for(KWMWish *wish in self.wishArray){ NSInteger removeIndex = -1;
for(NSInteger i = 0;i < self.wishArray.count;i++){
KWMWish *wish = [self.wishArray objectAtIndex:i];
if([wish.variantId isEqualToNumber:variantId]){ if([wish.variantId isEqualToNumber:variantId]){
[self.wishArray removeObject:wish]; removeIndex = i;
break;
} }
} }
if(removeIndex != -1){
[self.wishArray removeObjectAtIndex:removeIndex];
[self.tbvWish reloadData];
}
} }
//计算总价格 //计算总价格
...@@ -73,7 +85,7 @@ ...@@ -73,7 +85,7 @@
} }
#pragma mark --KWMVariantsVCDelegate #pragma mark --KWMVariantsVCDelegate
-(void)kwm_setVariant:(KWMVariantsVC *)variantsVC variant:(BUYProductVariant *)variant{ -(void)kwm_setVariant:(KWMVariantsVC *)variantsVC variant:(BUYProductVariant *)variant color:(KWMColor *)color count:(NSInteger)count{
for(KWMWish *wish in self.wishArray){ for(KWMWish *wish in self.wishArray){
if([wish.variantId isEqualToNumber:variantsVC.wish.variantId]){ if([wish.variantId isEqualToNumber:variantsVC.wish.variantId]){
wish.variantId = variant.identifier; wish.variantId = variant.identifier;
...@@ -176,11 +188,11 @@ ...@@ -176,11 +188,11 @@
#pragma mark-- KWMAPIManager #pragma mark-- KWMAPIManager
-(void)requestWishList{ -(void)requestWishList{
__weak KWMWishListVC *weakSelf = self; __weak KWMWishListVC *weakSelf = self;
NSDictionary *customerDict = [[NSUserDefaults standardUserDefaults] objectForKey:@"customer"]; if(![self checkLogin]){
BUYCustomer *customer = [[BUYCustomer alloc] initWithModelManager:self.client.modelManager JSONDictionary:customerDict];
if(!customer){
return; return;
} }
NSDictionary *customerDict = [[NSUserDefaults standardUserDefaults] objectForKey:@"customer"];
BUYCustomer *customer = [[BUYCustomer alloc] initWithModelManager:self.client.modelManager JSONDictionary:customerDict];
NSDictionary *parament = @{ NSDictionary *parament = @{
@"customer_id":customer.identifier.stringValue, @"customer_id":customer.identifier.stringValue,
@"customer_email":customer.email, @"customer_email":customer.email,
...@@ -193,8 +205,9 @@ ...@@ -193,8 +205,9 @@
void(^success)(NSURLSessionDataTask *,KWMAdditionalListResult *) = ^(NSURLSessionDataTask *task,KWMAdditionalListResult *result){ void(^success)(NSURLSessionDataTask *,KWMAdditionalListResult *) = ^(NSURLSessionDataTask *task,KWMAdditionalListResult *result){
[weakSelf hideLoading]; [weakSelf hideLoading];
if(result && result.data){ if(result && result.data){
NSMutableArray *wishArray = (NSMutableArray *)result.data; NSArray *wishArray = (NSArray *)result.data;
weakSelf.wishArray = wishArray; [weakSelf.wishArray removeAllObjects];
[weakSelf.wishArray addObjectsFromArray:wishArray];
[weakSelf.tbvWish reloadData]; [weakSelf.tbvWish reloadData];
[weakSelf requestProductsApi]; [weakSelf requestProductsApi];
} }
......
...@@ -509,6 +509,7 @@ ...@@ -509,6 +509,7 @@
<outlet property="lbCount" destination="GZ8-oT-VCl" id="LiQ-6e-76f"/> <outlet property="lbCount" destination="GZ8-oT-VCl" id="LiQ-6e-76f"/>
<outlet property="lbPrice" destination="0UA-fW-OwV" id="ifJ-78-Kc8"/> <outlet property="lbPrice" destination="0UA-fW-OwV" id="ifJ-78-Kc8"/>
<outlet property="vContentHeight" destination="YBc-tS-Vne" id="qU7-CX-T7w"/> <outlet property="vContentHeight" destination="YBc-tS-Vne" id="qU7-CX-T7w"/>
<outlet property="vCount" destination="zhl-Qy-ueI" id="DHl-4S-o3l"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="MKE-1G-zhs" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="MKE-1G-zhs" userLabel="First Responder" sceneMemberID="firstResponder"/>
...@@ -584,6 +585,9 @@ ...@@ -584,6 +585,9 @@
<state key="normal" title="结算"> <state key="normal" title="结算">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state> </state>
<connections>
<action selector="onClickComplete:" destination="fOt-KO-9Ov" eventType="touchUpInside" id="fYb-h4-MUt"/>
</connections>
</button> </button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="b66-L6-qYh" userLabel="line"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="b66-L6-qYh" userLabel="line">
<rect key="frame" x="0.0" y="0.0" width="375" height="1"/> <rect key="frame" x="0.0" y="0.0" width="375" height="1"/>
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
@property (nonatomic) BUYProduct *product; @property (nonatomic) BUYProduct *product;
@property (nonatomic) BOOL isMore;
-(void)setData:(BUYProduct *)product; -(void)setData:(BUYProduct *)product;
@end @end
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
@interface KWMCollectionCell () @interface KWMCollectionCell ()
@property (nonatomic, weak) IBOutlet UIView *vMore;
@property (nonatomic, weak) IBOutlet NSLayoutConstraint *priceSpace; @property (nonatomic, weak) IBOutlet NSLayoutConstraint *priceSpace;
@end @end
...@@ -27,6 +29,11 @@ ...@@ -27,6 +29,11 @@
self.lbPrice.textAlignment = NSTextAlignmentRight; self.lbPrice.textAlignment = NSTextAlignmentRight;
} }
-(void)setIsMore:(BOOL)isMore{
_isMore = isMore;
self.vMore.hidden = !isMore;
}
-(void)setData:(BUYProduct *)product{ -(void)setData:(BUYProduct *)product{
if(product!=nil){ if(product!=nil){
self.product = product; self.product = product;
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
...@@ -80,24 +80,46 @@ ...@@ -80,24 +80,46 @@
<color key="textColor" red="0.3411764705882353" green="0.3411764705882353" blue="0.3411764705882353" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.3411764705882353" green="0.3411764705882353" blue="0.3411764705882353" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="amz-6P-JML" userLabel="more">
<rect key="frame" x="10" y="10" width="114" height="160"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hnM-cO-OAy">
<rect key="frame" x="35" y="67" width="45" height="25.5"/>
<string key="text">- 更多 -
MORE…</string>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="9"/>
<color key="textColor" red="0.3411764705882353" green="0.3411764705882353" blue="0.3411764705882353" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="hnM-cO-OAy" firstAttribute="centerX" secondItem="amz-6P-JML" secondAttribute="centerX" id="Lgt-0C-IXP"/>
<constraint firstItem="hnM-cO-OAy" firstAttribute="centerY" secondItem="amz-6P-JML" secondAttribute="centerY" id="xox-b1-Saf"/>
</constraints>
</view>
</subviews> </subviews>
</view> </view>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints> <constraints>
<constraint firstItem="amz-6P-JML" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="10" id="3XV-kO-0E1"/>
<constraint firstItem="LfZ-kv-Lcb" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="20" id="4FC-Uc-GOl"/> <constraint firstItem="LfZ-kv-Lcb" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="20" id="4FC-Uc-GOl"/>
<constraint firstItem="4Y5-kT-G7g" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="10" id="5Ri-3a-lVo"/> <constraint firstItem="4Y5-kT-G7g" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="10" id="5Ri-3a-lVo"/>
<constraint firstItem="4Y5-kT-G7g" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="10" id="85s-gm-OFy"/> <constraint firstItem="4Y5-kT-G7g" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="10" id="85s-gm-OFy"/>
<constraint firstItem="j4S-Pj-0Jm" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="10" id="Bkd-4C-LiV"/> <constraint firstItem="j4S-Pj-0Jm" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="10" id="Bkd-4C-LiV"/>
<constraint firstItem="j4S-Pj-0Jm" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="10" id="Dkb-sp-DPv"/> <constraint firstItem="j4S-Pj-0Jm" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="10" id="Dkb-sp-DPv"/>
<constraint firstItem="LfZ-kv-Lcb" firstAttribute="top" secondItem="4Y5-kT-G7g" secondAttribute="bottom" constant="9" id="Hih-1i-3KV"/> <constraint firstItem="LfZ-kv-Lcb" firstAttribute="top" secondItem="4Y5-kT-G7g" secondAttribute="bottom" constant="9" id="Hih-1i-3KV"/>
<constraint firstAttribute="trailing" secondItem="amz-6P-JML" secondAttribute="trailing" constant="10" id="Kom-EE-ghy"/>
<constraint firstAttribute="bottom" secondItem="j4S-Pj-0Jm" secondAttribute="bottom" constant="10" id="QNw-5B-Cvq"/> <constraint firstAttribute="bottom" secondItem="j4S-Pj-0Jm" secondAttribute="bottom" constant="10" id="QNw-5B-Cvq"/>
<constraint firstAttribute="trailing" secondItem="LfZ-kv-Lcb" secondAttribute="trailing" constant="20" id="Utq-Pv-OJV"/> <constraint firstAttribute="trailing" secondItem="LfZ-kv-Lcb" secondAttribute="trailing" constant="20" id="Utq-Pv-OJV"/>
<constraint firstAttribute="trailing" secondItem="4Y5-kT-G7g" secondAttribute="trailing" constant="10" id="c4e-06-wrV"/> <constraint firstAttribute="trailing" secondItem="4Y5-kT-G7g" secondAttribute="trailing" constant="10" id="c4e-06-wrV"/>
<constraint firstItem="Lqb-dN-SOP" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="cjj-Hs-hsD"/> <constraint firstItem="Lqb-dN-SOP" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="cjj-Hs-hsD"/>
<constraint firstItem="Lqb-dN-SOP" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="dE5-5Y-muD"/> <constraint firstItem="Lqb-dN-SOP" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="dE5-5Y-muD"/>
<constraint firstAttribute="trailing" secondItem="j4S-Pj-0Jm" secondAttribute="trailing" constant="10" id="iMA-ja-UYW"/> <constraint firstAttribute="trailing" secondItem="j4S-Pj-0Jm" secondAttribute="trailing" constant="10" id="iMA-ja-UYW"/>
<constraint firstItem="amz-6P-JML" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="10" id="jBH-Oa-MWm"/>
<constraint firstAttribute="trailing" secondItem="Lqb-dN-SOP" secondAttribute="trailing" id="l8a-QN-k7a"/> <constraint firstAttribute="trailing" secondItem="Lqb-dN-SOP" secondAttribute="trailing" id="l8a-QN-k7a"/>
<constraint firstAttribute="bottom" secondItem="Lqb-dN-SOP" secondAttribute="bottom" id="lT8-Mv-gJt"/> <constraint firstAttribute="bottom" secondItem="Lqb-dN-SOP" secondAttribute="bottom" id="lT8-Mv-gJt"/>
<constraint firstAttribute="bottom" secondItem="amz-6P-JML" secondAttribute="bottom" constant="10" id="w65-DU-il0"/>
</constraints> </constraints>
<size key="customSize" width="199" height="202"/> <size key="customSize" width="199" height="202"/>
<connections> <connections>
...@@ -106,6 +128,7 @@ ...@@ -106,6 +128,7 @@
<outlet property="lbDiscount" destination="QJA-H1-mJd" id="qCj-cg-ksd"/> <outlet property="lbDiscount" destination="QJA-H1-mJd" id="qCj-cg-ksd"/>
<outlet property="lbPrice" destination="mdo-JD-RUh" id="wFN-oq-HYR"/> <outlet property="lbPrice" destination="mdo-JD-RUh" id="wFN-oq-HYR"/>
<outlet property="priceSpace" destination="gHK-yL-dZ3" id="ITE-eD-QTF"/> <outlet property="priceSpace" destination="gHK-yL-dZ3" id="ITE-eD-QTF"/>
<outlet property="vMore" destination="amz-6P-JML" id="chb-jd-GPy"/>
</connections> </connections>
<point key="canvasLocation" x="56" y="115"/> <point key="canvasLocation" x="56" y="115"/>
</collectionViewCell> </collectionViewCell>
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
//每当滑动到倒数15个的时候,尝试load下一页 //每当滑动到倒数15个的时候,尝试load下一页
- (void)kwm_onNexPage:(BOOL)isNewBrand; - (void)kwm_onNexPage:(BOOL)isNewBrand;
- (void)kwm_onClickMore:(BOOL)isNewBrand;
@end @end
@interface KWMNewGoodsCell : UITableViewCell<UICollectionViewDelegate,UICollectionViewDataSource> @interface KWMNewGoodsCell : UITableViewCell<UICollectionViewDelegate,UICollectionViewDataSource>
......
...@@ -56,6 +56,9 @@ static NSString *idStr = @"KWMCollectionCell"; ...@@ -56,6 +56,9 @@ static NSString *idStr = @"KWMCollectionCell";
#pragma mark - UICollectionViewDataSource #pragma mark - UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
if(self.products && self.products.count>9){
return 10;
}
if(self.products && self.products.count>0){ if(self.products && self.products.count>0){
return self.products.count; return self.products.count;
}else if(self.loadStatus && self.loadStatus.cacheData){ }else if(self.loadStatus && self.loadStatus.cacheData){
...@@ -68,6 +71,7 @@ static NSString *idStr = @"KWMCollectionCell"; ...@@ -68,6 +71,7 @@ static NSString *idStr = @"KWMCollectionCell";
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
KWMCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:idStr forIndexPath:indexPath]; KWMCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:idStr forIndexPath:indexPath];
cell.isMore = indexPath.row == 9;
if(self.products && self.products.count>indexPath.row){ if(self.products && self.products.count>indexPath.row){
[cell setData:[self.products objectAtIndex:indexPath.row]]; [cell setData:[self.products objectAtIndex:indexPath.row]];
}else if(self.loadStatus && self.loadStatus.cacheData && self.loadStatus.cacheData.count>indexPath.row){ }else if(self.loadStatus && self.loadStatus.cacheData && self.loadStatus.cacheData.count>indexPath.row){
...@@ -85,6 +89,12 @@ static NSString *idStr = @"KWMCollectionCell"; ...@@ -85,6 +89,12 @@ static NSString *idStr = @"KWMCollectionCell";
} }
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
if(indexPath.row == 9){
if ([self.delegate respondsToSelector:@selector(kwm_onClickMore:)]) {
[self.delegate kwm_onClickMore:self.isSameBrand];
}
return;
}
BUYProduct *selectProduct; BUYProduct *selectProduct;
if(self.products!=nil && self.products.count>indexPath.row){ if(self.products!=nil && self.products.count>indexPath.row){
selectProduct = [self.products objectAtIndex:indexPath.row]; selectProduct = [self.products objectAtIndex:indexPath.row];
......
...@@ -279,8 +279,8 @@ ...@@ -279,8 +279,8 @@
</subviews> </subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="Po3-1j-gji" firstAttribute="top" secondItem="wbB-ey-Zag" secondAttribute="bottom" id="0pW-XB-Gbt"/> <constraint firstAttribute="bottom" secondItem="0gx-v6-eAP" secondAttribute="bottom" id="JWf-1t-OhT"/>
<constraint firstItem="Po3-1j-gji" firstAttribute="top" secondItem="Fmw-OX-y1u" secondAttribute="bottom" id="2Re-MQ-0YA"/> <constraint firstAttribute="bottom" secondItem="Fmw-OX-y1u" secondAttribute="bottom" id="KDQ-E4-wkV"/>
<constraint firstItem="taY-Y0-CRF" firstAttribute="top" secondItem="GXA-CG-nHY" secondAttribute="top" constant="64" id="O4E-7c-QiS"/> <constraint firstItem="taY-Y0-CRF" firstAttribute="top" secondItem="GXA-CG-nHY" secondAttribute="top" constant="64" id="O4E-7c-QiS"/>
<constraint firstItem="taY-Y0-CRF" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="QND-SZ-tAr"/> <constraint firstItem="taY-Y0-CRF" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="QND-SZ-tAr"/>
<constraint firstAttribute="trailing" secondItem="wbB-ey-Zag" secondAttribute="trailing" id="QVg-n3-hOZ"/> <constraint firstAttribute="trailing" secondItem="wbB-ey-Zag" secondAttribute="trailing" id="QVg-n3-hOZ"/>
...@@ -289,12 +289,12 @@ ...@@ -289,12 +289,12 @@
<constraint firstAttribute="trailing" secondItem="taY-Y0-CRF" secondAttribute="trailing" id="aew-aA-WyS"/> <constraint firstAttribute="trailing" secondItem="taY-Y0-CRF" secondAttribute="trailing" id="aew-aA-WyS"/>
<constraint firstItem="0gx-v6-eAP" firstAttribute="top" secondItem="GXA-CG-nHY" secondAttribute="top" id="dO9-sW-Trm"/> <constraint firstItem="0gx-v6-eAP" firstAttribute="top" secondItem="GXA-CG-nHY" secondAttribute="top" id="dO9-sW-Trm"/>
<constraint firstAttribute="trailing" secondItem="0gx-v6-eAP" secondAttribute="trailing" id="fII-UN-CCe"/> <constraint firstAttribute="trailing" secondItem="0gx-v6-eAP" secondAttribute="trailing" id="fII-UN-CCe"/>
<constraint firstAttribute="bottom" secondItem="wbB-ey-Zag" secondAttribute="bottom" id="iRq-ft-rl5"/>
<constraint firstItem="Fmw-OX-y1u" firstAttribute="top" secondItem="YH1-IF-LTL" secondAttribute="bottom" constant="-20" id="kf6-GV-ebU"/> <constraint firstItem="Fmw-OX-y1u" firstAttribute="top" secondItem="YH1-IF-LTL" secondAttribute="bottom" constant="-20" id="kf6-GV-ebU"/>
<constraint firstItem="Fmw-OX-y1u" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="pet-Wg-LZs"/> <constraint firstItem="Fmw-OX-y1u" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="pet-Wg-LZs"/>
<constraint firstItem="0gx-v6-eAP" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="sNX-bT-fOh"/> <constraint firstItem="0gx-v6-eAP" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="sNX-bT-fOh"/>
<constraint firstItem="wbB-ey-Zag" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="snp-el-ovi"/> <constraint firstItem="wbB-ey-Zag" firstAttribute="leading" secondItem="GXA-CG-nHY" secondAttribute="leading" id="snp-el-ovi"/>
<constraint firstAttribute="trailing" secondItem="Fmw-OX-y1u" secondAttribute="trailing" id="ssZ-nT-TMI"/> <constraint firstAttribute="trailing" secondItem="Fmw-OX-y1u" secondAttribute="trailing" id="ssZ-nT-TMI"/>
<constraint firstItem="Po3-1j-gji" firstAttribute="top" secondItem="0gx-v6-eAP" secondAttribute="bottom" id="vaM-QO-Syn"/>
</constraints> </constraints>
<variation key="default"> <variation key="default">
<mask key="constraints"> <mask key="constraints">
......
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