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
85b6a274
Commit
85b6a274
authored
Jul 13, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a deep blog home com
parent
89357459
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
50 additions
and
12 deletions
+50
-12
AppDelegate+Deeplink.m
iCemarose/Class/AppDelegate+Deeplink.m
+7
-0
UIViewController+HTTP.m
iCemarose/Class/Classify/UIViewController+HTTP.m
+7
-3
Home.storyboard
iCemarose/Class/UI/Home/Home.storyboard
+9
-8
KWMBlogDetailVC.h
iCemarose/Class/UI/Home/KWMBlogDetailVC.h
+3
-0
KWMBlogDetailVC.m
iCemarose/Class/UI/Home/KWMBlogDetailVC.m
+21
-0
KWMHomeVC.m
iCemarose/Class/UI/Home/KWMHomeVC.m
+1
-0
KWMHotSalesHeader.xib
iCemarose/Class/UI/NewHome/Cell/KWMHotSalesHeader.xib
+1
-1
KWMNewHomeVC.m
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
+1
-0
No files found.
iCemarose/Class/AppDelegate+Deeplink.m
View file @
85b6a274
...
...
@@ -11,6 +11,7 @@
#import "AppDelegate.h"
#import "KWMProductDetailVC.h"
#import "KWMSelectedGoodsVC.h"
#import "KWMBlogDetailVC.h"
@implementation
AppDelegate
(
Deeplink
)
...
...
@@ -36,6 +37,12 @@
[[
AppDelegate
mainViewController
].
selectedViewController
pushViewController
:
productDetailVC
animated
:
YES
];
return
YES
;
}];
[
routes
addRoute
:
@"/blogs/:blog/:handle"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
KWMBlogDetailVC
*
blogDetailVC
=
(
KWMBlogDetailVC
*
)[
KWMBlogDetailVC
findControllerBy
:
@"KWMBlogDetailVC"
fromStoryboard
:
@"Home"
];
blogDetailVC
.
handle
=
parameters
[
@"handle"
];
[[
AppDelegate
mainViewController
].
selectedViewController
pushViewController
:
blogDetailVC
animated
:
YES
];
return
YES
;
}];
}
-
(
BOOL
)
handleURL
:
(
NSURL
*
)
url
{
...
...
iCemarose/Class/Classify/UIViewController+HTTP.m
View file @
85b6a274
...
...
@@ -9,6 +9,8 @@
#import "UIViewController+HTTP.h"
#import <JLRoutes/JLRoutes.h>
#import <RegexKitLite/RegexKitLite.h>
#import <TOWebViewController/TOWebViewController.h>
#import "AppDelegate.h"
@implementation
UIViewController
(
HTTP
)
...
...
@@ -17,10 +19,12 @@
NSURL
*
url
=
[[
NSURL
alloc
]
initWithString
:[
URLString
stringByReplacingOccurrencesOfRegex
:
@"^https?"
withString
:
@"cemarose"
]];
if
([
JLRoutes
canRouteURL
:
url
])
{
[
JLRoutes
routeURL
:
url
];
}
else
if
([
application
respondsToSelector
:
@selector
(
openURL
:
options
:
completionHandler
:
)])
{
[
application
openURL
:[
NSURL
URLWithString
:
URLString
]
options
:@{}
completionHandler
:
nil
];
//
}else if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) {
//
[application openURL:[NSURL URLWithString:URLString] options:@{} completionHandler:nil];
}
else
{
[
application
openURL
:[
NSURL
URLWithString
:
URLString
]];
// [application openURL:[NSURL URLWithString:URLString]];
TOWebViewController
*
wv
=
[[
TOWebViewController
alloc
]
initWithURLString
:
URLString
];
[[
AppDelegate
mainViewController
].
selectedViewController
pushViewController
:
wv
animated
:
YES
];
}
}
...
...
iCemarose/Class/UI/Home/Home.storyboard
View file @
85b6a274
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"121
18"
systemVersion=
"16A32
3"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"121
20"
systemVersion=
"16F7
3"
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=
"1208
6
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1208
8
"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<scenes>
...
...
@@ -32,7 +32,7 @@
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"375"
height=
"648"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<subviews>
<imageView
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
image=
"ic_ home_content_title"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"6b3-4L-fqj"
>
<imageView
hidden=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
image=
"ic_ home_content_title"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"6b3-4L-fqj"
>
<rect
key=
"frame"
x=
"20"
y=
"10"
width=
"14"
height=
"9"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"9"
id=
"SlC-wh-5e0"
/>
...
...
@@ -40,17 +40,17 @@
</constraints>
</imageView>
<webView
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"XjH-A0-ATq"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
83.5"
width=
"375"
height=
"564.5
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
34"
width=
"375"
height=
"614
"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
</webView>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"
Label
"
lineBreakMode=
"tailTruncation"
numberOfLines=
"0"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"35I-9E-t9l"
>
<rect
key=
"frame"
x=
"20"
y=
"23"
width=
"325"
height=
"
32.5
"
/>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
""
lineBreakMode=
"tailTruncation"
numberOfLines=
"0"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"35I-9E-t9l"
>
<rect
key=
"frame"
x=
"20"
y=
"23"
width=
"325"
height=
"
0.0
"
/>
<fontDescription
key=
"fontDescription"
name=
"PingFangSC-Regular"
family=
"PingFang SC"
pointSize=
"23"
/>
<color
key=
"textColor"
red=
"0.29803921568627451"
green=
"0.34901960784313724"
blue=
"0.40000000000000002"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"
Label
"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"gjF-Th-7MU"
>
<rect
key=
"frame"
x=
"20"
y=
"
66.5"
width=
"345"
height=
"17
"
/>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
""
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"gjF-Th-7MU"
>
<rect
key=
"frame"
x=
"20"
y=
"
34"
width=
"345"
height=
"0.0
"
/>
<fontDescription
key=
"fontDescription"
name=
"PingFangSC-Regular"
family=
"PingFang SC"
pointSize=
"12"
/>
<color
key=
"textColor"
red=
"0.29803921570000003"
green=
"0.34901960780000002"
blue=
"0.40000000000000002"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
...
...
@@ -83,6 +83,7 @@
</constraints>
</view>
<connections>
<outlet
property=
"flagImg"
destination=
"6b3-4L-fqj"
id=
"Zw9-1P-Fjp"
/>
<outlet
property=
"lbTitle"
destination=
"35I-9E-t9l"
id=
"zpt-Oq-Rhh"
/>
<outlet
property=
"publishTime"
destination=
"gjF-Th-7MU"
id=
"HE9-1B-5Yl"
/>
<outlet
property=
"tbvArticle"
destination=
"XdN-GP-LIS"
id=
"3qw-6w-72k"
/>
...
...
iCemarose/Class/UI/Home/KWMBlogDetailVC.h
View file @
85b6a274
...
...
@@ -16,5 +16,8 @@
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
lbTitle
;
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
publishTime
;
@property
(
weak
,
nonatomic
)
IBOutlet
UIView
*
vHeader
;
@property
(
weak
,
nonatomic
)
IBOutlet
UIImageView
*
flagImg
;
@property
(
nonatomic
)
KWMArticlesResult
*
article
;
@property
(
nonatomic
)
NSString
*
handle
;
@end
iCemarose/Class/UI/Home/KWMBlogDetailVC.m
View file @
85b6a274
...
...
@@ -23,7 +23,28 @@
// Do any additional setup after loading the view
self
.
title
=
@"正文"
;
self
.
automaticallyAdjustsScrollViewInsets
=
NO
;
if
(
!
self
.
handle
)
{
[
self
initData
];
}
else
{
[
self
requestData
];
}
}
-
(
void
)
requestData
{
[
self
showLoading
];
[
self
.
api
getAllBlog
:@{
@"handle"
:
self
.
handle
}
success
:
^
(
NSURLSessionDataTask
*
task
,
KWMBlogResult
*
result
)
{
[
self
hideLoading
];
self
.
article
=
result
.
blogs
.
firstObject
;
[
self
initData
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
[
self
showError
:
error
];
NSLog
(
@"error:%@"
,
error
);
self
.
view
.
hidden
=
NO
;
}];
}
-
(
void
)
initData
{
self
.
flagImg
.
hidden
=
NO
;
self
.
wbArticle
.
delegate
=
self
;
self
.
wbArticle
.
scrollView
.
scrollEnabled
=
NO
;
self
.
lbTitle
.
text
=
_article
.
title
;
...
...
iCemarose/Class/UI/Home/KWMHomeVC.m
View file @
85b6a274
...
...
@@ -43,6 +43,7 @@
[
super
viewDidLoad
];
_dataArr
=
[
NSArray
array
];
[
self
requestBlogAPI
];
// FIXME: mo to main
[
self
.
api
loginWebSuccess
:
nil
failure
:
nil
];
}
...
...
iCemarose/Class/UI/NewHome/Cell/KWMHotSalesHeader.xib
View file @
85b6a274
...
...
@@ -67,7 +67,7 @@
<constraint
firstAttribute=
"height"
constant=
"190"
id=
"NbW-Kh-s5O"
/>
</constraints>
</view>
<collectionView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
dataMode=
"none"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"UGY-II-IMu"
>
<collectionView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
scrollEnabled=
"NO"
showsHorizontalScrollIndicator=
"NO"
showsVerticalScrollIndicator=
"NO"
dataMode=
"none"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"UGY-II-IMu"
>
<rect
key=
"frame"
x=
"0.0"
y=
"250"
width=
"375"
height=
"0.0"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<constraints>
...
...
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
View file @
85b6a274
...
...
@@ -345,6 +345,7 @@ typedef enum{
-
(
void
)
setHomeData
:
(
KWMHomeData
*
)
homeData
{
_homeData
=
homeData
;
[
homeData
.
ad_banner
[
0
]
setUrl
:
@"https://www.cemarose.com/blogs/news/article-1"
];
self
.
adHeader
.
adArray
=
self
.
homeData
.
ad_banner
;
// self.recommendHeader.productArray = self.productArray;
// self.clothingSetsHeader.productArray = self.productArray;
...
...
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