Commit b87fb731 by lee

去掉首面 等待时间|加入brand deeplink

parent 289771d9
......@@ -13,22 +13,36 @@
#import "KWMSelectedGoodsVC.h"
#import "KWMBlogDetailVC.h"
#import "KWMNewProductVC.h"
#import "KWMBrandCaramelVC.h"
@implementation AppDelegate (Deeplink)
- (UINavigationController *) navigationController {
return [[AppDelegate mainViewController] selectedViewController];
}
- (void)registerRouter {
JLRoutes *routes = [JLRoutes routesForScheme:@"cemarose"];
[routes addRoute:@"/collections/:handle/*" handler:^BOOL(NSDictionary<NSString *,id> * _Nonnull parameters) {
NSArray *tags = parameters[JLRouteWildcardComponentsKey];
NSString *handle = parameters[@"handle"];
tags = tags.count > 0 ? [tags[0] componentsSeparatedByString:@"+"] : nil;
// NSArray *tags = [parameters[JLRouteWildcardComponentsKey] componentsSeparatedByString:@"+"];
NSLog(@"trace tags %@",[tags componentsJoinedByString:@","]);
// NSArray *brands = @[@"amelie-wang",@"babywalker",@"beau-loves",@"billieblush",@"billybandit",@"bonpoint",@"burberry",@"caramel",@"chloe",@"collegien",@"dolce-gabbana",@"emile-et-ida",@"fendi",@"gucci",@"hucklebones",@"il-gufo",@"indikidual",@"karl-lagerfeld-kids",@"kenzo",@"lanvin",@"little-marc-jacobs",@"loud-apparel",@"louis-louise",@"louise-misha",@"marie-chantal",@"marni",@"mini-melissa",@"mini-rodini",@"mischka-aoki",@"moncler",@"moschino",@"msgm",@"nailmatic",@"nana-huchy",@"noukies",@"oeuf",@"patachou",@"paul-smith",@"pepe",@"sons-daughters-eyewear",@"stella-mccartney-kids",@"story-loris",@"tartine-et-chocolat",@"the-animals-observatory",@"tiny-cottons",@"veja",@"young-versace",@"zadig-voltaire"];
NSArray *brands = @[@"amelie-wang",@"babywalker",@"beau-loves",@"billieblush",@"billybandit",@"bonpoint",@"burberry",@"caramel",@"chloe",@"collegien",@"dolce-gabbana",@"emile-et-ida",@"fendi",@"gucci",@"hucklebones",@"il-gufo",@"indikidual",@"karl-lagerfeld-kids",@"kenzo",@"lanvin",@"little-marc-jacobs",@"loud-apparel",@"louis-louise",@"louise-misha",@"marie-chantal",@"marni",@"mini-melissa",@"mini-rodini",@"mischka-aoki",@"moncler",@"moschino",@"msgm",@"nailmatic",@"nana-huchy",@"noukies",@"oeuf",@"patachou",@"paul-smith",@"pepe",@"sons-daughters-eyewear",@"stella-mccartney-kids",@"story-loris",@"tartine-et-chocolat",@"the-animals-observatory",@"tiny-cottons",@"veja",@"young-versace",@"zadig-voltaire"];
if ([brands containsObject:handle]) {
KWMBrandCaramelVC *brandCaramelVC = [KWMBrandCaramelVC getNewInstance];
brandCaramelVC.isSale = NO;
brandCaramelVC.handle = handle;
brandCaramelVC.brand = handle;
[[self navigationController] pushViewController:brandCaramelVC animated:NO];
}else{
KWMSelectedGoodsVC * selectedGoodsVC = (KWMSelectedGoodsVC *)[KWMBaseVC findControllerBy:[KWMSelectedGoodsVC kwmTag] fromStoryboard:@"New"];
selectedGoodsVC.handle = parameters[@"handle"];
selectedGoodsVC.handle = handle;
selectedGoodsVC.ctags = tags;
selectedGoodsVC.title = parameters[@"title"];
[[AppDelegate mainViewController].selectedViewController pushViewController:selectedGoodsVC animated:YES];
[[AppDelegate mainViewController].selectedViewController pushViewController:selectedGoodsVC animated:NO];
}
return YES;
}];
[routes addRoute:@"/products/:id" handler:^BOOL(NSDictionary<NSString *,id> * _Nonnull parameters) {
......@@ -38,7 +52,7 @@
// productDetailVC.product = brandCell.leftProduct;
vc.handle = parameters[@"id"];
// NSLog(@"%@",[AppDelegate mainViewController].selectedViewController);
[[AppDelegate mainViewController].selectedViewController pushViewController:vc animated:YES];
[[AppDelegate mainViewController].selectedViewController pushViewController:vc animated:NO];
return YES;
}];
[routes addRoute:@"/blogs/:blog/:handle" handler:^BOOL(NSDictionary<NSString *,id> * _Nonnull parameters) {
......@@ -46,7 +60,7 @@
blogDetailVC.handle = parameters[@"handle"];
blogDetailVC.type = KWMContentTypeBlog;;
blogDetailVC.title = parameters[@"title"];
[[AppDelegate mainViewController].selectedViewController pushViewController:blogDetailVC animated:YES];
[[AppDelegate mainViewController].selectedViewController pushViewController:blogDetailVC animated:NO];
return YES;
}];
[routes addRoute:@"/pages/:handle" handler:^BOOL(NSDictionary<NSString *,id> * _Nonnull parameters) {
......@@ -54,7 +68,7 @@
blogDetailVC.handle = parameters[@"handle"];
blogDetailVC.type = KWMContentTypePage;
blogDetailVC.title = parameters[@"title"];
[[AppDelegate mainViewController].selectedViewController pushViewController:blogDetailVC animated:YES];
[[AppDelegate mainViewController].selectedViewController pushViewController:blogDetailVC animated:NO];
return YES;
}];
}
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" 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"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
......
......@@ -43,6 +43,10 @@
return @"KWMBrandCaramelVC";
}
+ (NSString *)kwmBoard {
return @"Brand";
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES];
......
......@@ -36,7 +36,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self requestExchangeRateApi];
[self initSplash];
// [self initSplash];
[self loadTabBar];
NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
BOOL registerSuccess = [defaults boolForKey:KEY_USER_REGISTER];
......
......@@ -555,7 +555,7 @@
NSDictionary *customerDict = [[NSUserDefaults standardUserDefaults] objectForKey:@"customer"];
BUYCustomer *customer = [[BUYCustomer alloc] initWithModelManager:self.client.modelManager JSONDictionary:customerDict];
BUYProductVariant *variant = self.variant;
if(!customer || !variant){
if(!(customer && customer.identifier && variant)){
return;
}
NSDictionary *parament = @{
......
......@@ -255,7 +255,7 @@
// price += [model.price.priceValue decimalNumberByMultiplyingBy:[NSDecimalNumber decimalNumberWithString:@(model.quantity).stringValue]].integerValue;
total = [total decimalNumberByAdding:[model.price.priceValue decimalNumberByMultiplyingBy:[NSDecimalNumber decimalNumberWithString:@(model.quantity).stringValue]]];
// FIXME: 这里要bug
total = [total decimalNumberByAdding:nil];
// total = [total decimalNumberByAdding:nil];
}
}
// _lbTotalPrice.text = [NSString stringWithFormat: @"¥%@",[KWMStringUtil getEUR2CNYstring:@(price)]];
......
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