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