diff --git a/xplan-ios/Assets.xcassets/Mine/DressUp/mine_dressup_time.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/DressUp/mine_dressup_time.imageset/Contents.json deleted file mode 100644 index 30c46d43..00000000 --- a/xplan-ios/Assets.xcassets/Mine/DressUp/mine_dressup_time.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "mine_dressup_time@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "mine_dressup_time@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/xplan-ios/Assets.xcassets/Mine/DressUp/mine_dressup_time.imageset/mine_dressup_time@2x.png b/xplan-ios/Assets.xcassets/Mine/DressUp/mine_dressup_time.imageset/mine_dressup_time@2x.png deleted file mode 100644 index 155df507..00000000 Binary files a/xplan-ios/Assets.xcassets/Mine/DressUp/mine_dressup_time.imageset/mine_dressup_time@2x.png and /dev/null differ diff --git a/xplan-ios/Assets.xcassets/Mine/DressUp/mine_dressup_time.imageset/mine_dressup_time@3x.png b/xplan-ios/Assets.xcassets/Mine/DressUp/mine_dressup_time.imageset/mine_dressup_time@3x.png deleted file mode 100644 index 95e56a38..00000000 Binary files a/xplan-ios/Assets.xcassets/Mine/DressUp/mine_dressup_time.imageset/mine_dressup_time@3x.png and /dev/null differ diff --git a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineCarTableViewCell.m b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineCarTableViewCell.m index 7fef63be..e6bd3ff1 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineCarTableViewCell.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineCarTableViewCell.m @@ -27,8 +27,6 @@ @property (nonatomic, strong) UILabel *titleLabel; ///还有多少时间 @property (nonatomic,strong) UIStackView *timeStackView; -///状态icon -@property (nonatomic, strong) UIImageView *timeImageView; ///剩余天数 @property (nonatomic, strong) UILabel *timeLabel; ///使用 @@ -62,7 +60,6 @@ [self.nameStackView addArrangedSubview:self.giveImageView]; [self.nameStackView addArrangedSubview:self.titleLabel]; - [self.timeStackView addArrangedSubview:self.timeImageView]; [self.timeStackView addArrangedSubview:self.timeLabel]; } @@ -85,10 +82,6 @@ make.size.mas_equalTo(CGSizeMake(11, 11)); }]; - [self.timeImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.width.mas_equalTo(11); - }]; - [self.timeStackView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.nameStackView); make.top.mas_equalTo(self.carImageView.mas_centerY).offset(3); @@ -120,7 +113,6 @@ _carInfo = carInfo; if (_carInfo) { self.titleLabel.text = _carInfo.name; - self.timeImageView.hidden = _carInfo.status != Dressup_Car_Status_Ok; self.useButton.hidden = _carInfo.status != Dressup_Car_Status_Ok; if (_carInfo.status == Dressup_Car_Status_Ok) { self.timeLabel.text = [NSString stringWithFormat:@"剩余%ld天", _carInfo.expireDate]; @@ -218,13 +210,6 @@ return _timeStackView; } -- (UIImageView *)timeImageView { - if (!_timeImageView) { - _timeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_dressup_time"]]; - } - return _timeImageView; -} - - (UILabel *)timeLabel { if (!_timeLabel) { _timeLabel = [[UILabel alloc] init]; diff --git a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineHeadwearTableViewCell.m b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineHeadwearTableViewCell.m index c723474a..6a9c847a 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineHeadwearTableViewCell.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineHeadwearTableViewCell.m @@ -27,8 +27,6 @@ @property (nonatomic, strong) UILabel *titleLabel; ///还有多少时间 @property (nonatomic,strong) UIStackView *timeStackView; -///状态icon -@property (nonatomic, strong) UIImageView *timeImageView; ///剩余天数 @property (nonatomic, strong) UILabel *timeLabel; ///使用 @@ -68,7 +66,6 @@ [self.nameStackView addArrangedSubview:self.giveImageView]; [self.nameStackView addArrangedSubview:self.titleLabel]; - [self.timeStackView addArrangedSubview:self.timeImageView]; [self.timeStackView addArrangedSubview:self.timeLabel]; } @@ -89,10 +86,6 @@ make.size.mas_equalTo(CGSizeMake(11, 11)); }]; - [self.timeImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.width.mas_equalTo(11); - }]; - [self.timeStackView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.nameStackView); make.top.mas_equalTo(self.headWearImageView.mas_centerY).offset(3); @@ -124,7 +117,6 @@ _headwearModel = headwearModel; if (_headwearModel) { self.titleLabel.text = _headwearModel.headwearName; - self.timeImageView.hidden = _headwearModel.status != Dressup_Headwear_Status_Ok; self.useButton.hidden = _headwearModel.status != Dressup_Headwear_Status_Ok; if (_headwearModel.status == Dressup_Headwear_Status_Ok) { self.timeLabel.text = [NSString stringWithFormat:@"剩余%@天", _headwearModel.expireDays]; @@ -247,13 +239,6 @@ return _timeStackView; } -- (UIImageView *)timeImageView { - if (!_timeImageView) { - _timeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_dressup_time"]]; - } - return _timeImageView; -} - - (UILabel *)timeLabel { if (!_timeLabel) { _timeLabel = [[UILabel alloc] init]; diff --git a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNameplateTableViewCell.m b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNameplateTableViewCell.m index 7b453e63..d1b27836 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNameplateTableViewCell.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNameplateTableViewCell.m @@ -16,20 +16,18 @@ #import "NameplateModel.h" @interface XPMineNameplateTableViewCell () +///铭牌背景 +@property (nonatomic, strong) UIView *namePlateBgView; ///铭牌 @property (nonatomic, strong) NetImageView *namePlateImageView; ///名字 @property (nonatomic, strong) UILabel *titleLabel; ///还有多少时间 @property (nonatomic,strong) UIStackView *timeStackView; -///状态icon -@property (nonatomic, strong) UIImageView *timeImageView; ///剩余天数 @property (nonatomic, strong) UILabel *timeLabel; ///使用 @property (nonatomic,strong) UIButton *useButton; -///显示分割线 -@property (nonatomic,strong) UIView * lineView; @end @@ -47,49 +45,42 @@ - (void)initSubViews { self.backgroundColor = [UIColor clearColor];; self.selectionStyle = UITableViewCellSelectionStyleNone; - [self.contentView addSubview:self.namePlateImageView]; + [self.contentView addSubview:self.namePlateBgView]; + [self.namePlateBgView addSubview:self.namePlateImageView]; [self.contentView addSubview:self.titleLabel]; [self.contentView addSubview:self.timeStackView]; [self.contentView addSubview:self.useButton]; - [self.contentView addSubview:self.lineView]; - [self.timeStackView addArrangedSubview:self.timeImageView]; [self.timeStackView addArrangedSubview:self.timeLabel]; } - (void)initSubViewConstraints { - [self.namePlateImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(60); - make.width.mas_equalTo(100); - make.centerY.mas_equalTo(self.contentView); - make.left.mas_equalTo(self.contentView).offset(20); - }]; + [self.namePlateBgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(64); + make.width.mas_equalTo(136); + make.bottom.mas_equalTo(self); + make.left.mas_equalTo(self.contentView).offset(15); + }]; + [self.namePlateImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(30); + make.width.mas_equalTo(90); + make.centerX.centerY.mas_equalTo(self.namePlateBgView); + }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.namePlateImageView.mas_right).offset(10); - make.bottom.mas_equalTo(self.namePlateImageView.mas_centerY).offset(-3); - }]; - [self.timeImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.width.mas_equalTo(11); + make.left.mas_equalTo(self.namePlateBgView.mas_right).offset(10); + make.bottom.mas_equalTo(self.namePlateBgView.mas_centerY).offset(-3); }]; [self.timeStackView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.titleLabel); - make.top.mas_equalTo(self.namePlateImageView.mas_centerY).offset(3); + make.top.mas_equalTo(self.namePlateBgView.mas_centerY).offset(3); }]; [self.useButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self); + make.centerY.mas_equalTo(self.namePlateBgView); make.right.mas_equalTo(self.contentView).offset(-15); make.height.mas_equalTo(33); make.width.mas_equalTo(85); }]; - - [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.contentView).offset(105); - make.height.mas_equalTo(0.5); - make.bottom.mas_equalTo(self.contentView); - make.right.mas_equalTo(self.contentView).offset(-15); - }]; - } #pragma mark - private @@ -97,7 +88,6 @@ _nameplateModel = nameplateModel; if (_nameplateModel) { self.titleLabel.text = _nameplateModel.nameplateName; - self.timeImageView.hidden = _nameplateModel.isExpired; self.useButton.hidden = _nameplateModel.isExpired; if (!_nameplateModel.isExpired) { self.timeLabel.text = [NSString stringWithFormat:@"剩余%@天", _nameplateModel.expireDays]; @@ -128,14 +118,21 @@ } #pragma mark - Getter && Setter +- (UIView *)namePlateBgView { + if (!_namePlateBgView) { + _namePlateBgView = [[UIView alloc] init]; + _namePlateBgView.backgroundColor = [ThemeColor appCellBackgroundColor]; + _namePlateBgView.layer.masksToBounds = YES; + _namePlateBgView.layer.cornerRadius = 12; + } + return _namePlateBgView; +} + - (NetImageView *)namePlateImageView { if (!_namePlateImageView) { _namePlateImageView = [[NetImageView alloc] init]; _namePlateImageView.image = [UIImageConstant defaultAvatarPlaceholder]; _namePlateImageView.contentMode = UIViewContentModeScaleAspectFit; - _namePlateImageView.backgroundColor = [ThemeColor appCellBackgroundColor]; - _namePlateImageView.layer.masksToBounds = YES; - _namePlateImageView.layer.cornerRadius = 12; } return _namePlateImageView;; } @@ -174,13 +171,6 @@ return _useButton; } -- (UIImageView *)timeImageView { - if (!_timeImageView) { - _timeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_dressup_time"]]; - } - return _timeImageView; -} - - (UILabel *)timeLabel { if (!_timeLabel) { _timeLabel = [[UILabel alloc] init]; @@ -190,12 +180,4 @@ return _timeLabel; } -- (UIView *)lineView { - if (!_lineView) { - _lineView = [[UIView alloc] init]; - _lineView.backgroundColor = [ThemeColor dividerColor]; - } - return _lineView; -} - @end diff --git a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.m b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.m index 198fa40c..90d253ea 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.m @@ -122,6 +122,8 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (self.type == DressUpListType_Noble) { return self.datasource.count > 0 ? 236 : (KScreenHeight - kNavigationHeight - 100 -50); + } else if (self.type == DressUpListType_Nameplate) { + return self.datasource.count > 0 ? 76 : (KScreenHeight - kNavigationHeight - 100 -50); } else { return self.datasource.count > 0 ? 120 : (KScreenHeight - kNavigationHeight - 100 -50); } @@ -203,6 +205,7 @@ if (@available(iOS 11.0, *)) { _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } + _tableView.contentInset = UIEdgeInsetsMake(0, 0, kSafeAreaBottomHeight, 0); [_tableView registerClass:[XPMineNameplateTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineNameplateTableViewCell class])]; [_tableView registerClass:[XPMineCarTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineCarTableViewCell class])]; [_tableView registerClass:[XPMineHeadwearTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineHeadwearTableViewCell class])];