Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ios1x
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
ios1x
Commits
d148bf5c
Commit
d148bf5c
authored
7 years ago
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
product update UI, add brand description
parent
4cfedd42
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
299 additions
and
83 deletions
+299
-83
project.pbxproj
iCemarose.xcodeproj/project.pbxproj
+10
-0
1024x1024bb.jpg
iCemarose/Assets.xcassets/AppIcon.appiconset/1024x1024bb.jpg
+0
-0
Contents.json
iCemarose/Assets.xcassets/AppIcon.appiconset/Contents.json
+6
-0
LaunchScreen.storyboard
iCemarose/Base.lproj/LaunchScreen.storyboard
+3
-3
KWMContactUsVC.m
iCemarose/Class/UI/Mine/KWMContactUsVC.m
+1
-1
Mine.storyboard
iCemarose/Class/UI/Mine/Mine.storyboard
+3
-3
KWMNewHomeVC.m
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
+1
-0
KWMMidDetailView.h
iCemarose/Class/UI/NewProduct/Cell/KWMMidDetailView.h
+9
-0
KWMMidDetailView.m
iCemarose/Class/UI/NewProduct/Cell/KWMMidDetailView.m
+69
-10
KWMSecondDetailView.h
iCemarose/Class/UI/NewProduct/Cell/KWMSecondDetailView.h
+6
-0
KWMSecondDetailView.m
iCemarose/Class/UI/NewProduct/Cell/KWMSecondDetailView.m
+15
-11
KWMNewProductVC.m
iCemarose/Class/UI/NewProduct/KWMNewProductVC.m
+46
-22
NewProduct.storyboard
iCemarose/Class/UI/NewProduct/NewProduct.storyboard
+12
-5
KWMCollectionCell.h
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.h
+2
-0
KWMCollectionCell.m
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.m
+44
-0
KWMBeforePayVC.m
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
+6
-5
KWMImageUtil.m
iCemarose/Class/Util/KWMImageUtil.m
+14
-9
KWMProductSameBrandView.h
iCemarose/Class/View/KWMProductSameBrandView.h
+16
-0
KWMProductSameBrandView.m
iCemarose/Class/View/KWMProductSameBrandView.m
+21
-0
KWMProductSameBrandView.xib
iCemarose/Class/View/KWMProductSameBrandView.xib
+0
-0
KWMTBVSectionHeardView.h
iCemarose/Class/View/KWMTBVSectionHeardView.h
+2
-0
KWMTBVSectionHeardView.m
iCemarose/Class/View/KWMTBVSectionHeardView.m
+4
-0
KWMTBVSectionHeardView.xib
iCemarose/Class/View/KWMTBVSectionHeardView.xib
+7
-12
Info.plist
iCemarose/Info.plist
+2
-2
No files found.
iCemarose.xcodeproj/project.pbxproj
View file @
d148bf5c
...
...
@@ -350,6 +350,8 @@
DA4E36981F17729C0007E4D0
/* KWMCategoryModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA4E36971F17729C0007E4D0
/* KWMCategoryModel.m */
;
};
DA4E369E1F188B400007E4D0
/* BUYClient+FilterSoldout.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA4E369D1F188B400007E4D0
/* BUYClient+FilterSoldout.m */
;
};
DA4E36A11F18A6CB0007E4D0
/* KWMPageResult.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA4E36A01F18A6CB0007E4D0
/* KWMPageResult.m */
;
};
DA7457681F692D67000E192E
/* KWMProductSameBrandView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA7457671F692D67000E192E
/* KWMProductSameBrandView.m */
;
};
DA74576C1F692DCA000E192E
/* KWMProductSameBrandView.xib in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA74576B1F692DCA000E192E
/* KWMProductSameBrandView.xib */
;
};
DA7DF8E51F1DB01600D5239B
/* NSString+Format.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA7DF8E41F1DB01600D5239B
/* NSString+Format.m */
;
};
DA8B97801F58F816002FC38A
/* SDImageCache+Resize.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA8B977F1F58F816002FC38A
/* SDImageCache+Resize.m */
;
};
DA8D64121F31C67F00B8F4A6
/* DeepLinkURLProtocol.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA8D64111F31C67F00B8F4A6
/* DeepLinkURLProtocol.m */
;
};
...
...
@@ -978,6 +980,9 @@
DA4E369D1F188B400007E4D0
/* BUYClient+FilterSoldout.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"BUYClient+FilterSoldout.m"
;
sourceTree
=
"<group>"
;
};
DA4E369F1F18A6CB0007E4D0
/* KWMPageResult.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMPageResult.h
;
sourceTree
=
"<group>"
;
};
DA4E36A01F18A6CB0007E4D0
/* KWMPageResult.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMPageResult.m
;
sourceTree
=
"<group>"
;
};
DA7457661F692D67000E192E
/* KWMProductSameBrandView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
KWMProductSameBrandView.h
;
sourceTree
=
"<group>"
;
};
DA7457671F692D67000E192E
/* KWMProductSameBrandView.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMProductSameBrandView.m
;
sourceTree
=
"<group>"
;
};
DA74576B1F692DCA000E192E
/* KWMProductSameBrandView.xib */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.xib
;
path
=
KWMProductSameBrandView.xib
;
sourceTree
=
"<group>"
;
};
DA7DF8E31F1DB01600D5239B
/* NSString+Format.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"NSString+Format.h"
;
sourceTree
=
"<group>"
;
};
DA7DF8E41F1DB01600D5239B
/* NSString+Format.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"NSString+Format.m"
;
sourceTree
=
"<group>"
;
};
DA8B977E1F58F816002FC38A
/* SDImageCache+Resize.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"SDImageCache+Resize.h"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1515,6 +1520,9 @@
80C8014D1D78134800002306
/* KWMTBVSectionHeardView.h */
,
80C8014E1D78134800002306
/* KWMTBVSectionHeardView.m */
,
80C801501D78136400002306
/* KWMTBVSectionHeardView.xib */
,
DA7457661F692D67000E192E
/* KWMProductSameBrandView.h */
,
DA7457671F692D67000E192E
/* KWMProductSameBrandView.m */
,
DA74576B1F692DCA000E192E
/* KWMProductSameBrandView.xib */
,
80E844251D7FB0FF0042AED2
/* KWMRuleView.h */
,
80E844261D7FB0FF0042AED2
/* KWMRuleView.m */
,
80E844281D7FB1130042AED2
/* KWMRuleView.xib */
,
...
...
@@ -2420,6 +2428,7 @@
8077F79B1D73E39000A2E2E2
/* KWMBrandCaramelCell.xib in Resources */
,
C034E6EB1D6AF0A0006EE129
/* Localizable.strings in Resources */
,
C0243BC91EFBD6060013CFA7
/* KWMCategoryFilterTab.xib in Resources */
,
DA74576C1F692DCA000E192E
/* KWMProductSameBrandView.xib in Resources */
,
C0F586AE1E279574001248E2
/* KWMBottomView.xib in Resources */
,
C0392DBA1DCC38450051AC8E
/* KWMShippingCell.xib in Resources */
,
C0CCB3D01EEA765B00BC2FB8
/* KWMFilterTabItem.xib in Resources */
,
...
...
@@ -2752,6 +2761,7 @@
807AF4A41DC984950000A326
/* KWMBrandsResult.m in Sources */
,
C048342B1F1324B400A5BFB4
/* KWMAdHeader.m in Sources */
,
C034E8471D6B10A0006EE129
/* UIColor+Extend.m in Sources */
,
DA7457681F692D67000E192E
/* KWMProductSameBrandView.m in Sources */
,
C0DD53351EE55190002D1E0C
/* ArcToCircleLayer.m in Sources */
,
C091EE361DDEEA9400A382B9
/* KWMVariants.m in Sources */
,
C0E8AE121D7D52B200C193DC
/* KWMPayTypeVC.m in Sources */
,
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Assets.xcassets/AppIcon.appiconset/1024x1024bb.jpg
0 → 100644
View file @
d148bf5c
48.5 KB
This diff is collapsed.
Click to expand it.
iCemarose/Assets.xcassets/AppIcon.appiconset/Contents.json
View file @
d148bf5c
...
...
@@ -101,6 +101,12 @@
"idiom"
:
"ipad"
,
"filename"
:
"appicon-16.png"
,
"scale"
:
"2x"
},
{
"size"
:
"1024x1024"
,
"idiom"
:
"ios-marketing"
,
"filename"
:
"1024x1024bb.jpg"
,
"scale"
:
"1x"
}
],
"info"
:
{
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Base.lproj/LaunchScreen.storyboard
View file @
d148bf5c
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"1
2120"
systemVersion=
"16F73
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
launchScreen=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
initialViewController=
"01J-lp-oVM"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"1
3196
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
launchScreen=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
initialViewController=
"01J-lp-oVM"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
2088
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
3173
"
/>
<capability
name=
"Constraints with non-1.0 multipliers"
minToolsVersion=
"5.1"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
...
...
@@ -35,7 +35,7 @@
<constraint
firstAttribute=
"height"
constant=
"24"
id=
"x1H-Jw-5lD"
/>
</constraints>
</imageView>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"v 1.5.
6
"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"ytF-B2-drm"
>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"v 1.5.
7
"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"ytF-B2-drm"
>
<rect
key=
"frame"
x=
"168"
y=
"631"
width=
"39"
height=
"16"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"13"
/>
<color
key=
"textColor"
red=
"0.40000000000000002"
green=
"0.40000000000000002"
blue=
"0.40000000000000002"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Mine/KWMContactUsVC.m
View file @
d148bf5c
...
...
@@ -56,7 +56,7 @@
-
(
IBAction
)
wechatAction
:
(
id
)
sender
{
[
self
showToast
:
@"复制成功"
];
UIPasteboard
*
pb
=
[
UIPasteboard
generalPasteboard
];
pb
.
string
=
@"cemarose
1
"
;
pb
.
string
=
@"cemarose"
;
}
-
(
IBAction
)
weiboAction
:
(
id
)
sender
{
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Mine/Mine.storyboard
View file @
d148bf5c
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"12120"
systemVersion=
"16
F73
"
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=
"16
G29
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
...
...
@@ -329,8 +329,8 @@
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"nFz-xe-Hyc"
userLabel=
"v电话"
>
<rect
key=
"frame"
x=
"0.0"
y=
"72"
width=
"375"
height=
"38"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"cemarose
1
"
textAlignment=
"natural"
lineBreakMode=
"characterWrap"
numberOfLines=
"0"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"elR-WQ-QQC"
>
<rect
key=
"frame"
x=
"30"
y=
"10.5"
width=
"5
9
.5"
height=
"17"
/>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"cemarose"
textAlignment=
"natural"
lineBreakMode=
"characterWrap"
numberOfLines=
"0"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"elR-WQ-QQC"
>
<rect
key=
"frame"
x=
"30"
y=
"10.5"
width=
"5
4
.5"
height=
"17"
/>
<fontDescription
key=
"fontDescription"
name=
"PingFangSC-Regular"
family=
"PingFang SC"
pointSize=
"12"
/>
<color
key=
"textColor"
red=
"0.22352941179999999"
green=
"0.22352941179999999"
blue=
"0.22352941179999999"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<nil
key=
"highlightedColor"
/>
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
View file @
d148bf5c
...
...
@@ -209,6 +209,7 @@ typedef enum{
-
(
void
)
kwm_onClickProduct
:
(
BUYProduct
*
)
product
{
// NSLog(@"product");
[
self
openURLWithString
:[
NSString
stringWithFormat
:
@"https://cemarose.myshopify.com/products/%@"
,
product
.
handle
]];
// [self openURLWithString:[NSString stringWithFormat:@"https://cemarose.myshopify.com/products/19247-01"]];
}
#pragma mark - UICollectionViewDataSource
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/NewProduct/Cell/KWMMidDetailView.h
View file @
d148bf5c
...
...
@@ -9,9 +9,18 @@
#import <UIKit/UIKit.h>
#import <Buy/Buy.h>
@protocol
KWMMidDetailViewDelegate
<
NSObject
>
-
(
void
)
kwm_updatedHeight
:
(
CGFloat
)
height
;
@end
@interface
KWMMidDetailView
:
UIView
@property
(
nonatomic
,
weak
)
IBOutlet
UIView
*
vView
;
@property
(
nonatomic
,
weak
)
id
<
KWMMidDetailViewDelegate
>
delegate
;
@property
(
nonatomic
,
weak
)
BUYProduct
*
product
;
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/NewProduct/Cell/KWMMidDetailView.m
View file @
d148bf5c
...
...
@@ -6,11 +6,20 @@
// Copyright © 2017年 kollway. All rights reserved.
//
#import <WebKit/WebKit.h>
#import "KWMMidDetailView.h"
#import "KWMStringUtil.h"
#import "KWMTBVSectionHeardView.h"
#import <JLRoutes/JLRoutes.h>
@interface
KWMMidDetailView
()
<
WKNavigationDelegate
,
WKScriptMessageHandler
>
@property
(
nonatomic
,
weak
)
IBOutlet
UILabel
*
lbDetail
;
@property
(
nonatomic
,
strong
)
WKWebView
*
webView
;
@property
(
nonatomic
,
strong
)
KWMTBVSectionHeardView
*
titleView
;
@interface
KWMMidDetailView
()
@property
(
nonatomic
,
weak
)
IBOutlet
UILabel
*
lbDetail
;
@end
@implementation
KWMMidDetailView
...
...
@@ -43,22 +52,72 @@
}
-
(
void
)
addView
{
[[
NSBundle
mainBundle
]
loadNibNamed
:
NSStringFromClass
([
self
class
])
owner
:
self
options
:
nil
];
// [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class])
// owner:self
// options:nil];
self
.
titleView
=
[[
KWMTBVSectionHeardView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
UI_SCREEN_WIDTH
,
50
)];
self
.
titleView
.
title
=
@"商品详情"
;
self
.
titleView
.
ivMore
.
hidden
=
YES
;
WKUserContentController
*
userContentController
=
[[
WKUserContentController
alloc
]
init
];
[
userContentController
addScriptMessageHandler
:
self
name
:
@"handle"
];
WKWebViewConfiguration
*
configutation
=
[[
WKWebViewConfiguration
alloc
]
init
];
configutation
.
userContentController
=
userContentController
;
self
.
webView
=
[[
WKWebView
alloc
]
initWithFrame
:
self
.
bounds
configuration
:
configutation
];
self
.
webView
.
navigationDelegate
=
self
;
// self.vView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
// [self addSubview:self.vView];
[
self
addSubview
:
self
.
webView
];
[
self
addSubview
:
self
.
titleView
];
self
.
webView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
self
.
titleView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
id
views
=
@{
@"web"
:
self
.
webView
,
@"title"
:
self
.
titleView
};
[
self
addConstraints
:[
NSLayoutConstraint
constraintsWithVisualFormat
:
@"H:|[web]|"
options
:
0
metrics
:
nil
views
:
views
]];
[
self
addConstraints
:[
NSLayoutConstraint
constraintsWithVisualFormat
:
@"H:|[title]|"
options
:
0
metrics
:
nil
views
:
views
]];
[
self
addConstraints
:[
NSLayoutConstraint
constraintsWithVisualFormat
:
@"V:|[title(50)][web]|"
options
:
0
metrics
:
nil
views
:
views
]];
self
.
vView
.
frame
=
CGRectMake
(
0
,
0
,
self
.
frame
.
size
.
width
,
self
.
frame
.
size
.
height
);
[
self
addSubview
:
self
.
vView
];
}
//- (void)layoutSubviews {
// [super layoutSubviews];
// self.webView.frame = self.bounds;
//}
-
(
void
)
setProduct
:
(
BUYProduct
*
)
product
{
_product
=
product
;
if
(
product
&&
!
[
KWMStringUtil
isEmpty
:
product
.
stringDescription
]){
self
.
lbDetail
.
text
=
product
.
stringDescription
;
if
(
product
&&
product
.
htmlDescription
.
length
){
// self.lbDetail.text = product.htmlDescription;
// NSString *html = [NSString stringWithFormat:@"%@<script type='text/javascript'>window.webkit.messageHandlers.handle.postMessage(document.body.clientHeight)</scriot>",product.htmlDescription];
NSString
*
css
=
[
NSString
stringWithFormat
:
@"p{font-size:12px;}img{width:100%%;}*{padding:0;margin:0;max-width:%f}"
,
UI_SCREEN_WIDTH
];
NSString
*
html
=
[[
NSString
stringWithFormat
:
@"<meta name=
\"
viewport
\"
content=
\"
width=device-width, initial-scale=1.0 user-scalable=yes
\"
/><div id=
\"
container
\"
>%@<div><script type=
\"
text/javascript
\"
>function update() {window.webkit.messageHandlers.handle.postMessage({height:document.body.scrollHeight})} function timer(){ setTimeout(timer,1000); update()} function delay() { setTimeout(update,1000) } window.onload = update</script><style type=
\"
text/css
\"
>%@</style>"
,
product
.
htmlDescription
,
css
]
stringByReplacingOccurrencesOfString
:
@"src=
\"
//cdn.shopify.com"
withString
:
@"src=
\"
https://o42yton8r.qnssl.com"
];
[
self
.
webView
loadHTMLString
:
html
baseURL
:
nil
];
}
else
{
self
.
lbDetail
.
text
=
@"暂无商品描述"
;
// self.lbDetail.text = @"暂无商品描述";
self
.
hidden
=
YES
;
[
self
.
delegate
kwm_updatedHeight
:
0
];
}
}
-
(
void
)
webView
:
(
WKWebView
*
)
webView
decidePolicyForNavigationAction
:
(
WKNavigationAction
*
)
navigationAction
decisionHandler
:
(
void
(
^
)(
WKNavigationActionPolicy
))
decisionHandler
{
NSURL
*
url
=
navigationAction
.
request
.
URL
;
if
([
JLRoutes
canRouteURL
:
url
])
{
[
JLRoutes
routeURL
:
url
];
decisionHandler
(
WKNavigationActionPolicyCancel
);
}
else
{
decisionHandler
(
WKNavigationActionPolicyAllow
);
}
}
-
(
void
)
userContentController
:
(
WKUserContentController
*
)
userContentController
didReceiveScriptMessage
:
(
WKScriptMessage
*
)
message
{
NSNumber
*
height
=
[
message
.
body
objectForKey
:
@"height"
];
NSLog
(
@"fuck height: %@"
,
height
);
[
self
.
delegate
kwm_updatedHeight
:
height
.
floatValue
+
50
];
}
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/NewProduct/Cell/KWMSecondDetailView.h
View file @
d148bf5c
...
...
@@ -15,6 +15,8 @@
-
(
void
)
kwm_clickCollectionCell
:
(
BUYProduct
*
)
product
;
-
(
void
)
kwm_updatedSecondDetailViewHeight
:(
CGFloat
)
height
;
-
(
void
)
kwm_clickMore
:(
BOOL
)
isSameBrand
;
@end
...
...
@@ -37,6 +39,10 @@
@property
(
nonatomic
)
NSString
*
brand
;
@property
(
nonatomic
)
NSNumber
*
productCount
;
@property
(
nonatomic
)
NSString
*
brandDescription
;
@property
(
nonatomic
)
NSInteger
count
;
//isSameBrand 是否同一品牌商品
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/NewProduct/Cell/KWMSecondDetailView.m
View file @
d148bf5c
...
...
@@ -8,6 +8,7 @@
#import "KWMSecondDetailView.h"
#import "KWMTBVSectionHeardView.h"
#import "KWMProductSameBrandView.h"
@interface
KWMSecondDetailView
()
...
...
@@ -138,27 +139,30 @@ static NSString *idStr = @"KWMNewGoodsCell";
}
-
(
UIView
*
)
tableView
:
(
UITableView
*
)
tableView
viewForHeaderInSection
:
(
NSInteger
)
section
{
KWMTBVSectionHeardView
*
vTBVSectionHeard
=
[[
KWMTBVSectionHeardView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
UI_SCREEN_WIDTH
,
60
)];
if
(
section
==
0
)
{
NSString
*
title
;
if
(
self
.
brand
==
nil
){
vTBVSectionHeard
=
[[
KWMTBVSectionHeardView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
UI_SCREEN_WIDTH
,
40
)];
title
=
@"其他商品"
;
}
else
{
title
=
[
NSString
stringWithFormat
:
@"%@
\n
其他商品"
,
self
.
brand
];
}
vTBVSectionHeard
.
lbSectionTitel
.
text
=
title
;
KWMProductSameBrandView
*
view
=
[[[
NSBundle
mainBundle
]
loadNibNamed
:
@"KWMProductSameBrandView"
owner
:
nil
options
:
nil
]
firstObject
];
view
.
frame
=
CGRectMake
(
0
,
0
,
UI_SCREEN_WIDTH
,
[
self
tableView
:
tableView
heightForHeaderInSection
:
section
]);
view
.
brandName
.
text
=
self
.
brand
?:
@"其他商品"
;
view
.
quantity
.
text
=
self
.
productCount
.
stringValue
?:
@"0"
;
view
.
brandDescription
.
text
=
self
.
brandDescription
;
return
view
;
}
else
{
KWMTBVSectionHeardView
*
vTBVSectionHeard
=
[[
KWMTBVSectionHeardView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
UI_SCREEN_WIDTH
,
60
)];
vTBVSectionHeard
=
[[
KWMTBVSectionHeardView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
UI_SCREEN_WIDTH
,
40
)];
vTBVSectionHeard
.
lbSectionTitel
.
text
=
@"同类商品"
;
}
vTBVSectionHeard
.
ivMore
.
hidden
=
YES
;
return
vTBVSectionHeard
;
}
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForHeaderInSection
:
(
NSInteger
)
section
{
if
(
section
==
0
&&
self
.
brand
!=
nil
){
return
60
;
CGFloat
height
=
8
;
// height += [self.brandDescription sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11]}].height;
height
+=
[
self
.
brandDescription
boundingRectWithSize
:
CGSizeMake
(
UI_SCREEN_WIDTH
-
54
,
0
)
options
:
NSStringDrawingUsesLineFragmentOrigin
|
NSStringDrawingUsesFontLeading
attributes
:
@{
NSFontAttributeName
:
[
UIFont
fontWithName
:
@"Helvetica Neue"
size
:
11
]}
context
:
nil
].
size
.
height
;
[
self
.
delegate
kwm_updatedSecondDetailViewHeight
:
450
+
height
];
return
60
+
height
;
}
else
{
return
40
;
}
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/NewProduct/KWMNewProductVC.m
View file @
d148bf5c
...
...
@@ -22,7 +22,7 @@
#import <PPNetworkHelper/PPNetworkHelper.h>
#import <TOWebViewController/NJKWebViewProgress.h>
@interface
KWMNewProductVC
()
@interface
KWMNewProductVC
()
<
KWMMidDetailViewDelegate
>
@property
(
weak
,
nonatomic
)
IBOutlet
KWMFirstDetailView
*
detailView1
;
...
...
@@ -38,6 +38,8 @@
@property
(
weak
,
nonatomic
)
IBOutlet
NSLayoutConstraint
*
heightMidView
;
@property
(
weak
,
nonatomic
)
IBOutlet
NSLayoutConstraint
*
detailView2HeightConstraint
;
// 0 非自动 1 是加购 2 是立即购买
@property
(
assign
,
nonatomic
)
NSInteger
autoAddToBag
;
...
...
@@ -82,6 +84,7 @@
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[
self
initShopCartCount
];
[
self
.
navigationController
setNavigationBarHidden
:
YES
];
}
...
...
@@ -98,7 +101,7 @@
self
.
colorArray
=
[
NSMutableArray
array
];
self
.
detailView1
.
delegate
=
self
;
self
.
detailView2
.
delegate
=
self
;
self
.
midDetailView
.
delegate
=
self
;
if
(
self
.
product
){
self
.
midDetailView
.
product
=
self
.
product
;
[
self
.
detailView1
setData
:
self
.
product
];
...
...
@@ -109,8 +112,8 @@
}
[
self
requestColorMetafield
];
[
self
requestAdminProduct
];
[
self
initShopCartCount
];
[
self
initMidViewHight
];
//
[self initShopCartCount];
//
[self initMidViewHight];
[
self
.
btnLike
setImage
:[
UIImage
imageNamed
:
@"ic_like_unable"
]
forState
:
UIControlStateNormal
];
...
...
@@ -123,22 +126,22 @@
[
self
.
btnShopCart
setTitle
:
count
.
stringValue
forState
:
UIControlStateNormal
];
}
-
(
void
)
initMidViewHight
{
if
(
self
.
product
){
if
([
KWMStringUtil
isEmpty
:
self
.
product
.
stringDescription
]){
self
.
heightMidView
.
constant
=
86
.
5
;
}
else
{
NSString
*
detail
=
self
.
product
.
stringDescription
;
//获得字体,计算文字显示所需高度
UIFont
*
font
=
[
UIFont
systemFontOfSize
:
11
];
if
(
SYSTEM_VERSION_LESS_THAN
(
@"9.0"
)){
[
UIFont
fontWithName
:
@"PingFang SC"
size
:
11
];
}
NSInteger
heightLbDetail
=
[
KWMStringUtil
getLabelHeight
:
detail
labelFont
:
font
textWidth
:
UI_SCREEN_WIDTH
-
20
].
height
;
self
.
heightMidView
.
constant
=
(
86
.
5
-
15
+
heightLbDetail
);
}
}
}
//
-(void)initMidViewHight{
//
if(self.product){
//
if([KWMStringUtil isEmpty:self.product.stringDescription]){
//
self.heightMidView.constant = 86.5;
//
}else{
//
NSString *detail = self.product.stringDescription;
//
//获得字体,计算文字显示所需高度
//
UIFont *font = [UIFont systemFontOfSize:11];
//
if(SYSTEM_VERSION_LESS_THAN(@"9.0")){
//
[UIFont fontWithName:@"PingFang SC" size:11];
//
}
//
NSInteger heightLbDetail = [KWMStringUtil getLabelHeight:detail labelFont:font textWidth:UI_SCREEN_WIDTH - 20].height;
//
self.heightMidView.constant = (86.5 - 15 + heightLbDetail);
//
}
//
}
//
}
//请求API得到颜色Meterfield后才会调用这个.
...
...
@@ -286,6 +289,10 @@
}
#pragma mark -- KWMSecondDetailViewDelegate
-
(
void
)
kwm_updatedSecondDetailViewHeight
:
(
CGFloat
)
height
{
self
.
detailView2HeightConstraint
.
constant
=
height
;
}
-
(
void
)
kwm_clickCollectionCell
:
(
BUYProduct
*
)
product
{
if
(
!
product
){
return
;
...
...
@@ -435,6 +442,12 @@
}
}
#pragma mark - KWMMidViewDetailDelegate
-
(
void
)
kwm_updatedHeight
:
(
CGFloat
)
height
{
self
.
heightMidView
.
constant
=
height
;
}
#pragma mark - API BUYClient+Storefront
-
(
void
)
requestProductDetail
{
if
(
!
(
self
.
productId
||
self
.
product
||
self
.
handle
)){
...
...
@@ -449,7 +462,7 @@
}
else
if
(
product
){
weakSelf
.
product
=
product
;
weakSelf
.
productId
=
product
.
identifier
;
[
weakSelf
initMidViewHight
];
//
[weakSelf initMidViewHight];
weakSelf
.
midDetailView
.
product
=
product
;
[
weakSelf
.
detailView1
setData
:
product
];
[
self
requestBrandProducts
:
1
];
...
...
@@ -490,11 +503,22 @@
NSString
*
handle
=
[
KWMStringUtil
deleteOtherCharExceptLetterWithLine
:
self
.
product
.
vendor
];
self
.
detailView2
.
isLoadingSameBrand
=
YES
;
__weak
KWMNewProductVC
*
weakSelf
=
self
;
[
self
.
api
searchProduct
:@{
@"keyword"
:
self
.
product
.
vendor
}
success
:
^
(
NSURLSessionDataTask
*
task
,
KWMSearchResult
*
result
)
{
// weakSelf.detailView2.isLoadingSameBrand = NO;
weakSelf
.
detailView2
.
brand
=
weakSelf
.
product
.
vendor
;
weakSelf
.
detailView2
.
productCount
=
result
.
products
.
total
;
// [weakSelf.detailView2 setData:result.productList isSameBrand:YES];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
// weakSelf.detailView2.isLoadingSameBrand = NO;
}];
[
self
.
client
getCollectionByHandle
:
handle
completion
:
^
(
BUYCollection
*
_Nullable
collection
,
NSError
*
_Nullable
error
)
{
if
(
collection
&&
!
error
){
weakSelf
.
detailView2
.
brandDescription
=
collection
.
stringDescription
;
[
weakSelf
.
client
getProductsPage
:
page
inCollection
:
collection
.
identifier
completion
:^
(
NSArray
<
BUYProduct
*>
*
_Nullable
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
_Nullable
error
)
{
weakSelf
.
detailView2
.
isLoadingSameBrand
=
NO
;
weakSelf
.
detailView2
.
brand
=
weakSelf
.
product
.
vendor
;
[
weakSelf
.
detailView2
setData
:
products
isSameBrand
:
YES
];
}];
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/NewProduct/NewProduct.storyboard
View file @
d148bf5c
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"1
2120"
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=
"1
3196
"
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=
"1
2088
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
3173
"
/>
<capability
name=
"Aspect ratio constraints"
minToolsVersion=
"5.1"
/>
<capability
name=
"Constraints with non-1.0 multipliers"
minToolsVersion=
"5.1"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<customFonts
key=
"customFonts"
>
<array
key=
"PingFang.ttc"
>
<string>
PingFangSC-Medium
</string>
<string>
PingFangSC-Regular
</string>
</array>
</customFonts>
<scenes>
<!--新商品详情-->
<scene
sceneID=
"fO1-9n-Cyi"
>
...
...
@@ -79,7 +85,7 @@
<rect
key=
"frame"
x=
"0.0"
y=
"50"
width=
"375"
height=
"567"
/>
<subviews>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"X5Y-fo-qOg"
>
<rect
key=
"frame"
x=
"-0.5"
y=
"0.0"
width=
"375"
height=
"11
5
1.5"
/>
<rect
key=
"frame"
x=
"-0.5"
y=
"0.0"
width=
"375"
height=
"11
6
1.5"
/>
<subviews>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"2KH-pA-K5l"
customClass=
"KWMFirstDetailView"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"625"
/>
...
...
@@ -93,10 +99,10 @@
</constraints>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"pyO-1P-iAa"
customClass=
"KWMSecondDetailView"
>
<rect
key=
"frame"
x=
"0.0"
y=
"711.5"
width=
"375"
height=
"4
4
0"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"711.5"
width=
"375"
height=
"4
5
0"
/>
<color
key=
"backgroundColor"
red=
"0.82745098039999998"
green=
"0.83921568629999999"
blue=
"0.85098039219999999"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"4
4
0"
id=
"SH3-J6-rwf"
/>
<constraint
firstAttribute=
"height"
constant=
"4
5
0"
id=
"SH3-J6-rwf"
/>
</constraints>
</view>
</subviews>
...
...
@@ -222,6 +228,7 @@
<outlet
property=
"btnShopCart"
destination=
"gbx-rg-A8B"
id=
"vel-Ab-0rI"
/>
<outlet
property=
"detailView1"
destination=
"2KH-pA-K5l"
id=
"ynO-by-UfZ"
/>
<outlet
property=
"detailView2"
destination=
"pyO-1P-iAa"
id=
"scJ-Iv-fnz"
/>
<outlet
property=
"detailView2HeightConstraint"
destination=
"SH3-J6-rwf"
id=
"H8q-0s-nUI"
/>
<outlet
property=
"heightMidView"
destination=
"Pwf-vg-Z3k"
id=
"h8Z-Kr-bXi"
/>
<outlet
property=
"midDetailView"
destination=
"t55-gT-VGG"
id=
"BRI-de-9Jz"
/>
<outlet
property=
"scrollView"
destination=
"T6J-Gp-5iu"
id=
"ZLc-Xh-Pyk"
/>
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.h
View file @
d148bf5c
...
...
@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h>
#import "Buy/Buy.h"
#import "KWMDataProduct.h"
@interface
KWMCollectionCell
:
UICollectionViewCell
...
...
@@ -22,5 +23,6 @@
@property
(
nonatomic
)
BOOL
isMore
;
-
(
void
)
setData
:(
BUYProduct
*
)
product
;
-
(
void
)
setDataProduct
:(
KWMDataProduct
*
)
product
;
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Product/Cell/KWMCollectionCell.m
View file @
d148bf5c
...
...
@@ -36,6 +36,10 @@
-
(
void
)
setData
:
(
BUYProduct
*
)
product
{
if
(
product
!=
nil
){
if
([
product
isKindOfClass
:[
KWMDataProduct
class
]])
{
[
self
setDataProduct
:(
KWMDataProduct
*
)
product
];
return
;
}
self
.
product
=
product
;
self
.
lbBrand
.
text
=
product
.
title
;
NSString
*
imageUrl
=
[
KWMImageUtil
getProductImageUrl
:
product
ImageSize
:
SmallImage
];
...
...
@@ -77,5 +81,45 @@
}
}
-
(
void
)
setDataProduct
:
(
KWMDataProduct
*
)
product
{
self
.
lbBrand
.
text
=
product
.
vendor
;
NSString
*
imageUrl
=
[
KWMImageUtil
getProductImageUrl
:
product
ImageSize
:
SmallImage
];
NSURL
*
imageURL
=
[
NSURL
URLWithString
:
imageUrl
];
[
self
.
ivCollectionCell
sd_setImageWithURL
:
imageURL
placeholderImage
:[
UIImage
imageNamed
:
@"ic_loading"
]];
KWMVariants
*
variant
=
product
.
variants
.
firstObject
;
if
(
variant
.
compareAtPrice
)
{
self
.
lbPrice
.
hidden
=
NO
;
self
.
priceSpace
.
constant
=
4
;
// NSString *priceString = productVariant.compareAtPriceFormatted;
NSString
*
priceString
=
variant
.
compareAtPrice
.
priceFormatted
;
NSDictionary
*
attribtDic
=
@{
NSStrikethroughStyleAttributeName
:
[
NSNumber
numberWithInteger
:
NSUnderlineStyleSingle
]};
NSMutableAttributedString
*
attribtStr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
priceString
attributes
:
attribtDic
];
self
.
lbPrice
.
attributedText
=
attribtStr
;
}
else
{
self
.
lbPrice
.
hidden
=
YES
;
self
.
lbPrice
.
text
=
nil
;
self
.
priceSpace
.
constant
=
0
;
}
NSString
*
priceString
,
*
discountStr
;
if
(
variant
.
compareAtPrice
)
{
self
.
lbPrice
.
hidden
=
NO
;
self
.
priceSpace
.
constant
=
4
;
// priceString = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:productVariant.compareAtPrice]];
priceString
=
variant
.
compareAtPrice
.
priceFormatted
;
NSDictionary
*
attribtDic
=
@{
NSStrikethroughStyleAttributeName
:
[
NSNumber
numberWithInteger
:
NSUnderlineStyleSingle
]};
NSMutableAttributedString
*
attribtStr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
priceString
attributes
:
attribtDic
];
self
.
lbPrice
.
attributedText
=
attribtStr
;
}
else
{
self
.
lbPrice
.
hidden
=
YES
;
self
.
lbPrice
.
text
=
nil
;
self
.
priceSpace
.
constant
=
0
;
// self.discountLeft.constant = -28;
// self.lbDiscount.textAlignment = NSTextAlignmentCenter;
}
// discountStr = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:productVariant.price]];
discountStr
=
variant
.
price
.
priceFormatted
;
self
.
lbDiscount
.
text
=
discountStr
;
}
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
View file @
d148bf5c
...
...
@@ -312,11 +312,11 @@
// // init checkout 这里应该也没用了 因为self.cart不存在
// checkout = [[BUYCheckout alloc] initWithModelManager:self.client.modelManager cart:self.cart];
// }
NSDictionary
*
checkoutCache
=
[
self
.
userDao
checkOutCache
];
//
NSDictionary *checkoutCache = [self.userDao checkOutCache];
BUYCheckout
*
checkout
=
nil
;
if
(
!
checkoutCache
||
self
.
cartCookie
)
{
//
if (!checkoutCache || self.cartCookie) {
checkout
=
[[
BUYCheckout
alloc
]
initWithModelManager
:
self
.
client
.
modelManager
JSONDictionary
:
nil
];
}
//
}
// if(self.address){
if
([
self
checkAddress
:
self
.
address
]){
KWMSelectAddressVC
*
addressVC
=
(
KWMSelectAddressVC
*
)[
KWMBaseVC
findControllerBy
:[
KWMSelectAddressVC
kwmTag
]
fromStoryboard
:
@"ShopCart"
];
...
...
@@ -554,10 +554,11 @@
[
newReq
setValue
:
this
.
client
.
customerToken
.
accessToken
forHTTPHeaderField
:
@"X-Shopify-Customer-Access-Token"
];
}
// 如果有checkout说明是新订单 直接更新订单地址就好 如果没有checkout说明是旧订单已经有地址所以无需更新
if
(
checkout
||
this
.
cartCookie
)
{
// 170922 所有订单全部刷新地址
// if (checkout || this.cartCookie) {
newReq
.
HTTPMethod
=
@"PATCH"
;
[
newReq
setHTTPBody
:[
NSJSONSerialization
dataWithJSONObject
:[
checkout
jsonDictionaryForCheckout
]
options
:
0
error
:
nil
]];
}
//
}
return
newReq
;
}];
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/Util/KWMImageUtil.m
View file @
d148bf5c
...
...
@@ -6,6 +6,7 @@
#import "KWMImageUtil.h"
#import "KWMStringUtil.h"
#import "Buy/Buy.h"
#import <RegexKitLite/RegexKitLite.h>
@implementation
KWMImageUtil
{
...
...
@@ -181,18 +182,22 @@
+
(
NSString
*
)
getProductImageUrlByOriginalUrl
:
(
NSString
*
)
originalImgUrl
ImageSize
:
(
NSInteger
)
ImageSize
{
NSMutableString
*
newImageUrl
=
[[
NSMutableString
alloc
]
initWithString
:
@""
];;
NSMutableString
*
newImageUrl
=
[[
NSMutableString
alloc
]
initWithString
:
[
originalImgUrl
stringByReplacingOccurrencesOfString
:
@"?"
withString
:
@"%3F"
]
];;
//https://cdn.shopify.com/s/files/1/1089/5284/products/5413_1.jpg?v==1459708223 转换为
//https://o42yton8r.qnssl.com/s/files/1/1089/5284/products/5413_1.jpg?imageView2/1/w/300/h/300/v==1459708223
if
(
originalImgUrl
){
NSRange
startRange
=
[
originalImgUrl
rangeOfString
:
@"?"
];
if
(
startRange
.
location
!=
NSNotFound
)
{
newImageUrl
=
[[
NSMutableString
alloc
]
initWithString
:
originalImgUrl
];
// if(originalImgUrl){
// NSRange startRange = [originalImgUrl rangeOfString:@"?"];
// if (startRange.location != NSNotFound) {
// newImageUrl=[[NSMutableString alloc]initWithString:originalImgUrl];
// NSArray<NSString *> *imageWH = [self getImageWH:ImageSize];
// NSString *size = [NSString stringWithFormat:@"imageView2/2/w/%@/h/%@/",imageWH[0],imageWH[1]];
// [newImageUrl insertString:size atIndex:startRange.location+1];
// }
// }
NSArray
<
NSString
*>
*
imageWH
=
[
self
getImageWH
:
ImageSize
];
NSString
*
size
=
[
NSString
stringWithFormat
:
@"imageView2/2/w/%@/h/%@/"
,
imageWH
[
0
],
imageWH
[
1
]];
[
newImageUrl
insertString
:
size
atIndex
:
startRange
.
location
+
1
];
}
}
NSString
*
size
=
[
NSString
stringWithFormat
:
@"?imageView2/2/w/%@/h/%@/"
,
imageWH
[
0
],
imageWH
[
1
]];
[
newImageUrl
appendString
:
size
];
return
[
newImageUrl
stringByReplacingOccurrencesOfString
:
@"cdn.shopify.com"
withString
:
Image_Domain
];
}
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/View/KWMProductSameBrandView.h
0 → 100644
View file @
d148bf5c
//
// KWMProductSameBrandView.h
// iCemarose
//
// Created by Sanchew on 2017/9/13.
// Copyright © 2017年 kollway. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
KWMProductSameBrandView
:
UIView
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
brandName
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
quantity
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
brandDescription
;
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/View/KWMProductSameBrandView.m
0 → 100644
View file @
d148bf5c
//
// KWMProductSameBrandView.m
// iCemarose
//
// Created by Sanchew on 2017/9/13.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "KWMProductSameBrandView.h"
@implementation
KWMProductSameBrandView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/View/KWMProductSameBrandView.xib
0 → 100644
View file @
d148bf5c
This diff is collapsed.
Click to expand it.
iCemarose/Class/View/KWMTBVSectionHeardView.h
View file @
d148bf5c
...
...
@@ -23,6 +23,8 @@
@property
(
nonatomic
)
KWMNewGoodsModel
*
goodsModel
;
@property
(
nonatomic
)
NSString
*
title
;
@property
(
weak
,
nonatomic
)
id
<
KWMTBVSectionHeardViewDelegate
>
delegate
;
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/View/KWMTBVSectionHeardView.m
View file @
d148bf5c
...
...
@@ -59,6 +59,10 @@
}
}
-
(
void
)
setTitle
:
(
NSString
*
)
title
{
_lbSectionTitel
.
text
=
title
;
}
-
(
void
)
onClickWacthMore
:
(
UITapGestureRecognizer
*
)
tapGesture
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
kwm_watchMoreProductsByBrand
:
AndTitle
:
)])
{
[
self
.
delegate
kwm_watchMoreProductsByBrand
:
_goodsModel
AndTitle
:
_lbSectionTitel
.
text
];
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/View/KWMTBVSectionHeardView.xib
View file @
d148bf5c
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
1542"
systemVersion=
"16B2555
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
3196
"
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=
"1
1524
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
3173
"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<customFonts
key=
"customFonts"
>
<array
key=
"PingFang.ttc"
>
<string>
PingFangSC-Light
</string>
</array>
</customFonts>
<objects>
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
customClass=
"KWMTBVSectionHeardView"
>
<connections>
...
...
@@ -54,27 +59,17 @@
</imageView>
</subviews>
<constraints>
<constraint
firstItem=
"wdX-Ml-DYY"
firstAttribute=
"centerY"
secondItem=
"PIL-ko-rzF"
secondAttribute=
"centerY"
id=
"9nq-Ez-yrN"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"wdX-Ml-DYY"
secondAttribute=
"trailing"
constant=
"140"
id=
"NEV-2U-wJ5"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"owh-51-VTC"
secondAttribute=
"trailing"
constant=
"20"
id=
"NS0-1s-TK1"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"wdX-Ml-DYY"
secondAttribute=
"bottom"
id=
"PA5-Nd-lp4"
/>
<constraint
firstItem=
"wdX-Ml-DYY"
firstAttribute=
"top"
secondItem=
"PIL-ko-rzF"
secondAttribute=
"top"
id=
"cHx-1l-c6C"
/>
<constraint
firstItem=
"wdX-Ml-DYY"
firstAttribute=
"centerX"
secondItem=
"PIL-ko-rzF"
secondAttribute=
"centerX"
id=
"hFz-IN-tkC"
/>
<constraint
firstItem=
"owh-51-VTC"
firstAttribute=
"centerY"
secondItem=
"PIL-ko-rzF"
secondAttribute=
"centerY"
id=
"hO5-ch-Xcn"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"aAy-jd-lsA"
secondAttribute=
"trailing"
constant=
"50"
id=
"k3t-q6-hhh"
/>
<constraint
firstItem=
"wdX-Ml-DYY"
firstAttribute=
"leading"
secondItem=
"PIL-ko-rzF"
secondAttribute=
"leading"
constant=
"140"
id=
"op9-bF-1ab"
/>
<constraint
firstItem=
"aAy-jd-lsA"
firstAttribute=
"leading"
secondItem=
"PIL-ko-rzF"
secondAttribute=
"leading"
constant=
"50"
id=
"pbZ-Az-bo4"
/>
<constraint
firstItem=
"aAy-jd-lsA"
firstAttribute=
"centerY"
secondItem=
"PIL-ko-rzF"
secondAttribute=
"centerY"
id=
"zQe-eq-mgX"
/>
</constraints>
<nil
key=
"simulatedStatusBarMetrics"
/>
<freeformSimulatedSizeMetrics
key=
"simulatedDestinationMetrics"
/>
<variation
key=
"default"
>
<mask
key=
"constraints"
>
<exclude
reference=
"9nq-Ez-yrN"
/>
<exclude
reference=
"NEV-2U-wJ5"
/>
<exclude
reference=
"op9-bF-1ab"
/>
</mask>
</variation>
<point
key=
"canvasLocation"
x=
"559.5"
y=
"-51"
/>
</view>
</objects>
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Info.plist
View file @
d148bf5c
...
...
@@ -15,7 +15,7 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.5.
6
<
/string
>
<
string
>
1.5.
7
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleURLTypes
<
/k
e
y
>
...
...
@@ -56,7 +56,7 @@
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
2017090617
<
/string
>
<
string
>
1.5.7.4
<
/string
>
<
k
e
y
>
ITSAppUsesNonExemptEncryption
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
LSApplicationQueriesSchemes
<
/k
e
y
>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment