完成 2.7.32 需求
This commit is contained in:
@@ -38,6 +38,9 @@
|
||||
#import "XPRoomTypeSelectionViewController.h"
|
||||
#import "XPRoomTopicViewController.h"
|
||||
|
||||
#import "ShareHelder.h"
|
||||
#import "XPRoomPresenter.h"
|
||||
|
||||
|
||||
@interface RoomHeaderView ()<XPRoomRecommendViewDelegate>
|
||||
///容器
|
||||
@@ -57,6 +60,8 @@
|
||||
@property (nonatomic,strong) UIStackView *onlineStackView;
|
||||
///id和在线人数
|
||||
@property (nonatomic,strong) YYLabel *idLabel;
|
||||
///分享
|
||||
@property (nonatomic,strong) UIButton *shareButton;
|
||||
///收藏
|
||||
@property (nonatomic,strong) UIButton *collectButton;
|
||||
///设置
|
||||
@@ -143,6 +148,21 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)shareButtonAction:(UIButton *)sender {
|
||||
// @kWeakify(self);
|
||||
XPRoomPresenter *presenter = [[XPRoomPresenter alloc] init];
|
||||
[presenter getShareLink:@(self.hostDelegate.getRoomInfo.uid).stringValue
|
||||
success:^(NSString * _Nonnull link) {
|
||||
// @kStrongify(self);
|
||||
if (![NSString isEmpty:link]) {
|
||||
[ShareHelder shareImage:kImage(@"share_icon") //self.hostDelegate.getRoomInfo.avatar
|
||||
url:link
|
||||
fromController:[XCCurrentVCStackManager shareManager].getCurrentVC];
|
||||
}
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
@@ -154,6 +174,7 @@
|
||||
|
||||
[self addSubview:self.settingButton];
|
||||
[self addSubview:self.topicButton];
|
||||
[self addSubview:self.shareButton];
|
||||
[self addSubview:self.backBtn];
|
||||
[self.nickStackView addArrangedSubview:self.titleStackView];
|
||||
[self.nickStackView addArrangedSubview:self.onlineStackView];
|
||||
@@ -187,6 +208,11 @@
|
||||
// make.trailing.equalTo(self.topicButton.mas_leading).mas_offset(-5);
|
||||
make.size.mas_equalTo(CGSizeMake(20, 20));
|
||||
}];
|
||||
[self.shareButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.collectButton);
|
||||
make.trailing.mas_equalTo(self.collectButton.mas_leading).offset(-6);
|
||||
make.size.mas_equalTo(CGSizeMake(24, 24));
|
||||
}];
|
||||
|
||||
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self).offset(35);
|
||||
@@ -196,7 +222,7 @@
|
||||
[self.nickStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.settingButton);
|
||||
make.leading.equalTo(self.avatarView.mas_trailing).mas_offset(6);
|
||||
make.trailing.mas_equalTo(self.collectButton.mas_leading);
|
||||
make.trailing.mas_equalTo(self.shareButton.mas_leading);
|
||||
}];
|
||||
[self.titleStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_greaterThanOrEqualTo(50);
|
||||
@@ -303,7 +329,7 @@
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
} roomUid:roomUid uid:uid type:type roomUids:nil];
|
||||
} roomUid:roomUid uid:uid type:type roomUids:@""];
|
||||
}
|
||||
|
||||
|
||||
@@ -345,13 +371,23 @@
|
||||
- (UIButton *)settingButton {
|
||||
if (!_settingButton) {
|
||||
_settingButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_settingButton setImage:[UIImage imageNamed:@"room_info_setting"] forState:UIControlStateNormal];
|
||||
[_settingButton setImage:kImage(@"room_info_setting") forState:UIControlStateNormal];
|
||||
[_settingButton addTarget:self action:@selector(settingButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_settingButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8];
|
||||
}
|
||||
return _settingButton;
|
||||
}
|
||||
|
||||
- (UIButton *)shareButton {
|
||||
if (!_shareButton) {
|
||||
_shareButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_shareButton setImage:[UIImage imageNamed:@"room_share"] forState:UIControlStateNormal];
|
||||
[_shareButton addTarget:self action:@selector(shareButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_shareButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8];
|
||||
}
|
||||
return _shareButton;
|
||||
}
|
||||
|
||||
- (UIButton *)topicButton {
|
||||
if (!_topicButton) {
|
||||
_topicButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
|
Reference in New Issue
Block a user