diff --git a/xplan-ios/Main/Home/View/XPPartyListViewController.m b/xplan-ios/Main/Home/View/XPPartyListViewController.m index 02a7dd28..c0a4944e 100644 --- a/xplan-ios/Main/Home/View/XPPartyListViewController.m +++ b/xplan-ios/Main/Home/View/XPPartyListViewController.m @@ -197,7 +197,7 @@ } - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{ if([self.tabId isEqualToString:@"recommend"]){ - return section == 0 ? UIEdgeInsetsMake(kGetScaleWidth(8), kGetScaleWidth(16), 0, kGetScaleWidth(16)):UIEdgeInsetsMake(0, 0, 0, 0); + return section == 0 ? UIEdgeInsetsMake(kGetScaleWidth(8), kGetScaleWidth(15), 0, kGetScaleWidth(15)):UIEdgeInsetsMake(0, 0, 0, 0); } return UIEdgeInsetsMake(0, 0, 0, 0); } diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPPrivilegeCardGiftCell.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPPrivilegeCardGiftCell.m index b8c77e51..2293e915 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPPrivilegeCardGiftCell.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPPrivilegeCardGiftCell.m @@ -55,26 +55,11 @@ - (void)setCardModel:(XPPrivilegeCardItemModel *)cardModel{ _cardModel = cardModel; _titleVeiw.text = _cardModel.cardName; - if(_cardModel.checkTime != nil){ - NSArray *curTimeList = [_cardModel.checkTime componentsSeparatedByString:@" "]; - if(curTimeList.count > 0){ - NSString *dailyTime = [self getTimeWtihCurTime:curTimeList.firstObject dailyTime:_cardModel.effectDay]; - _timeView.text = [NSString stringWithFormat:@"有效期至:%@",dailyTime]; - } - } + _timeView.text = [NSString stringWithFormat:@"有效期至:%@",_cardModel.expireTime]; _bgImageView.imageUrl = _cardModel.cardUrl; _bgImageView.layer.borderWidth = _cardModel.isSelected ? 2 : 0; } --(NSString *)getTimeWtihCurTime:(NSString *)curTime dailyTime:(NSString *)dailyTime{ - NSCalendar *calendar = [NSCalendar currentCalendar]; - NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init]; - [inputFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier :@"zh_CN"]]; - [inputFormatter setDateFormat:@"yyyy-MM-dd"]; - NSDate *inputDate = [inputFormatter dateFromString:curTime]; - NSDate *nextDate = [NSDate dateWithTimeInterval:(24*60*60*dailyTime.integerValue) sinceDate:inputDate]; - NSDateComponents *comps = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitWeekday|NSCalendarUnitDay fromDate:nextDate]; - return [NSString stringWithFormat:@"%ld-%ld-%ld",comps.year,comps.month,comps.day]; -} + #pragma mark - 懒加载 - (NetImageView *)bgImageView{ diff --git a/xplan-ios/Main/Room/PrivilegeCard/Subviews/XPPrivilegeCardItemCell.m b/xplan-ios/Main/Room/PrivilegeCard/Subviews/XPPrivilegeCardItemCell.m index 0f5694be..e104d1be 100644 --- a/xplan-ios/Main/Room/PrivilegeCard/Subviews/XPPrivilegeCardItemCell.m +++ b/xplan-ios/Main/Room/PrivilegeCard/Subviews/XPPrivilegeCardItemCell.m @@ -217,14 +217,8 @@ _nameView.attributedText =_cardModel.nameAtt; _instructionsView.attributedText = _cardModel.instructionsAtt; _useIDView.text = _cardModel.erbanNoStr; - if(_cardModel.checkTime != nil){ - NSArray *curTimeList = [_cardModel.checkTime componentsSeparatedByString:@" "]; - if(curTimeList.count > 0){ - NSString *dailyTime = [self getTimeWtihCurTime:curTimeList.firstObject dailyTime:_cardModel.effectDay]; - _timeView.text = [NSString stringWithFormat:@"有效期:%@ 至 %@",curTimeList.firstObject,dailyTime]; - } - } - + _timeView.text = [NSString stringWithFormat:@"有效期:%@ 至 %@",_cardModel.effectTime,_cardModel.expireTime]; + } @@ -234,16 +228,7 @@ return textAtt; }; --(NSString *)getTimeWtihCurTime:(NSString *)curTime dailyTime:(NSString *)dailyTime{ - NSCalendar *calendar = [NSCalendar currentCalendar]; - NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init]; - [inputFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier :@"zh_CN"]]; - [inputFormatter setDateFormat:@"yyyy-MM-dd"]; - NSDate *inputDate = [inputFormatter dateFromString:curTime]; - NSDate *nextDate = [NSDate dateWithTimeInterval:(24*60*60*dailyTime.integerValue) sinceDate:inputDate]; - NSDateComponents *comps = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitWeekday|NSCalendarUnitDay fromDate:nextDate]; - return [NSString stringWithFormat:@"%ld-%ld-%ld",comps.year,comps.month,comps.day]; -} + -(void)againEditAction{ if(self.delegate && [self.delegate respondsToSelector:@selector(againEditPrivilegeCardWithCell:cardModel:)]){ [self.delegate againEditPrivilegeCardWithCell:self cardModel:self.cardModel];