Commit a087a082 by houweibin

1,图片获取方法补完。。

parent 5b9b3e13
......@@ -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;
}
......
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