修复bug
This commit is contained in:
@@ -47,6 +47,8 @@
|
||||
|
||||
- (void)renderWithSession:(NIMRecentSession *)recent {
|
||||
NIMUser *user = [[NIMSDK sharedSDK].userManager userInfo:recent.session.sessionId];
|
||||
self.avatarImageView.image = nil;
|
||||
self.nameLabel.text = @"";
|
||||
if (user.userInfo == nil) {
|
||||
NSString * uid = recent.session.sessionId;
|
||||
if (uid > 0) {
|
||||
@@ -56,7 +58,6 @@
|
||||
NIMUser * userInfo = users.firstObject;
|
||||
self.nameLabel.text = userInfo.userInfo.nickName;
|
||||
NSString *avatarUrl = userInfo.userInfo.avatarUrl;
|
||||
self.avatarImageView.image = nil;
|
||||
[self.avatarImageView loadImageWithUrl:avatarUrl completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
self.avatarImageView.image = image;
|
||||
}];
|
||||
@@ -67,7 +68,6 @@
|
||||
} else {
|
||||
NSString *avatarUrl = user.userInfo.avatarUrl;
|
||||
self.nameLabel.text = user.userInfo.nickName;
|
||||
self.avatarImageView.image = nil;
|
||||
[self.avatarImageView loadImageWithUrl:avatarUrl completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
self.avatarImageView.image = image;
|
||||
}];
|
||||
|
@@ -72,7 +72,8 @@
|
||||
self.avatarItem.avatarUrl = userInfo.isReview ? userInfo.reviewingAvatar : userInfo.avatar;
|
||||
|
||||
self.nickItem.subTitle = userInfo.nick;
|
||||
NSString *dateStr = [self.dateFormatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:userInfo.birth/1000]];
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSince1970:userInfo.birth/1000];
|
||||
NSString *dateStr = [self.dateFormatter stringFromDate:date];
|
||||
self.birthItem.subTitle = dateStr;
|
||||
|
||||
self.photoItem.photoArray = userInfo.privatePhoto;
|
||||
@@ -226,7 +227,7 @@
|
||||
if (!_dateFormatter) {
|
||||
_dateFormatter = [[NSDateFormatter alloc] init];
|
||||
_dateFormatter.dateFormat = @"yyyy-MM-dd";
|
||||
|
||||
[_dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"Asia/Shanghai"]];
|
||||
}
|
||||
return _dateFormatter;
|
||||
}
|
||||
|
@@ -242,10 +242,23 @@
|
||||
// if(dateStr.length > 0){
|
||||
// _starIconView.image = kImage(dateStr);
|
||||
// }
|
||||
_birthdayView.text = [NSDate timestampSwitchTime:_userInfo.birth / 1000 andFormatter:@"yyyy-MM-dd"];
|
||||
_birthdayView.text = [self timestampSwitchTime:_userInfo.birth / 1000 andFormatter:@"yyyy-MM-dd"];
|
||||
_areaView.text = _userInfo.region;
|
||||
}
|
||||
-(NSString *)timestampSwitchTime:(NSInteger)timestamp andFormatter:(NSString *)format{
|
||||
|
||||
|
||||
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
[formatter setDateStyle:NSDateFormatterMediumStyle];
|
||||
[formatter setTimeZone:[NSTimeZone timeZoneWithName:@"Asia/Shanghai"]];
|
||||
[formatter setTimeStyle:NSDateFormatterShortStyle];
|
||||
|
||||
[formatter setDateFormat:format]; // (@"YYYY-MM-dd hh:mm:ss")----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制
|
||||
NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:timestamp];
|
||||
NSString *confromTimespStr = [formatter stringFromDate:confromTimesp];
|
||||
return confromTimespStr;
|
||||
}
|
||||
- (NSString *)calculateConstellationWithMonth:(long)time
|
||||
{
|
||||
NSString *astroString = YMLocalizedString(@"XPMineHeadView0");
|
||||
|
@@ -322,6 +322,7 @@
|
||||
if (!_dateFormatter) {
|
||||
_dateFormatter = [[NSDateFormatter alloc] init];
|
||||
_dateFormatter.dateFormat = @"yyyy-MM-dd";
|
||||
[_dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"Asia/Shanghai"]];
|
||||
}
|
||||
return _dateFormatter;
|
||||
}
|
||||
|
@@ -87,17 +87,39 @@
|
||||
- (void)setAvatarList:(NSArray *)avatarList{
|
||||
_avatarList = avatarList;
|
||||
if(_avatarList.count == 0)return;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
MSRoomOnLineAvatarView *imageView = [self.stackView viewWithTag:100 + 2 - i];
|
||||
if(i < _avatarList.count){
|
||||
XPMessageRemoteExtModel *model = _avatarList[i];
|
||||
imageView.model = model;
|
||||
imageView.isHiddenSubView = NO;
|
||||
}else{
|
||||
imageView.isHiddenSubView = YES;
|
||||
}
|
||||
MSRoomOnLineAvatarView *imageView1 = [self.stackView viewWithTag:100];
|
||||
MSRoomOnLineAvatarView *imageView2 = [self.stackView viewWithTag:101];
|
||||
MSRoomOnLineAvatarView *imageView3 = [self.stackView viewWithTag:102];
|
||||
imageView1.isHiddenSubView = YES;
|
||||
imageView2.isHiddenSubView = YES;
|
||||
imageView3.isHiddenSubView = YES;
|
||||
if(_avatarList.count == 1){
|
||||
imageView3.isHiddenSubView = NO;
|
||||
XPMessageRemoteExtModel *model3 = _avatarList[0];
|
||||
imageView3.model = model3;
|
||||
}else if(_avatarList.count == 2){
|
||||
imageView2.isHiddenSubView = NO;
|
||||
XPMessageRemoteExtModel *model2 = _avatarList[0];
|
||||
imageView2.model = model2;
|
||||
|
||||
imageView3.isHiddenSubView = NO;
|
||||
XPMessageRemoteExtModel *model3 = _avatarList[1];
|
||||
imageView3.model = model3;
|
||||
}else{
|
||||
imageView1.isHiddenSubView = NO;
|
||||
XPMessageRemoteExtModel *model1 = _avatarList[0];
|
||||
imageView1.model = model1;
|
||||
|
||||
imageView2.isHiddenSubView = NO;
|
||||
XPMessageRemoteExtModel *model2 = _avatarList[1];
|
||||
imageView2.model = model2;
|
||||
|
||||
imageView3.isHiddenSubView = NO;
|
||||
XPMessageRemoteExtModel *model3 = _avatarList[2];
|
||||
imageView3.model = model3;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UIView *)countBgView{
|
||||
|
@@ -45,7 +45,7 @@
|
||||
-(void)installConstraints{
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.mas_equalTo(kGetScaleWidth(0));
|
||||
make.width.mas_equalTo(isMSZH() ? 150 : 200);
|
||||
make.width.mas_equalTo(150);
|
||||
make.height.mas_equalTo(kGetScaleWidth(30));
|
||||
|
||||
}];
|
||||
@@ -147,7 +147,7 @@
|
||||
_titleView.defaultSelectedIndex = 0;
|
||||
_titleView.cellSpacing = 20;
|
||||
_titleView.cellWidthIncrement = 5;
|
||||
_titleView.cellWidth = 40;
|
||||
_titleView.cellWidth = 30;
|
||||
_titleView.listContainer = self.pi_containerView;
|
||||
|
||||
JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init];
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
- (NSArray<NSString *> *)titles{
|
||||
if(!_titles){
|
||||
_titles = @[YMLocalizedString(@"XPMineMainGuildListVC1"),YMLocalizedString(@"MSSessionPublicChatHallVC0")];
|
||||
_titles = @[YMLocalizedString(@"XPMineMainGuildListVC1"),YMLocalizedString(@"MSSessionPublicChatHallVC2")];
|
||||
}
|
||||
return _titles;
|
||||
}
|
||||
|
@@ -3794,8 +3794,9 @@ ineHeadView12" = "الحمل";
|
||||
|
||||
//MSRoomGameWebVC
|
||||
"MSRoomGameWebVC0"="هل أنت متأكد أنك تريد الخروج من اللعبة؟";
|
||||
"MSSessionPublicChatHallVC0"="غرفة الدردشة العامة";
|
||||
"MSSessionPublicChatHallVC0"="دردشة عامة";
|
||||
"MSSessionPublicChatHallVC1"="~اريد تصدر العناوين";
|
||||
"MSSessionPublicChatHallVC2"="دردشة عامة";
|
||||
"MSSessionReleaseHeadlinesView0"="(الرجاء إدخال المحتوي الذي تريد أن تتصدر عناوينهّ~ )يقتصر على 100 كلمة";
|
||||
"MSSessionReleaseHeadlinesView1"=" تصدر العناوين%@";
|
||||
"MSSessionContextHeadlinesView0"="~عزيزي%@، هيا تصدر العناوين ";
|
||||
|
@@ -3598,6 +3598,7 @@
|
||||
///MSSessionPublicChatHallVC
|
||||
"MSSessionPublicChatHallVC0"="Chating";
|
||||
"MSSessionPublicChatHallVC1"="I want headlines~";
|
||||
"MSSessionPublicChatHallVC2"="Chating";
|
||||
///MSSessionReleaseHeadlinesView
|
||||
"MSSessionReleaseHeadlinesView0"="Enter your headline content~ (100 characters max)";
|
||||
"MSSessionReleaseHeadlinesView1"=" %@ makes headlines";
|
||||
|
@@ -3254,6 +3254,7 @@
|
||||
///MSSessionPublicChatHallVC
|
||||
"MSSessionPublicChatHallVC0"="公聊厅";
|
||||
"MSSessionPublicChatHallVC1"="我要上头条~";
|
||||
"MSSessionPublicChatHallVC2"="公聊";
|
||||
///MSSessionReleaseHeadlinesView
|
||||
"MSSessionReleaseHeadlinesView0"="请输入想上头条的内容~(仅限100字)";
|
||||
"MSSessionReleaseHeadlinesView1"=" %@上头条";
|
||||
|
@@ -3248,6 +3248,7 @@
|
||||
///MSSessionPublicChatHallVC
|
||||
"MSSessionPublicChatHallVC0"="公聊廳";
|
||||
"MSSessionPublicChatHallVC1"="我要上頭條~";
|
||||
"MSSessionPublicChatHallVC2"="公聊";
|
||||
///MSSessionReleaseHeadlinesView
|
||||
"MSSessionReleaseHeadlinesView0"="請輸入想上頭條的內容~(僅限100字)";
|
||||
"MSSessionReleaseHeadlinesView1"=" %@上頭條";
|
||||
|
Reference in New Issue
Block a user