Commit c5965b3d by lee

u

parent 81145eba
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import "AppDelegate+Deeplink.h" #import "AppDelegate+Deeplink.h"
#import <JLRoutes/JLRoutes.h> #import <JLRoutes/JLRoutes.h>
#import "AppDelegate.h" #import "AppDelegate.h"
#import "KWMProductDetailVC.h" #import "KWMNewProductVC.h"
#import "KWMSelectedGoodsVC.h" #import "KWMSelectedGoodsVC.h"
#import "KWMBlogDetailVC.h" #import "KWMBlogDetailVC.h"
#import "KWMNewProductVC.h" #import "KWMNewProductVC.h"
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
[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"]);
KWMNewProductVC *vc = [KWMNewProductVC getNewInstance]; KWMNewProductVC *vc = [KWMNewProductVC getNewInstance];
// KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"]; // KWMNewProductVC *productDetailVC = [KWMNewProductVC getNewInstance];
// productDetailVC.product = brandCell.leftProduct; // productDetailVC.product = brandCell.leftProduct;
vc.handle = parameters[@"id"]; vc.handle = parameters[@"id"];
// NSLog(@"%@",[AppDelegate mainViewController].selectedViewController); // NSLog(@"%@",[AppDelegate mainViewController].selectedViewController);
......
...@@ -15,8 +15,15 @@ ...@@ -15,8 +15,15 @@
@implementation UIViewController (HTTP) @implementation UIViewController (HTTP)
- (void)openURLWithString:(NSString *)URLString { - (void)openURLWithString:(NSString *)URLString {
UIApplication *application = [UIApplication sharedApplication]; NSString *parten=@"[^%\\da-zA-Z:/.?&=]+";
NSURL *url = [[NSURL alloc] initWithString:[URLString stringByReplacingOccurrencesOfRegex:@"^https?" withString:@"cemarose"]]; NSRegularExpression *reg=[NSRegularExpression regularExpressionWithPattern:parten options:0 error:nil];
NSArray *matchs=[reg matchesInString:URLString options:0 range:NSMakeRange(0, [URLString length])];
NSString *encodeURL=[NSString stringWithString:URLString];
for (long i=matchs.count-1; i>=0; --i) {
NSTextCheckingResult *tcr=matchs[i];
encodeURL=[encodeURL stringByReplacingCharactersInRange:tcr.range withString:[[encodeURL substringWithRange:tcr.range] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
}
NSURL *url = [[NSURL alloc] initWithString:[encodeURL stringByReplacingOccurrencesOfRegex:@"^https?" withString:@"cemarose"]];
if ([JLRoutes canRouteURL:url]) { if ([JLRoutes canRouteURL:url]) {
[JLRoutes routeURL:url]; [JLRoutes routeURL:url];
// }else if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) { // }else if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import "KWMBrandCaramelVC.h" #import "KWMBrandCaramelVC.h"
#import "KWMBrandCaramelCell.h" #import "KWMBrandCaramelCell.h"
#import "KWMBarandSelectView.h" #import "KWMBarandSelectView.h"
#import "KWMProductDetailVC.h" #import "KWMNewProductVC.h"
#import "KWMShopCartVC.h" #import "KWMShopCartVC.h"
#import "KWMShopCartData.h" #import "KWMShopCartData.h"
#import "UIImageView+WebCache.h" #import "UIImageView+WebCache.h"
...@@ -232,14 +232,14 @@ static NSString *idStr = @"KWMBrandCaramelCell"; ...@@ -232,14 +232,14 @@ static NSString *idStr = @"KWMBrandCaramelCell";
//点击左边商品回调 //点击左边商品回调
- (void)kwm_onClickLeftIamge:(KWMBrandCaramelCell *)brandCell{ - (void)kwm_onClickLeftIamge:(KWMBrandCaramelCell *)brandCell{
KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"]; KWMNewProductVC *productDetailVC = [KWMNewProductVC getNewInstance];
productDetailVC.product = brandCell.leftProduct; productDetailVC.product = brandCell.leftProduct;
[self.navigationController pushViewController:productDetailVC animated:YES]; [self.navigationController pushViewController:productDetailVC animated:YES];
} }
//点击右边商品回调 //点击右边商品回调
- (void)kwm_onClickRightIamge:(KWMBrandCaramelCell *)brandCell{ - (void)kwm_onClickRightIamge:(KWMBrandCaramelCell *)brandCell{
KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"]; KWMNewProductVC *productDetailVC = [KWMNewProductVC getNewInstance];
productDetailVC.product = brandCell.rightProduct; productDetailVC.product = brandCell.rightProduct;
[self.navigationController pushViewController:productDetailVC animated:YES]; [self.navigationController pushViewController:productDetailVC animated:YES];
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "KWMCategoryVC.h" #import "KWMCategoryVC.h"
#import "KWMProductDetailVC.h" #import "KWMNewProductVC.h"
#import "KWMShopCartVC.h" #import "KWMShopCartVC.h"
#import "KWMNewProductVC.h" #import "KWMNewProductVC.h"
#import "KWMSearchFeedbackVC.h" #import "KWMSearchFeedbackVC.h"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view // Do any additional setup after loading the view
self.title = @"正文"; if(!self.title) self.title = @"正文";
self.automaticallyAdjustsScrollViewInsets = NO; self.automaticallyAdjustsScrollViewInsets = NO;
if (!self.handle) { if (!self.handle) {
[self initData]; [self initData];
......
...@@ -154,7 +154,7 @@ typedef enum{ ...@@ -154,7 +154,7 @@ typedef enum{
#pragma mark - KWMMenuDelegate #pragma mark - KWMMenuDelegate
-(void)kwm_onClickHotMenu{ -(void)kwm_onClickHotMenu{
[self openURLWithString:@"https://cemarose.myshopify.com/collections/new?title=%E6%9C%80%E6%96%B0%E5%8D%95%E5%93%81"]; [self openURLWithString:@"https://cemarose.myshopify.com/collections/new?title=最新单品"];
} }
-(void)kwm_onClickNewMenu{ -(void)kwm_onClickNewMenu{
...@@ -173,12 +173,12 @@ typedef enum{ ...@@ -173,12 +173,12 @@ typedef enum{
-(void)kwm_onClickDeliveryMenu{ -(void)kwm_onClickDeliveryMenu{
NSLog(@"deliverymenu"); NSLog(@"deliverymenu");
[self openURLWithString:@"https://www.cemarose.com/pages/service-description/"]; [self openURLWithString:@"https://www.cemarose.com/pages/service-description/?title=服务说明"];
} }
#pragma mark - KWMRecommendDelegate #pragma mark - KWMRecommendDelegate
-(void)kwm_gotoRecommendPage{ -(void)kwm_gotoRecommendPage{
[self openURLWithString:@"https://cemarose.myshopify.com/collections/hot-sell-app"]; [self openURLWithString:@"https://cemarose.myshopify.com/collections/hot-sell-app?title=主推单品"];
} }
#pragma mark - KWMRecommendDelegate KWMClothingSetsDelegate KWMHotSalesDelegate #pragma mark - KWMRecommendDelegate KWMClothingSetsDelegate KWMHotSalesDelegate
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
//// Copyright © 2017年 kollway. All rights reserved. //// Copyright © 2017年 kollway. All rights reserved.
//// ////
// //
//#import "KWMProductDetailVC.h" //#import "KWMNewProductVC.h"
//#import "KWMProductDetailView.h" //#import "KWMProductDetailView.h"
//#import "KWMBottomView.h" //#import "KWMBottomView.h"
//#import "KWMUserModel.h" //#import "KWMUserModel.h"
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import "KWMSearchFeedbackVC.h" #import "KWMSearchFeedbackVC.h"
#import "KWMBrandCaramelCell.h" #import "KWMBrandCaramelCell.h"
#import "KWMSearchFeedBackView.h" #import "KWMSearchFeedBackView.h"
#import "KWMProductDetailVC.h" #import "KWMNewProductVC.h"
@interface KWMSearchFeedbackVC ()<UITableViewDelegate,UITableViewDataSource,KWMSearchFeedBackViewDelegate,KWMBrandCaramelCellDelegate> @interface KWMSearchFeedbackVC ()<UITableViewDelegate,UITableViewDataSource,KWMSearchFeedBackViewDelegate,KWMBrandCaramelCellDelegate>
@property (nonatomic) KWMSearchFeedBackView *vSearchFB; @property (nonatomic) KWMSearchFeedBackView *vSearchFB;
...@@ -90,14 +90,14 @@ static NSString *idStr = @"KWMBrandCaramelCell"; ...@@ -90,14 +90,14 @@ static NSString *idStr = @"KWMBrandCaramelCell";
#pragma mark -- KWMBrandCaramelCellDelegate #pragma mark -- KWMBrandCaramelCellDelegate
//点击左边商品回调 //点击左边商品回调
- (void)kwm_onClickLeftIamge:(KWMBrandCaramelCell *)brandCell{ - (void)kwm_onClickLeftIamge:(KWMBrandCaramelCell *)brandCell{
KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"]; KWMNewProductVC *productDetailVC = [KWMNewProductVC getNewInstance];
productDetailVC.productId = brandCell.leftDataProduct.id; productDetailVC.productId = brandCell.leftDataProduct.id;
[self.navigationController pushViewController:productDetailVC animated:YES]; [self.navigationController pushViewController:productDetailVC animated:YES];
} }
//点击右边商品回调 //点击右边商品回调
- (void)kwm_onClickRightIamge:(KWMBrandCaramelCell *)brandCell{ - (void)kwm_onClickRightIamge:(KWMBrandCaramelCell *)brandCell{
KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"]; KWMNewProductVC *productDetailVC = [KWMNewProductVC getNewInstance];
productDetailVC.productId = brandCell.rightDataProduct.id; productDetailVC.productId = brandCell.rightDataProduct.id;
[self.navigationController pushViewController:productDetailVC animated:YES]; [self.navigationController pushViewController:productDetailVC animated:YES];
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "KWMSelectedGoodsVC.h" #import "KWMSelectedGoodsVC.h"
#import "KWMProductDetailVC.h" #import "KWMNewProductVC.h"
#import "KWMBeforePayVC.h" #import "KWMBeforePayVC.h"
#import "KWMMineTitleView.h" #import "KWMMineTitleView.h"
#import "MJRefresh.h" #import "MJRefresh.h"
...@@ -168,14 +168,14 @@ static NSString *idStr = @"KWMBrandCaramelCell"; ...@@ -168,14 +168,14 @@ static NSString *idStr = @"KWMBrandCaramelCell";
//点击左边商品回调 //点击左边商品回调
- (void)kwm_onClickLeftIamge:(KWMBrandCaramelCell *)brandCell{ - (void)kwm_onClickLeftIamge:(KWMBrandCaramelCell *)brandCell{
KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"]; KWMNewProductVC *productDetailVC = [KWMNewProductVC getNewInstance];
productDetailVC.product = brandCell.leftProduct; productDetailVC.product = brandCell.leftProduct;
[self.navigationController pushViewController:productDetailVC animated:YES]; [self.navigationController pushViewController:productDetailVC animated:YES];
} }
//点击右边商品回调 //点击右边商品回调
- (void)kwm_onClickRightIamge:(KWMBrandCaramelCell *)brandCell{ - (void)kwm_onClickRightIamge:(KWMBrandCaramelCell *)brandCell{
KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"]; KWMNewProductVC *productDetailVC = [KWMNewProductVC getNewInstance];
productDetailVC.product = brandCell.rightProduct; productDetailVC.product = brandCell.rightProduct;
[self.navigationController pushViewController:productDetailVC animated:YES]; [self.navigationController pushViewController:productDetailVC animated:YES];
} }
......
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