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
fbd54512
Commit
fbd54512
authored
Sep 01, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u image cache
parent
fcca7788
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
3 deletions
+105
-3
project.pbxproj
iCemarose.xcodeproj/project.pbxproj
+6
-0
Contents.json
...cassets/ad_home_header_placeholder.imageset/Contents.json
+22
-0
ad_home_header_placeholder@3x.png
...er_placeholder.imageset/ad_home_header_placeholder@3x.png
+0
-0
KWMCartResult.m
iCemarose/Class/Api/Cemarose/KWMCartResult.m
+1
-1
SDImageCache+Resize.h
iCemarose/Class/SDImageCache+Resize.h
+13
-0
SDImageCache+Resize.m
iCemarose/Class/SDImageCache+Resize.m
+61
-0
KWMAdHeader.m
iCemarose/Class/UI/NewHome/Cell/KWMAdHeader.m
+2
-2
No files found.
iCemarose.xcodeproj/project.pbxproj
View file @
fbd54512
...
@@ -354,6 +354,7 @@
...
@@ -354,6 +354,7 @@
DA4E369E1F188B400007E4D0
/* BUYClient+FilterSoldout.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA4E369D1F188B400007E4D0
/* BUYClient+FilterSoldout.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 */
;
};
DA4E36A11F18A6CB0007E4D0
/* KWMPageResult.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA4E36A01F18A6CB0007E4D0
/* KWMPageResult.m */
;
};
DA7DF8E51F1DB01600D5239B
/* NSString+Format.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA7DF8E41F1DB01600D5239B
/* NSString+Format.m */
;
};
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 */
;
};
DA8D64121F31C67F00B8F4A6
/* DeepLinkURLProtocol.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA8D64111F31C67F00B8F4A6
/* DeepLinkURLProtocol.m */
;
};
DA8D64151F31CD2600B8F4A6
/* DPWebViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA8D64141F31CD2600B8F4A6
/* DPWebViewController.m */
;
};
DA8D64151F31CD2600B8F4A6
/* DPWebViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DA8D64141F31CD2600B8F4A6
/* DPWebViewController.m */
;
};
DAB6431A1F04CFE5002CD7FE
/* AppDelegate+Deeplink.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DAB643191F04CFE5002CD7FE
/* AppDelegate+Deeplink.m */
;
};
DAB6431A1F04CFE5002CD7FE
/* AppDelegate+Deeplink.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DAB643191F04CFE5002CD7FE
/* AppDelegate+Deeplink.m */
;
};
...
@@ -987,6 +988,8 @@
...
@@ -987,6 +988,8 @@
DA4E36A01F18A6CB0007E4D0
/* KWMPageResult.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMPageResult.m
;
sourceTree
=
"<group>"
;
};
DA4E36A01F18A6CB0007E4D0
/* KWMPageResult.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
KWMPageResult.m
;
sourceTree
=
"<group>"
;
};
DA7DF8E31F1DB01600D5239B
/* NSString+Format.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"NSString+Format.h"
;
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>"
;
};
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>"
;
};
DA8B977F1F58F816002FC38A
/* SDImageCache+Resize.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"SDImageCache+Resize.m"
;
sourceTree
=
"<group>"
;
};
DA8D64101F31C67F00B8F4A6
/* DeepLinkURLProtocol.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
DeepLinkURLProtocol.h
;
sourceTree
=
"<group>"
;
};
DA8D64101F31C67F00B8F4A6
/* DeepLinkURLProtocol.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
DeepLinkURLProtocol.h
;
sourceTree
=
"<group>"
;
};
DA8D64111F31C67F00B8F4A6
/* DeepLinkURLProtocol.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
DeepLinkURLProtocol.m
;
sourceTree
=
"<group>"
;
};
DA8D64111F31C67F00B8F4A6
/* DeepLinkURLProtocol.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
DeepLinkURLProtocol.m
;
sourceTree
=
"<group>"
;
};
DA8D64131F31CD2600B8F4A6
/* DPWebViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
DPWebViewController.h
;
sourceTree
=
"<group>"
;
};
DA8D64131F31CD2600B8F4A6
/* DPWebViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
DPWebViewController.h
;
sourceTree
=
"<group>"
;
};
...
@@ -1341,6 +1344,8 @@
...
@@ -1341,6 +1344,8 @@
DAB643191F04CFE5002CD7FE
/* AppDelegate+Deeplink.m */
,
DAB643191F04CFE5002CD7FE
/* AppDelegate+Deeplink.m */
,
DA8D64101F31C67F00B8F4A6
/* DeepLinkURLProtocol.h */
,
DA8D64101F31C67F00B8F4A6
/* DeepLinkURLProtocol.h */
,
DA8D64111F31C67F00B8F4A6
/* DeepLinkURLProtocol.m */
,
DA8D64111F31C67F00B8F4A6
/* DeepLinkURLProtocol.m */
,
DA8B977E1F58F816002FC38A
/* SDImageCache+Resize.h */
,
DA8B977F1F58F816002FC38A
/* SDImageCache+Resize.m */
,
);
);
path
=
Class
;
path
=
Class
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -2678,6 +2683,7 @@
...
@@ -2678,6 +2683,7 @@
C0DD534D1EE6AE06002D1E0C
/* BaseCell.m in Sources */
,
C0DD534D1EE6AE06002D1E0C
/* BaseCell.m in Sources */
,
C0E8AE091D7D030B00C193DC
/* KWMEditAddressVC.m in Sources */
,
C0E8AE091D7D030B00C193DC
/* KWMEditAddressVC.m in Sources */
,
807AF4A51DC984950000A326
/* KWMCustomerResult.m in Sources */
,
807AF4A51DC984950000A326
/* KWMCustomerResult.m in Sources */
,
DA8B97801F58F816002FC38A
/* SDImageCache+Resize.m in Sources */
,
C066650F1D7675FC00F02EF4
/* KWMAboutUsVC.m in Sources */
,
C066650F1D7675FC00F02EF4
/* KWMAboutUsVC.m in Sources */
,
807AF4A31DC984950000A326
/* KWMBlogResult.m in Sources */
,
807AF4A31DC984950000A326
/* KWMBlogResult.m in Sources */
,
C0CC14081D7823B0007B5986
/* KWMSizeCell.m in Sources */
,
C0CC14081D7823B0007B5986
/* KWMSizeCell.m in Sources */
,
...
...
iCemarose/Assets.xcassets/ad_home_header_placeholder.imageset/Contents.json
0 → 100644
View file @
fbd54512
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"ad_home_header_placeholder@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
iCemarose/Assets.xcassets/ad_home_header_placeholder.imageset/ad_home_header_placeholder@3x.png
0 → 100644
View file @
fbd54512
33.6 KB
iCemarose/Class/Api/Cemarose/KWMCartResult.m
View file @
fbd54512
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
// shopCartModel.price = [item[@"discounted_price"] floatValue] / 100;
// shopCartModel.price = [item[@"discounted_price"] floatValue] / 100;
shopCartModel
.
price
=
[[
NSDecimalNumber
decimalNumberWithString
:[
item
[
@"discounted_price"
]
stringValue
]]
decimalNumberByDividingBy
:[
NSDecimalNumber
decimalNumberWithDecimal
:
@
(
100
).
decimalValue
]];
shopCartModel
.
price
=
[[
NSDecimalNumber
decimalNumberWithString
:[
item
[
@"discounted_price"
]
stringValue
]]
decimalNumberByDividingBy
:[
NSDecimalNumber
decimalNumberWithDecimal
:
@
(
100
).
decimalValue
]];
shopCartModel
.
line_price
=
[[
NSDecimalNumber
decimalNumberWithString
:[
item
[
@"line_price"
]
stringValue
]]
decimalNumberByDividingBy
:[
NSDecimalNumber
decimalNumberWithDecimal
:
@
(
100
).
decimalValue
]];
shopCartModel
.
line_price
=
[[
NSDecimalNumber
decimalNumberWithString
:[
item
[
@"line_price"
]
stringValue
]]
decimalNumberByDividingBy
:[
NSDecimalNumber
decimalNumberWithDecimal
:
@
(
100
).
decimalValue
]];
shopCartModel
.
imageStr
=
[
KWMImageUtil
getProductImageUrlByOriginalUrl
:
item
[
@"image"
]
ImageSize
:
Norma
lImage
];
shopCartModel
.
imageStr
=
[
KWMImageUtil
getProductImageUrlByOriginalUrl
:
item
[
@"image"
]
ImageSize
:
Smal
lImage
];
shopCartModel
.
shopCartDict
=
item
;
shopCartModel
.
shopCartDict
=
item
;
[
datas
addObject
:
shopCartModel
];
[
datas
addObject
:
shopCartModel
];
}
}
...
...
iCemarose/Class/SDImageCache+Resize.h
0 → 100644
View file @
fbd54512
//
// SDImageCache+Resize.h
// iCemarose
//
// Created by Sanchew on 2017/9/1.
// Copyright © 2017年 kollway. All rights reserved.
//
#import <SDWebImage/SDImageCache.h>
@interface
SDImageCache
(
Resize
)
@end
iCemarose/Class/SDImageCache+Resize.m
0 → 100644
View file @
fbd54512
//
// SDImageCache+Resize.m
// iCemarose
//
// Created by Sanchew on 2017/9/1.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "SDImageCache+Resize.h"
#import <Aspects/Aspects.h>
#import <RegexKitLite/RegexKitLite.h>
#import <SDWebImage/SDWebImageDownloader.h>
#import <AFNetworking/AFNetworking.h>
@implementation
SDImageCache
(
Resize
)
+
(
void
)
load
{
[
self
aspect_hookSelector
:
@selector
(
queryDiskCacheForKey
:
done
:
)
withOptions
:
AspectPositionInstead
usingBlock
:^
(
id
<
AspectInfo
>
info
){
SDWebImageQueryCompletedBlock
real
=
info
.
arguments
[
1
];
SDWebImageQueryCompletedBlock
block
=
^
(
UIImage
*
image
,
SDImageCacheType
cacheType
)
{
NSString
*
reg
=
@"imageView2/2/w/(
\\
d+)/h/(
\\
d+)"
;
NSArray
*
sizeM
=
@[
@"150"
,
@"300"
,
@"500"
,
@"1000"
];
NSString
*
imageUrl
=
info
.
arguments
[
0
];
if
(
!
image
&&
[
imageUrl
isMatchedByRegex
:
reg
])
{
NSArray
*
sizes
=
[
imageUrl
captureComponentsMatchedByRegex
:
reg
];
NSUInteger
si
=
[
sizeM
indexOfObject
:
sizes
[
1
]];
if
(
sizeM
.
count
>
si
+
1
)
{
NSString
*
cs
=
sizeM
[
si
+
1
];
NSString
*
niu
=
[
imageUrl
stringByReplacingOccurrencesOfRegex
:
reg
withString
:[
NSString
stringWithFormat
:
@"imageView2/2/w/%@/h/%@"
,
cs
,
cs
]];
[
info
.
originalInvocation
.
target
queryDiskCacheForKey
:
niu
done
:
real
];
return
;
}
}
real
(
image
,
cacheType
);
};
[
info
.
originalInvocation
setArgument
:
&
block
atIndex
:
3
];
[
info
.
originalInvocation
invoke
];
}
error
:
nil
];
}
@end
//@implementation SDWebImageDownloader (log)
////- (id <SDWebImageOperation>)downloadImageWithURL:(NSURL *)url options:(SDWebImageDownloaderOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageDownloaderCompletedBlock)completedBlock
//
//+ (void)load {
// [self aspect_hookSelector:@selector(downloadImageWithURL:options:progress:completed:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> info) {
// NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
// AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
// NSString *url = [NSString stringWithFormat:@"http://localhost:3001?c=%@",info.arguments[0]];
// NSURL *URL = [NSURL URLWithString:url];
// NSURLRequest *request = [NSURLRequest requestWithURL:URL];
//
// NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:nil];
// [dataTask resume];
// } error:nil];
//}
//
//@end
iCemarose/Class/UI/NewHome/Cell/KWMAdHeader.m
View file @
fbd54512
...
@@ -65,12 +65,12 @@
...
@@ -65,12 +65,12 @@
_focusView
=
[[
SDCycleScrollView
alloc
]
init
];
_focusView
=
[[
SDCycleScrollView
alloc
]
init
];
_focusView
.
delegate
=
self
;
_focusView
.
delegate
=
self
;
_focusView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_focusView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
_focusView
.
frame
=
CGRectMake
(
0
,
0
,
375
,
190
);
// _focusView.frame = CGRectMake(0, 0, UI_SCREEN_WIDTH, 304 * UI_SCREEN_WIDTH / 414
);
_focusView
.
autoScrollTimeInterval
=
3
;
_focusView
.
autoScrollTimeInterval
=
3
;
_focusView
.
pageControlAliment
=
SDCycleScrollViewPageContolAlimentRight
;
_focusView
.
pageControlAliment
=
SDCycleScrollViewPageContolAlimentRight
;
_focusView
.
pageDotImage
=
[
UIImage
imageNamed
:
@"ic_page_1"
];
_focusView
.
pageDotImage
=
[
UIImage
imageNamed
:
@"ic_page_1"
];
_focusView
.
currentPageDotImage
=
[
UIImage
imageNamed
:
@"ic_page_2"
];
_focusView
.
currentPageDotImage
=
[
UIImage
imageNamed
:
@"ic_page_2"
];
_focusView
.
placeholderImage
=
[
UIImage
imageNamed
:
@"
ic_loading
"
];
_focusView
.
placeholderImage
=
[
UIImage
imageNamed
:
@"
ad_home_header_placeholder
"
];
_focusView
.
backgroundColor
=
[
UIColor
whiteColor
];
_focusView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
self
addSubview
:
_focusView
];
[
self
addSubview
:
_focusView
];
NSDictionary
*
views
=
@{
@"v"
:
_focusView
};
NSDictionary
*
views
=
@{
@"v"
:
_focusView
};
...
...
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