Commit 602d2c14 by lee

rm trush fileJ

parent fbd54512
...@@ -342,9 +342,6 @@ ...@@ -342,9 +342,6 @@
C0F5868D1E24F821001248E2 /* SHorizontalView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F5866F1E24F820001248E2 /* SHorizontalView.m */; }; C0F5868D1E24F821001248E2 /* SHorizontalView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F5866F1E24F820001248E2 /* SHorizontalView.m */; };
C0F5868E1E24F821001248E2 /* SSView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F586711E24F820001248E2 /* SSView.m */; }; C0F5868E1E24F821001248E2 /* SSView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F586711E24F820001248E2 /* SSView.m */; };
C0F5868F1E24F821001248E2 /* SVerticalView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F586731E24F820001248E2 /* SVerticalView.m */; }; C0F5868F1E24F821001248E2 /* SVerticalView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F586731E24F820001248E2 /* SVerticalView.m */; };
C0F586951E25C17A001248E2 /* KWMProductDetailVC.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F586941E25C17A001248E2 /* KWMProductDetailVC.m */; };
C0F5869B1E25D05F001248E2 /* KWMProductDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F5869A1E25D05F001248E2 /* KWMProductDetailView.m */; };
C0F5869D1E25D3B6001248E2 /* KWMProductDetailView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0F5869C1E25D3B6001248E2 /* KWMProductDetailView.xib */; };
C0F586AE1E279574001248E2 /* KWMBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0F586AD1E279574001248E2 /* KWMBottomView.xib */; }; C0F586AE1E279574001248E2 /* KWMBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0F586AD1E279574001248E2 /* KWMBottomView.xib */; };
C0FBD88E1F049D510009E375 /* KWMOrderPaid.m in Sources */ = {isa = PBXBuildFile; fileRef = C0FBD88D1F049D510009E375 /* KWMOrderPaid.m */; }; C0FBD88E1F049D510009E375 /* KWMOrderPaid.m in Sources */ = {isa = PBXBuildFile; fileRef = C0FBD88D1F049D510009E375 /* KWMOrderPaid.m */; };
C0FC278E1D9B73B000C5CFFE /* KWMGiftCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C0FC278D1D9B73B000C5CFFE /* KWMGiftCardCell.m */; }; C0FC278E1D9B73B000C5CFFE /* KWMGiftCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C0FC278D1D9B73B000C5CFFE /* KWMGiftCardCell.m */; };
...@@ -966,11 +963,6 @@ ...@@ -966,11 +963,6 @@
C0F586711E24F820001248E2 /* SSView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSView.m; sourceTree = "<group>"; }; C0F586711E24F820001248E2 /* SSView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSView.m; sourceTree = "<group>"; };
C0F586721E24F820001248E2 /* SVerticalView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVerticalView.h; sourceTree = "<group>"; }; C0F586721E24F820001248E2 /* SVerticalView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVerticalView.h; sourceTree = "<group>"; };
C0F586731E24F820001248E2 /* SVerticalView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVerticalView.m; sourceTree = "<group>"; }; C0F586731E24F820001248E2 /* SVerticalView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVerticalView.m; sourceTree = "<group>"; };
C0F586931E25C17A001248E2 /* KWMProductDetailVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMProductDetailVC.h; sourceTree = "<group>"; };
C0F586941E25C17A001248E2 /* KWMProductDetailVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMProductDetailVC.m; sourceTree = "<group>"; };
C0F586991E25D05F001248E2 /* KWMProductDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMProductDetailView.h; sourceTree = "<group>"; };
C0F5869A1E25D05F001248E2 /* KWMProductDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMProductDetailView.m; sourceTree = "<group>"; };
C0F5869C1E25D3B6001248E2 /* KWMProductDetailView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KWMProductDetailView.xib; sourceTree = "<group>"; };
C0F586AD1E279574001248E2 /* KWMBottomView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KWMBottomView.xib; sourceTree = "<group>"; }; C0F586AD1E279574001248E2 /* KWMBottomView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KWMBottomView.xib; sourceTree = "<group>"; };
C0FBD88C1F049D510009E375 /* KWMOrderPaid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMOrderPaid.h; sourceTree = "<group>"; }; C0FBD88C1F049D510009E375 /* KWMOrderPaid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMOrderPaid.h; sourceTree = "<group>"; };
C0FBD88D1F049D510009E375 /* KWMOrderPaid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMOrderPaid.m; sourceTree = "<group>"; }; C0FBD88D1F049D510009E375 /* KWMOrderPaid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMOrderPaid.m; sourceTree = "<group>"; };
...@@ -2165,8 +2157,6 @@ ...@@ -2165,8 +2157,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C0F586421E24F820001248E2 /* Cell */, C0F586421E24F820001248E2 /* Cell */,
C0F586931E25C17A001248E2 /* KWMProductDetailVC.h */,
C0F586941E25C17A001248E2 /* KWMProductDetailVC.m */,
C0F586601E24F820001248E2 /* KWMNewTypeSelectedVC.h */, C0F586601E24F820001248E2 /* KWMNewTypeSelectedVC.h */,
C0F586611E24F820001248E2 /* KWMNewTypeSelectedVC.m */, C0F586611E24F820001248E2 /* KWMNewTypeSelectedVC.m */,
C0F586621E24F820001248E2 /* KWMNewVC.h */, C0F586621E24F820001248E2 /* KWMNewVC.h */,
...@@ -2210,9 +2200,6 @@ ...@@ -2210,9 +2200,6 @@
C0F586551E24F820001248E2 /* KWMNewTypeView.h */, C0F586551E24F820001248E2 /* KWMNewTypeView.h */,
C0F586561E24F820001248E2 /* KWMNewTypeView.m */, C0F586561E24F820001248E2 /* KWMNewTypeView.m */,
C0F586571E24F820001248E2 /* KWMNewTypeView.xib */, C0F586571E24F820001248E2 /* KWMNewTypeView.xib */,
C0F586991E25D05F001248E2 /* KWMProductDetailView.h */,
C0F5869A1E25D05F001248E2 /* KWMProductDetailView.m */,
C0F5869C1E25D3B6001248E2 /* KWMProductDetailView.xib */,
C08827A41E28B4AF006A8B91 /* KWMPageControl.h */, C08827A41E28B4AF006A8B91 /* KWMPageControl.h */,
C08827A51E28B4AF006A8B91 /* KWMPageControl.m */, C08827A51E28B4AF006A8B91 /* KWMPageControl.m */,
C02C7DA41E66B2AE008DC29C /* KWMFilterCell.h */, C02C7DA41E66B2AE008DC29C /* KWMFilterCell.h */,
...@@ -2417,7 +2404,6 @@ ...@@ -2417,7 +2404,6 @@
C0DD533A1EE55190002D1E0C /* KWMSplashView.xib in Resources */, C0DD533A1EE55190002D1E0C /* KWMSplashView.xib in Resources */,
8091DFA31D6E8CCA0020519C /* Guide.storyboard in Resources */, 8091DFA31D6E8CCA0020519C /* Guide.storyboard in Resources */,
80F82E4F1D701F82008B470B /* Brand.storyboard in Resources */, 80F82E4F1D701F82008B470B /* Brand.storyboard in Resources */,
C0F5869D1E25D3B6001248E2 /* KWMProductDetailView.xib in Resources */,
C034E69D1D6AEB12006EE129 /* LaunchScreen.storyboard in Resources */, C034E69D1D6AEB12006EE129 /* LaunchScreen.storyboard in Resources */,
C0A6B3C11F01FC5300D85673 /* KWMProductColorCell.xib in Resources */, C0A6B3C11F01FC5300D85673 /* KWMProductColorCell.xib in Resources */,
C00D40941F187C9500DEA685 /* KWMCategoryTitleView.xib in Resources */, C00D40941F187C9500DEA685 /* KWMCategoryTitleView.xib in Resources */,
...@@ -2573,7 +2559,6 @@ ...@@ -2573,7 +2559,6 @@
C048B8E21EF3C04B000DA7AF /* KWMBeforePayData.m in Sources */, C048B8E21EF3C04B000DA7AF /* KWMBeforePayData.m in Sources */,
C03846941DB89EEB008C3BAB /* KWMCemaroseResult.m in Sources */, C03846941DB89EEB008C3BAB /* KWMCemaroseResult.m in Sources */,
C04834411F13350F00A5BFB4 /* KWMRecommendHeader.m in Sources */, C04834411F13350F00A5BFB4 /* KWMRecommendHeader.m in Sources */,
C0F586951E25C17A001248E2 /* KWMProductDetailVC.m in Sources */,
C0F586871E24F820001248E2 /* KWMNewTypeSelectedVC.m in Sources */, C0F586871E24F820001248E2 /* KWMNewTypeSelectedVC.m in Sources */,
80598D471D99193400BF0F97 /* KWMInformationVC.m in Sources */, 80598D471D99193400BF0F97 /* KWMInformationVC.m in Sources */,
C034E7B91D6B0A8D006EE129 /* KWMHomeVC.m in Sources */, C034E7B91D6B0A8D006EE129 /* KWMHomeVC.m in Sources */,
...@@ -2658,7 +2643,6 @@ ...@@ -2658,7 +2643,6 @@
807806871D7566DD00FD2841 /* NSString+PinYin.m in Sources */, 807806871D7566DD00FD2841 /* NSString+PinYin.m in Sources */,
C034E8511D6B10A0006EE129 /* UIWindow+Launch.m in Sources */, C034E8511D6B10A0006EE129 /* UIWindow+Launch.m in Sources */,
C034E8571D6B10A0006EE129 /* CoreSVP.m in Sources */, C034E8571D6B10A0006EE129 /* CoreSVP.m in Sources */,
C0F5869B1E25D05F001248E2 /* KWMProductDetailView.m in Sources */,
C06665091D75A2E500F02EF4 /* KWMOrderCell.m in Sources */, C06665091D75A2E500F02EF4 /* KWMOrderCell.m in Sources */,
C0DD53141EE54B96002D1E0C /* KWMSearchBrandView.m in Sources */, C0DD53141EE54B96002D1E0C /* KWMSearchBrandView.m in Sources */,
C0CCB3C51EEA5A1100BC2FB8 /* UIView+Prettify.m in Sources */, C0CCB3C51EEA5A1100BC2FB8 /* UIView+Prettify.m in Sources */,
......
//
// KWMProductDetailView.h
// iCemarose
//
// Created by HouWeiBin on 2017/1/11.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "Buy/Buy.h"
@protocol KWMProductDetailViewDelegate <NSObject>
- (void)kwm_onClickImage:(NSMutableArray *)imageArr currentIndex:(NSInteger)currentIndex;
- (void)kwm_onClickInformation;
- (void)kwm_onClickSizeBtn;
- (void)kwm_goToBrandVC;
- (void)kwm_onClickSizeGuide;
@end
@interface KWMProductDetailView : UIView
@property (weak, nonatomic) id<KWMProductDetailViewDelegate>delegate;
@property (weak, nonatomic) IBOutlet UIButton *sizeGuide;
-(void)setData:(BUYProduct *)product;
@end
//
// KWMProductDetailView.m
// iCemarose
//
// Created by HouWeiBin on 2017/1/11.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "KWMProductDetailView.h"
#import "KWMImageUtil.h"
#import "KWMStringUtil.h"
#import "KWMPageControl.h"
#import "YYWebImage/YYWebImage.h"
@interface KWMProductDetailView ()<UIScrollViewDelegate>
@property(nonatomic,weak) IBOutlet UIView *vView;
@property(nonatomic,weak) IBOutlet UIScrollView *imageScrollView;
@property(nonatomic,weak) IBOutlet UIButton *btnBrand;
@property(nonatomic,weak) IBOutlet UILabel *lbName;
@property(nonatomic,weak) IBOutlet UILabel *lbPrice;
@property(nonatomic,weak) IBOutlet UILabel *lbOldPrice;
@property(nonatomic,weak) IBOutlet UILabel *lbDetail;
//单位label
@property(nonatomic,weak) IBOutlet UILabel *lbUnit;
@property(nonatomic,weak) IBOutlet KWMPageControl *pageControl;
@property (nonatomic) BUYProduct *product;
@property (nonatomic) NSMutableArray *imageArr;
@property (nonatomic) NSTimer *timer;
@property (nonatomic) BOOL isFirstScroll;
@property (nonatomic) BOOL isShowCNY;
- (IBAction)onClickSizeBtn:(id)sender;
- (IBAction)onClickInformationBtn:(id)sender;
- (IBAction)onClickBlandBtn:(id)sender;
@end
@implementation KWMProductDetailView
- (id)init{
if (self=[super init]){
[self addView];
}
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[self addView];
}
return self;
}
-(instancetype)initWithFrame:(CGRect)frame{
if (self =[super initWithFrame:frame]) {
[self addView];
}
return self;
}
-(void)awakeFromNib{
[super awakeFromNib];
}
-(void) addView{
[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class])
owner:self
options:nil];
NSLog(@"KWMProductDetailView%f%f",self.frame.size.width,self.frame.size.height);
self.vView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
[self addSubview:self.vView];
}
-(void) addTimer{
if ([self.timer isValid]) {
return;
}
self.timer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(doTimer) userInfo:nil repeats:YES];
[self.timer setFireDate:[NSDate new]];//开启
}
-(void) removeTimer{
//结束
if ([self.timer isValid]) {
[self.timer invalidate];
self.timer = nil;
}
}
//开始计时
-(void) doTimer{
if (self.isFirstScroll) {
self.isFirstScroll = NO;
return;
}
NSInteger currentIndex = self.pageControl.currentPage;
currentIndex ++;
currentIndex = currentIndex % self.pageControl.numberOfPages;
[self.imageScrollView setContentOffset:CGPointMake(UI_SCREEN_WIDTH * currentIndex, 0) animated:YES];
self.pageControl.currentPage = currentIndex;
}
-(void)setData:(BUYProduct *)product{
if(product == nil){
return;
}
self.isShowCNY = YES;
self.isFirstScroll = YES;
[self removeTimer];
self.product = product;
self.imageScrollView.delegate = self;
[self.imageScrollView setContentOffset:CGPointMake(0, 0) animated:NO];
for (UIView *subview in self.imageScrollView.subviews) {
[subview removeFromSuperview];
}
[self initImage:product];
[self initView:product];
//[self addTimer];
}
-(void)initImage:(BUYProduct *)product{
if(product == nil){
return;
}
NSInteger imageCount = product.imagesArray == nil? 0:product.imagesArray.count;
self.imageArr = [NSMutableArray array];
CGFloat w = UI_SCREEN_WIDTH;
CGFloat h = UI_SCREEN_WIDTH;
for( int i =0;i < imageCount;i++){
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(i*w, 0, w, h)];
imageView.tag = i;
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.clipsToBounds = YES;
NSString *imageUrl = [KWMImageUtil getProductImageUrlByPosition:self.product ImageSize:BigImage Position:i];
[self.imageArr addObject:imageUrl];
NSURL *imageURL = [NSURL URLWithString:imageUrl];
UITapGestureRecognizer *imageTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onClickImage:)];
imageView.userInteractionEnabled = YES;
[imageView addGestureRecognizer:imageTap];
if(i + 1 == imageCount){
[imageView yy_setImageWithURL:imageURL placeholder:nil options:YYWebImageOptionProgressive completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
if(image && !error){
[self performSelector:@selector(addTimer) withObject:nil afterDelay:0.5f];
}
}];
}else{
[imageView yy_setImageWithURL:imageURL options:YYWebImageOptionProgressive];
}
[self.imageScrollView addSubview:imageView];
}
self.pageControl.numberOfPages = imageCount;
self.pageControl.currentPage = 0;
// [self.pageControl setValue:[UIImage imageNamed:@"ic_page_2"] forKey:@"_currentPageImage"];
// [self.pageControl setValue:[UIImage imageNamed:@"ic_page_1"] forKey:@"_pageImage"];
self.pageControl.defaultImage = [UIImage imageNamed:@"ic_page_1"];
self.pageControl.currentImage = [UIImage imageNamed:@"ic_page_2"];
self.imageScrollView.contentSize = CGSizeMake(w*imageCount,0);
self.imageScrollView.pagingEnabled = YES;
}
-(void)initView:(BUYProduct *)product{
if(product == nil){
return;
}
[self.btnBrand setTitle:product.vendor forState:UIControlStateNormal];
self.lbName.text = product.title;
BUYProductVariant *productVariant= product.variants.firstObject;
// 2017-06-30 暂时注释
// NSAttributedString *detailAttr = [[NSAttributedString alloc] initWithData:[self.product.htmlDescription dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
// self.lbDetail.attributedText = detailAttr;
// self.lbPrice.text = [KWMStringUtil getEUR2CNYstring:productVariant.price];
self.lbPrice.text = productVariant.price.priceValueFormatted;
if (productVariant.compareAtPrice) {
// NSString *priceString = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:productVariant.compareAtPrice]];
NSString *priceString = productVariant.compareAtPrice.priceValueFormatted;
NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:priceString attributes:attribtDic];
self.lbOldPrice.attributedText = attribtStr;
}else{
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;
}
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
NSInteger index = fabs(scrollView.contentOffset.x)/scrollView.frame.size.width;
[self.pageControl setCurrentPage:index];
}
-(void)onClickImage:(UITapGestureRecognizer *)tapGesture{
if(self.delegate!=nil){
UIView *view = [tapGesture view];
[self.delegate kwm_onClickImage:self.imageArr currentIndex:view.tag];
}
}
-(void)onClickPrice:(UITapGestureRecognizer *)tapGesture{
// if(self.product == nil){
// return;
// }
// self.isShowCNY = !self.isShowCNY;
// BUYProductVariant *productVariant= self.product.variants.firstObject;
// if(self.isShowCNY){
// self.lbUnit.text = @"¥";
//// self.lbPrice.text = [KWMStringUtil getEUR2CNYstring:productVariant.price];
// self.lbPrice.text = productVariant.price.priceValueFormatted;
// if (productVariant.compareAtPrice) {
//// NSString *priceString = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:productVariant.compareAtPrice]];
// NSString *priceString = productVariant.compareAtPrice.priceValueFormatted;
// 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;
// if (productVariant.compareAtPrice) {
// NSString *priceString = [NSString stringWithFormat:@"€%@",productVariant.compareAtPrice.stringValue];
// NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
// NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:priceString attributes:attribtDic];
// self.lbOldPrice.attributedText = attribtStr;
// }
// }
}
-(void)onClickSizeBtn:(id)sender{
if(self.delegate!=nil){
[self.delegate kwm_onClickSizeBtn];
}
}
-(void)onClickBlandBtn:(id)sender{
if(self.delegate!=nil){
[self.delegate kwm_goToBrandVC];
}
}
-(void)onClickInformationBtn:(id)sender{
if(self.delegate!=nil){
[self.delegate kwm_onClickInformation];
}
}
- (IBAction)openSizeGuide:(id)sender {
[self.delegate kwm_onClickSizeGuide];
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.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="12088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWMProductDetailView">
<connections>
<outlet property="btnBrand" destination="s6N-a3-C4Z" id="ips-Jp-qG3"/>
<outlet property="imageScrollView" destination="h8J-3U-wMB" id="MbO-M3-YVy"/>
<outlet property="lbDetail" destination="RNK-se-cgR" id="ASL-LJ-BW0"/>
<outlet property="lbName" destination="SQm-rY-OyA" id="Fux-pg-fca"/>
<outlet property="lbOldPrice" destination="Mql-V1-hiE" id="Sh1-Fz-sfU"/>
<outlet property="lbPrice" destination="gpT-Sg-ghu" id="FGd-AA-Yiv"/>
<outlet property="lbUnit" destination="wfT-JC-g9d" id="MSn-kd-aQ2"/>
<outlet property="pageControl" destination="M6v-TN-2WE" id="QPe-TI-LdG"/>
<outlet property="sizeGuide" destination="EM9-Ay-Qxk" id="4Dh-eU-qhb"/>
<outlet property="vView" destination="iN0-l3-epB" id="TQD-W9-jEg"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1H6-J2-jj4" userLabel="vContent">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lKe-L4-ROK" userLabel="vTop">
<rect key="frame" x="0.0" y="0.0" width="375" height="447"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h8J-3U-wMB">
<rect key="frame" x="0.0" y="36" width="375" height="375"/>
<constraints>
<constraint firstAttribute="width" secondItem="h8J-3U-wMB" secondAttribute="height" multiplier="1:1" id="xTw-hD-9tf"/>
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="h8J-3U-wMB" firstAttribute="centerY" secondItem="lKe-L4-ROK" secondAttribute="centerY" id="ZGl-tQ-ba8"/>
<constraint firstAttribute="trailing" secondItem="h8J-3U-wMB" secondAttribute="trailing" id="meb-bD-9hK"/>
<constraint firstItem="h8J-3U-wMB" firstAttribute="leading" secondItem="lKe-L4-ROK" secondAttribute="leading" id="snn-ZQ-b7q"/>
</constraints>
</view>
<pageControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" numberOfPages="3" translatesAutoresizingMaskIntoConstraints="NO" id="M6v-TN-2WE" customClass="KWMPageControl">
<rect key="frame" x="168" y="447" width="39" height="10"/>
<constraints>
<constraint firstAttribute="height" constant="10" id="n7t-N5-xKa"/>
</constraints>
</pageControl>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ymw-Cg-156" userLabel="vBottom">
<rect key="frame" x="0.0" y="457" width="375" height="210"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iJa-Oj-Sd2">
<rect key="frame" x="0.0" y="0.0" width="375" height="130"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s6N-a3-C4Z">
<rect key="frame" x="21" y="0.0" width="333" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="Toj-nJ-jse"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Light" family="PingFang SC" pointSize="21"/>
<state key="normal" title=" ">
<color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="onClickBlandBtn:" destination="-1" eventType="touchUpInside" id="MTC-eM-zpB"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SQm-rY-OyA">
<rect key="frame" x="21" y="34.5" width="333" height="24"/>
<fontDescription key="fontDescription" name="PingFangSC-Light" family="PingFang SC" pointSize="17"/>
<color key="textColor" red="0.30588235294117649" green="0.30588235294117649" blue="0.30588235294117649" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wfT-JC-g9d">
<rect key="frame" x="21" y="66" width="9" height="21"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="15"/>
<color key="textColor" red="0.94509803921568625" green="0.5725490196078431" blue="0.60392156862745094" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gpT-Sg-ghu">
<rect key="frame" x="20" y="62" width="27" height="28"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="20"/>
<color key="textColor" red="0.94509803921568625" green="0.5725490196078431" blue="0.60392156862745094" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥ " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mql-V1-hiE">
<rect key="frame" x="55" y="68.5" width="25.5" height="18.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" red="0.30588235294117649" green="0.30588235294117649" blue="0.30588235294117649" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RNK-se-cgR" userLabel="商品详细">
<rect key="frame" x="21" y="98" width="100" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="UV7-x8-5Ft"/>
<constraint firstAttribute="width" constant="100" id="y6W-y1-HsD"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<color key="textColor" red="0.15294117647058825" green="0.14901960784313725" blue="0.21176470588235294" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="asI-Rf-ZXG">
<rect key="frame" x="281" y="93.5" width="68" height="29"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<state key="normal" title="发货与退货 ">
<color key="titleColor" red="0.15294117647058825" green="0.14901960784313725" blue="0.21176470588235294" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="onClickInformationBtn:" destination="-1" eventType="touchUpInside" id="4mR-gG-0FF"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DbC-Os-2e9">
<rect key="frame" x="349" y="97.5" width="7" height="22"/>
<state key="normal" image="button_mine_more"/>
<connections>
<action selector="onClickInformationBtn:" destination="-1" eventType="touchUpInside" id="XW1-UB-w3S"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EM9-Ay-Qxk">
<rect key="frame" x="21" y="94" width="48" height="29"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<state key="normal" title="尺码指南">
<color key="titleColor" red="0.1529411765" green="0.14901960780000001" blue="0.21176470589999999" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="openSizeGuide:" destination="-1" eventType="touchUpInside" id="NXp-bD-VUT"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="gpT-Sg-ghu" firstAttribute="bottom" secondItem="wfT-JC-g9d" secondAttribute="bottom" constant="3" id="0gt-hJ-gW7"/>
<constraint firstItem="Mql-V1-hiE" firstAttribute="leading" secondItem="gpT-Sg-ghu" secondAttribute="trailing" constant="8" id="2kJ-k6-7uE"/>
<constraint firstAttribute="trailing" secondItem="DbC-Os-2e9" secondAttribute="trailing" constant="19" id="3Gy-6z-Jli"/>
<constraint firstAttribute="trailing" secondItem="s6N-a3-C4Z" secondAttribute="trailing" constant="21" id="BH6-4A-Psp"/>
<constraint firstItem="asI-Rf-ZXG" firstAttribute="centerY" secondItem="EM9-Ay-Qxk" secondAttribute="centerY" id="Bx2-7F-7xQ"/>
<constraint firstItem="RNK-se-cgR" firstAttribute="leading" secondItem="iJa-Oj-Sd2" secondAttribute="leading" constant="21" id="HHm-2W-PD5"/>
<constraint firstItem="Mql-V1-hiE" firstAttribute="bottom" secondItem="wfT-JC-g9d" secondAttribute="bottom" id="LwR-CA-mq2"/>
<constraint firstItem="s6N-a3-C4Z" firstAttribute="leading" secondItem="iJa-Oj-Sd2" secondAttribute="leading" constant="21" id="Qm4-Ii-IA5"/>
<constraint firstItem="SQm-rY-OyA" firstAttribute="top" secondItem="s6N-a3-C4Z" secondAttribute="bottom" constant="4.5" id="TVX-ig-tsH"/>
<constraint firstItem="DbC-Os-2e9" firstAttribute="centerY" secondItem="RNK-se-cgR" secondAttribute="centerY" id="VPI-Ze-aTr"/>
<constraint firstItem="DbC-Os-2e9" firstAttribute="leading" secondItem="asI-Rf-ZXG" secondAttribute="trailing" id="YDX-0r-4eX"/>
<constraint firstItem="s6N-a3-C4Z" firstAttribute="top" secondItem="iJa-Oj-Sd2" secondAttribute="top" id="YxU-Rv-XEv"/>
<constraint firstItem="wfT-JC-g9d" firstAttribute="leading" secondItem="iJa-Oj-Sd2" secondAttribute="leading" constant="21" id="ZU3-uY-xmf"/>
<constraint firstAttribute="trailing" secondItem="SQm-rY-OyA" secondAttribute="trailing" constant="21" id="dX6-4X-Blu"/>
<constraint firstItem="wfT-JC-g9d" firstAttribute="top" secondItem="SQm-rY-OyA" secondAttribute="bottom" constant="7.5" id="gcI-jU-lhJ"/>
<constraint firstAttribute="height" constant="130" id="nLX-8H-mni"/>
<constraint firstItem="SQm-rY-OyA" firstAttribute="leading" secondItem="iJa-Oj-Sd2" secondAttribute="leading" constant="21" id="njb-yV-RRh"/>
<constraint firstItem="gpT-Sg-ghu" firstAttribute="leading" secondItem="wfT-JC-g9d" secondAttribute="trailing" constant="-10" id="o9j-pp-GRZ"/>
<constraint firstItem="asI-Rf-ZXG" firstAttribute="centerY" secondItem="RNK-se-cgR" secondAttribute="centerY" id="pfI-QQ-uu0"/>
<constraint firstItem="RNK-se-cgR" firstAttribute="top" secondItem="gpT-Sg-ghu" secondAttribute="bottom" constant="8" id="pjQ-9v-2rS"/>
<constraint firstItem="EM9-Ay-Qxk" firstAttribute="leading" secondItem="iJa-Oj-Sd2" secondAttribute="leading" constant="21" id="rJ1-DF-mLV"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="urC-7Y-7AI">
<rect key="frame" x="20" y="145" width="335" height="50"/>
<color key="backgroundColor" red="0.14117647058823529" green="0.14117647058823529" blue="0.14117647058823529" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="6Yk-Bk-8ri"/>
</constraints>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="15"/>
<state key="normal" title="选择我的尺码">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="onClickSizeBtn:" destination="-1" eventType="touchUpInside" id="rSj-Tb-ddv"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="urC-7Y-7AI" secondAttribute="trailing" constant="20" id="1pJ-nV-TQC"/>
<constraint firstAttribute="trailing" secondItem="iJa-Oj-Sd2" secondAttribute="trailing" id="8a6-sG-pwj"/>
<constraint firstItem="urC-7Y-7AI" firstAttribute="top" secondItem="iJa-Oj-Sd2" secondAttribute="bottom" constant="15" id="Esv-ho-R0c"/>
<constraint firstItem="urC-7Y-7AI" firstAttribute="leading" secondItem="Ymw-Cg-156" secondAttribute="leading" constant="20" id="Lo5-UN-aGU"/>
<constraint firstItem="iJa-Oj-Sd2" firstAttribute="top" secondItem="Ymw-Cg-156" secondAttribute="top" id="Vl5-q8-AzT"/>
<constraint firstAttribute="bottom" secondItem="urC-7Y-7AI" secondAttribute="bottom" constant="15" id="amK-Hd-VFe"/>
<constraint firstItem="iJa-Oj-Sd2" firstAttribute="leading" secondItem="Ymw-Cg-156" secondAttribute="leading" id="hhQ-sM-yEW"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Ymw-Cg-156" firstAttribute="top" secondItem="M6v-TN-2WE" secondAttribute="bottom" id="5Y0-G8-3We"/>
<constraint firstAttribute="trailing" secondItem="Ymw-Cg-156" secondAttribute="trailing" id="6Mc-RC-ip7"/>
<constraint firstItem="M6v-TN-2WE" firstAttribute="top" secondItem="lKe-L4-ROK" secondAttribute="bottom" id="6oL-sd-1s7"/>
<constraint firstItem="lKe-L4-ROK" firstAttribute="top" secondItem="1H6-J2-jj4" secondAttribute="top" id="MVZ-Po-h2C"/>
<constraint firstAttribute="bottom" secondItem="Ymw-Cg-156" secondAttribute="bottom" id="Mef-7q-yrb"/>
<constraint firstItem="lKe-L4-ROK" firstAttribute="leading" secondItem="1H6-J2-jj4" secondAttribute="leading" id="bsW-GL-chq"/>
<constraint firstAttribute="trailing" secondItem="lKe-L4-ROK" secondAttribute="trailing" id="h7C-hB-wS6"/>
<constraint firstItem="Ymw-Cg-156" firstAttribute="leading" secondItem="1H6-J2-jj4" secondAttribute="leading" id="kHl-jZ-gRA"/>
<constraint firstItem="M6v-TN-2WE" firstAttribute="centerX" secondItem="1H6-J2-jj4" secondAttribute="centerX" id="mmR-Qc-1vL"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="1H6-J2-jj4" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="Vwo-SW-Wdm"/>
<constraint firstAttribute="bottom" secondItem="1H6-J2-jj4" secondAttribute="bottom" id="keW-PS-saN"/>
<constraint firstAttribute="trailing" secondItem="1H6-J2-jj4" secondAttribute="trailing" id="t8x-Nz-EbA"/>
<constraint firstItem="1H6-J2-jj4" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="yGK-Vx-7gu"/>
</constraints>
<point key="canvasLocation" x="128.5" y="74.5"/>
</view>
</objects>
<resources>
<image name="button_mine_more" width="7" height="14"/>
</resources>
</document>
////
//// KWMProductDetailVC.h
//// iCemarose
////
//// Created by HouWeiBin on 2017/1/11.
//// Copyright © 2017年 kollway. All rights reserved.
////
//
//#import "KWMBaseVC.h"
//
//@interface KWMProductDetailVC : KWMBaseVC
//
//@property (nonatomic) BUYProduct *product;
//
//@property (nonatomic) NSNumber *productId;
//
///**
// * SKU 人为定义的SKU
// */
//@property (nonatomic) NSString *handle;
//
//@end
////
//// KWMProductDetailVC.m
//// iCemarose
////
//// Created by HouWeiBin on 2017/1/11.
//// Copyright © 2017年 kollway. All rights reserved.
////
//
//#import "KWMNewProductVC.h"
//#import "KWMProductDetailView.h"
//#import "KWMBottomView.h"
//#import "KWMUserModel.h"
//#import "PhotoBroswerVC.h"
//#import "KWMStringUtil.h"
//#import "KWMShopCartData.h"
//#import "KWMInformationVC.h"
//#import "KWMBrandCaramelVC.h"
//#import "KWMSelectSizeVC.h"
//#import "KWMShopCartVC.h"
//#import "KWMBeforePayVC.h"
//#import "KWMLoginVC.h"
//#import "MZFormSheetPresentationViewController.h"
//#import "KWMShareVC.h"
//#import "KWMImageUtil.h"
//#import "KWMShoppingCart.h"
//#import <RegexKitLite/RegexKitLite.h>
//#import <TOWebViewController/TOWebViewController.h>
//#import <AFNetworking/AFNetworking.h>
//#import <TOWebViewController/NJKWebViewProgress.h>
//#import <PPNetworkHelper/PPNetworkHelper.h>
//
//
//@interface KWMProductDetailVC ()<KWMBottomViewDelegate,KWMProductDetailViewDelegate,KWMSelectSizeVCDelegate,UIScrollViewDelegate>
//
//@property (weak, nonatomic) IBOutlet UIScrollView *svContent;
//
//@property (nonatomic) KWMProductDetailView *productDetailView;
//
//@property (nonatomic) KWMBottomView *recommendView;
//
//@property (nonatomic) BUYCollection *collectionSameType;
//
//@property (nonatomic) BUYCollection *collectionSameBrand;
//
//@property (nonatomic) NSString *typeTag;
//
//@property (weak, nonatomic) IBOutlet UIButton *btnShopCart;
//
//@property (weak, nonatomic) IBOutlet UIButton *btnShare;
//
//- (IBAction)onClickBackBtn:(id)sender;
//
//- (IBAction)onClickShopCartBtn:(id)sender;
//
//- (IBAction)onClickShare:(id)sender;
//
//@end
//
//@implementation KWMProductDetailVC
//
//- (void)viewDidLoad {
// [super viewDidLoad];
// [self initScrollView];
// [self initRecommendProduct];
//// [self initShopCartCount];
// //刷新product,如果是缓存的product,因为没有字典,所以会发生错误,需要重新请求一个有字典的product
// if(self.handle || (self.product && self.product.identifier && !self.product.JSONDictionary)){
// [self getProductBy:nil product:self.product];
// }
// NSArray *types = @[@"baby",@"girls",@"boys",@"shoes",@"newborn"];
// for (NSString *tag in self.product.tags) {
// if ([types containsObject:tag.lowercaseString]) {
// self.typeTag = tag.lowercaseString;
// break;
// }
// }
// if (!self.typeTag) {
// self.productDetailView.sizeGuide.hidden = YES;
// }
//}
//
//- (BOOL)prefersStatusBarHidden {
// return YES;
//}
//
//- (void)viewWillAppear:(BOOL)animated{
// [super viewWillAppear:animated];
// [self.navigationController setNavigationBarHidden:YES animated:YES];
// [self initShopCartCount];
//}
//
//- (void)viewWillDisappear:(BOOL)animated{
// [super viewWillDisappear:animated];
// [self.navigationController setNavigationBarHidden:NO animated:YES];
//}
//
//- (void)initScrollView{
// CGFloat w = UI_SCREEN_WIDTH;
// CGFloat h = UI_SCREEN_HEITHT-60;
// for (int i = 0;i < 2;i++){
// if(i == 0){
// self.productDetailView = [[KWMProductDetailView alloc] init];
// self.productDetailView.frame = CGRectMake(i*w, 0, w, h);
// self.productDetailView.delegate = self;
// [self.svContent addSubview:self.productDetailView];
// [self.productDetailView setData:self.product];
// }else{
// self.recommendView = [[KWMBottomView alloc] init];
// self.recommendView.frame = CGRectMake(i*w, 0, w, h);
// self.recommendView.delegate = self;
// [self.svContent addSubview:self.recommendView];
// }
// }
// self.svContent.delegate = self;
// self.svContent.contentSize = CGSizeMake(w*2,0);
// self.svContent.pagingEnabled = YES;
// if(self.product && self.product.imagesArray && self.product.imagesArray.count>0){
// NSInteger imageCount = self.product.imagesArray.count;
// [self.recommendView setCount:imageCount];
// }
//}
//
//- (void)kwm_onClickSizeGuide {
//
// NSString *brand = [self.product.vendor stringByReplacingOccurrencesOfRegex:@"\\s*\\W\\s*" withString:@"-"].lowercaseString;
// NSString *baseUrl = @"http://www.cemarose.cn/pages/";
// NSString *url= [NSString stringWithFormat:@"%@%@-size-guide-%@",baseUrl,brand,self.typeTag];
// NSLog(@"size guide url: %@",url);
//// TOWebViewController *wv = [[TOWebViewController alloc] initWithURLString:url];
// TOWebViewController *wv = [[TOWebViewController alloc] init];
// __unused id _ = wv.view;
// wv.showPageTitles = NO;
// wv.title = @"Size Guide";
// wv.navigationButtonsHidden = YES;
//// AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
////// manager.responseSerializer = [AFXMLParserResponseSerializer serializer];
//// manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//// manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html", nil];
//// [manager GET:url parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) {
////// NJKWebViewProgress *wvp = [vc valueForKeyPath:@"progressManager"];
////// [wvp.progressDelegate webViewProgress:wvp updateProgress:downloadProgress.fractionCompleted];
//// } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
//// NSString *body = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
//// body = [body stringByReplacingOccurrencesOfRegex:@"<meta[\\w\\W]*?/?>" withString:@""];
//// body = [body stringByReplacingOccurrencesOfRegex:@"<script[\\w\\W]*?</script>" withString:@""];
//// body = [body stringByReplacingOccurrencesOfRegex:@"<header[\\w\\W]*?</header>" withString:@""];
//// body = [body stringByReplacingOccurrencesOfRegex:@"<footer[\\w\\W]*?</footer>" withString:@""];
//// body = [body stringByReplacingOccurrencesOfRegex:@"<head>" withString:@"<head><meta name=\"viewport\" content=\"width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no\" /><style type='text/css'>"
//// @".page-title h1.label{font-size:17px;}"
//// @".rte.text-content td{padding-left:10px;}"
//// @"</style>"];
//// [wv.webView loadHTMLString:body baseURL:[NSURL URLWithString:baseUrl]];
//// } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
//// }];
// void(^success)(id) = ^(id body){
// if (!body) {
// return;
// }
// body = [[NSString alloc] initWithData:body encoding:NSUTF8StringEncoding];
// body = [body stringByReplacingOccurrencesOfRegex:@"<meta[\\w\\W]*?/?>" withString:@""];
// body = [body stringByReplacingOccurrencesOfRegex:@"<script[\\w\\W]*?</script>" withString:@""];
// body = [body stringByReplacingOccurrencesOfRegex:@"<header[\\w\\W]*?</header>" withString:@""];
// body = [body stringByReplacingOccurrencesOfRegex:@"<footer[\\w\\W]*?</footer>" withString:@""];
// body = [body stringByReplacingOccurrencesOfRegex:@"<head>" withString:@"<head><meta name=\"viewport\" content=\"width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no\" /><style type='text/css'>"
// @".page-title h1.label{font-size:17px;}"
// @".rte.text-content td{padding-left:10px;}"
// @"</style>"];
// [wv.webView loadHTMLString:body baseURL:[NSURL URLWithString:baseUrl]];
//
// };
//
// __weak typeof(self) this = self;
// [PPNetworkHelper setAFHTTPSessionManagerProperty:^(AFHTTPSessionManager *sessionManager) {
// sessionManager.responseSerializer = [AFHTTPResponseSerializer serializer];
// sessionManager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html", nil];
// }];
// [PPNetworkHelper GET:url parameters:nil responseCache:success success:success failure:^(NSError *error) {
// [this showError:error];
// }];
// [self.navigationController pushViewController:wv animated:YES];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(200 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^{
// NJKWebViewProgress *wvp = [wv valueForKeyPath:@"progressManager"];
// [wvp.progressDelegate webViewProgress:wvp updateProgress:0.1];
// });
//
//
//}
//
//-(void)onClickBackBtn:(id)sender{
// [self.navigationController popViewControllerAnimated:YES];
//}
//
//-(void)onClickShopCartBtn:(id)sender{
// KWMShopCartVC *shopCartVC = (KWMShopCartVC *)[KWMBaseVC findControllerBy:[KWMShopCartVC kwmTag] fromStoryboard:@"ShopCart"];
// [self.navigationController pushViewController:shopCartVC animated:YES];
//}
//
//-(void)onClickShare:(id)sender{
// if(!self.product){
// return;
// }
// KWMShareVC *shareVC = (KWMShareVC *)[KWMBaseVC findControllerBy:[KWMShareVC kwmTag] fromStoryboard:@"New"];
// CGSize size = [UIScreen mainScreen].bounds.size;
// [self showPresentation:shareVC size:size tapOutsideClose:YES style:MZFormSheetPresentationTransitionStyleFade];
// shareVC.shareUrl = [NSString stringWithFormat:@"https://www.cemarose.com/products/%@",self.product.handle];
// shareVC.imageUrl = [KWMImageUtil getProductImageUrl:self.product ImageSize:SmallImage];
// shareVC.productName = self.product.title;
//}
//
//- (void)initShopCartCount{
// NSNumber *count = [[KWMShoppingCart sharedInstance] count];
// [self.btnShopCart setTitle:count.stringValue forState:UIControlStateNormal];
//}
//
//- (void)setProductId:(NSNumber *)productId{
// _productId = productId;
// [self getProductBy:self.productId product:nil];
//}
//
////KWMProductDetailViewDelegate
//-(void)kwm_onClickImage:(NSMutableArray *)imageArr currentIndex:(NSInteger)currentIndex{
// //避免循环引用
// __weak KWMProductDetailVC *weakSelf=self;
// NSArray<NSString *> *imags = imageArr;
// [PhotoBroswerVC show:self type:PhotoBroswerVCTypePush index:currentIndex isShowSaveBtn:YES photoModelBlock:^NSArray *{
// NSArray *localImages = imags;
// NSMutableArray *modelsM = [NSMutableArray arrayWithCapacity:localImages.count];
// for (NSUInteger i = 0; i< localImages.count; i++) {
// PhotoModel *pbModel=[[PhotoModel alloc] init];
// pbModel.mid = i + 1;
// //源frame
// UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, weakSelf.view.frame.size.width, weakSelf.view.frame.size.height)];
// pbModel.sourceImageView = imageV;
// pbModel.image_HD_U = [[KWMAPIManager sharedManager] toAbsoluteUrl:localImages[i]];
// [modelsM addObject:pbModel];
// }
// return modelsM;
// }];
//}
//
//-(void)kwm_onClickInformation{
// KWMInformationVC *informationVC = (KWMInformationVC *)[KWMBaseVC findControllerBy:[KWMInformationVC kwmTag] fromStoryboard:@"Main"];
// informationVC.inforStr = NSLocalizedString(@"getAndReturnGoods",@"getAndReturnGoods");
// informationVC.inforTitleStr = NSLocalizedString(@"getAndReturnGoodsTitle",@"getAndReturnGoodsTitle");
// informationVC.titleStr = @"发货与退货";
// [self.navigationController pushViewController:informationVC animated:YES];
//}
//
//-(void)kwm_onClickSizeBtn{
// KWMSelectSizeVC *editVC = (KWMSelectSizeVC *)[KWMBaseVC findControllerBy:[KWMSelectSizeVC kwmTag] fromStoryboard:@"ShopCart"];
// editVC.delegate = self;
// editVC.product = self.product;
//
//// NSDictionary *shopCartDict = self.product.JSONDictionary;
// editVC.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0];
// editVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
// editVC.providesPresentationContextTransitionStyle = YES;
// editVC.definesPresentationContext = YES;
// [self presentViewController:editVC animated:YES completion:nil];
//}
//
//-(void)kwm_goToBrandVC{
// if(self.product && self.product.vendor){
// KWMBrandCaramelVC *brandCaramelVC = (KWMBrandCaramelVC *)[KWMBrandCaramelVC findControllerBy:[KWMBrandCaramelVC kwmTag] fromStoryboard:@"Brand"];
// NSString *brand = self.product.vendor;
// brandCaramelVC.brand = brand;
// brandCaramelVC.handle = [KWMStringUtil deleteOtherCharExceptLetterWithLine:brand];
// brandCaramelVC.isSale = NO;
// [self.navigationController pushViewController:brandCaramelVC animated:YES];
// }
//}
//
////KWMBottomViewDelegate
//-(void)kwm_loadNewPage:(BOOL)isSameBrand{
// if(isSameBrand && self.collectionSameBrand!=nil){
// [self requestProducts:self.collectionSameBrand.identifier isSameBrand:isSameBrand];
// }else if(self.collectionSameType!=nil){
// [self requestProducts:self.collectionSameType.identifier isSameBrand:isSameBrand];
// }
//}
//
//-(void)kwm_clickCollectionCell:(BUYProduct *)product{
// if(product == nil){
// return;
// }
// self.product = product;
// [self.productDetailView setData:product];
// [self.svContent setContentOffset:CGPointMake(0, 0) animated:YES];
// if(self.product && self.product.imagesArray && self.product.imagesArray.count>0){
// NSInteger imageCount = self.product.imagesArray.count;
// [self.recommendView setCount:imageCount];
// }
// [self initRecommendProduct];
//}
//
//#pragma mark - KWMSelectSizeVCDelegate
//
//- (void)kwm_addShopWithVariantId:(NSNumber *)identifier quantity:(NSInteger)quantity variant:(BUYProductVariant *) variant buyNow:(BOOL)buyNow callback:(void (^)(BOOL))callback {
// __weak KWMProductDetailVC *this = self;
// if (!buyNow) {
// [[KWMShoppingCart sharedInstance] increaseProductWithVariantId:identifier quantity:quantity callback:^(NSError *error, KWMCartResult *cart) {
// if (cart.items.firstObject && !cart.items.firstObject.product_id) {
// KWMShopCartModel *model = cart.items.firstObject;
// BUYImageLink *il = this.product.images.firstObject;
//// model.imageStr = [KWMImageUtil getProductImageUrl:this.product.identifier ImageSize:NormalImage];
// model.imageStr = [KWMImageUtil getProductImageUrlByOriginalUrl:il.sourceURL.absoluteString ImageSize:NormalImage];
// model.name = this.product.title;
// model.brand = this.product.vendor;
// model.size = variant.title;
//// model.price = variant.price.floatValue;
// model.price = variant.price;
// model.product_id = this.product.identifier;
// }
// if (!error) {
// [this showToast:@"添加成功"];
// [this.btnShopCart setTitle:cart.item_count.stringValue forState:UIControlStateNormal];
// callback(YES);
// }else{
// [this showError:error];
// callback(NO);
// }
// }];
// return;
// }
// callback(YES);
// KWMUserModel *useModel = [KWMUserModel shareUser];
// if (!useModel.status) {
// //登录
// KWMLoginVC *loginVc = (KWMLoginVC *)[KWMBaseVC findControllerBy:[KWMLoginVC kwmTag] fromStoryboard:@"Login"];
// UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:loginVc];
// [self presentViewController:nav animated:YES completion:nil];
// return;
// }
// [self showLoading];
// [self.api tmpCartWithVariantId:identifier quantity:quantity success:^(NSURLSessionDataTask *task, NSString *cartCookie) {
// [this hideLoading];
// KWMBeforePayVC *beforePayVC = (KWMBeforePayVC *)[KWMBaseVC findControllerBy:[KWMBeforePayVC kwmTag] fromStoryboard:@"ShopCart"];
// beforePayVC.cartCookie = cartCookie;
// [this.navigationController pushViewController:beforePayVC animated:YES];
// } failure:^(NSURLSessionDataTask *task, NSError *error) {
// [this showError:error];
// }];
//
//}
//
//////KWMSelectSizeVCDelegate
////-(void)kwm_addShopCartItem:(KWMShopCartModel *)shopCartModel{
//// [self initShopCartCount];
////}
////
////-(void)kwm_fastBuy:(BUYCart *)fastBuyCart{
//// if(fastBuyCart == nil){
//// return;
//// }
//// KWMUserModel *useModel = [KWMUserModel shareUser];
//// if (useModel.status) {
//// KWMBeforePayVC *beforePayVC = (KWMBeforePayVC *)[KWMBaseVC findControllerBy:[KWMBeforePayVC kwmTag] fromStoryboard:@"ShopCart"];
//// beforePayVC.fastPayCart = fastBuyCart;
//// [self.navigationController pushViewController:beforePayVC animated:YES];}
//// //用户未登录
//// else{
//// KWMLoginVC *loginVc = (KWMLoginVC *)[KWMBaseVC findControllerBy:[KWMLoginVC kwmTag] fromStoryboard:@"Login"];
//// UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:loginVc];
//// [self presentViewController:nav animated:YES completion:nil];
//// }
////}
//
//#pragma mark - KWMSelectSizeVCDelegate End
//
//-(void)initRecommendProduct{
// if(self.product == nil){
// return;
// }
// [self.recommendView clear];
// [self.recommendView setBrandString:self.product.vendor];
// NSString *handle = [KWMStringUtil deleteOtherCharExceptLetterWithLine:self.product.vendor];
// //该商品的品牌不为nil
// if(self.product.vendor){
// [self requestCollection:handle isSameBrand:YES];
// }
// //该商品的类型不为nil
// if(self.product.productType){
// [self requestCollection:self.product.productType isSameBrand:NO];
// }
//}
//
////获取相同类型商品collection/相同品牌商品collection
//-(void)requestCollection:(NSString *)handle isSameBrand:(BOOL)isSameBrand{
// __weak KWMProductDetailVC *weakSelf = self;
// [self.client getCollectionByHandle:handle completion:^(BUYCollection *collection, NSError *error) {
// if(!error && collection!=nil){
// if(isSameBrand){
// [weakSelf hideLoading];
// weakSelf.collectionSameBrand = collection;
// }else{
// weakSelf.collectionSameType = collection;
// }
// [self requestProducts:collection.identifier isSameBrand:isSameBrand];
// }else if(error != nil){
// [self showError:error];
// }
// }];
//}
//
////获取某个商品集合,并将其设置到猜你喜欢view中
//-(void)requestProducts:(NSNumber *)collectionId isSameBrand:(BOOL)isSameBrand{
// __weak KWMProductDetailVC *weakSelf = self;
// NSInteger targetPage;
// if(isSameBrand){
// if(self.recommendView.isLoadingSameBrand){
// return;
// }
// targetPage = self.recommendView.pageSameBrand + 1;
// self.recommendView.isLoadingSameBrand = YES;
// }else{
// if(self.recommendView.isLoadingSameType){
// return;
// }
// targetPage = self.recommendView.pageSameType + 1;
// self.recommendView.isLoadingSameType = YES;
// }
//
// [self.client getProductsPage:targetPage inCollection:collectionId withTags:nil sortOrder:BUYCollectionSortCollectionDefault completion:^(NSArray<BUYProduct *> *products, NSUInteger page, BOOL reachedEnd, NSError *error) {
// if(isSameBrand){
// self.recommendView.isLoadingSameBrand = NO;
// }else{
// self.recommendView.isLoadingSameType = NO;
// }
// if(!error && products!=nil){
// if(isSameBrand){
// weakSelf.recommendView.pageSameBrand += 1;
// }else{
// weakSelf.recommendView.pageSameType += 1;
// }
// [weakSelf.recommendView setData:products isSameBrand:isSameBrand];
// }else if(error != nil){
// [self showError:error];
// }
// }];
//}
//
////查找商品API
//- (void)getProductBy:(NSNumber *)productId product:(BUYProduct *)product{
// if(productId == nil && product == nil && !self.handle){
// return;
// }
// [self showLoading];
// void(^completion)(BUYProduct *, NSError *) = ^(BUYProduct * _Nullable product, NSError * _Nullable error) {
// [self hideLoading];
// if (product != nil && error == nil) {
// self.product = product;
// [self.productDetailView setData:product];
// if(productId){
// [self kwm_clickCollectionCell:product];
// }
// }else{
// self.product = nil;
// [self showError:error];
// }
// };
// if (self.handle) {
// [self.client getProductByHandle:self.handle completion:completion];
// }else{
// [self.client getProductById:productId?productId:product.identifier completion:completion];
// }
//}
//
//@end
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