房间公告显示异常的问题

This commit is contained in:
fengshuo
2022-03-15 11:16:00 +08:00
parent ee915d1297
commit ff8a6e2095
4 changed files with 156 additions and 11 deletions

View File

@@ -212,6 +212,7 @@
E80DE40A277568D300BE5BCB /* ThemeColor+FirstRecharge.m in Sources */ = {isa = PBXBuildFile; fileRef = E80DE409277568D300BE5BCB /* ThemeColor+FirstRecharge.m */; };
E80DE40D2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = E80DE40C2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m */; };
E80DE4102775C34E00BE5BCB /* XPFirstRechargeSuccessView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80DE40F2775C34E00BE5BCB /* XPFirstRechargeSuccessView.m */; };
E80E900C27E0358900434B90 /* XPRoomTopicAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80E900B27E0358900434B90 /* XPRoomTopicAlertView.m */; };
E811FFF72742367B00918544 /* XPGiftEmptyCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E811FFF62742367B00918544 /* XPGiftEmptyCollectionViewCell.m */; };
E8133916273E532D00708B66 /* XPGiftItemCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8133915273E532D00708B66 /* XPGiftItemCollectionViewCell.m */; };
E81366E326F0A1FC0076364C /* LoginBindPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E81366E226F0A1FC0076364C /* LoginBindPhoneViewController.m */; };
@@ -961,6 +962,8 @@
E80DE40C2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFirstRechargeFlowLayout.m; sourceTree = "<group>"; };
E80DE40E2775C34E00BE5BCB /* XPFirstRechargeSuccessView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFirstRechargeSuccessView.h; sourceTree = "<group>"; };
E80DE40F2775C34E00BE5BCB /* XPFirstRechargeSuccessView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFirstRechargeSuccessView.m; sourceTree = "<group>"; };
E80E900A27E0358900434B90 /* XPRoomTopicAlertView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopicAlertView.h; sourceTree = "<group>"; };
E80E900B27E0358900434B90 /* XPRoomTopicAlertView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTopicAlertView.m; sourceTree = "<group>"; };
E811FFF52742367B00918544 /* XPGiftEmptyCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftEmptyCollectionViewCell.h; sourceTree = "<group>"; };
E811FFF62742367B00918544 /* XPGiftEmptyCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftEmptyCollectionViewCell.m; sourceTree = "<group>"; };
E8133914273E532D00708B66 /* XPGiftItemCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftItemCollectionViewCell.h; sourceTree = "<group>"; };
@@ -3229,6 +3232,8 @@
E87E91542796B6DE00A7B3F2 /* XPRoomInviteUserViewController.m */,
E8AA6EED27DF1E6B009B4C2B /* XPRoomTopicViewController.h */,
E8AA6EEE27DF1E6B009B4C2B /* XPRoomTopicViewController.m */,
E80E900A27E0358900434B90 /* XPRoomTopicAlertView.h */,
E80E900B27E0358900434B90 /* XPRoomTopicAlertView.m */,
);
path = View;
sourceTree = "<group>";
@@ -4713,6 +4718,7 @@
E8A6C29527CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m in Sources */,
E8EEB8F726FC2673007C6EBA /* UserPhoto.m in Sources */,
E81C27A226EF23490031E639 /* XPEnum.h in Sources */,
E80E900C27E0358900434B90 /* XPRoomTopicAlertView.m in Sources */,
9BB54966278303EB0090CD26 /* XPNobleCenterNavView.m in Sources */,
9B92A36327980DCC00AD168F /* Api+SkillCard.m in Sources */,
E88B5CB526FB20B800DA9178 /* XPMineTeenagerPwdView.m in Sources */,

View File

