Commit 6998e73fff9b52c743096fc3e35e442cdccd1de4

Authored by zhangxiaowen
1 parent a298cf08

no message

CNLiveMineModule/Classes/Controller/CNLiveMineController.m
... ... @@ -16,8 +16,6 @@
16 16 #import "CNLiveMineCell.h"
17 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 19 @interface CNLiveMineController()<UITableViewDelegate, UITableViewDataSource, CNLiveMineHeaderViewDelegate, CNLiveMineCellDelegate>
22 20 @property (nonatomic, strong) UITableView *tableView;
23 21 @property (nonatomic, weak) CNLiveMineHeaderView *headerView;
... ... @@ -89,7 +87,7 @@ static const NSInteger kHEIGHT = 250;
89 87  
90 88 - (void)viewDidLoad {
91 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 91 if (@available(iOS 11, *)) {
94 92 self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
95 93 }
... ... @@ -305,7 +303,7 @@ static const NSInteger kHEIGHT = 250;
305 303 _tableView.delegate = self;
306 304 _tableView.dataSource = self;
307 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 307 _tableView.estimatedRowHeight = 0;
310 308 _tableView.estimatedSectionHeaderHeight = 0;
311 309 _tableView.estimatedSectionFooterHeight = 0;
... ...
CNLiveMineModule/Classes/Module/CNLiveMineService.m
... ... @@ -17,6 +17,7 @@
17 17  
18 18 @implementation CNLiveMineService
19 19  
  20 +// 我的
20 21 - (UIViewController *)getMineViewController {
21 22 return [CNLiveMineController new];
22 23 }
... ... @@ -26,4 +27,14 @@
26 27 [CNLivePageJumpManager pushViewController:vc];
27 28 }
28 29  
  30 +
  31 +
  32 +// 积分
  33 +// 目击者
  34 +// 订单
  35 +// 余额
  36 +// 我的收藏
  37 +// 设置
  38 +
  39 +
29 40 @end
... ...
CNLiveMineModule/Classes/View/CNLiveMineCell.m
... ... @@ -10,8 +10,6 @@
10 10 #import <Masonry/Masonry.h>
11 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 13 @interface CNLiveMineCell()
16 14 @property (nonatomic, strong) UIView *bgView;
17 15 @property (nonatomic, strong) UIButton *titleButton;
... ... @@ -25,7 +23,7 @@
25 23 - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
26 24 self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
27 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 27 [self xw_layoutSubviews];
30 28 }
31 29 return self;
... ... @@ -34,6 +32,7 @@
34 32 - (void)xw_layoutSubviews{
35 33 [self.contentView addSubview:self.bgView];
36 34 [self.contentView addSubview:self.titleButton];
  35 + [self.contentView addSubview:self.allButton];
37 36 [self.contentView addSubview:self.line];
38 37 }
39 38  
... ... @@ -42,7 +41,8 @@
42 41 [_titleButton setTitle:model.name forState:UIControlStateNormal];
43 42 UIImage *xw_image = [self xw_getImageName:model.pic bundleName:@"CNLiveMineModule" targetClass:[CNLiveMineCell class]];
44 43 [_titleButton setImage:xw_image forState:UIControlStateNormal];
45   -
  44 + _allButton.hidden = YES;
  45 +
46 46 switch (model.type) {
47 47 case CNLiveMineCellTypeOrder:
48 48 {
... ... @@ -89,7 +89,7 @@
89 89  
90 90 }];
91 91  
92   - [self.contentView addSubview:self.allButton];
  92 + _allButton.hidden = NO;
93 93 [_allButton mas_makeConstraints:^(MASConstraintMaker *make) {
94 94 make.top.equalTo(self.titleButton.mas_top);
95 95 make.right.equalTo(self.bgView.mas_right).with.offset(-self.model.margin);
... ... @@ -134,6 +134,8 @@
134 134 make.height.with.offset(50);
135 135  
136 136 }];
  137 + _allButton.hidden = YES;
  138 +
137 139 [_line mas_makeConstraints:^(MASConstraintMaker *make) {
138 140 make.top.equalTo(self.titleButton.mas_bottom).with.offset(0);
139 141 make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin);
... ... @@ -175,6 +177,8 @@
175 177 make.height.with.offset(50);
176 178  
177 179 }];
  180 + _allButton.hidden = YES;
  181 +
178 182 [_line mas_makeConstraints:^(MASConstraintMaker *make) {
179 183 make.top.equalTo(self.titleButton.mas_bottom).with.offset(0);
180 184 make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin);
... ... @@ -211,6 +215,8 @@
211 215 make.height.with.offset(50);
212 216  
213 217 }];
  218 + _allButton.hidden = YES;
  219 +
214 220 [_line mas_makeConstraints:^(MASConstraintMaker *make) {
215 221 make.top.equalTo(self.titleButton.mas_bottom).with.offset(0);
216 222 make.left.equalTo(self.bgView.mas_left).with.offset(self.model.margin);
... ... @@ -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 242 - (void)awakeFromNib {
257 243 [super awakeFromNib];
258 244 // Initialization code
... ... @@ -305,11 +291,11 @@
305 291 [_allButton setImage:xw_image forState:UIControlStateNormal];
306 292 [_allButton setImage:xw_image forState:UIControlStateHighlighted];
307 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 295 _allButton.adjustsImageWhenHighlighted = NO;
310 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 299 _allButton.imageEdgeInsets = UIEdgeInsetsMake(0, 50, 0, -50);
314 300  
315 301 }
... ... @@ -319,10 +305,32 @@
319 305 - (UIView *)line{
320 306 if (!_line) {
321 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 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 11 #import <SDWebImage/SDWebImage.h>
12 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 14 @interface CNLiveMineHeaderView ()
17 15 @property (nonatomic, strong) UIImageView *bgView;
18 16 @property (nonatomic, strong) UIButton *witness;
... ... @@ -32,7 +30,7 @@ static const NSInteger margin = 20;
32 30 self = [super initWithFrame:frame];
33 31 if(self){
34 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 34 // [XWUserInfoNotification addUserInfoUpdateObserver:self selector:@selector(userInfoUpdateNotification:)];
37 35 [self createSubViews];
38 36 }
... ... @@ -268,7 +266,7 @@ static const NSInteger margin = 20;
268 266 _address = [[UILabel alloc] init];
269 267 _address.numberOfLines = 1;
270 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 270 _address.attributedText = [self createAttributedImageName:@"mine_location" string:@"北京海淀区花园桥" isFront:YES];
273 271 }
274 272 return _address;
... ...
CNLiveMineModule/Classes/View/CNLiveMineNavigationBar.m
... ... @@ -12,8 +12,6 @@
12 12 #import "QMUIKit.h"
13 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 15 @interface CNLiveMineNavigationBar ()
18 16 @property (nonatomic, strong) UIImageView *header;
19 17 @property (nonatomic, strong) UILabel *name;
... ...