Commit c184edab6f3f320df6f2169fbf72865332bce55f

Authored by zhangxiaowen
1 parent dd5a2268

no message

CNLiveQrCodeModule/Classes/Controller/CNLiveGenerateQrCodeController.m
@@ -235,7 +235,7 @@ static const CGFloat timeValue = 1.5; @@ -235,7 +235,7 @@ static const CGFloat timeValue = 1.5;
235 _navigationBar = [[CNLiveQrCodeNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)]; 235 _navigationBar = [[CNLiveQrCodeNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];
236 _navigationBar.delegate = self; 236 _navigationBar.delegate = self;
237 _navigationBar.title.text = @"生成二维码"; 237 _navigationBar.title.text = @"生成二维码";
238 - UIImage *image2 = [UIImage cn_getImageName:@"mine_code_more" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]]; 238 + UIImage *image2 = [self getImageWithImageName:@"mine_code_more" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]];
239 [_navigationBar.right setImage:[image2 imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; 239 [_navigationBar.right setImage:[image2 imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
240 } 240 }
241 return _navigationBar; 241 return _navigationBar;
CNLiveQrCodeModule/Classes/Controller/CNLiveGroupQrCodeController.m
@@ -87,7 +87,7 @@ static const CGFloat timeValue = 1.5; @@ -87,7 +87,7 @@ static const CGFloat timeValue = 1.5;
87 _navigationBar = [[CNLiveQrCodeNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)]; 87 _navigationBar = [[CNLiveQrCodeNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];
88 _navigationBar.backgroundColor = [UIColor whiteColor]; 88 _navigationBar.backgroundColor = [UIColor whiteColor];
89 _navigationBar.delegate = self; 89 _navigationBar.delegate = self;
90 - UIImage *image = [UIImage cn_getImageName:@"code_back_black_b" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveGroupQrCodeController class]]; 90 + UIImage *image = [self getImageWithImageName:@"code_back_black_b" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveGroupQrCodeController class]];
91 [_navigationBar.left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; 91 [_navigationBar.left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
92 _navigationBar.title.text = @"群二维码名片"; 92 _navigationBar.title.text = @"群二维码名片";
93 _navigationBar.title.textColor = [UIColor blackColor]; 93 _navigationBar.title.textColor = [UIColor blackColor];
CNLiveQrCodeModule/Classes/Controller/CNLiveMyQrCodeController.m
@@ -229,7 +229,7 @@ static const CGFloat timeValue = 1.5; @@ -229,7 +229,7 @@ static const CGFloat timeValue = 1.5;
229 - (UIImageView *)bgView{ 229 - (UIImageView *)bgView{
230 if(!_bgView){ 230 if(!_bgView){
231 _bgView = [[UIImageView alloc]initWithFrame:self.view.bounds]; 231 _bgView = [[UIImageView alloc]initWithFrame:self.view.bounds];
232 - UIImage *image = [UIImage cn_getImageName:@"qr_code_bg" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeController class]]; 232 + UIImage *image = [self getImageWithImageName:@"qr_code_bg" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeController class]];
233 [_bgView sd_setImageWithURL:[NSURL URLWithString:@"User_Head"] placeholderImage:image completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { 233 [_bgView sd_setImageWithURL:[NSURL URLWithString:@"User_Head"] placeholderImage:image completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
234 }]; 234 }];
235 } 235 }
@@ -248,7 +248,7 @@ static const CGFloat timeValue = 1.5; @@ -248,7 +248,7 @@ static const CGFloat timeValue = 1.5;
248 _navigationBar = [[CNLiveQrCodeNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)]; 248 _navigationBar = [[CNLiveQrCodeNavigationBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NavigationContentTop)];
249 _navigationBar.delegate = self; 249 _navigationBar.delegate = self;
250 _navigationBar.title.text = @"我的二维码"; 250 _navigationBar.title.text = @"我的二维码";
251 - UIImage *image2 = [UIImage cn_getImageName:@"mine_code_more" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeController class]]; 251 + UIImage *image2 = [self getImageWithImageName:@"mine_code_more" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveMyQrCodeController class]];
252 [_navigationBar.right setImage:[image2 imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; 252 [_navigationBar.right setImage:[image2 imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
253 } 253 }
254 return _navigationBar; 254 return _navigationBar;
CNLiveQrCodeModule/Classes/Controller/CNLiveScanQrCodeController.m
@@ -300,8 +300,8 @@ static const CGFloat timeValue = 1.5; @@ -300,8 +300,8 @@ static const CGFloat timeValue = 1.5;
300 CGFloat flashlightBtnX = 0.5 * (self.view.frame.size.width - flashlightBtnW); 300 CGFloat flashlightBtnX = 0.5 * (self.view.frame.size.width - flashlightBtnW);
301 CGFloat flashlightBtnY = 0.55 * self.view.frame.size.height; 301 CGFloat flashlightBtnY = 0.55 * self.view.frame.size.height;
302 _flashlightBtn.frame = CGRectMake(flashlightBtnX, flashlightBtnY, flashlightBtnW, flashlightBtnH); 302 _flashlightBtn.frame = CGRectMake(flashlightBtnX, flashlightBtnY, flashlightBtnW, flashlightBtnH);
303 - UIImage *image1 = [UIImage cn_getImageName:@"flashlight_close" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanQrCodeController class]];  
304 - UIImage *image2 = [UIImage cn_getImageName:@"flashlight_open" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanQrCodeController class]]; 303 + UIImage *image1 = [self getImageWithImageName:@"flashlight_close" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanQrCodeController class]];
  304 + UIImage *image2 = [self getImageWithImageName:@"flashlight_open" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanQrCodeController class]];
