Commit 6998e73fff9b52c743096fc3e35e442cdccd1de4

Authored by zhangxiaowen
1 parent a298cf08

no message

CNLiveMineModule/Classes/Controller/CNLiveMineController.m
@@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
16 #import "CNLiveMineCell.h" 16 #import "CNLiveMineCell.h"
17 #import "CNLiveMineModel.h" 17 #import "CNLiveMineModel.h"
18 18
19 -#define HexColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]  
20 -  
21 @interface CNLiveMineController()<UITableViewDelegate, UITableViewDataSource, CNLiveMineHeaderViewDelegate, CNLiveMineCellDelegate> 19 @interface CNLiveMineController()<UITableViewDelegate, UITableViewDataSource, CNLiveMineHeaderViewDelegate, CNLiveMineCellDelegate>
22 @property (nonatomic, strong) UITableView *tableView; 20 @property (nonatomic, strong) UITableView *tableView;
23 @property (nonatomic, weak) CNLiveMineHeaderView *headerView; 21 @property (nonatomic, weak) CNLiveMineHeaderView *headerView;
@@ -89,7 +87,7 @@ static const NSInteger kHEIGHT = 250; @@ -89,7 +87,7 @@ static const NSInteger kHEIGHT = 250;
89 87
90 - (void)viewDidLoad { 88 - (void)viewDidLoad {
91 [super viewDidLoad]; 89 [super viewDidLoad];
92 - self.view.backgroundColor = HexColor(0xf4f4f4); 90 + self.view.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:244.0/255.0 blue:244.0/255.0 alpha:1.0];
93 if (@available(iOS 11, *)) { 91 if (@available(iOS 11, *)) {
94 self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; 92 self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
95 } 93 }
@@ -305,7 +303,7 @@ static const NSInteger kHEIGHT = 250; @@ -305,7 +303,7 @@ static const NSInteger kHEIGHT = 250;
305 _tableView.delegate = self; 303 _tableView.delegate = self;
306 _tableView.dataSource = self; 304 _tableView.dataSource = self;
307 _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 305 _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
308 - _tableView.backgroundColor = HexColor(0xf4f4f4); 306 + _tableView.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:244.0/255.0 blue:244.0/255.0 alpha:1.0];
309 _tableView.estimatedRowHeight = 0; 307 _tableView.estimatedRowHeight = 0;
310 _tableView.estimatedSectionHeaderHeight = 0; 308 _tableView.estimatedSectionHeaderHeight = 0;
311 _tableView.estimatedSectionFooterHeight = 0; 309 _tableView.estimatedSectionFooterHeight = 0;
CNLiveMineModule/Classes/Module/CNLiveMineService.m
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 17
18 @implementation CNLiveMineService 18 @implementation CNLiveMineService
19 19
  20 +// 我的
20 - (UIViewController *)getMineViewController { 21 - (UIViewController *)getMineViewController {
21 return [CNLiveMineController new]; 22 return [CNLiveMineController new];
22 } 23 }
@@ -26,4 +27,14 @@ @@ -26,4 +27,14 @@
26 [CNLivePageJumpManager pushViewController:vc]; 27 [CNLivePageJumpManager pushViewController:vc];
27 } 28 }
28 29
  30 +
  31 +
  32 +// 积分
  33 +// 目击者
  34 +// 订单
  35 +// 余额
  36 +// 我的收藏
  37 +// 设置
  38 +
  39 +
29 @end 40 @end
CNLiveMineModule/Classes/View/CNLiveMineCell.m
@@ -10,8 +10,6 @@ @@ -10,8 +10,6 @@
10 #import <Masonry/Masonry.h> 10 #import <Masonry/Masonry.h>
11 #import "QMUIKit.h" 11 #import "QMUIKit.h"
12 12
13 -#define HexColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]  
14 -  
15 @interface CNLiveMineCell() 13 @interface CNLiveMineCell()
16 @property (nonatomic, strong) UIView *bgView; 14 @property (nonatomic, strong) UIView *bgView;
17 @property (nonatomic, strong) UIButton *titleButton; 15 @property (nonatomic, strong) UIButton *titleButton;
@@ -25,7 +23,7 @@ @@ -25,7 +23,7 @@
25 - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ 23 - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
26 self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 24 self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
27 if (self) { 25 if (self) {
28 - self.contentView.backgroundColor = HexColor(0xf4f4f4); 26 + self.contentView.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:244.0/255.0 blue:244.0/255.0 alpha:1.0];
29 [self xw_layoutSubviews]; 27 [self xw_layoutSubviews];
30 } 28 }
31 return self; 29 return self;
@@ -34,6 +32,7 @@ @@ -34,6 +32,7 @@
34 - (void)xw_layoutSubviews{ 32 - (void)xw_layoutSubviews{
35 [self.contentView addSubview:self.bgView]; 33 [self.contentView addSubview:self.bgView];
36 [self.contentView addSubview:self.titleButton]; 34 [self.contentView addSubview:self.titleButton];
  35 + [self.contentView addSubview:self.allButton];
37 [self.contentView addSubview:self.line]; 36 [self.contentView addSubview:self.line];
38 } 37 }
39 38
@@ -42,7 +41,8 @@ @@ -42,7 +41,8 @@
42 [_titleButton setTitle:model.name forState:UIControlStateNormal]; 41 [_titleButton setTitle:model.name forState:UIControlStateNormal];
43 UIImage *xw_image = [self xw_getImageName:model.pic bundleName:@"CNLiveMineModule" targetClass:[CNLiveMineCell class]]; 42 UIImage *xw_image = [self xw_getImageName:model.pic bundleName:@"CNLiveMineModule" targetClass:[CNLiveMineCell class]];
44 [_titleButton setImage:xw_image forState:UIControlStateNormal]; 43 [_titleButton setImage:xw_image forState:UIControlStateNormal];
45 - 44 + _allButton.hidden = YES;
  45 +
46 switch (model.type) { 46 switch (model.type) {
47 case CNLiveMineCellTypeOrder: 47 case CNLiveMineCellTypeOrder:
48 { 48 {
@@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@
89 89
90 }]; 90 }];
91 91
92 - [self.contentView addSubview:self.allButton]; 92 + _allButton.hidden = NO;
93 [_allButton mas_makeConstraints:^(MASConstraintMaker *make) { 93 [_allButton mas_makeConstraints:^(MASConstraintMaker *make) {
94 make.top.equalTo(self.titleButton.mas_top); 94 make.top.equalTo(self.titleButton.mas_top);
95 make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin); 95 make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin);
@@ -134,6 +134,8 @@ @@ -134,6 +134,8 @@
134 make.height.with.offset(50); 134 make.height.with.offset(50);
135 135
136 }]; 136 }];
  137 + _allButton.hidden = YES;
  138 +
137 [_line mas_makeConstraints:^(MASConstraintMaker *make) { 139 [_line mas_makeConstraints:^(MASConstraintMaker *make) {
138 make.top.equalTo(self.titleButton.mas_bottom).with.offset(0); 140 make.top.equalTo(self.titleButton.mas_bottom).with.offset(0);
139 make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); 141 make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin);
@@ -175,6 +177,8 @@ @@ -175,6 +177,8 @@
175 make.height.with.offset(50); 177 make.height.with.offset(50);
176 178
177 }]; 179 }];
  180 + _allButton.hidden = YES;
  181 +
178 [_line mas_makeConstraints:^(MASConstraintMaker *make) { 182 [_line mas_makeConstraints:^(MASConstraintMaker *make) {
179 make.top.equalTo(self.titleButton.mas_bottom).with.offset(0); 183 make.top.equalTo(self.titleButton.mas_bottom).with.offset(0);
180 make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); 184 make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin);
@@ -211,6 +215,8 @@ @@ -211,6 +215,8 @@
211 make.height.with.offset(50); 215 make.height.with.offset(50);
212 216
213 }]; 217 }];
  218 + _allButton.hidden = YES;
  219 +
