Commit 7d4885e3 by lee

u

parents 8ea2bdaa ca57cf3c
......@@ -441,6 +441,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
}else {
[[weakSelf.tbvBrandCaramel mj_footer] endRefreshingWithNoMoreData];
}
[weakSelf appendDataList:[NSArray array] setPage:tagetPage];
}else{
if(tagetPage == 1){
[weakSelf.dataList removeAllObjects];
......
......@@ -352,6 +352,10 @@ typedef enum{
self.page = page;
if (!error) {
[KWMPPCacheUtil saveDataToCache:parameters urlKey:CACHE_KEY_SDK_getCollectionByHandle_getProductsPage products:products];
if(isHome && cpage == 1){
//清除预先显示的缓存商品
self.productArray.removeAllObjects;
}
[self setValue:products forKeyPath:valueKeyPath];
[self.cvHome reloadData];
}else{
......
......@@ -10,6 +10,7 @@
#import "KWMImageUtil.h"
#import "KWMStringUtil.h"
#import "KWMPageControl.h"
#import "KWMUserDao.h"
//#import "YYWebImage/YYWebImage.h"
#import <SDCycleScrollView/SDCycleScrollView.h>
......@@ -31,9 +32,6 @@
@property(nonatomic,weak) IBOutlet UIView *freeShipping;
//单位label
@property(nonatomic,weak) IBOutlet UILabel *lbUnit;
//@property(nonatomic,weak) IBOutlet KWMPageControl *pageControl;
@property (weak, nonatomic) IBOutlet UIView *sizeGuideView;
......@@ -134,7 +132,7 @@
if(product == nil){
return;
}
self.isShowCNY = YES;
self.isShowCNY = [[KWMUserDao shareDao].currencyCode isEqualToString:@"CNY"];
// self.isFirstScroll = YES;
// [self removeTimer];
self.product = product;
......@@ -210,13 +208,10 @@
self.lbOldPrice.hidden = YES;
}
UITapGestureRecognizer *priceTap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onClickPrice:)];
UITapGestureRecognizer *priceTap2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onClickPrice:)];
UITapGestureRecognizer *priceTap3 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onClickPrice:)];
[self.lbUnit addGestureRecognizer:priceTap1];
[self.lbPrice addGestureRecognizer:priceTap2];
[self.lbOldPrice addGestureRecognizer:priceTap3];
self.lbUnit.userInteractionEnabled = YES;
self.lbPrice.userInteractionEnabled = YES;
self.lbOldPrice.userInteractionEnabled = YES;
self.freeShipping.hidden = [product.tags containsObject:@"not-return"];
......@@ -243,21 +238,29 @@
return;
}
self.isShowCNY = !self.isShowCNY;
BUYProductVariant *productVariant= self.product.variants.firstObject;
[self refreshPrice];
}
-(void)refreshPrice{
if(self.product == nil || !self.product.variants || self.product.variants.count == 0){
return;
}
BUYProductVariant *productVariant = self.product.variants.firstObject;
if(self.variant){
productVariant = self.variant;
}
if(self.isShowCNY){
self.lbUnit.text = @"¥";
self.lbPrice.text = [KWMStringUtil price:productVariant.price];
if (productVariant.compareAtPrice) {
NSString *priceString = [NSString stringWithFormat:@"¥%@",[KWMStringUtil price:productVariant.compareAtPrice]];
NSString *priceString = [KWMStringUtil price:productVariant.compareAtPrice];
NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:priceString attributes:attribtDic];
self.lbOldPrice.attributedText = attribtStr;
}
}else{
self.lbUnit.text = @"€";
self.lbPrice.text = productVariant.price.stringValue;
self.lbPrice.text = [NSString stringWithFormat:@"€%.2f",productVariant.price.floatValue];
if (productVariant.compareAtPrice) {
NSString *priceString = [NSString stringWithFormat:@"€%@",productVariant.compareAtPrice.stringValue];
NSString *priceString = [NSString stringWithFormat:@"€%.2f",productVariant.compareAtPrice.floatValue];
NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:priceString attributes:attribtDic];
self.lbOldPrice.attributedText = attribtStr;
......@@ -294,6 +297,7 @@
NSString *colorString = color?[NSString stringWithFormat:@"%@ /",color.title]:@"";
self.lbVariant.text = [NSString stringWithFormat:@"已选择 %@ %@ / %ld",colorString,variant.title,count];
}
[self refreshPrice];
}
- (void)setSizeGuideHidden:(BOOL)sizeGuideHidden {
......
......@@ -497,7 +497,7 @@ static NSString *kEnglishNum = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu
// if(exchageRate == 0){
// exchageRate = ExchangeRate;
// }
CNYstring = [NSString stringWithFormat:@"%.0f",price.floatValue * exchageRate];
CNYstring = [NSString stringWithFormat:@"%.2f",price.floatValue * exchageRate];
// CNYstring = [NSString stringWithFormat:@"%.2f",price.floatValue];
return CNYstring;
......@@ -505,7 +505,7 @@ static NSString *kEnglishNum = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu
+ (NSString *)price:(NSNumber *)price{
NSString *CNYstring = [self getEUR2CNYstring:price];
return [NSString stringWithFormat:@"¥ %@",CNYstring];
return [NSString stringWithFormat:@"CN¥%@",CNYstring];
}
+ (NSArray *)splitArray:(NSArray *)array withSubSize:(NSInteger)subSize{
......
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