Commit 5d5bc8887b2122faa6b4c2dbaaaa7c7c109e1b93
1 parent
c7060f7d
提交服务中心UI
Showing
21 changed files
with
865 additions
and
24 deletions
CNLiveServiceCenterModule/Assets/CNLiveServiceCenterModule.bundle/service_ creatorLog@2x.png
0 → 100644
39.6 KB
CNLiveServiceCenterModule/Assets/CNLiveServiceCenterModule.bundle/service_ creatorLog@3x.png
0 → 100644
130 KB
CNLiveServiceCenterModule/Assets/CNLiveServiceCenterModule.bundle/service_cellBg@2x.png
0 → 100644
6.73 KB
CNLiveServiceCenterModule/Assets/CNLiveServiceCenterModule.bundle/service_cellBg@3x.png
0 → 100644
13 KB
CNLiveServiceCenterModule/Assets/CNLiveServiceCenterModule.bundle/service_live@2x.png
0 → 100644
1.66 KB
CNLiveServiceCenterModule/Assets/CNLiveServiceCenterModule.bundle/service_live@3x.png
0 → 100644
3.91 KB
CNLiveServiceCenterModule/Assets/CNLiveServiceCenterModule.bundle/service_workBg@2x.png
0 → 100644
3.89 KB
CNLiveServiceCenterModule/Assets/CNLiveServiceCenterModule.bundle/service_workBg@3x.png
0 → 100644
7.03 KB
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Category/UIImage+Service.h
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Category/UIImage+Service.m
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | |
| 11 | 11 | @implementation UIImage (Service) |
| 12 | 12 | |
| 13 | -+ (UIImage *)imageNamedFromBundle:(NSString *)imageName { | |
| 13 | ++ (UIImage *)imageNamedFromService:(NSString *)imageName { | |
| 14 | 14 | NSBundle *imageBundle = [NSBundle serviceBundle]; |
| 15 | 15 | NSString *imageNameStr = [NSString stringWithFormat:@"%@",[imageName stringByAppendingString:@"@2x"]]; |
| 16 | 16 | NSString *imagePath = [imageBundle pathForResource:imageNameStr ofType:@"png"]; | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Controller/CNLiveBServiceCenterController.m
| ... | ... | @@ -9,6 +9,11 @@ |
| 9 | 9 | |
| 10 | 10 | #import "CNLiveBServiceCenterController.h" |
| 11 | 11 | #import "CNLiveBServiceCenterHeaderView.h" |
| 12 | +#import "CNLiveBServiceCertificationCell.h" | |
| 13 | +#import "CNLiveBServiceHelpLearnCell.h" | |
| 14 | +#import "CNLiveBServiceCenterModel.h" | |
| 15 | +#import "CNLiveBServiceWorkCell.h" | |
| 16 | + | |
| 12 | 17 | |
| 13 | 18 | @interface CNLiveBServiceCenterController ()<UITableViewDataSource,UITableViewDelegate> |
| 14 | 19 | |
| ... | ... | @@ -89,47 +94,102 @@ |
| 89 | 94 | |
| 90 | 95 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
| 91 | 96 | |
| 92 | - return 4; | |
| 97 | + if (section == 0) { | |
| 98 | + return 3; | |
| 99 | + }else if (section == 1) { | |
| 100 | + return 1; | |
| 101 | + }else { | |
| 102 | + return 0; | |
| 103 | + } | |
| 93 | 104 | |
| 94 | 105 | } |
| 95 | 106 | |
| 96 | 107 | //设置UI |
| 97 | 108 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
| 98 | - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; | |
| 99 | - cell.textLabel.backgroundColor = [UIColor yellowColor]; | |
| 100 | - cell.textLabel.text = [NSString stringWithFormat:@"section = %ld,row = %ld",indexPath.section,indexPath.row]; | |
| 101 | - return cell; | |
| 102 | 109 | |
| 110 | + if (indexPath.section == 0) { | |
| 111 | + if (indexPath.row == 0 || indexPath.row == 1) { | |
| 112 | + CNLiveBServiceCertificationCell *certificationCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBServiceCertificationCell forIndexPath:indexPath]; | |
| 113 | + if (indexPath.row == 0) { | |
| 114 | + [certificationCell configUI:[CNLiveBServiceCenterModel new] type:CNLiveBServiceCertificationCellTypePerson]; | |
| 115 | + }else { | |
| 116 | + [certificationCell configUI:[CNLiveBServiceCenterModel new] type:CNLiveBServiceCertificationCellTypeInstitutions]; | |
| 117 | + } | |
| 118 | + return certificationCell; | |
| 119 | + }else if (indexPath.row == 2){ | |
| 120 | + CNLiveBServiceHelpLearnCell *helpLearnCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBServiceHelpLearnCell forIndexPath:indexPath]; | |
| 121 | + return helpLearnCell; | |
| 122 | + | |
| 123 | + }else { | |
| 124 | + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; | |
| 125 | + return cell; | |
| 126 | + | |
| 127 | + } | |
| 128 | + }else if (indexPath.section == 1){ | |
| 129 | + if (indexPath.row == 0 ) { | |
| 130 | + CNLiveBServiceWorkCell *helpLearnCell = [tableView dequeueReusableCellWithIdentifier:kCNLiveBServiceWorkCell forIndexPath:indexPath]; | |
| 131 | + return helpLearnCell; | |
| 132 | + }else { | |
| 133 | + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; | |
| 134 | + return cell; | |
| 135 | + | |
| 136 | + } | |
| 137 | + | |
| 138 | + }else{ | |
| 139 | + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; | |
| 140 | + return cell; | |
| 141 | + | |
| 142 | + } | |
| 103 | 143 | |
| 104 | 144 | } |
| 105 | 145 | |
| 106 | 146 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { |
| 107 | 147 | |
| 108 | - return [UIView new]; | |
| 148 | + CNLiveBCenterHeaderFooterView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:kCNLiveBCenterHeaderFooterView]; | |
| 149 | + if (section == 0) { | |
| 150 | + headerView.titleL.text = @"申请入驻"; | |
| 151 | + }else if (section == 1) { | |
| 152 | + headerView.titleL.text = @"工作台"; | |
| 153 | + }else { | |
| 154 | + headerView.titleL.text = @""; | |
| 155 | + } | |
| 156 | + return headerView; | |
| 109 | 157 | |
| 110 | 158 | } |
| 111 | 159 | |
| 112 | 160 | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { |
| 113 | 161 | |
| 114 | - return [UIView new]; | |
| 162 | + return [[UIView alloc]init]; | |
| 115 | 163 | } |
| 116 | 164 | |
| 117 | 165 | //设置高度 |
| 118 | 166 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { |
| 119 | 167 | |
| 120 | - return 50; | |
| 168 | + if (indexPath.section == 0) { | |
| 169 | + if (indexPath.row == 0) { | |
| 170 | + return 112; | |
| 171 | + }else if(indexPath.row == 1) | |
| 172 | + { | |
| 173 | + return 124; | |
| 174 | + }else { | |
| 175 | + return 85; | |
| 176 | + } | |
| 177 | + }else{ | |
| 178 | + return 112; | |
| 179 | + } | |
| 180 | + | |
| 121 | 181 | |
| 122 | 182 | } |
| 123 | 183 | |
| 124 | 184 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { |
| 125 | 185 | |
| 126 | - return 20; | |
| 186 | + return 22.5; | |
| 127 | 187 | |
| 128 | 188 | } |
| 129 | 189 | |
| 130 | 190 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { |
| 131 | 191 | |
| 132 | - return 20; | |
| 192 | + return 0.01; | |
| 133 | 193 | |
| 134 | 194 | } |
| 135 | 195 | |
| ... | ... | @@ -172,6 +232,11 @@ |
| 172 | 232 | _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, -kStatusHeight, KScreenWidth, KScreenHeight + kStatusHeight - kVerticalTabBarTotalHeight) style:UITableViewStyleGrouped]; |
| 173 | 233 | _tableView.backgroundColor = [UIColor whiteColor]; |
| 174 | 234 | [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"]; |
| 235 | + [_tableView registerClass:[CNLiveBServiceCertificationCell class] forCellReuseIdentifier:kCNLiveBServiceCertificationCell]; | |
| 236 | + [_tableView registerClass:[CNLiveBServiceHelpLearnCell class] forCellReuseIdentifier:kCNLiveBServiceHelpLearnCell]; | |
| 237 | + [_tableView registerClass:[CNLiveBServiceWorkCell class] forCellReuseIdentifier:kCNLiveBServiceWorkCell]; | |
| 238 | + | |
| 239 | + [_tableView registerClass:[CNLiveBCenterHeaderFooterView class] forHeaderFooterViewReuseIdentifier:kCNLiveBCenterHeaderFooterView]; | |
| 175 | 240 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
| 176 | 241 | _tableView.dataSource = self; |
| 177 | 242 | _tableView.delegate = self; | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Model/Layout/CNLiveBServiceCenterLayout.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBServiceCenterLayout.h | |
| 3 | +// AFNetworking | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/8. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <Foundation/Foundation.h> | |
| 9 | +@class CNLiveBServiceCenterModel; | |
| 10 | + | |
| 11 | +NS_ASSUME_NONNULL_BEGIN | |
| 12 | + | |
| 13 | +@interface CNLiveBServiceCenterLayout : NSObject | |
| 14 | + | |
| 15 | +@property (strong ,nonatomic) CNLiveBServiceCenterModel * model; | |
| 16 | + | |
| 17 | +/** 详情标题高度 */ | |
| 18 | +@property (nonatomic, assign) CGFloat totalHeight; | |
| 19 | + | |
| 20 | +/** 编辑数据 */ | |
| 21 | +- (void)editModel:(CNLiveBServiceCenterModel *)model; | |
| 22 | + | |
| 23 | +@end | |
| 24 | + | |
| 25 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Model/Layout/CNLiveBServiceCenterLayout.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBServiceCenterLayout.m | |
| 3 | +// AFNetworking | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/8. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveBServiceCenterLayout.h" | |
| 9 | +#import "CNLiveBServiceCenterModel.h" | |
| 10 | + | |
| 11 | +@implementation CNLiveBServiceCenterLayout | |
| 12 | + | |
| 13 | +- (instancetype)init | |
| 14 | +{ | |
| 15 | + self = [super init]; | |
| 16 | + if (self) { | |
| 17 | + self.totalHeight = 0.0; | |
| 18 | + | |
| 19 | + } | |
| 20 | + return self; | |
| 21 | +} | |
| 22 | + | |
| 23 | +- (void)editModel:(CNLiveBServiceCenterModel *)model { | |
| 24 | + self.model = model; | |
| 25 | + | |
| 26 | + self.totalHeight = 106; | |
| 27 | + | |
| 28 | +} | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +@end | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceCenterHeaderView.h
| ... | ... | @@ -42,3 +42,16 @@ NS_ASSUME_NONNULL_BEGIN |
| 42 | 42 | @end |
| 43 | 43 | |
| 44 | 44 | NS_ASSUME_NONNULL_END |
| 45 | + | |
| 46 | + | |
| 47 | +#define kCNLiveBCenterHeaderFooterView @"CNLiveBCenterHeaderFooterView" | |
| 48 | + | |
| 49 | +NS_ASSUME_NONNULL_BEGIN | |
| 50 | + | |
| 51 | +@interface CNLiveBCenterHeaderFooterView : UITableViewHeaderFooterView | |
| 52 | + | |
| 53 | +/*** 题头 ***/ | |
| 54 | +@property (nonatomic, strong) UILabel *titleL; | |
| 55 | +@end | |
| 56 | + | |
| 57 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceCenterHeaderView.m
| ... | ... | @@ -94,8 +94,8 @@ |
| 94 | 94 | |
| 95 | 95 | self.bgHeaderImageV.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); |
| 96 | 96 | |
| 97 | - self.roundedView.frame = CGRectMake(0, self.frame.size.height - 15, self.frame.size.width, 15); | |
| 98 | - UIBezierPath *fieldPath = [UIBezierPath bezierPathWithRoundedRect:self.roundedView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(15 , 15)]; | |
| 97 | + self.roundedView.frame = CGRectMake(0, self.frame.size.height - 15, self.frame.size.width, 30); | |
| 98 | + UIBezierPath *fieldPath = [UIBezierPath bezierPathWithRoundedRect:self.roundedView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(30 , 30)]; | |
| 99 | 99 | CAShapeLayer *fieldLayer = [[CAShapeLayer alloc] init]; |
| 100 | 100 | fieldLayer.frame = self.roundedView.bounds; |
| 101 | 101 | fieldLayer.path = fieldPath.CGPath; |
| ... | ... | @@ -110,8 +110,9 @@ |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | //测试 |
| 113 | - self.userImageV.image = [UIImage imageNamedFromBundle:@"service_person"]; | |
| 113 | + self.userImageV.image = [UIImage imageNamedFromService:@"service_person"]; | |
| 114 | 114 | self.userNameL.text = @"用户昵称"; |
| 115 | + self.locationL.text = @"北京 朝阳"; | |
| 115 | 116 | |
| 116 | 117 | |
| 117 | 118 | |
| ... | ... | @@ -161,10 +162,17 @@ |
| 161 | 162 | |
| 162 | 163 | [self.locationImageV mas_makeConstraints:^(MASConstraintMaker *make) { |
| 163 | 164 | make.left.equalTo(weakSelf.userImageV.mas_right).offset(12); |
| 164 | - make.bottom.equalTo(weakSelf.mas_bottom).offset(38); | |
| 165 | + make.bottom.equalTo(weakSelf.userImageV.mas_bottom); | |
| 165 | 166 | make.width.mas_equalTo(9); |
| 166 | 167 | make.height.mas_equalTo(10.5); |
| 167 | 168 | }]; |
| 169 | + | |
| 170 | + [self.locationL mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 171 | + make.left.equalTo(weakSelf.locationImageV.mas_right).offset(4.5); | |
| 172 | + make.centerY.equalTo(weakSelf.locationImageV.mas_centerY); | |
| 173 | + make.right.equalTo(weakSelf.mas_right).offset(-20); | |
| 174 | + make.height.mas_equalTo(10.5); | |
| 175 | + }]; | |
| 168 | 176 | |
| 169 | 177 | |
| 170 | 178 | |
| ... | ... | @@ -195,7 +203,7 @@ |
| 195 | 203 | { |
| 196 | 204 | if (!_bgHeaderImageV) { |
| 197 | 205 | _bgHeaderImageV = [[UIImageView alloc]init]; |
| 198 | - _bgHeaderImageV.image = [UIImage imageNamedFromBundle:@"service_headerBg"]; | |
| 206 | + _bgHeaderImageV.image = [UIImage imageNamedFromService:@"service_headerBg"]; | |
| 199 | 207 | // UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(platformImageViewAction:)]; |
| 200 | 208 | // [_bgHeaderImageV addGestureRecognizer:tap]; |
| 201 | 209 | _bgHeaderImageV.userInteractionEnabled = YES; |
| ... | ... | @@ -236,7 +244,7 @@ |
| 236 | 244 | { |
| 237 | 245 | if (!_wjjCertificationImageV) { |
| 238 | 246 | _wjjCertificationImageV = [[UIImageView alloc]init]; |
| 239 | - _wjjCertificationImageV.image = [UIImage imageNamedFromBundle:@"service_wjj_attestation"]; | |
| 247 | + _wjjCertificationImageV.image = [UIImage imageNamedFromService:@"service_wjj_attestation"]; | |
| 240 | 248 | } |
| 241 | 249 | return _wjjCertificationImageV; |
| 242 | 250 | } |
| ... | ... | @@ -246,7 +254,7 @@ |
| 246 | 254 | { |
| 247 | 255 | if (!_personCertificationImageV) { |
| 248 | 256 | _personCertificationImageV = [[UIImageView alloc]init]; |
| 249 | - _personCertificationImageV.image = [UIImage imageNamedFromBundle:@"service_personCertification"]; | |
| 257 | + _personCertificationImageV.image = [UIImage imageNamedFromService:@"service_personCertification"]; | |
| 250 | 258 | } |
| 251 | 259 | return _personCertificationImageV; |
| 252 | 260 | } |
| ... | ... | @@ -256,7 +264,7 @@ |
| 256 | 264 | { |
| 257 | 265 | if (!_enterpriseCertificationImageV) { |
| 258 | 266 | _enterpriseCertificationImageV = [[UIImageView alloc]init]; |
| 259 | - _enterpriseCertificationImageV.image = [UIImage imageNamedFromBundle:@"service_enterprise"]; | |
| 267 | + _enterpriseCertificationImageV.image = [UIImage imageNamedFromService:@"service_enterprise"]; | |
| 260 | 268 | } |
| 261 | 269 | return _enterpriseCertificationImageV; |
| 262 | 270 | } |
| ... | ... | @@ -267,7 +275,7 @@ |
| 267 | 275 | { |
| 268 | 276 | if (!_locationImageV) { |
| 269 | 277 | _locationImageV = [[UIImageView alloc]init]; |
| 270 | - _locationImageV.image = [UIImage imageNamed:@"certification_show"]; | |
| 278 | + _locationImageV.image = [UIImage imageNamedFromService:@"service_location"]; | |
| 271 | 279 | } |
| 272 | 280 | return _locationImageV; |
| 273 | 281 | } |
| ... | ... | @@ -276,7 +284,7 @@ |
| 276 | 284 | |
| 277 | 285 | if (!_locationL) { |
| 278 | 286 | _locationL = [[UILabel alloc]init]; |
| 279 | - _locationL.textColor = [UIColor yellowColor]; | |
| 287 | + _locationL.textColor = [UIColor whiteColor]; | |
| 280 | 288 | _locationL.font = [UIFont systemFontOfSize:12]; |
| 281 | 289 | _locationL.numberOfLines = 1; |
| 282 | 290 | } |
| ... | ... | @@ -420,7 +428,7 @@ |
| 420 | 428 | { |
| 421 | 429 | if (!_authImageV) { |
| 422 | 430 | _authImageV = [[UIImageView alloc]init]; |
| 423 | - _authImageV.image = [UIImage imageNamedFromBundle:@"service_personLog"]; | |
| 431 | + _authImageV.image = [UIImage imageNamedFromService:@"service_personLog"]; | |
| 424 | 432 | } |
| 425 | 433 | return _authImageV; |
| 426 | 434 | } |
| ... | ... | @@ -444,7 +452,7 @@ |
| 444 | 452 | { |
| 445 | 453 | if (!_authTipImageV) { |
| 446 | 454 | _authTipImageV = [[UIImageView alloc]init]; |
| 447 | - _authTipImageV.image = [UIImage imageNamedFromBundle:@"service_enterTip"]; | |
| 455 | + _authTipImageV.image = [UIImage imageNamedFromService:@"service_enterTip"]; | |
| 448 | 456 | } |
| 449 | 457 | return _authTipImageV; |
| 450 | 458 | } |
| ... | ... | @@ -452,3 +460,75 @@ |
| 452 | 460 | |
| 453 | 461 | |
| 454 | 462 | @end |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | +@interface CNLiveBCenterHeaderFooterView() | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | +@end | |
| 471 | + | |
| 472 | +@implementation CNLiveBCenterHeaderFooterView | |
| 473 | + | |
| 474 | +- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier | |
| 475 | +{ | |
| 476 | + self = [super initWithReuseIdentifier:reuseIdentifier]; | |
| 477 | + if (self) { | |
| 478 | + [self setupUI]; | |
| 479 | + } | |
| 480 | + return self; | |
| 481 | +} | |
| 482 | + | |
| 483 | +- (void)awakeFromNib { | |
| 484 | + [super awakeFromNib]; | |
| 485 | + [self setupUI]; | |
| 486 | + | |
| 487 | +} | |
| 488 | + | |
| 489 | +- (void)layoutSubviews { | |
| 490 | + [super layoutSubviews]; | |
| 491 | + | |
| 492 | + [self layoutUI]; | |
| 493 | +} | |
| 494 | + | |
| 495 | + | |
| 496 | +#pragma mark - ***setupUI*** | |
| 497 | +- (void)setupUI { | |
| 498 | + | |
| 499 | + [self setBackgroundColor:[UIColor yellowColor]]; | |
| 500 | + [self.contentView addSubview:self.titleL]; | |
| 501 | + self.titleL.frame = CGRectMake(15, 4, KScreenWidth - 30, 15); | |
| 502 | + | |
| 503 | +} | |
| 504 | + | |
| 505 | +#pragma mark - ***layoutUI*** | |
| 506 | +- (void)layoutUI { | |
| 507 | + | |
| 508 | +} | |
| 509 | + | |
| 510 | +#pragma mark - editUI | |
| 511 | + | |
| 512 | +#pragma mark - ***事件实现*** | |
| 513 | + | |
| 514 | + | |
| 515 | +#pragma mark - ***私有方法*** | |
| 516 | +#pragma mark - ***懒加载*** | |
| 517 | + | |
| 518 | +/*** 认证与否 ***/ | |
| 519 | +- (UILabel *)titleL { | |
| 520 | + | |
| 521 | + if (!_titleL) { | |
| 522 | + _titleL = [[UILabel alloc]init]; | |
| 523 | + _titleL.textColor = RGBOF(0x333333); | |
| 524 | + _titleL.font = [UIFont fontWithName:@"Helvetica-Bold" size:15];//加粗; | |
| 525 | + _titleL.numberOfLines = 1; | |
| 526 | + | |
| 527 | + } | |
| 528 | + return _titleL; | |
| 529 | + | |
| 530 | +} | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | +@end | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceCertificationCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBServiceCertificationCell.h | |
| 3 | +// AFNetworking | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/8. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +@class CNLiveBServiceCenterModel; | |
| 10 | + | |
| 11 | + | |
| 12 | +#define kCNLiveBServiceCertificationCell @"CNLiveBServiceCertificationCell" | |
| 13 | + | |
| 14 | +typedef NS_ENUM(NSInteger, CNLiveBServiceCertificationCellType){ | |
| 15 | + CNLiveBServiceCertificationCellTypePerson = 0, | |
| 16 | + CNLiveBServiceCertificationCellTypeInstitutions = 1 | |
| 17 | +}; | |
| 18 | + | |
| 19 | +NS_ASSUME_NONNULL_BEGIN | |
| 20 | + | |
| 21 | +@interface CNLiveBServiceCertificationCell : UITableViewCell | |
| 22 | + | |
| 23 | +@property (strong ,nonatomic) CNLiveBServiceCenterModel * model; | |
| 24 | + | |
| 25 | +- (void)configUI:(CNLiveBServiceCenterModel *)model type:(CNLiveBServiceCertificationCellType)type; | |
| 26 | + | |
| 27 | +@end | |
| 28 | + | |
| 29 | +NS_ASSUME_NONNULL_END | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceCertificationCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBServiceCertificationCell.m | |
| 3 | +// AFNetworking | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/8. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveBServiceCertificationCell.h" | |
| 9 | +#import "CNLiveBServiceCenterModel.h" | |
| 10 | +#import <Masonry/Masonry.h> | |
| 11 | +#import "UIImage+Service.h" | |
| 12 | +#import <CNLiveBaseKit/CNLiveBaseKit.h> | |
| 13 | + | |
| 14 | +@interface CNLiveBServiceCertificationCell() | |
| 15 | +/** 背景*/ | |
| 16 | +@property (nonatomic, strong) UIImageView *cellBGimageV; | |
| 17 | +/** 头部*/ | |
| 18 | +@property (nonatomic, strong) UILabel *titleL; | |
| 19 | +/** 内容*/ | |
| 20 | +@property (nonatomic, strong) UILabel *contentL; | |
| 21 | +/** 认证*/ | |
| 22 | +@property (nonatomic, strong) UIButton *certificationBtn; | |
| 23 | +/** 认证Log*/ | |
| 24 | +@property (nonatomic, strong) UIImageView *certificationLogImageV; | |
| 25 | + | |
| 26 | + | |
| 27 | +@end | |
| 28 | + | |
| 29 | +@implementation CNLiveBServiceCertificationCell | |
| 30 | + | |
| 31 | + | |
| 32 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | |
| 33 | +{ | |
| 34 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 35 | + if (self) { | |
| 36 | + [self setupUI]; | |
| 37 | + } | |
| 38 | + return self; | |
| 39 | +} | |
| 40 | + | |
| 41 | +- (void)awakeFromNib { | |
| 42 | + [super awakeFromNib]; | |
| 43 | + [self setupUI]; | |
| 44 | + | |
| 45 | +} | |
| 46 | + | |
| 47 | +- (void)layoutSubviews { | |
| 48 | + [super layoutSubviews]; | |
| 49 | + | |
| 50 | + [self layoutUI]; | |
| 51 | +} | |
| 52 | + | |
| 53 | + | |
| 54 | +#pragma mark - ***setupUI*** | |
| 55 | +- (void)setupUI { | |
| 56 | + | |
| 57 | + [self setBackgroundColor:[UIColor whiteColor]]; | |
| 58 | + [self addSubview:self.cellBGimageV]; | |
| 59 | + [self addSubview:self.titleL]; | |
| 60 | + [self addSubview:self.contentL]; | |
| 61 | + [self addSubview:self.certificationBtn]; | |
| 62 | + [self addSubview:self.certificationLogImageV]; | |
| 63 | + | |
| 64 | + //测试 | |
| 65 | +// self.contentView.backgroundColor = [UIColor yellowColor]; | |
| 66 | +// self.contentL.backgroundColor = [UIColor yellowColor]; | |
| 67 | + self.titleL.text = @"个人认证"; | |
| 68 | + self.contentL.text = @"适合企业、媒体、国家机构和其他知名机构申请。\n申请方式:在B端申请或在电脑打开链接:http://open.cnlive.com/操作申请."; | |
| 69 | + | |
| 70 | +} | |
| 71 | + | |
| 72 | +#pragma mark - ***layoutUI*** | |
| 73 | +- (void)layoutUI { | |
| 74 | + | |
| 75 | + __weak typeof(self) weakSelf = self; | |
| 76 | + | |
| 77 | + [self.cellBGimageV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 78 | + make.left.equalTo(weakSelf.mas_left).offset(0); | |
| 79 | + make.top.equalTo(weakSelf.mas_top).offset(0); | |
| 80 | + make.right.equalTo(weakSelf.mas_right).offset(0); | |
| 81 | + make.bottom.equalTo(weakSelf.mas_bottom).offset(0); | |
| 82 | + }]; | |
| 83 | + | |
| 84 | + [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 85 | + make.left.equalTo(weakSelf.mas_left).offset(20.5); | |
| 86 | + make.top.equalTo(weakSelf.mas_top).offset(26.5); | |
| 87 | + make.width.mas_equalTo(100); | |
| 88 | + make.height.mas_equalTo(17); | |
| 89 | + }]; | |
| 90 | + | |
| 91 | + [self.contentL mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 92 | + make.left.equalTo(weakSelf.titleL.mas_left).offset(0); | |
| 93 | + make.top.equalTo(weakSelf.titleL.mas_bottom).offset(13); | |
| 94 | + make.right.equalTo(weakSelf.mas_right).offset(-20.5); | |
| 95 | + make.bottom.equalTo(weakSelf.mas_bottom).offset(-23); | |
| 96 | + }]; | |
| 97 | + | |
| 98 | + | |
| 99 | +} | |
| 100 | + | |
| 101 | +#pragma mark - editUI | |
| 102 | +- (void)configUI:(CNLiveBServiceCenterModel *)model type:(CNLiveBServiceCertificationCellType)type{ | |
| 103 | + | |
| 104 | + if (type == CNLiveBServiceCertificationCellTypePerson) { | |
| 105 | + self.titleL.text = @"个人认证"; | |
| 106 | + self.titleL.textColor = RGBOF(0x389fef); | |
| 107 | + self.contentL.text = @"适合公众人物、领域专家、名师讲座和网络名人申请。\n申请方式:在B端——申请入驻下选择“身份认证”进行申请。"; | |
| 108 | + | |
| 109 | + }else { | |
| 110 | + self.titleL.text = @"机构认证"; | |
| 111 | + self.titleL.textColor = RGBOF(0xe7a010); | |
| 112 | + self.contentL.text = @"适合企业、媒体、国家机构和其他知名机构申请。\n申请方式:在B端申请或在电脑打开链接:http://open.cnlive.com/操作申请。"; | |
| 113 | + } | |
| 114 | + | |
| 115 | + | |
| 116 | +} | |
| 117 | + | |
| 118 | +#pragma mark - ***事件实现*** | |
| 119 | +- (void)attentionBtnAction:(UIButton *)sender { | |
| 120 | + | |
| 121 | +// if (self.clickAttentionBtnBlock) { | |
| 122 | +// self.clickAttentionBtnBlock(self, sender); | |
| 123 | +// } | |
| 124 | +// | |
| 125 | +} | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | +#pragma mark - ***私有方法*** | |
| 130 | +#pragma mark - ***懒加载*** | |
| 131 | +/*** 背景 ***/ | |
| 132 | +- (UIImageView *)cellBGimageV | |
| 133 | +{ | |
| 134 | + if (!_cellBGimageV) { | |
| 135 | + _cellBGimageV = [[UIImageView alloc]init]; | |
| 136 | + _cellBGimageV.image = [UIImage imageNamedFromService:@"service_cellBg"]; | |
| 137 | + } | |
| 138 | + return _cellBGimageV; | |
| 139 | +} | |
| 140 | + | |
| 141 | +/*** 头部 ***/ | |
| 142 | +- (UILabel *)titleL { | |
| 143 | + | |
| 144 | + if (!_titleL) { | |
| 145 | + _titleL = [[UILabel alloc]init]; | |
| 146 | + _titleL.font = [UIFont fontWithName:@"Helvetica-Bold" size:18]; | |
| 147 | + _titleL.numberOfLines = 1; | |
| 148 | + } | |
| 149 | + return _titleL; | |
| 150 | + | |
| 151 | +} | |
| 152 | + | |
| 153 | +/*** 内容 ***/ | |
| 154 | +- (UILabel *)contentL { | |
| 155 | + | |
| 156 | + if (!_contentL) { | |
| 157 | + _contentL = [[UILabel alloc]init]; | |
| 158 | + _contentL.font = [UIFont systemFontOfSize:12]; | |
| 159 | + _contentL.textAlignment = NSTextAlignmentLeft; | |
| 160 | + //让内容置顶 | |
| 161 | + [_contentL sizeToFit]; | |
| 162 | + _contentL.textColor = RGBOF(0x7b7b7b); | |
| 163 | + _contentL.numberOfLines = 0; | |
| 164 | + } | |
| 165 | + return _contentL; | |
| 166 | +} | |
| 167 | + | |
| 168 | + | |
| 169 | +/*** 认证按钮***/ | |
| 170 | +- (UIButton *)certificationBtn | |
| 171 | +{ | |
| 172 | + if (!_certificationBtn) { | |
| 173 | + _certificationBtn = [UIButton buttonWithType:UIButtonTypeSystem]; | |
| 174 | + [_certificationBtn setTitle:@"去认证" forState:UIControlStateNormal]; | |
| 175 | + [_certificationBtn setTitle:@"已认证" forState:UIControlStateSelected]; | |
| 176 | + [_certificationBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
| 177 | + [_certificationBtn setTitleColor:RGBOF(0x999999) forState:UIControlStateNormal]; | |
| 178 | + | |
| 179 | + } | |
| 180 | + return _certificationBtn; | |
| 181 | +} | |
| 182 | + | |
| 183 | +/*** 认证Logo ***/ | |
| 184 | +- (UIImageView *)certificationLogImageV | |
| 185 | +{ | |
| 186 | + if (!_certificationLogImageV) { | |
| 187 | + _certificationLogImageV = [[UIImageView alloc]init]; | |
| 188 | + _certificationLogImageV.image = [UIImage imageNamedFromService:@"service_personLog"]; | |
| 189 | + } | |
| 190 | + return _certificationLogImageV; | |
| 191 | +} | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 196 | + [super setSelected:selected animated:animated]; | |
| 197 | + | |
| 198 | + // Configure the view for the selected state | |
| 199 | +} | |
| 200 | + | |
| 201 | +@end | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceHelpLearnCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBServiceHelpLearnCell.h | |
| 3 | +// CNLiveServiceCenterModule | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/8. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +@class CNLiveBServiceCenterModel; | |
| 10 | + | |
| 11 | + | |
| 12 | +#define kCNLiveBServiceHelpLearnCell @"CNLiveBServiceHelpLearnCell" | |
| 13 | + | |
| 14 | +NS_ASSUME_NONNULL_BEGIN | |
| 15 | + | |
| 16 | +@interface CNLiveBServiceHelpLearnCell : UITableViewCell | |
| 17 | + | |
| 18 | +@end | |
| 19 | + | |
| 20 | +NS_ASSUME_NONNULL_END | |
| 21 | + | |
| 22 | + | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceHelpLearnCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBServiceHelpLearnCell.m | |
| 3 | +// CNLiveServiceCenterModule | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/8. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveBServiceHelpLearnCell.h" | |
| 9 | +#import <Masonry/Masonry.h> | |
| 10 | +#import "UIImage+Service.h" | |
| 11 | +#import <CNLiveBaseKit/CNLiveBaseKit.h> | |
| 12 | + | |
| 13 | + | |
| 14 | +@interface CNLiveBServiceHelpLearnCell() | |
| 15 | +/** 内容图片*/ | |
| 16 | +@property (nonatomic, strong) UIImageView *cellContentImageV; | |
| 17 | + | |
| 18 | + | |
| 19 | +@end | |
| 20 | + | |
| 21 | +@implementation CNLiveBServiceHelpLearnCell | |
| 22 | + | |
| 23 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | |
| 24 | +{ | |
| 25 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 26 | + if (self) { | |
| 27 | + [self setupUI]; | |
| 28 | + } | |
| 29 | + return self; | |
| 30 | +} | |
| 31 | + | |
| 32 | +- (void)awakeFromNib { | |
| 33 | + [super awakeFromNib]; | |
| 34 | + [self setupUI]; | |
| 35 | + | |
| 36 | +} | |
| 37 | + | |
| 38 | +- (void)layoutSubviews { | |
| 39 | + [super layoutSubviews]; | |
| 40 | + | |
| 41 | + [self layoutUI]; | |
| 42 | +} | |
| 43 | + | |
| 44 | + | |
| 45 | +#pragma mark - ***setupUI*** | |
| 46 | +- (void)setupUI { | |
| 47 | + | |
| 48 | + [self setBackgroundColor:[UIColor whiteColor]]; | |
| 49 | + [self addSubview:self.cellContentImageV]; | |
| 50 | + | |
| 51 | +} | |
| 52 | + | |
| 53 | +#pragma mark - ***layoutUI*** | |
| 54 | +- (void)layoutUI { | |
| 55 | + | |
| 56 | + __weak typeof(self) weakSelf = self; | |
| 57 | + | |
| 58 | + [self.cellContentImageV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 59 | + make.left.equalTo(weakSelf.mas_left).offset(12); | |
| 60 | + make.top.equalTo(weakSelf.mas_top).offset(5); | |
| 61 | + make.right.equalTo(weakSelf.mas_right).offset(-12); | |
| 62 | + make.bottom.equalTo(weakSelf.mas_bottom).offset(-5); | |
| 63 | + }]; | |
| 64 | + | |
| 65 | +} | |
| 66 | + | |
| 67 | +#pragma mark - editUI | |
| 68 | +- (void)configUI:(CNLiveBServiceCenterModel *)model{ | |
| 69 | + | |
| 70 | +} | |
| 71 | + | |
| 72 | +#pragma mark - ***事件实现*** | |
| 73 | +- (void)attentionBtnAction:(UIButton *)sender { | |
| 74 | + | |
| 75 | +// if (self.clickAttentionBtnBlock) { | |
| 76 | +// self.clickAttentionBtnBlock(self, sender); | |
| 77 | +// } | |
| 78 | +// | |
| 79 | +} | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | +#pragma mark - ***私有方法*** | |
| 84 | +#pragma mark - ***懒加载*** | |
| 85 | +/*** 背景 ***/ | |
| 86 | +- (UIImageView *)cellContentImageV | |
| 87 | +{ | |
| 88 | + if (!_cellContentImageV) { | |
| 89 | + _cellContentImageV = [[UIImageView alloc]init]; | |
| 90 | + _cellContentImageV.image = [UIImage imageNamedFromService:@"service_ creatorLog"]; | |
| 91 | + } | |
| 92 | + return _cellContentImageV; | |
| 93 | +} | |
| 94 | + | |
| 95 | + | |
| 96 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 97 | + [super setSelected:selected animated:animated]; | |
| 98 | + | |
| 99 | + // Configure the view for the selected state | |
| 100 | +} | |
| 101 | + | |
| 102 | + | |
| 103 | +@end | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceWorkCell.h
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBServiceWorkCell.h | |
| 3 | +// CNLiveServiceCenterModule | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/9. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import <UIKit/UIKit.h> | |
| 9 | +@class CNLiveBServiceCenterModel; | |
| 10 | + | |
| 11 | + | |
| 12 | +#define kCNLiveBServiceWorkCell @"CNLiveBServiceWorkCell" | |
| 13 | + | |
| 14 | +NS_ASSUME_NONNULL_BEGIN | |
| 15 | + | |
| 16 | +@interface CNLiveBServiceWorkCell : UITableViewCell | |
| 17 | + | |
| 18 | +@property (strong ,nonatomic) CNLiveBServiceCenterModel * model; | |
| 19 | + | |
| 20 | +- (void)configUI:(CNLiveBServiceCenterModel *)model; | |
| 21 | + | |
| 22 | + | |
| 23 | +@end | |
| 24 | + | |
| 25 | +NS_ASSUME_NONNULL_END | |
| 26 | + | |
| 27 | +NS_ASSUME_NONNULL_BEGIN | |
| 28 | + | |
| 29 | +@interface CNLiveBCenterItmButton : UIButton | |
| 30 | + | |
| 31 | + | |
| 32 | +@end | |
| 33 | + | |
| 34 | +NS_ASSUME_NONNULL_END | |
| 35 | + | ... | ... |
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/View/CNLiveBServiceWorkCell.m
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBServiceWorkCell.m | |
| 3 | +// CNLiveServiceCenterModule | |
| 4 | +// | |
| 5 | +// Created by 梁星国 on 2020/4/9. | |
| 6 | +// | |
| 7 | + | |
| 8 | +#import "CNLiveBServiceWorkCell.h" | |
| 9 | + | |
| 10 | +#import "CNLiveBServiceCenterModel.h" | |
| 11 | +#import <Masonry/Masonry.h> | |
| 12 | +#import "UIImage+Service.h" | |
| 13 | +#import <CNLiveBaseKit/CNLiveBaseKit.h> | |
| 14 | + | |
| 15 | +@interface CNLiveBServiceWorkCell() | |
| 16 | +/** 背景*/ | |
| 17 | +@property (nonatomic, strong) CNLiveBCenterItmButton *workImageButton; | |
| 18 | + | |
| 19 | + | |
| 20 | +@end | |
| 21 | + | |
| 22 | +@implementation CNLiveBServiceWorkCell | |
| 23 | + | |
| 24 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | |
| 25 | +{ | |
| 26 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 27 | + if (self) { | |
| 28 | + [self setupUI]; | |
| 29 | + } | |
| 30 | + return self; | |
| 31 | +} | |
| 32 | + | |
| 33 | +- (void)awakeFromNib { | |
| 34 | + [super awakeFromNib]; | |
| 35 | + [self setupUI]; | |
| 36 | + | |
| 37 | +} | |
| 38 | + | |
| 39 | +- (void)layoutSubviews { | |
| 40 | + [super layoutSubviews]; | |
| 41 | + | |
| 42 | + [self layoutUI]; | |
| 43 | +} | |
| 44 | + | |
| 45 | + | |
| 46 | +#pragma mark - ***setupUI*** | |
| 47 | +- (void)setupUI { | |
| 48 | + | |
| 49 | + [self setBackgroundColor:[UIColor whiteColor]]; | |
| 50 | + [self addSubview:self.workImageButton]; | |
| 51 | + | |
| 52 | + self.workImageButton.frame = CGRectMake(0, 0, 101.5, 116.5); | |
| 53 | + | |
| 54 | +} | |
| 55 | + | |
| 56 | +#pragma mark - ***layoutUI*** | |
| 57 | +- (void)layoutUI { | |
| 58 | + | |
| 59 | + __weak typeof(self) weakSelf = self; | |
| 60 | + | |
| 61 | + | |
| 62 | +} | |
| 63 | + | |
| 64 | +#pragma mark - editUI | |
| 65 | +- (void)configUI:(CNLiveBServiceCenterModel *)model { | |
| 66 | + | |
| 67 | +} | |
| 68 | + | |
| 69 | +#pragma mark - ***事件实现*** | |
| 70 | +- (void)attentionBtnAction:(UIButton *)sender { | |
| 71 | + | |
| 72 | +// if (self.clickAttentionBtnBlock) { | |
| 73 | +// self.clickAttentionBtnBlock(self, sender); | |
| 74 | +// } | |
| 75 | +// | |
| 76 | +} | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | +#pragma mark - ***私有方法*** | |
| 81 | +#pragma mark - ***懒加载*** | |
| 82 | +/*** 背景 ***/ | |
| 83 | +- (CNLiveBCenterItmButton *)workImageButton | |
| 84 | +{ | |
| 85 | + if (!_workImageButton) { | |
| 86 | + _workImageButton = [[CNLiveBCenterItmButton alloc]initWithFrame:CGRectMake(0, 0, 101.5, 116.5)]; | |
| 87 | + } | |
| 88 | + return _workImageButton; | |
| 89 | +} | |
| 90 | + | |
| 91 | + | |
| 92 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 93 | + [super setSelected:selected animated:animated]; | |
| 94 | + | |
| 95 | + // Configure the view for the selected state | |
| 96 | +} | |
| 97 | + | |
| 98 | + | |
| 99 | +@end | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | +@interface CNLiveBCenterItmButton() | |
| 105 | + | |
| 106 | +/*** 背景试图 ***/ | |
| 107 | +@property (nonatomic, strong) UIImageView *itemImageBgV; | |
| 108 | +/*** 题头 ***/ | |
| 109 | +@property (nonatomic, strong) UILabel *titleL; | |
| 110 | +/*** 图标 ***/ | |
| 111 | +@property (nonatomic, strong) UIImageView *tipImageV; | |
| 112 | + | |
| 113 | +@end | |
| 114 | + | |
| 115 | +@implementation CNLiveBCenterItmButton | |
| 116 | + | |
| 117 | +- (instancetype)init | |
| 118 | +{ | |
| 119 | + self = [super init]; | |
| 120 | + if (self) { | |
| 121 | + [self setupUI]; | |
| 122 | + } | |
| 123 | + return self; | |
| 124 | +} | |
| 125 | + | |
| 126 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 127 | +{ | |
| 128 | + self = [super initWithFrame:frame]; | |
| 129 | + if (self) { | |
| 130 | + [self setupUI]; | |
| 131 | + } | |
| 132 | + return self; | |
| 133 | +} | |
| 134 | + | |
| 135 | +- (void)awakeFromNib { | |
| 136 | + [super awakeFromNib]; | |
| 137 | + [self setupUI]; | |
| 138 | + | |
| 139 | +} | |
| 140 | + | |
| 141 | +- (void)layoutSubviews { | |
| 142 | + [super layoutSubviews]; | |
| 143 | + | |
| 144 | + [self layoutUI]; | |
| 145 | +} | |
| 146 | + | |
| 147 | + | |
| 148 | +#pragma mark - ***setupUI*** | |
| 149 | +- (void)setupUI { | |
| 150 | + | |
| 151 | + [self setBackgroundColor:[UIColor whiteColor]]; | |
| 152 | + [self addSubview:self.itemImageBgV]; | |
| 153 | + [self addSubview:self.titleL]; | |
| 154 | + [self addSubview:self.tipImageV]; | |
| 155 | + | |
| 156 | +} | |
| 157 | + | |
| 158 | +#pragma mark - ***layoutUI*** | |
| 159 | +- (void)layoutUI { | |
| 160 | + | |
| 161 | + __weak typeof(self) weakSelf = self; | |
| 162 | + | |
| 163 | + [self.itemImageBgV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 164 | + make.left.equalTo(weakSelf.mas_left).offset(0); | |
| 165 | + make.right.equalTo(weakSelf.mas_right).offset(0); | |
| 166 | + make.top.mas_equalTo(weakSelf.mas_top).offset(0); | |
| 167 | + make.bottom.mas_equalTo(weakSelf.mas_bottom).offset(0); | |
| 168 | + }]; | |
| 169 | + | |
| 170 | + [self.tipImageV mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 171 | + make.top.equalTo(weakSelf.mas_top).offset(30.5); | |
| 172 | + make.centerX.equalTo(weakSelf.itemImageBgV.mas_centerX); | |
| 173 | + make.width.mas_equalTo(32.5); | |
| 174 | + make.height.mas_equalTo(28.5); | |
| 175 | + }]; | |
| 176 | + | |
| 177 | + [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 178 | + make.top.equalTo(weakSelf.tipImageV.mas_bottom).offset(19); | |
| 179 | + make.left.equalTo(weakSelf.mas_left).offset(10); | |
| 180 | + make.right.equalTo(weakSelf.mas_right).offset(-10); | |
| 181 | + make.height.mas_equalTo(12.5); | |
| 182 | + }]; | |
| 183 | + | |
| 184 | + | |
| 185 | +} | |
| 186 | + | |
| 187 | +#pragma mark - editUI | |
| 188 | +- (void)configUI:(Boolean)isAuth { | |
| 189 | + | |
| 190 | +} | |
| 191 | + | |
| 192 | +#pragma mark - ***事件实现*** | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | +#pragma mark - ***私有方法*** | |
| 197 | +#pragma mark - ***懒加载*** | |
| 198 | +/*** 背景***/ | |
| 199 | +- (UIImageView *)itemImageBgV | |
| 200 | +{ | |
| 201 | + if (!_itemImageBgV) { | |
| 202 | + _itemImageBgV = [[UIImageView alloc]init]; | |
| 203 | + _itemImageBgV.image = [UIImage imageNamedFromService:@"service_workBg"]; | |
| 204 | + } | |
| 205 | + return _itemImageBgV; | |
| 206 | +} | |
| 207 | + | |
| 208 | +/*** 题头***/ | |
| 209 | +- (UILabel *)titleL { | |
| 210 | + | |
| 211 | + if (!_titleL) { | |
| 212 | + _titleL = [[UILabel alloc]init]; | |
| 213 | + _titleL.textColor = RGBOF(0x333333); | |
| 214 | + _titleL.font = [UIFont systemFontOfSize:13]; | |
| 215 | + _titleL.text = @"我要直播"; | |
| 216 | + _titleL.textAlignment = NSTextAlignmentCenter; | |
| 217 | + _titleL.numberOfLines = 1; | |
| 218 | + | |
| 219 | + } | |
| 220 | + return _titleL; | |
| 221 | + | |
| 222 | +} | |
| 223 | + | |
| 224 | +/*** 标识图片 ***/ | |
| 225 | +- (UIImageView *)tipImageV | |
| 226 | +{ | |
| 227 | + if (!_tipImageV) { | |
| 228 | + _tipImageV = [[UIImageView alloc]init]; | |
| 229 | + _tipImageV.image = [UIImage imageNamedFromService:@"service_live"]; | |
| 230 | + } | |
| 231 | + return _tipImageV; | |
| 232 | +} | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | +@end | ... | ... |