Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ios1x
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
ios1x
Commits
23f1b4a7
Commit
23f1b4a7
authored
Jul 14, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
050f30f1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
8 deletions
+49
-8
AppDelegate+Deeplink.m
iCemarose/Class/AppDelegate+Deeplink.m
+6
-4
KWMBaseVC.h
iCemarose/Class/UI/KWMBaseVC.h
+2
-0
KWMBaseVC.m
iCemarose/Class/UI/KWMBaseVC.m
+9
-0
KWMNewHomeVC.m
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
+18
-1
KWMNewProductVC.h
iCemarose/Class/UI/NewProduct/KWMNewProductVC.h
+2
-0
KWMNewProductVC.m
iCemarose/Class/UI/NewProduct/KWMNewProductVC.m
+12
-3
No files found.
iCemarose/Class/AppDelegate+Deeplink.m
View file @
23f1b4a7
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#import "KWMProductDetailVC.h"
#import "KWMProductDetailVC.h"
#import "KWMSelectedGoodsVC.h"
#import "KWMSelectedGoodsVC.h"
#import "KWMBlogDetailVC.h"
#import "KWMBlogDetailVC.h"
#import "KWMNewProductVC.h"
@implementation
AppDelegate
(
Deeplink
)
@implementation
AppDelegate
(
Deeplink
)
...
@@ -30,11 +31,12 @@
...
@@ -30,11 +31,12 @@
}];
}];
[
routes
addRoute
:
@"/products/:id"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
[
routes
addRoute
:
@"/products/:id"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
NSLog
(
@"product id %@"
,
parameters
[
@"id"
]);
NSLog
(
@"product id %@"
,
parameters
[
@"id"
]);
KWMProductDetailVC
*
productDetailVC
=
(
KWMProductDetailVC
*
)[
KWMBaseVC
findControllerBy
:[
KWMProductDetailVC
kwmTag
]
fromStoryboard
:
@"New"
];
KWMNewProductVC
*
vc
=
[
KWMNewProductVC
getNewInstance
];
// KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"];
// productDetailVC.product = brandCell.leftProduct;
// productDetailVC.product = brandCell.leftProduct;
productDetailVC
.
handle
=
parameters
[
@"id"
];
//
productDetailVC.handle = parameters[@"id"];
NSLog
(
@"%@"
,[
AppDelegate
mainViewController
].
selectedViewController
);
//
NSLog(@"%@",[AppDelegate mainViewController].selectedViewController);
[[
AppDelegate
mainViewController
].
selectedViewController
pushViewController
:
productDetailVC
animated
:
YES
];
[[
AppDelegate
mainViewController
].
selectedViewController
pushViewController
:
vc
animated
:
YES
];
return
YES
;
return
YES
;
}];
}];
[
routes
addRoute
:
@"/blogs/:blog/:handle"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
[
routes
addRoute
:
@"/blogs/:blog/:handle"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
...
...
iCemarose/Class/UI/KWMBaseVC.h
View file @
23f1b4a7
...
@@ -28,8 +28,10 @@
...
@@ -28,8 +28,10 @@
@property
(
nonatomic
)
CGFloat
keyboardHeight
;
@property
(
nonatomic
)
CGFloat
keyboardHeight
;
+
(
NSString
*
)
kwmTag
;
+
(
NSString
*
)
kwmTag
;
+
(
NSString
*
)
kwmBoard
;
+
(
KWMBaseVC
*
)
findControllerBy
:(
NSString
*
)
controllerId
+
(
KWMBaseVC
*
)
findControllerBy
:(
NSString
*
)
controllerId
fromStoryboard
:(
NSString
*
)
storyboardName
;
fromStoryboard
:(
NSString
*
)
storyboardName
;
+
(
instancetype
)
getNewInstance
;
-
(
void
(
^
)(
NSURLSessionDataTask
*
,
NSError
*
))
defaultFailure
;
-
(
void
(
^
)(
NSURLSessionDataTask
*
,
NSError
*
))
defaultFailure
;
-
(
void
)
popDelay
;
-
(
void
)
popDelay
;
...
...
iCemarose/Class/UI/KWMBaseVC.m
View file @
23f1b4a7
...
@@ -34,6 +34,11 @@
...
@@ -34,6 +34,11 @@
return
NSStringFromClass
([
self
class
]);
return
NSStringFromClass
([
self
class
]);
}
}
+
(
NSString
*
)
kwmBoard
{
[
self
doesNotRecognizeSelector
:
@selector
(
kwmBoard
)];
return
nil
;
}
+
(
KWMBaseVC
*
)
findControllerBy
:
(
NSString
*
)
controllerId
+
(
KWMBaseVC
*
)
findControllerBy
:
(
NSString
*
)
controllerId
fromStoryboard
:
(
NSString
*
)
storyboardName
{
fromStoryboard
:
(
NSString
*
)
storyboardName
{
UIStoryboard
*
myStoryboard
=
[
UIStoryboard
storyboardWithName
:
storyboardName
bundle
:
nil
];
UIStoryboard
*
myStoryboard
=
[
UIStoryboard
storyboardWithName
:
storyboardName
bundle
:
nil
];
...
@@ -41,6 +46,10 @@
...
@@ -41,6 +46,10 @@
return
baseController
;
return
baseController
;
}
}
+
(
instancetype
)
getNewInstance
{
return
[
self
findControllerBy
:[
self
kwmTag
]
fromStoryboard
:[
self
kwmBoard
]];
}
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
self
.
extendedLayoutIncludesOpaqueBars
=
YES
;
self
.
extendedLayoutIncludesOpaqueBars
=
YES
;
...
...
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
View file @
23f1b4a7
...
@@ -333,6 +333,24 @@ typedef enum{
...
@@ -333,6 +333,24 @@ typedef enum{
}];
}];
}
}
//- (void) requestProductWithId:(NSNumber *) identifier tags:(NSArray *) tags valueKeyPath:(NSString *) valueKeyPath home:(BOOL) isHome page:(NSInteger) cpage{
// [self showLoading];
// [self.client getProductsPage:cpage inCollection:identifier withTags:tags sortOrder:BUYCollectionSortCollectionDefault completion:^(NSArray<BUYProduct *> * _Nullable products, NSUInteger page, BOOL reachedEnd, NSError * _Nullable error) {
// [self hideLoading];
//
// if (!error) {
// [self setValue:products forKeyPath:valueKeyPath];
// [self.cvHome reloadData];
// }else{
// [self showError:error];
// }
// if (isHome) {
// self.page = self.page + 1;
// products.count ? [self.cvHome.mj_footer endRefreshing] : [self.cvHome.mj_footer endRefreshingWithNoMoreData];
// }
// }];
//}
-
(
void
)
loadHomeData
{
-
(
void
)
loadHomeData
{
[
self
requestProductWithHandle
:
@"hot-sell-app"
tags
:
nil
valueKeyPath
:
@"recommendHeader.productArray"
];
[
self
requestProductWithHandle
:
@"hot-sell-app"
tags
:
nil
valueKeyPath
:
@"recommendHeader.productArray"
];
[
self
.
api
getHomeDataWithSuccess
:
^
(
NSURLSessionDataTask
*
task
,
KWMHomeDataResult
*
result
)
{
[
self
.
api
getHomeDataWithSuccess
:
^
(
NSURLSessionDataTask
*
task
,
KWMHomeDataResult
*
result
)
{
...
@@ -345,7 +363,6 @@ typedef enum{
...
@@ -345,7 +363,6 @@ typedef enum{
-
(
void
)
setHomeData
:
(
KWMHomeData
*
)
homeData
{
-
(
void
)
setHomeData
:
(
KWMHomeData
*
)
homeData
{
_homeData
=
homeData
;
_homeData
=
homeData
;
[
homeData
.
ad_banner
[
0
]
setUrl
:
@"https://www.cemarose.com/blogs/news/article-1"
];
self
.
adHeader
.
adArray
=
self
.
homeData
.
ad_banner
;
self
.
adHeader
.
adArray
=
self
.
homeData
.
ad_banner
;
// self.recommendHeader.productArray = self.productArray;
// self.recommendHeader.productArray = self.productArray;
// self.clothingSetsHeader.productArray = self.productArray;
// self.clothingSetsHeader.productArray = self.productArray;
...
...
iCemarose/Class/UI/NewProduct/KWMNewProductVC.h
View file @
23f1b4a7
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
@property
(
nonatomic
)
BUYProduct
*
product
;
@property
(
nonatomic
)
BUYProduct
*
product
;
@property
(
nonatomic
)
NSString
*
handle
;
@property
(
nonatomic
)
NSNumber
*
productId
;
@property
(
nonatomic
)
NSNumber
*
productId
;
@end
@end
iCemarose/Class/UI/NewProduct/KWMNewProductVC.m
View file @
23f1b4a7
...
@@ -59,6 +59,10 @@
...
@@ -59,6 +59,10 @@
@implementation
KWMNewProductVC
@implementation
KWMNewProductVC
+
(
NSString
*
)
kwmBoard
{
return
@"NewProduct"
;
}
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
...
@@ -333,12 +337,12 @@
...
@@ -333,12 +337,12 @@
#pragma mark - API BUYClient+Storefront
#pragma mark - API BUYClient+Storefront
-
(
void
)
requestProductDetail
{
-
(
void
)
requestProductDetail
{
if
(
!
self
.
productId
&&
!
self
.
product
){
if
(
!
(
self
.
productId
||
self
.
product
||
self
.
handle
)
){
return
;
return
;
}
}
[
self
showLoading
];
[
self
showLoading
];
__weak
KWMNewProductVC
*
weakSelf
=
self
;
__weak
KWMNewProductVC
*
weakSelf
=
self
;
[
self
.
client
getProductById
:
self
.
productId
?:
self
.
product
.
identifier
completion
:
^
(
BUYProduct
*
_Nullable
product
,
NSError
*
_Nullable
error
)
{
void
(
^
completion
)(
BUYProduct
*
,
NSError
*
)
=
^
(
BUYProduct
*
_Nullable
product
,
NSError
*
_Nullable
error
)
{
[
weakSelf
hideLoading
];
[
weakSelf
hideLoading
];
if
(
error
){
if
(
error
){
[
weakSelf
showError
:
error
];
[
weakSelf
showError
:
error
];
...
@@ -350,7 +354,12 @@
...
@@ -350,7 +354,12 @@
[
self
requestBrandProducts
:
1
];
[
self
requestBrandProducts
:
1
];
[
self
requestCategoryProducts
:
1
];
[
self
requestCategoryProducts
:
1
];
}
}
}];
};
if
(
self
.
handle
)
{
[
self
.
client
getProductByHandle
:
self
.
handle
completion
:
completion
];
}
else
{
[
self
.
client
getProductById
:
self
.
productId
?:
self
.
product
.
identifier
completion
:
completion
];
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment