|
@@ -10,6 +10,7 @@
|
|
|
#import "UIView+SDAutoLayout.h"
|
|
|
#import "SLNewMsgBgView.h"
|
|
|
#import "SLMomentsNewsVc.h"
|
|
|
+#import "SLMsgBgSetVc.h"
|
|
|
|
|
|
@implementation SDTimeLineTableHeaderView
|
|
|
|
|
@@ -30,13 +31,6 @@
|
|
|
return self;
|
|
|
}
|
|
|
|
|
|
-- (void)setHeaderWithLoginInfo {
|
|
|
- SLUserModel *model = [SLGlobalInfo SharedInstance].loginInfo.user;
|
|
|
- NSString *urlStr = [model getUserHeadUrl];
|
|
|
- [_iconView sd_setImageWithURL:[NSURL URLWithString:urlStr] placeholderImage:ImageName(@"icon_ellipse")];
|
|
|
- _nameLabel.text = model.userName;
|
|
|
-}
|
|
|
-
|
|
|
- (void)setup
|
|
|
{
|
|
|
_backgroundImageView = [UIImageView new];
|
|
@@ -46,11 +40,6 @@
|
|
|
|
|
|
_iconView = [UIImageView new];
|
|
|
[self addSubview:_iconView];
|
|
|
-//
|
|
|
-// WS(weakSelf);
|
|
|
-// [self.KVOController observe:[SLGlobalInfo SharedInstance] keyPath:@"loginInfo" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld block:^(id _Nullable observer, id _Nonnull object, NSDictionary<NSKeyValueChangeKey,id> * _Nonnull change) {
|
|
|
-// [weakSelf setHeaderWithLoginInfo];
|
|
|
-// }];
|
|
|
|
|
|
_nameLabel = [UILabel new];
|
|
|
SLLoginInfo *targetModel = [SLGlobalInfo SharedInstance].loginInfo;
|
|
@@ -87,6 +76,7 @@
|
|
|
[moreInterestBtn handleEvent:UIControlEventTouchUpInside withBlock:^{
|
|
|
|
|
|
}];
|
|
|
+ moreInterestBtn.hidden = YES;
|
|
|
[self addSubview:moreInterestBtn];
|
|
|
|
|
|
_newMsgBgView = [[SLNewMsgBgView alloc] initWithFrame:CGRectZero];
|
|
@@ -143,12 +133,28 @@
|
|
|
SLMomentsNewsVc *vc = [SLMomentsNewsVc loadViewControllewWithNib];
|
|
|
[weakSelf.viewController navPushViewController:vc animated:YES];
|
|
|
}];
|
|
|
+
|
|
|
+ self.bgSelImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
|
|
|
+ self.bgSelImageView.image = ImageName(@"icon_moment_bg_sel");
|
|
|
+ self.bgSelImageView.hidden = YES;
|
|
|
+ [self addSubview:self.bgSelImageView];
|
|
|
+ self.bgSelImageView.sd_layout
|
|
|
+ .widthIs(56)
|
|
|
+ .heightIs(56)
|
|
|
+ .rightSpaceToView(self, 16)
|
|
|
+ .centerYEqualToView(_iconView);
|
|
|
+ [self.bgSelImageView addTapWithBlock:^{
|
|
|
+ SLMsgBgSetVc *vc = [SLMsgBgSetVc loadViewControllewWithNib];
|
|
|
+ [weakSelf.viewController navPushViewController:vc animated:YES];
|
|
|
+ }];
|
|
|
}
|
|
|
|
|
|
- (void)confignHeaderWith:(SLUserModel *)userModel {
|
|
|
NSString *urlStr = [userModel getUserHeadUrl];
|
|
|
[_iconView sd_setImageWithURL:[NSURL URLWithString:urlStr] placeholderImage:ImageName(@"icon_ellipse")];
|
|
|
_nameLabel.text = userModel.userName;
|
|
|
+ NSString *bgImg = [NSString stringWithFormat:@"%@%@",[SLHttpCenter SharedInstance].serverUrl, userModel.friendCircleImage];
|
|
|
+ [_backgroundImageView sd_setImageWithURL:[NSURL URLWithString:bgImg] placeholderImage:ImageName(@"icon_moment_bg_01")];
|
|
|
}
|
|
|
|
|
|
@end
|