305 [_flashlightBtn setImage:image1 forState:UIControlStateNormal]; 305 [_flashlightBtn setImage:image1 forState:UIControlStateNormal];
306 [_flashlightBtn setImage:image2 forState:UIControlStateSelected]; 306 [_flashlightBtn setImage:image2 forState:UIControlStateSelected];
307 [_flashlightBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 307 [_flashlightBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
@@ -343,7 +343,7 @@ static const CGFloat timeValue = 1.5; @@ -343,7 +343,7 @@ static const CGFloat timeValue = 1.5;
343 CGFloat flashlightBtnX = 0.5 * (self.view.frame.size.width - flashlightBtnW); 343 CGFloat flashlightBtnX = 0.5 * (self.view.frame.size.width - flashlightBtnW);
344 CGFloat flashlightBtnY = CGRectGetMaxY(self.promptLabel.frame)+15; 344 CGFloat flashlightBtnY = CGRectGetMaxY(self.promptLabel.frame)+15;
345 _codeButton.frame = CGRectMake(flashlightBtnX, flashlightBtnY, flashlightBtnW, flashlightBtnH); 345 _codeButton.frame = CGRectMake(flashlightBtnX, flashlightBtnY, flashlightBtnW, flashlightBtnH);
346 - UIImage *image = [UIImage cn_getImageName:@"qr_code_green" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanQrCodeController class]]; 346 + UIImage *image = [self getImageWithImageName:@"qr_code_green" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanQrCodeController class]];
347 [_codeButton setImage:image forState:UIControlStateNormal]; 347 [_codeButton setImage:image forState:UIControlStateNormal];
348 [_codeButton setTitle:@"我的二维码" forState:UIControlStateNormal]; 348 [_codeButton setTitle:@"我的二维码" forState:UIControlStateNormal];
349 _codeButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:15.0f]; 349 _codeButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:15.0f];
CNLiveQrCodeModule/Classes/Controller/CNLiveScanResultController.m
@@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
79 _navigationBar.title.textColor = [UIColor blackColor]; 79 _navigationBar.title.textColor = [UIColor blackColor];
80 _navigationBar.delegate = self; 80 _navigationBar.delegate = self;
81 81
82 - UIImage *image = [UIImage cn_getImageName:@"code_back_black_b" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanResultController class]]; 82 + UIImage *image = [self getImageWithImageName:@"code_back_black_b" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveScanResultController class]];
83 [_navigationBar.left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; 83 [_navigationBar.left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
84 _navigationBar.right = nil; 84 _navigationBar.right = nil;
85 85
CNLiveQrCodeModule/Classes/View/CNLiveGenerateCodeView.m
@@ -98,7 +98,7 @@ static const NSInteger margin = 20; @@ -98,7 +98,7 @@ static const NSInteger margin = 20;
98 98
99 NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 99 NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
100 100
101 - UIImage *xw_image = [UIImage cn_getImageName:@"qr_code_icon" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]]; 101 + UIImage *xw_image = [self getImageWithImageName:@"qr_code_icon" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]];
102 [self.qrCode sd_setImageWithURL:nil placeholderImage:[SGQRCodeObtain generateQRCodeWithData:jsonStr size:SCREEN_WIDTH-12*margin logoImage:xw_image ratio:0.2]]; 102 [self.qrCode sd_setImageWithURL:nil placeholderImage:[SGQRCodeObtain generateQRCodeWithData:jsonStr size:SCREEN_WIDTH-12*margin logoImage:xw_image ratio:0.2]];
103 103
104 } 104 }
@@ -124,7 +124,7 @@ static const NSInteger margin = 20; @@ -124,7 +124,7 @@ static const NSInteger margin = 20;
124 _header = [[UIImageView alloc] init]; 124 _header = [[UIImageView alloc] init];
125 _header.layer.masksToBounds = YES; 125 _header.layer.masksToBounds = YES;
126 _header.layer.cornerRadius = 5; 126 _header.layer.cornerRadius = 5;
127 - UIImage *xw_image = [UIImage cn_getImageName:@"default_avatar_f" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]]; 127 + UIImage *xw_image = [self getImageWithImageName:@"default_avatar_f" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]];
128 [_header sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.faceUrl] placeholderImage:xw_image]; 128 [_header sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.faceUrl] placeholderImage:xw_image];
129 } 129 }
130 return _header; 130 return _header;
CNLiveQrCodeModule/Classes/View/CNLiveGroupQrCodeView.m
@@ -106,7 +106,7 @@ static const NSInteger margin = 15; @@ -106,7 +106,7 @@ static const NSInteger margin = 15;
106 if (!_groupHead) { 106 if (!_groupHead) {
107 _groupHead = [[UIImageView alloc] init]; 107 _groupHead = [[UIImageView alloc] init];
108 _groupHead.backgroundColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; 108 _groupHead.backgroundColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
109 - UIImage *xw_image = [UIImage cn_getImageName:@"default_avatar_f" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]]; 109 + UIImage *xw_image = [self getImageWithImageName:@"default_avatar_f" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]];
110 [_groupHead sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.faceUrl] placeholderImage:xw_image]; 110 [_groupHead sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.faceUrl] placeholderImage:xw_image];
111 111
112 } 112 }
CNLiveQrCodeModule/Classes/View/CNLiveMyQrCodeView.m
@@ -124,7 +124,7 @@ static const CGFloat timeValue = 1.5; @@ -124,7 +124,7 @@ static const CGFloat timeValue = 1.5;
124 NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDic options:NSJSONWritingPrettyPrinted error:nil]; 124 NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDic options:NSJSONWritingPrettyPrinted error:nil];
125 NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 125 NSString *jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
126 126
127 - UIImage *xw_image = [UIImage cn_getImageName:@"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 [strongSelf.qrCode sd_setImageWithURL:nil placeholderImage:[SGQRCodeObtain generateQRCodeWithData:jsonStr size:SCREEN_WIDTH-12*margin logoImage:xw_image ratio:0.2]];
129 129
130 if([type isEqualToString:@"reset"]){ 130 if([type isEqualToString:@"reset"]){
@@ -162,7 +162,7 @@ static const CGFloat timeValue = 1.5; @@ -162,7 +162,7 @@ static const CGFloat timeValue = 1.5;
162 _header = [[UIImageView alloc] init]; 162 _header = [[UIImageView alloc] init];
163 _header.layer.masksToBounds = YES; 163 _header.layer.masksToBounds = YES;
164 _header.layer.cornerRadius = 5; 164 _header.layer.cornerRadius = 5;
165 - UIImage *xw_image = [UIImage cn_getImageName:@"default_avatar_f" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]]; 165 + UIImage *xw_image = [self getImageWithImageName:@"default_avatar_f" bundleName:@"CNLiveQrCodeModule" targetClass:[self class]];
166 [_header sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.faceUrl] placeholderImage:xw_image]; 166 [_header sd_setImageWithURL:[NSURL URLWithString:CNUserShareModel.faceUrl] placeholderImage:xw_image];
167 } 167 }
168 return _header; 168 return _header;
CNLiveQrCodeModule/Classes/View/CNLiveQrCodeNavigationBar.m
@@ -60,7 +60,7 @@ static const NSInteger margin = 15; @@ -60,7 +60,7 @@ static const NSInteger margin = 15;
60 _left= [UIButton buttonWithType:UIButtonTypeCustom]; 60 _left= [UIButton buttonWithType:UIButtonTypeCustom];
61 _left.adjustsImageWhenHighlighted = NO; 61 _left.adjustsImageWhenHighlighted = NO;
62 _left.frame = CGRectMake(margin, StatusBarHeight, NavigationBarHeight, NavigationBarHeight); 62 _left.frame = CGRectMake(margin, StatusBarHeight, NavigationBarHeight, NavigationBarHeight);
63 - UIImage *image = [UIImage cn_getImageName:@"mine_back_white_b" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveQrCodeNavigationBar class]]; 63 + UIImage *image = [self getImageWithImageName:@"mine_back_white_b" bundleName:@"CNLiveQrCodeModule" targetClass:[CNLiveQrCodeNavigationBar class]];
64 [_left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; 64 [_left setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
65 [_left setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft]; 65 [_left setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
66 [_left addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside]; 66 [_left addTarget:self action:@selector(goBack) forControlEvents:UIControlEventTouchUpInside];