214 [_line mas_makeConstraints:^(MASConstraintMaker *make) { 220 [_line mas_makeConstraints:^(MASConstraintMaker *make) {
215 make.top.equalTo(self.titleButton.mas_bottom).with.offset(0); 221 make.top.equalTo(self.titleButton.mas_bottom).with.offset(0);
216 make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin); 222 make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin);
@@ -233,26 +239,6 @@ @@ -233,26 +239,6 @@
233 } 239 }
234 } 240 }
235 241
236 -- (UIButton *)createButtonWithFrame:(CGRect)frame title:(NSString *)title image:(NSString *)image tag:(NSInteger)tag{  
237 - UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];  
238 - btn.tag = tag;  
239 - btn.frame = frame;  
240 - btn.titleLabel.font = [UIFont systemFontOfSize:14];  
241 - btn.titleLabel.textAlignment = NSTextAlignmentCenter;  
242 - btn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;//使图片和文字水平居中显示  
243 -  
244 - [btn setTitle:title forState:UIControlStateNormal];  
245 - [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];  
246 - UIImage *xw_image = [self xw_getImageName:image bundleName:@"CNLiveMineModule" targetClass:[CNLiveMineCell class]];  
247 - [btn setImage:xw_image forState:UIControlStateNormal];  
248 - btn.adjustsImageWhenHighlighted = NO;  
249 - [btn addTarget:self action:@selector(btnDidClicked:) forControlEvents:UIControlEventTouchUpInside];  
250 - btn.titleEdgeInsets = UIEdgeInsetsMake(btn.imageView.frame.size.height+self.model.margin, -btn.imageView.frame.size.width, 0, 0);  
251 - btn.imageEdgeInsets = UIEdgeInsetsMake(-btn.titleLabel.bounds.size.height, 0, self.model.margin, -btn.titleLabel.bounds.size.width);  
252 - return btn;  
253 -  
254 -}  
255 -  
256 - (void)awakeFromNib { 242 - (void)awakeFromNib {
257 [super awakeFromNib]; 243 [super awakeFromNib];
258 // Initialization code 244 // Initialization code
@@ -305,11 +291,11 @@ @@ -305,11 +291,11 @@
305 [_allButton setImage:xw_image forState:UIControlStateNormal]; 291 [_allButton setImage:xw_image forState:UIControlStateNormal];
306 [_allButton setImage:xw_image forState:UIControlStateHighlighted]; 292 [_allButton setImage:xw_image forState:UIControlStateHighlighted];
307 _allButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; 293 _allButton.titleLabel.font = [UIFont boldSystemFontOfSize:12];
308 - [_allButton setTitleColor:[UIColor colorWithRed:200.0/255.0 green:200.0/255.0 blue:200.0/255.0 alpha:1.0] forState:UIControlStateNormal]; 294 + [_allButton setTitleColor:[UIColor colorWithRed:190.0/255.0 green:190.0/255.0 blue:190.0/255.0 alpha:1.0] forState:UIControlStateNormal];
309 _allButton.adjustsImageWhenHighlighted = NO; 295 _allButton.adjustsImageWhenHighlighted = NO;
310 [_allButton addTarget:self action:@selector(allBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; 296 [_allButton addTarget:self action:@selector(allBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
311 297
312 - _allButton.titleEdgeInsets = UIEdgeInsetsMake(0, -12, 0, 12); 298 + _allButton.titleEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 10);
313 _allButton.imageEdgeInsets = UIEdgeInsetsMake(0, 50, 0, -50); 299 _allButton.imageEdgeInsets = UIEdgeInsetsMake(0, 50, 0, -50);
314 300
315 } 301 }
@@ -319,10 +305,32 @@ @@ -319,10 +305,32 @@
319 - (UIView *)line{ 305 - (UIView *)line{
320 if (!_line) { 306 if (!_line) {
321 _line = [[UIView alloc] init]; 307 _line = [[UIView alloc] init];
322 - _line.backgroundColor = HexColor(0xebebeb); 308 + _line.backgroundColor = [UIColor colorWithRed:235/255.0 green:235/255.0 blue:235/255.0 alpha:1.0];
323 } 309 }
324 return _line; 310 return _line;
325 } 311 }
  312 +
  313 +#pragma mark - 私有方法
  314 +- (UIButton *)createButtonWithFrame:(CGRect)frame title:(NSString *)title image:(NSString *)image tag:(NSInteger)tag{
  315 + UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
  316 + btn.tag = tag;
  317 + btn.frame = frame;
  318 + btn.titleLabel.font = [UIFont systemFontOfSize:14];
  319 + btn.titleLabel.textAlignment = NSTextAlignmentCenter;
  320 + btn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;//使图片和文字水平居中显示
  321 +
  322 + [btn setTitle:title forState:UIControlStateNormal];
  323 + [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  324 + UIImage *xw_image = [self xw_getImageName:image bundleName:@"CNLiveMineModule" targetClass:[CNLiveMineCell class]];
  325 + [btn setImage:xw_image forState:UIControlStateNormal];
  326 + btn.adjustsImageWhenHighlighted = NO;
  327 + [btn addTarget:self action:@selector(btnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
  328 + btn.titleEdgeInsets = UIEdgeInsetsMake(btn.imageView.frame.size.height+self.model.margin, -btn.imageView.frame.size.width, 0, 0);
  329 + btn.imageEdgeInsets = UIEdgeInsetsMake(-btn.titleLabel.bounds.size.height, 0, self.model.margin, -btn.titleLabel.bounds.size.width);
  330 + return btn;
  331 +
  332 +}
  333 +
326 /** 334 /**
327 * 创建图片 335 * 创建图片
328 * 336 *
CNLiveMineModule/Classes/View/CNLiveMineHeaderView.m
@@ -11,8 +11,6 @@ @@ -11,8 +11,6 @@
11 #import <SDWebImage/SDWebImage.h> 11 #import <SDWebImage/SDWebImage.h>
12 #import "QMUIKit.h" 12 #import "QMUIKit.h"
13 13
14 -#define HexColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]  
15 -  
16 @interface CNLiveMineHeaderView () 14 @interface CNLiveMineHeaderView ()
17 @property (nonatomic, strong) UIImageView *bgView; 15 @property (nonatomic, strong) UIImageView *bgView;
18 @property (nonatomic, strong) UIButton *witness; 16 @property (nonatomic, strong) UIButton *witness;
@@ -32,7 +30,7 @@ static const NSInteger margin = 20; @@ -32,7 +30,7 @@ static const NSInteger margin = 20;
32 self = [super initWithFrame:frame]; 30 self = [super initWithFrame:frame];
33 if(self){ 31 if(self){
34 self.userInteractionEnabled = YES; 32 self.userInteractionEnabled = YES;
35 - self.backgroundColor = HexColor(0xf4f4f4); 33 + self.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:244.0/255.0 blue:244.0/255.0 alpha:1.0];
36 // [XWUserInfoNotification addUserInfoUpdateObserver:self selector:@selector(userInfoUpdateNotification:)]; 34 // [XWUserInfoNotification addUserInfoUpdateObserver:self selector:@selector(userInfoUpdateNotification:)];
37 [self createSubViews]; 35 [self createSubViews];
38 } 36 }
@@ -268,7 +266,7 @@ static const NSInteger margin = 20; @@ -268,7 +266,7 @@ static const NSInteger margin = 20;
268 _address = [[UILabel alloc] init]; 266 _address = [[UILabel alloc] init];
269 _address.numberOfLines = 1; 267 _address.numberOfLines = 1;
270 _address.textColor = [UIColor colorWithRed:140/255.0 green:140/255.0 blue:142/255.0 alpha:1.0]; 268 _address.textColor = [UIColor colorWithRed:140/255.0 green:140/255.0 blue:142/255.0 alpha:1.0];
271 - _address.font = [UIFont systemFontOfSize:14]; 269 + _address.font = [UIFont systemFontOfSize:13];
272 _address.attributedText = [self createAttributedImageName:@"mine_location" string:@"北京海淀区花园桥" isFront:YES]; 270 _address.attributedText = [self createAttributedImageName:@"mine_location" string:@"北京海淀区花园桥" isFront:YES];
273 } 271 }
274 return _address; 272 return _address;
CNLiveMineModule/Classes/View/CNLiveMineNavigationBar.m
@@ -12,8 +12,6 @@ @@ -12,8 +12,6 @@
12 #import "QMUIKit.h" 12 #import "QMUIKit.h"
13 #import "CNUserInfoManager.h" 13 #import "CNUserInfoManager.h"
14 14
15 -#define HexColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]  
16 -  
17 @interface CNLiveMineNavigationBar () 15 @interface CNLiveMineNavigationBar ()
18 @property (nonatomic, strong) UIImageView *header; 16 @property (nonatomic, strong) UIImageView *header;
19 @property (nonatomic, strong) UILabel *name; 17 @property (nonatomic, strong) UILabel *name;