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
a087a082
Commit
a087a082
authored
7 years ago
by
houweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,图片获取方法补完。。
parent
5b9b3e13
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
KWMImageUtil.m
iCemarose/Class/Util/KWMImageUtil.m
+12
-8
No files found.
iCemarose/Class/Util/KWMImageUtil.m
View file @
a087a082
...
...
@@ -158,7 +158,7 @@
return
productImages
;
}
for
(
BUYImageLink
*
imageLink
in
imageLinks
){
NSString
*
productImage
=
[
imageLink
.
sourceURL
.
absoluteString
stringByReplacingOccurrencesOfString
:
@"cdn.shopify.com"
withString
:
@"o42yton8r.qnssl.com"
]
;
NSString
*
productImage
=
imageLink
.
sourceURL
.
absoluteString
;
[
productImages
addObject
:
productImage
];
}
return
productImages
;
...
...
@@ -177,8 +177,7 @@
for
(
NSDictionary
*
imageLink
in
imageLinks
){
if
(
imageLink
[
@"src"
]){
NSString
*
originalImage
=
imageLink
[
@"src"
];
NSString
*
productImage
=
[
originalImage
stringByReplacingOccurrencesOfString
:
@"cdn.shopify.com"
withString
:
Image_Domain
];
[
productImages
addObject
:
productImage
];
[
productImages
addObject
:
originalImage
];
}
}
return
productImages
;
...
...
@@ -217,18 +216,22 @@
[
newImageUrl
insertString
:
size
atIndex
:
startRange
.
location
+
1
];
}
}
return
[
NSString
stringWithFormat
:
@"%@"
,
newImageUrl
];;
return
[
newImageUrl
stringByReplacingOccurrencesOfString
:
@"cdn.shopify.com"
withString
:
Image_Domain
];
}
+
(
NSArray
*
)
getImageWH
:
(
NSInteger
)
ImageSize
{
if
(
ImageSize
==
BigImage
){
switch
(
ImageSize
)
{
case
BigImage
:
return
@[
@"1000"
,
@"1000"
];
}
else
if
(
ImageSize
==
SmallImage
){
case
SmallImage
:
return
@[
@"300"
,
@"300"
];
}
else
if
(
ImageSize
==
LowImage
){
case
LowImage
:
return
@[
@"150"
,
@"150"
];
}
else
{
case
NormalImage
:
return
@[
@"500"
,
@"500"
];
default
:
return
@[
@"300"
,
@"300"
];
}
}
...
...
@@ -236,6 +239,7 @@
NSArray
*
imageUrls
=
nil
;
if
(
product
){
imageUrls
=
[
self
getImageArrayBySize
:
product
ImageSize
:
ImageSize
];
return
imageUrls
;
}
return
nil
;
}
...
...
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