123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- //
- // FKVipPrivilegeCollectionCell.m
- // FirstLink
- //
- // Created by ascii on 2017/5/15.
- // Copyright © 2017年 FirstLink. All rights reserved.
- //
- #import "FKVipPrivilegeCollectionCell.h"
- NSString *const kVipFreePostageKey = @"kVipFreePostageKey";
- @interface FKVipPrivilegeCollectionCell ()
- @property (nonatomic, strong, readwrite) UIImageView *imgView;
- @property (nonatomic, strong, readwrite) UILabel *titleLabel;
- @property (nonatomic, strong, readwrite) UIImageView *lockImgView;
- @property (nonatomic, strong, readwrite) UIImageView *futureImgView;
- @end
- @implementation FKVipPrivilegeCollectionCell
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- [self setupViews];
- }
- return self;
- }
- #pragma mark - Method
- - (void)setupViews {
- [self addSubview:self.imgView];
- [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.equalTo(self);
- make.size.mas_equalTo(CGSizeMake(45, 45));
- make.top.mas_equalTo(self).offset(10);
- }];
-
- [self addSubview:self.titleLabel];
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.equalTo(self.imgView);
- make.top.mas_equalTo(self.imgView.mas_bottom).offset(10);
- }];
-
- [self addSubview:self.lockImgView];
- [self.lockImgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.imgView.mas_centerX).offset(16);
- make.top.equalTo(self.imgView.mas_centerY).offset(8);
- }];
-
- [self addSubview:self.futureImgView];
- [self.futureImgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.imgView.mas_centerX).offset(20);
- make.centerY.equalTo(self.titleLabel.mas_centerY).offset(-1);
- }];
- }
- #pragma mark - Property
- - (UIImageView *)imgView {
- if (!_imgView) {
- _imgView = [UIImageView new];
- }
- return _imgView;
- }
- - (UILabel *)titleLabel {
- if (!_titleLabel) {
- _titleLabel = [[UILabel alloc] init];
- _titleLabel.font = [UIFont systemFontOfSize:12];
- _titleLabel.textColor = UIColorFromRGB(0x333333);
- }
- return _titleLabel;
- }
- - (UIImageView *)lockImgView {
- if (!_lockImgView) {
- _lockImgView = [UIImageView new];
- _lockImgView.image = [UIImage imageNamed:@"vip_lock_icon"];
- _lockImgView.hidden = YES;
- }
- return _lockImgView;
- }
- - (UIImageView *)futureImgView {
- if (!_futureImgView) {
- _futureImgView = [UIImageView new];
- _futureImgView.image = [UIImage imageNamed:@"vip_future_icon"];
- _futureImgView.hidden = YES;
- }
- return _futureImgView;
- }
- @end
|