Commit 5b16b72c38f5ebd75b7d1983dddd55f0493efd51

Authored by zhangxiaowen
1 parent 68fd5c87

no message

CNLiveQrCodeModule/Classes/View/CNLiveMyQrCodeView.m
... ... @@ -125,7 +125,9 @@ static const CGFloat timeValue = 1.5;
125 125 NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
126 126  
127 127 UIImage *xw_image = [self getImageWithImageName:@"qr_code_icon" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeView class]];
128   - [strongSelf.qrCode sd_setImageWithURL:nil placeholderImage:[SGQRCodeObtain generateQRCodeWithData:jsonStr size:SCREEN_WIDTH-12*margin logoImage:xw_image ratio:0.2]];
  128 + 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 + [[SDImageCache sharedImageCache] storeImage:image forKey:CNUserShareModel.uid toDisk:YES completion:NULL];
129 131  
130 132 if([type isEqualToString:@"reset"]){
131 133 [QMUITips showSucceed:@"重置成功" inView:strongSelf hideAfterDelay:timeValue];
... ... @@ -191,7 +193,7 @@ static const CGFloat timeValue = 1.5;
191 193 - (UIImageView *)qrCode {
192 194 if (!_qrCode) {
193 195 _qrCode = [[UIImageView alloc] init];
194   - _qrCode.image = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:CNUserShareModel.uid];
  196 + [_qrCode sd_setImageWithURL:nil placeholderImage:[[SDImageCache sharedImageCache] imageFromDiskCacheForKey:CNUserShareModel.uid]];
195 197 }
196 198 return _qrCode;
197 199 }
... ...