Commit 961869d1 by lee

u home

parent ebf81198
......@@ -17,7 +17,9 @@
- (void)registerRouter {
JLRoutes *routes = [JLRoutes routesForScheme:@"cemarose"];
[routes addRoute:@"/collections/:handle/*" handler:^BOOL(NSDictionary<NSString *,id> * _Nonnull parameters) {
NSArray *tags = [parameters[JLRouteWildcardComponentsKey] componentsSeparatedByString:@"+"];
NSArray *tags = parameters[JLRouteWildcardComponentsKey];
tags = tags.count > 0 ? [tags[0] componentsSeparatedByString:@"+"] : nil;
// NSArray *tags = [parameters[JLRouteWildcardComponentsKey] componentsSeparatedByString:@"+"];
NSLog(@"trace tags %@",[tags componentsJoinedByString:@","]);
KWMSelectedGoodsVC * selectedGoodsVC = (KWMSelectedGoodsVC *)[KWMBaseVC findControllerBy:[KWMSelectedGoodsVC kwmTag] fromStoryboard:@"New"];
selectedGoodsVC.handle = parameters[@"handle"];
......
......@@ -7,11 +7,21 @@
//
#import "UIViewController+HTTP.h"
#import <JLRoutes/JLRoutes.h>
#import <RegexKitLite/RegexKitLite.h>
@implementation UIViewController (HTTP)
- (void)openURLWithString:(NSString *)URLString {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:URLString]];
UIApplication *application = [UIApplication sharedApplication];
NSURL *url = [[NSURL alloc] initWithString:[URLString stringByReplacingOccurrencesOfRegex:@"^https?" withString:@"cemarose"]];
if ([JLRoutes canRouteURL:url]) {
[JLRoutes routeURL:url];
}else if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) {
[application openURL:[NSURL URLWithString:URLString] options:@{} completionHandler:nil];
} else {
[application openURL:[NSURL URLWithString:URLString]];
}
}
@end
......@@ -108,5 +108,9 @@
return self.productArray?self.productArray.count:0;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[self.delegate kwm_onClickProduct:self.productArray[indexPath.item]];
}
@end
......@@ -106,6 +106,7 @@
homeCell.singleShow = YES;
homeCell.tag = i;
homeCell.product = product;
[self.singleShowView addSubview:homeCell];
}
self.heightSingleShowView.constant = itemHeight*singleShowArray.count;
......
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