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,7 +125,9 @@ 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 - [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 if([type isEqualToString:@"reset"]){ 132 if([type isEqualToString:@"reset"]){
131 [QMUITips showSucceed:@"重置成功" inView:strongSelf hideAfterDelay:timeValue]; 133 [QMUITips showSucceed:@"重置成功" inView:strongSelf hideAfterDelay:timeValue];
@@ -191,7 +193,7 @@ static const CGFloat timeValue = 1.5; @@ -191,7 +193,7 @@ static const CGFloat timeValue = 1.5;
191 - (UIImageView *)qrCode { 193 - (UIImageView *)qrCode {
192 if (!_qrCode) { 194 if (!_qrCode) {
193 _qrCode = [[UIImageView alloc] init]; 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 return _qrCode; 198 return _qrCode;
197 } 199 }