app年龄,星座,寻爱飘屏优化

This commit is contained in:
liyuhua
2023-09-20 17:34:12 +08:00
parent ccc29db030
commit 2435a11e85
75 changed files with 1367 additions and 663 deletions

View File

@@ -188,7 +188,7 @@
_tagView.itemWidthist = _roomInfo.labelsWidthList;
_tagView.itemList = [NSMutableArray arrayWithArray:_roomInfo.labels];
[_birthdayView setTitle:[self getAge] forState:UIControlStateNormal];
[_birthdayView setTitle:[NSString getAgeWithBirth:_roomInfo.birth] forState:UIControlStateNormal];
_birthdayView.backgroundColor = _roomInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
_gameBgView.hidden = YES;
_gameIconView.hidden = YES;
@@ -222,21 +222,7 @@
}
}
-(NSString *)getAge{
NSDateComponents *components1 = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate dateWithTimeIntervalSince1970:_roomInfo.birth/1000]];
NSInteger brithDateYear = [components1 year];
NSInteger brithDateDay = [components1 day];
NSInteger brithDateMonth = [components1 month];
//
NSDateComponents *components2 = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate date]]; NSInteger currentDateYear = [components2 year];
NSInteger currentDateDay = [components2 day]; NSInteger currentDateMonth = [components2 month]; //
NSInteger iAge = currentDateYear - brithDateYear - 1;
if ((currentDateMonth > brithDateMonth) || (currentDateMonth == brithDateMonth && currentDateDay >= brithDateDay)) {
iAge++;
}
return @(iAge).stringValue;
}
///svga
-(void)setPlaySoundStatus:(BOOL)isPlay{
_audioView.isPlay = isPlay;