Commit 0185d337 by lee

fix ui,fix checkout does not have uid,fix address country can not input 中国,App.Home data cache 24H

parent e2b375ed
...@@ -696,7 +696,9 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651"; ...@@ -696,7 +696,9 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
} }
- (NSURLSessionDataTask *)getHomeDataWithSuccess:(void (^)(NSURLSessionDataTask *, KWMHomeDataResult *))success failure:(void (^)(NSURLSessionDataTask *, NSError *))failure { - (NSURLSessionDataTask *)getHomeDataWithSuccess:(void (^)(NSURLSessionDataTask *, KWMHomeDataResult *))success failure:(void (^)(NSURLSessionDataTask *, NSError *))failure {
NSString *apiPath = @"https://ogbgohpla.qnssl.com/App.Home.json?32"; NSInteger st = [[NSDate date] timeIntervalSince1970];
st = st - st % 86400 - 28800;
NSString *apiPath = [NSString stringWithFormat:@"https://ogbgohpla.qnssl.com/App.Home.json?%ld",st];
return [self startSessionTask:KWMHTTPMethodGET apiPath:apiPath parameters:nil result:[KWMHomeDataResult class] model:nil success:success failure:failure]; return [self startSessionTask:KWMHTTPMethodGET apiPath:apiPath parameters:nil result:[KWMHomeDataResult class] model:nil success:success failure:failure];
} }
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
} }
_product = product; _product = product;
NSArray *variantsArray = product.variantsArray; NSArray *variantsArray = product.variantsArray;
self.lbTitle.text = product.vendor;
if(variantsArray && variantsArray.count > 0){ if(variantsArray && variantsArray.count > 0){
BUYProductVariant *variant = variantsArray.firstObject; BUYProductVariant *variant = variantsArray.firstObject;
// self.lbPrice.text = [KWMStringUtil price:variant.price]; // self.lbPrice.text = [KWMStringUtil price:variant.price];
......
...@@ -56,6 +56,10 @@ ...@@ -56,6 +56,10 @@
self.title = @"分类"; self.title = @"分类";
} }
+ (NSString *)kwmBoard {
return @"Main";
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self initData]; [self initData];
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
} }
self.vCount.hidden = self.wish?YES:NO; 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] priceFormattedByCurrencyCode:self.totalPrice];
} }
-(void)initCollectionView{ -(void)initCollectionView{
......
////
//// KWMNewVC.h
//// iCemarose
////
//// Created by 陈荣科 on 16/8/23.
//// Copyright © 2016年 kollway. All rights reserved.
////
// //
// KWMNewVC.h //#import "KWMBasePageVC.h"
// iCemarose //#import "KWMSearchBar.h"
// //#import "KWMNewGoodsCell.h"
// Created by 陈荣科 on 16/8/23. //#import "KWMTBVSectionHeardView.h"
// Copyright © 2016年 kollway. All rights reserved. //#import "UIColor+SAMAdditions.h"
// //
////tab页-商品
#import "KWMBasePageVC.h" //@interface KWMNewVC : KWMBasePageVC<UITableViewDelegate,UITableViewDataSource,KWMSearchBarDelegate,KWMNewGoodsCellDelegate,KWMTBVSectionHeardViewDelegate>
#import "KWMSearchBar.h" //
#import "KWMNewGoodsCell.h" //@property (weak, nonatomic) IBOutlet UIButton *btnBaby;
#import "KWMTBVSectionHeardView.h" //
#import "UIColor+SAMAdditions.h" //@property (weak, nonatomic) IBOutlet UIButton *btnGirl;
//
//tab页-商品 //@property (weak, nonatomic) IBOutlet UIButton *btnBoy;
@interface KWMNewVC : KWMBasePageVC<UITableViewDelegate,UITableViewDataSource,KWMSearchBarDelegate,KWMNewGoodsCellDelegate,KWMTBVSectionHeardViewDelegate> //
//@property (weak, nonatomic) IBOutlet UIButton *btnShoes;
@property (weak, nonatomic) IBOutlet UIButton *btnBaby; //
//@property (weak, nonatomic) IBOutlet UIButton *btnNewGoods;
@property (weak, nonatomic) IBOutlet UIButton *btnGirl; //
//@property (weak, nonatomic) IBOutlet UIButton *btnDiscount;
@property (weak, nonatomic) IBOutlet UIButton *btnBoy; //
//@property (weak, nonatomic) IBOutlet UITableView *tbvNewGoods;
@property (weak, nonatomic) IBOutlet UIButton *btnShoes; //
//@property (weak, nonatomic) IBOutlet UIView *vLine;
@property (weak, nonatomic) IBOutlet UIButton *btnNewGoods; //
//@property (weak, nonatomic) IBOutlet UIView *vBackground;
@property (weak, nonatomic) IBOutlet UIButton *btnDiscount; //
//
@property (weak, nonatomic) IBOutlet UITableView *tbvNewGoods; //- (IBAction)onClickBabyBtn:(id)sender;
//
@property (weak, nonatomic) IBOutlet UIView *vLine; //- (IBAction)onClickGirlBtn:(id)sender;
//
@property (weak, nonatomic) IBOutlet UIView *vBackground; //- (IBAction)onClickBoyBtn:(id)sender;
//
//- (IBAction)onClickShoesBtn:(id)sender;
- (IBAction)onClickBabyBtn:(id)sender; //
//- (IBAction)onClickNewGoodsBtn:(id)sender;
- (IBAction)onClickGirlBtn:(id)sender; //
//- (IBAction)onClickDiscountBtn:(id)sender;
- (IBAction)onClickBoyBtn:(id)sender; //
//@end
- (IBAction)onClickShoesBtn:(id)sender;
- (IBAction)onClickNewGoodsBtn:(id)sender;
- (IBAction)onClickDiscountBtn:(id)sender;
@end
...@@ -333,6 +333,7 @@ ...@@ -333,6 +333,7 @@
checkout.billingAddress = self.address; checkout.billingAddress = self.address;
} }
checkout.email = self.customer.email; checkout.email = self.customer.email;
checkout.customerId = self.customer.identifier;
// self.client.urlScheme = @"CemaroseApp://"; // self.client.urlScheme = @"CemaroseApp://";
// 走session的情况下应该不存在update 只是update cart自动会update到checkout // 走session的情况下应该不存在update 只是update cart自动会update到checkout
// if(checkoutCache){ // if(checkoutCache){
...@@ -719,13 +720,15 @@ ...@@ -719,13 +720,15 @@
[self.navigationController pushViewController:successVC animated:YES]; [self.navigationController pushViewController:successVC animated:YES];
} }
-(void) clearCheckout { -(void) clearCheckout {
self.cartCookie = nil; self.cartCookie = nil;
[[KWMShoppingCart sharedInstance] clearCartWithCallback:^(NSError *error, KWMCartResult *cart) { [KWMHttpUtil deleteCookie:@"cart"];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // [[KWMShoppingCart sharedInstance] clearCartWithCallback:^(NSError *error, KWMCartResult *cart) {
[KWMHttpUtil deleteCookie:@"cart"]; //// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// }); // [KWMHttpUtil deleteCookie:@"cart"];
}]; //// });
// }];
// [KWMHttpUtil deleteCookie:@"cart"]; // [KWMHttpUtil deleteCookie:@"cart"];
// [[KWMShopCartData alloc] removeAllItems]; // [[KWMShopCartData alloc] removeAllItems];
[self.userDao deleteCheckoutCache]; [self.userDao deleteCheckoutCache];
......
...@@ -145,6 +145,7 @@ ...@@ -145,6 +145,7 @@
}else{ }else{
requestAddress = [[BUYAddress alloc] initWithModelManager:self.client.modelManager JSONDictionary:nil]; requestAddress = [[BUYAddress alloc] initWithModelManager:self.client.modelManager JSONDictionary:nil];
} }
NSString *country = [self.tfCountry.text trim];
requestAddress.lastName = [self.tfName.text trim]; requestAddress.lastName = [self.tfName.text trim];
requestAddress.phone = [self.tfPhone.text trim]; requestAddress.phone = [self.tfPhone.text trim];
requestAddress.province = [self.tfProvince.text trim]; requestAddress.province = [self.tfProvince.text trim];
...@@ -152,7 +153,7 @@ ...@@ -152,7 +153,7 @@
requestAddress.city = [self.tfCity.text trim]; requestAddress.city = [self.tfCity.text trim];
requestAddress.address1 = [self.tfAddress.text trim]; requestAddress.address1 = [self.tfAddress.text trim];
requestAddress.address2 = [self.tfAddressDetail.text trim]; requestAddress.address2 = [self.tfAddressDetail.text trim];
requestAddress.country = [self.tfCountry.text trim]; requestAddress.country = [country isEqualToString:@"中国"] ? @"China" : country;
requestAddress.countryCode = @""; requestAddress.countryCode = @"";
requestAddress.zip = [self.tfZip.text trim]; requestAddress.zip = [self.tfZip.text trim];
requestAddress.firstName = [(requestAddress.firstName?requestAddress.firstName:@"") trim]; requestAddress.firstName = [(requestAddress.firstName?requestAddress.firstName:@"") trim];
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
#import "KWMUserModel.h" #import "KWMUserModel.h"
#import "KWMLoginVC.h" #import "KWMLoginVC.h"
#import "KWMShopCartData.h" #import "KWMShopCartData.h"
#import "KWMNewVC.h" //#import "KWMNewVC.h"
#import "KWMCategoryVC.h"
#import "KWMStringUtil.h" #import "KWMStringUtil.h"
#import "KWMShoppingCart.h" #import "KWMShoppingCart.h"
...@@ -93,9 +94,10 @@ ...@@ -93,9 +94,10 @@
//点击随意逛逛 //点击随意逛逛
- (IBAction)onClickRandomBtn:(id)sender { - (IBAction)onClickRandomBtn:(id)sender {
NSLog(@"点击了随意逛逛"); NSLog(@"点击了随意逛逛");
KWMNewVC *newVC = (KWMNewVC *)[KWMBaseVC findControllerBy:[KWMNewVC kwmTag] fromStoryboard:@"Main"]; // KWMNewVC *newVC = (KWMNewVC *)[KWMBaseVC findControllerBy:[KWMNewVC kwmTag] fromStoryboard:@"Main"];
self.hidesBottomBarWhenPushed = NO; self.hidesBottomBarWhenPushed = NO;
[self.navigationController pushViewController:newVC animated:YES]; KWMCategoryVC *vc = [KWMCategoryVC getNewInstance];
[self.navigationController pushViewController:vc animated:YES];
} }
- (void)onClickComplete:(id)sender{ - (void)onClickComplete:(id)sender{
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.5.0</string> <string>1.5.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2017071812</string> <string>2017071910</string>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>weixin</string> <string>weixin</string>
......
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