@@ -32,6 +32,7 @@
#import "XPRoomAnchorInfoCardView.h"
#import "AnchorGiftValueView.h"
#import "XPRoomTopicViewController.h"
#import "XPRoomTopicAlertView.h"
@interface XPRoomFunctionContainerView ()
///host
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
@@ -287,17 +288,12 @@
editTopicVC.roomInfo = roomInfo;
[self.delegate.getCurrentNav pushViewController:editTopicVC animated:YES];
} else {
NSString * title = roomInfo.roomDesc.length > 0 ? roomInfo.roomDesc : @"暂未设置话题";
TTAlertConfig * config = [[TTAlertConfig alloc] init];
config.title = title;
config.message = roomInfo.introduction.length > 0 ? roomInfo.introduction : @"暂未设置房间话题";
config.actionStyle = TTAlertActionCancelStyle;
config.cancelButtonConfig.title = @"关闭";
[TTPopup alertWithConfig:config confirmHandler:^{
} cancelHandler:^{
}];
TTPopupService * config = [[TTPopupService alloc] init];
XPRoomTopicAlertView * alertView = [[XPRoomTopicAlertView alloc] init];
alertView.title = roomInfo.roomDesc;
alertView.message = roomInfo.introduction;
config.contentView = alertView;
[TTPopup popupWithConfig:config];
}
}
}];

View File

@@ -0,0 +1,19 @@
//
// XPRoomTopicAlertView.h
// xplan-ios
//
// Created by 冯硕 on 2022/3/15.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPRoomTopicAlertView : UIView
///显示标题
@property (nonatomic,copy) NSString *title;
///显示内容
@property (nonatomic,copy) NSString *message;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,124 @@
//
// XPRoomTopicAlertView.m
// xplan-ios
//
// Created by on 2022/3/15.
//
#import "XPRoomTopicAlertView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "UIImage+Utils.h"
#import "TTPopup.h"
#import "XPMacro.h"
@interface XPRoomTopicAlertView ()
///
@property (nonatomic,strong) UILabel *titleLabel;
///
@property (nonatomic,strong) UITextView *textView;
///
@property (nonatomic,strong) UIButton *closeButton;
@end
@implementation XPRoomTopicAlertView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
self.layer.masksToBounds = YES;
self.layer.cornerRadius = 15;
self.backgroundColor = [UIColor whiteColor];
[self addSubview:self.titleLabel];
[self addSubview:self.textView];
[self addSubview:self.closeButton];
}
- (void)initSubViewConstraints {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(KScreenWidth - 40 * 2);
make.bottom.mas_equalTo(self.closeButton.mas_bottom).offset(20);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self).inset(20);
}];
[self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self).inset(20);
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(15);
make.height.mas_equalTo(200);
}];
[self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(124, 44));
make.top.mas_equalTo(self.textView.mas_bottom).offset(20);
make.centerX.mas_equalTo(self);
}];
}
#pragma mark - Event Response
- (void)closeButtonAction:(UIButton *)sender {
[TTPopup dismiss];
}
#pragma mark - Getters And Setters
- (void)setTitle:(NSString *)title {
_title = title;
self.titleLabel.text = _title.length > 0 ? _title : @"暂无设置话题";
}
- (void)setMessage:(NSString *)message {
_message = message;
self.textView.text = _message.length > 0 ? _message : @"暂未设置话题内容";
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.font = [UIFont fontWithName:@"PingFangSC-Medium" size:16];
_titleLabel.textColor = [ThemeColor mainTextColor];
}
return _titleLabel;
}
- (UITextView *)textView {
if (!_textView) {
_textView = [[UITextView alloc] init];
_textView.textColor = [ThemeColor mainTextColor];
_textView.backgroundColor = [UIColor clearColor];
_textView.font = [UIFont systemFontOfSize:15];
_textView.editable = NO;
}
return _textView;
}
- (UIButton *)closeButton {
if (!_closeButton) {
_closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_closeButton setTitle:@"关闭" forState:UIControlStateNormal];
[_closeButton setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateNormal];
_closeButton.titleLabel.font = [UIFont systemFontOfSize:15];
[_closeButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor], [ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
_closeButton.layer.masksToBounds = YES;
_closeButton.layer.cornerRadius = 22;
[_closeButton addTarget:self action:@selector(closeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _closeButton;
}
@end