Commit a6599e035b83179d7cccc4bec533577646a64004
1 parent
5b16b72c
no message
Showing
1 changed file
with
3 additions
and
1 deletions
CNLiveQrCodeModule/Classes/View/CNLiveMyQrCodeView.m
| @@ -125,6 +125,7 @@ static const CGFloat timeValue = 1.5; | @@ -125,6 +125,7 @@ static const CGFloat timeValue = 1.5; | ||
| 125 | NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; | 125 | NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; |
| 126 | 126 | ||
| 127 | UIImage *xw_image = [self getImageWithImageName:@"qr_code_icon" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeView class]]; | 127 | UIImage *xw_image = [self getImageWithImageName:@"qr_code_icon" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeView class]]; |
| 128 | + | ||
| 128 | UIImage *image = [SGQRCodeObtain generateQRCodeWithData:jsonStr size:SCREEN_WIDTH-12*margin logoImage:xw_image ratio:0.2]; | 129 | UIImage *image = [SGQRCodeObtain generateQRCodeWithData:jsonStr size:SCREEN_WIDTH-12*margin logoImage:xw_image ratio:0.2]; |
| 129 | [strongSelf.qrCode sd_setImageWithURL:nil placeholderImage:image]; | 130 | [strongSelf.qrCode sd_setImageWithURL:nil placeholderImage:image]; |
| 130 | [[SDImageCache sharedImageCache] storeImage:image forKey:CNUserShareModel.uid toDisk:YES completion:NULL]; | 131 | [[SDImageCache sharedImageCache] storeImage:image forKey:CNUserShareModel.uid toDisk:YES completion:NULL]; |
| @@ -193,7 +194,8 @@ static const CGFloat timeValue = 1.5; | @@ -193,7 +194,8 @@ static const CGFloat timeValue = 1.5; | ||
| 193 | - (UIImageView *)qrCode { | 194 | - (UIImageView *)qrCode { |
| 194 | if (!_qrCode) { | 195 | if (!_qrCode) { |
| 195 | _qrCode = [[UIImageView alloc] init]; | 196 | _qrCode = [[UIImageView alloc] init]; |
| 196 | - [_qrCode sd_setImageWithURL:nil placeholderImage:[[SDImageCache sharedImageCache] imageFromDiskCacheForKey:CNUserShareModel.uid]]; | 197 | + UIImage *image = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:CNUserShareModel.uid]; |
| 198 | + [_qrCode sd_setImageWithURL:nil placeholderImage:image]; | ||
| 197 | } | 199 | } |
| 198 | return _qrCode; | 200 | return _qrCode; |
| 199 | } | 201 | } |