diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 74dbd9c4..ad2f455b 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -119,6 +119,8 @@ 9B16A34827E17D9B00E13A98 /* XPRoomTrumpetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B16A34727E17D9B00E13A98 /* XPRoomTrumpetViewController.m */; }; 9B16A34B27E1915A00E13A98 /* XPTrumpetPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B16A34A27E1915A00E13A98 /* XPTrumpetPresenter.m */; }; 9B17F71827BD150600440843 /* SVGAParserManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B17F71727BD150600440843 /* SVGAParserManager.m */; }; + 9B1FC3D527E49A5D006EFFE0 /* ChatBubbleModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1FC3D427E49A5D006EFFE0 /* ChatBubbleModel.m */; }; + 9B1FC3D827E49C36006EFFE0 /* XPMineDressBubbleTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B1FC3D727E49C36006EFFE0 /* XPMineDressBubbleTableViewCell.m */; }; 9B208A362779B50100F9E54A /* GiftNobleInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B208A352779B50100F9E54A /* GiftNobleInfoModel.m */; }; 9B2489BC27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2489BB27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.m */; }; 9B2A12D52783EEC700CED41B /* XPNobleCenterTableHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12D42783EEC700CED41B /* XPNobleCenterTableHeadView.m */; }; @@ -776,6 +778,10 @@ 9B16A34A27E1915A00E13A98 /* XPTrumpetPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPTrumpetPresenter.m; sourceTree = ""; }; 9B17F71627BD150600440843 /* SVGAParserManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAParserManager.h; sourceTree = ""; }; 9B17F71727BD150600440843 /* SVGAParserManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVGAParserManager.m; sourceTree = ""; }; + 9B1FC3D327E49A5D006EFFE0 /* ChatBubbleModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChatBubbleModel.h; sourceTree = ""; }; + 9B1FC3D427E49A5D006EFFE0 /* ChatBubbleModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ChatBubbleModel.m; sourceTree = ""; }; + 9B1FC3D627E49C36006EFFE0 /* XPMineDressBubbleTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineDressBubbleTableViewCell.h; sourceTree = ""; }; + 9B1FC3D727E49C36006EFFE0 /* XPMineDressBubbleTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineDressBubbleTableViewCell.m; sourceTree = ""; }; 9B208A342779B50100F9E54A /* GiftNobleInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftNobleInfoModel.h; sourceTree = ""; }; 9B208A352779B50100F9E54A /* GiftNobleInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftNobleInfoModel.m; sourceTree = ""; }; 9B2489BA27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineVisitorEmptyTableViewCell.h; sourceTree = ""; }; @@ -3219,6 +3225,8 @@ E82D5C75276AEB5100858D6D /* NameplateModel.m */, 9BBC028C2786FA060007C24B /* NobleCardModel.h */, 9BBC028D2786FA060007C24B /* NobleCardModel.m */, + 9B1FC3D327E49A5D006EFFE0 /* ChatBubbleModel.h */, + 9B1FC3D427E49A5D006EFFE0 /* ChatBubbleModel.m */, ); path = Model; sourceTree = ""; @@ -3247,6 +3255,8 @@ E82D5C6C276ADCE700858D6D /* XPMineDressEmptyTableViewCell.m */, 9BBC028F2786FC570007C24B /* XPMineNobleCardTableViewCell.h */, 9BBC02902786FC570007C24B /* XPMineNobleCardTableViewCell.m */, + 9B1FC3D627E49C36006EFFE0 /* XPMineDressBubbleTableViewCell.h */, + 9B1FC3D727E49C36006EFFE0 /* XPMineDressBubbleTableViewCell.m */, ); path = Cell; sourceTree = ""; @@ -5008,6 +5018,7 @@ 9B92A3662798132600AD168F /* XPSkillCardTypeView.m in Sources */, E8EE827D272B9A2300A17217 /* XPRoomSendTextView.m in Sources */, 9BD63FAE277EE97A006EB744 /* XPReleaseRadioPresenter.m in Sources */, + 9B1FC3D827E49C36006EFFE0 /* XPMineDressBubbleTableViewCell.m in Sources */, 9B5BF8A827E1BED1005DD346 /* Api+RoomTrumpet.m in Sources */, E8EEB90626FC5772007C6EBA /* XPMineUserInfoEditViewController.m in Sources */, E8B846D626FDE01B00A777FE /* XPMineRechargePresenter.m in Sources */, @@ -5041,6 +5052,7 @@ E8DACCFB2766EDC60052092C /* MicroGiftValueView.m in Sources */, E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */, E8E70D7726F2F15100F03460 /* XPMineViewController.m in Sources */, + 9B1FC3D527E49A5D006EFFE0 /* ChatBubbleModel.m in Sources */, E896EFA62771AEDD00AD2CC1 /* XPMineFansTableViewCell.m in Sources */, E8E7DAEB2745158500C631CC /* XPGiftUserInfoModel.m in Sources */, E83DB487274670DA00D8CBD1 /* XPRoomGiftBroadCastModel.m in Sources */, diff --git a/xplan-ios/Base/MVP/Model/UserInfoModel.h b/xplan-ios/Base/MVP/Model/UserInfoModel.h index 5756fcc8..d1ea8432 100644 --- a/xplan-ios/Base/MVP/Model/UserInfoModel.h +++ b/xplan-ios/Base/MVP/Model/UserInfoModel.h @@ -100,6 +100,10 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,copy) NSString *fromNick; @property (nonatomic,assign) UserEnterRoomFromType fromType; @property (nonatomic,copy) NSString *fromUid; +///安卓房间公屏气泡 +@property (nonatomic, copy) NSString *androidBubbleUrl; +///iOS房间公屏气泡 +@property (nonatomic, copy) NSString *iosBubbleUrl; @end diff --git a/xplan-ios/Main/Mine/View/DressUp/Api/Api+DressUp.h b/xplan-ios/Main/Mine/View/DressUp/Api/Api+DressUp.h index e7855899..6436bc7d 100644 --- a/xplan-ios/Main/Mine/View/DressUp/Api/Api+DressUp.h +++ b/xplan-ios/Main/Mine/View/DressUp/Api/Api+DressUp.h @@ -34,6 +34,12 @@ NS_ASSUME_NONNULL_BEGIN /// @param uid uid + (void)nobleCardList:(HttpRequestHelperCompletion)completion ticket:(NSString *)ticket uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize; +/// 获取用户公屏气泡 +/// @param completion 完成 +/// @param page 分页 +/// @param pageSize 页数 ++ (void)chatBubbleList:(HttpRequestHelperCompletion)completion page:(NSString *)page pageSize:(NSString *)pageSize; + /// 使用头饰 /// @param completion 完成 /// @param headwearId 头饰id 0 取消使用头饰 diff --git a/xplan-ios/Main/Mine/View/DressUp/Api/Api+DressUp.m b/xplan-ios/Main/Mine/View/DressUp/Api/Api+DressUp.m index 3b46f69d..13f1584c 100644 --- a/xplan-ios/Main/Mine/View/DressUp/Api/Api+DressUp.m +++ b/xplan-ios/Main/Mine/View/DressUp/Api/Api+DressUp.m @@ -42,6 +42,14 @@ [self makeRequest:@"userInfoCard/listByPage" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, ticket, uid, page, pageSize, nil]; } +/// 获取用户公屏气泡 +/// @param completion 完成 +/// @param page 分页 +/// @param pageSize 页数 ++ (void)chatBubbleList:(HttpRequestHelperCompletion)completion page:(NSString *)page pageSize:(NSString *)pageSize { + [self makeRequest:@"userChatBubble/listByPage" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, page, pageSize, nil]; +} + /// 使用头饰 /// @param completion 完成 /// @param headwearId 头饰id 0 取消使用头饰 diff --git a/xplan-ios/Main/Mine/View/DressUp/Model/ChatBubbleModel.h b/xplan-ios/Main/Mine/View/DressUp/Model/ChatBubbleModel.h new file mode 100644 index 00000000..4eca8035 --- /dev/null +++ b/xplan-ios/Main/Mine/View/DressUp/Model/ChatBubbleModel.h @@ -0,0 +1,16 @@ +// +// ChatBubbleModel.h +// xplan-ios +// +// Created by GreenLand on 2022/3/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ChatBubbleModel : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/DressUp/Model/ChatBubbleModel.m b/xplan-ios/Main/Mine/View/DressUp/Model/ChatBubbleModel.m new file mode 100644 index 00000000..fbcaa738 --- /dev/null +++ b/xplan-ios/Main/Mine/View/DressUp/Model/ChatBubbleModel.m @@ -0,0 +1,12 @@ +// +// ChatBubbleModel.m +// xplan-ios +// +// Created by GreenLand on 2022/3/18. +// + +#import "ChatBubbleModel.h" + +@implementation ChatBubbleModel + +@end diff --git a/xplan-ios/Main/Mine/View/DressUp/Presenter/XPMineDressUpPresenter.h b/xplan-ios/Main/Mine/View/DressUp/Presenter/XPMineDressUpPresenter.h index 22d0338c..93216d38 100644 --- a/xplan-ios/Main/Mine/View/DressUp/Presenter/XPMineDressUpPresenter.h +++ b/xplan-ios/Main/Mine/View/DressUp/Presenter/XPMineDressUpPresenter.h @@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)getUserNameplateList; /// 获取用户贵族资料卡列表 - (void)getUserNobleCardList; +/// 获取用户公屏聊天气泡列表 +- (void)getUserChatBubbleList; /// 使用头饰 /// @param headwearId 头饰的id 不使用的时候传0 - (void)useHeader:(NSString *)headwearId; diff --git a/xplan-ios/Main/Mine/View/DressUp/Presenter/XPMineDressUpPresenter.m b/xplan-ios/Main/Mine/View/DressUp/Presenter/XPMineDressUpPresenter.m index b8eae573..75db540e 100644 --- a/xplan-ios/Main/Mine/View/DressUp/Presenter/XPMineDressUpPresenter.m +++ b/xplan-ios/Main/Mine/View/DressUp/Presenter/XPMineDressUpPresenter.m @@ -14,6 +14,7 @@ #import "CarModel.h" #import "NameplateModel.h" #import "NobleCardModel.h" +#import "ChatBubbleModel.h" @implementation XPMineDressUpPresenter @@ -58,6 +59,14 @@ }] ticket:ticket uid:uid page:@"1" pageSize:@"500"]; } +/// 获取用户公屏聊天气泡列表 +- (void)getUserChatBubbleList { + [Api chatBubbleList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + NSArray * array = [ChatBubbleModel modelsWithArray:data.data]; + [[self getView] getUserChatBubbleListSuccess:array]; + }] page:@"1" pageSize:@"500"]; +} + /// 使用头饰 /// @param headwearId 头饰的id 不使用的时候传0 - (void)useHeader:(NSString *)headwearId { diff --git a/xplan-ios/Main/Mine/View/DressUp/Protocol/XPMineDressUpProtocol.h b/xplan-ios/Main/Mine/View/DressUp/Protocol/XPMineDressUpProtocol.h index eea9ab5e..8e9ffc45 100644 --- a/xplan-ios/Main/Mine/View/DressUp/Protocol/XPMineDressUpProtocol.h +++ b/xplan-ios/Main/Mine/View/DressUp/Protocol/XPMineDressUpProtocol.h @@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)getUserNameplateListSuccess:(NSArray *)array; ///获取用户贵族资料卡成功 - (void)getUserNobleCardListSuccess:(NSArray *)array; +///获取用户公屏气泡成功 +- (void)getUserChatBubbleListSuccess:(NSArray *)array; ///使用头饰成功 - (void)useHeadwearSuccess:(NSString *)headWearId; ///使用座驾成功 diff --git a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineDressBubbleTableViewCell.h b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineDressBubbleTableViewCell.h new file mode 100644 index 00000000..5c444dcf --- /dev/null +++ b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineDressBubbleTableViewCell.h @@ -0,0 +1,29 @@ +// +// XPMineDressBubbleTableViewCell.h +// xplan-ios +// +// Created by GreenLand on 2022/3/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class ChatBubbleModel, XPMineDressBubbleTableViewCell; + +@protocol XPMineDressBubbleTableViewCellDelegate +///使用铭牌 +- (void)xPMineNameplateTableViewCell:(XPMineDressBubbleTableViewCell *)view nameplateId:(NSString *)nameplateId; + +@end + +@interface XPMineDressBubbleTableViewCell : UITableViewCell + +@property (nonatomic, strong) ChatBubbleModel *bubbleModel; + +@property (nonatomic,weak) id delegate; + +@end + + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineDressBubbleTableViewCell.m b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineDressBubbleTableViewCell.m new file mode 100644 index 00000000..b7fb459d --- /dev/null +++ b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineDressBubbleTableViewCell.m @@ -0,0 +1,201 @@ +// +// XPMineDressBubbleTableViewCell.m +// xplan-ios +// +// Created by GreenLand on 2022/3/18. +// + +#import "XPMineDressBubbleTableViewCell.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "NetImageView.h" +#import "UIImage+Utils.h" +///Model +#import "NameplateModel.h" + +@interface XPMineDressBubbleTableViewCell() +///铭牌 +@property (nonatomic, strong) NetImageView *namePlateImageView; +///名字 +@property (nonatomic, strong) UILabel *titleLabel; +///还有多少时间 +@property (nonatomic,strong) UIStackView *timeStackView; +///状态icon +@property (nonatomic, strong) UIImageView *timeImageView; +///剩余天数 +@property (nonatomic, strong) UILabel *timeLabel; +///使用 +@property (nonatomic,strong) UIButton *useButton; +///显示分割线 +@property (nonatomic,strong) UIView * lineView; + +@end + + +@implementation XPMineDressBubbleTableViewCell + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + self.selectionStyle = UITableViewCellSelectionStyleNone; + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [UIColor clearColor];; + self.selectionStyle = UITableViewCellSelectionStyleNone; + [self.contentView addSubview:self.namePlateImageView]; + [self.contentView addSubview:self.titleLabel]; + [self.contentView addSubview:self.timeStackView]; + [self.contentView addSubview:self.useButton]; + [self.contentView addSubview:self.lineView]; + [self.timeStackView addArrangedSubview:self.timeImageView]; + [self.timeStackView addArrangedSubview:self.timeLabel]; +} + +- (void)initSubViewConstraints { + [self.namePlateImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(60); + make.width.mas_equalTo(100); + make.centerY.mas_equalTo(self.contentView); + make.left.mas_equalTo(self.contentView).offset(20); + }]; + + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.namePlateImageView.mas_right).offset(10); + make.bottom.mas_equalTo(self.namePlateImageView.mas_centerY).offset(-3); + }]; + [self.timeImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.width.mas_equalTo(11); + }]; + [self.timeStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.titleLabel); + make.top.mas_equalTo(self.namePlateImageView.mas_centerY).offset(3); + }]; + + [self.useButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self); + make.right.mas_equalTo(self.contentView).offset(-15); + make.height.mas_equalTo(33); + make.width.mas_equalTo(85); + }]; + + [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.contentView).offset(105); + make.height.mas_equalTo(0.5); + make.bottom.mas_equalTo(self.contentView); + make.right.mas_equalTo(self.contentView).offset(-15); + }]; + +} + +#pragma mark - private +- (void)setBubbleModel:(ChatBubbleModel *)bubbleModel { + _bubbleModel = bubbleModel; +// if (bubbleModel) { +// self.titleLabel.text = _nameplateModel.nameplateName; +// self.timeImageView.hidden = _nameplateModel.isExpired; +// self.useButton.hidden = _nameplateModel.isExpired; +// if (!_nameplateModel.isExpired) { +// self.timeLabel.text = [NSString stringWithFormat:@"剩余%@天", _nameplateModel.expireDays]; +// } else { +// self.timeLabel.text = @"已过期"; +// } +// self.namePlateImageView.imageUrl = _nameplateModel.nameplateImage; +// if (_nameplateModel.isUsing) { +// [_useButton setTitle:@"取消使用" forState:UIControlStateNormal]; +// [_useButton setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateNormal]; +// [_useButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor], [ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; +// } else { +// [_useButton setTitle:@"使用" forState:UIControlStateNormal]; +// [_useButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal]; +// [_useButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; +// } +// } +} +#pragma mark - Event Response +- (void)useButtonAction:(UIButton *)sender { +// if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineNameplateTableViewCell:nameplateId:)]) { +// NSString * nameplateId = self.nameplateModel.nId;; +// if (self.nameplateModel.isUsing) { +// nameplateId = @"0"; +// } +// [self.delegate xPMineNameplateTableViewCell:self nameplateId:nameplateId]; +// } +} + +#pragma mark - Getter && Setter +- (NetImageView *)namePlateImageView { + if (!_namePlateImageView) { + _namePlateImageView = [[NetImageView alloc] init]; + _namePlateImageView.image = [UIImageConstant defaultAvatarPlaceholder]; + _namePlateImageView.contentMode = UIViewContentModeScaleAspectFit; + _namePlateImageView.backgroundColor = [ThemeColor appCellBackgroundColor]; + _namePlateImageView.layer.masksToBounds = YES; + _namePlateImageView.layer.cornerRadius = 12; + } + return _namePlateImageView;; +} + +- (UIStackView *)timeStackView { + if (!_timeStackView) { + _timeStackView = [[UIStackView alloc] init]; + _timeStackView.axis = UILayoutConstraintAxisHorizontal; + _timeStackView.distribution = UIStackViewDistributionFill; + _timeStackView.alignment = UIStackViewAlignmentCenter; + _timeStackView.spacing = 2; + } + return _timeStackView; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.font = [UIFont systemFontOfSize:15]; + _titleLabel.textColor = [ThemeColor mainTextColor]; + } + return _titleLabel; +} + +- (UIButton *)useButton { + if (!_useButton) { + _useButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_useButton setTitle:@"使用" forState:UIControlStateNormal]; + [_useButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal]; + [_useButton addTarget:self action:@selector(useButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + _useButton.layer.masksToBounds = YES; + _useButton.layer.cornerRadius = 33/2; + _useButton.titleLabel.font = [UIFont systemFontOfSize:14]; + [_useButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; + } + return _useButton; +} + +- (UIImageView *)timeImageView { + if (!_timeImageView) { + _timeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_dressup_time"]]; + } + return _timeImageView; +} + +- (UILabel *)timeLabel { + if (!_timeLabel) { + _timeLabel = [[UILabel alloc] init]; + _timeLabel.font = [UIFont systemFontOfSize:12]; + _timeLabel.textColor = [ThemeColor secondTextColor]; + } + return _timeLabel; +} + +- (UIView *)lineView { + if (!_lineView) { + _lineView = [[UIView alloc] init]; + _lineView.backgroundColor = [ThemeColor dividerColor]; + } + return _lineView; +} +@end diff --git a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.h b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.h index ab5a813d..f258aa02 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.h +++ b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.h @@ -14,6 +14,7 @@ typedef NS_ENUM(NSInteger, DressUpListType) { DressUpListType_Car, DressUpListType_Nameplate, DressUpListType_Noble, + DressUpListType_Bubble, }; @interface XPMineDressUpListViewController : MvpViewController diff --git a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.m b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.m index e03ab141..7bf41918 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpListViewController.m @@ -16,6 +16,7 @@ #import "XPMineNameplateTableViewCell.h" #import "XPMineDressEmptyTableViewCell.h" #import "XPMineNobleCardTableViewCell.h" +#import "XPMineDressBubbleTableViewCell.h" ///P #import "XPMineDressUpPresenter.h" #import "XPMineDressUpProtocol.h" @@ -88,6 +89,11 @@ [self.tableView reloadData]; } +- (void)getUserChatBubbleListSuccess:(NSArray *)array { + self.datasource = array; + [self.tableView reloadData]; +} + - (void)useHeadwearSuccess:(NSString *)headWearId { [self.presenter getUserHeadwearList]; [self showSuccessToast:headWearId.integerValue == 0 ? @"取消使用头饰成功" : @"头饰使用成功"]; @@ -153,6 +159,14 @@ cell.nobleCardModel = [self.datasource objectAtIndex:indexPath.row]; cell.delegate = self; return cell; + } else if (self.type == DressUpListType_Bubble) { + XPMineDressBubbleTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDressBubbleTableViewCell class])]; + if (cell == nil) { + cell = [[XPMineDressBubbleTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDressBubbleTableViewCell class])]; + } +// cell.nameplateModel = [self.datasource objectAtIndex:indexPath.row]; +// cell.delegate = self; + return cell; } else { XPMineNameplateTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineNameplateTableViewCell class])]; if (cell == nil) { @@ -161,7 +175,7 @@ cell.nameplateModel = [self.datasource objectAtIndex:indexPath.row]; cell.delegate = self; return cell; - } + } } XPMineDressEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDressEmptyTableViewCell class])]; @@ -187,6 +201,9 @@ break; case DressUpListType_Noble: [self.presenter getUserNobleCardList]; + break; + case DressUpListType_Bubble: + [self.presenter getUserChatBubbleList]; break; default: break; @@ -207,6 +224,7 @@ [_tableView registerClass:[XPMineCarTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineCarTableViewCell class])]; [_tableView registerClass:[XPMineHeadwearTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineHeadwearTableViewCell class])]; [_tableView registerClass:[XPMineNobleCardTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineNobleCardTableViewCell class])]; + [_tableView registerClass:[XPMineDressBubbleTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDressBubbleTableViewCell class])]; [_tableView registerClass:[XPMineDressEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDressEmptyTableViewCell class])]; } return _tableView; diff --git a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.m b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.m index c719d92e..51622757 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.m @@ -35,6 +35,8 @@ @property (nonatomic,strong) XPMineDressUpListViewController *nameplateView; ///贵族资料卡 @property (nonatomic, strong) XPMineDressUpListViewController *nobleView; +///公屏气泡 +@property (nonatomic, strong) XPMineDressUpListViewController *bubbleView; ///轮播图 @property (nonatomic,strong) SDCycleScrollView *cycleScrollView; ///房间活动的列表 @@ -122,8 +124,10 @@ return self.carView; } else if (index == 2) { return self.nameplateView; + } else if (index == 3) { + return self.nobleView; } - return self.nobleView; + return self.bubbleView; } // 点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,不关心具体是点击还是滚动选中的。 @@ -181,7 +185,7 @@ } - (NSArray *)titles { - return @[@"头饰", @"座驾", @"铭牌", @"资料卡"]; + return @[@"头饰", @"座驾", @"铭牌", @"资料卡", @"聊天气泡"]; } - (XPMineDressUpListViewController *)headwearView { @@ -216,6 +220,14 @@ return _nobleView; } +- (XPMineDressUpListViewController *)bubbleView { + if (!_bubbleView) { + _bubbleView = [[XPMineDressUpListViewController alloc] init]; + _bubbleView.type = DressUpListType_Bubble; + } + return _bubbleView; +} + - (SDCycleScrollView *)cycleScrollView { if (!_cycleScrollView) { _cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:nil]; diff --git a/xplan-ios/Main/Room/View/MenuContainerView/XPRoomSendTextView.m b/xplan-ios/Main/Room/View/MenuContainerView/XPRoomSendTextView.m index a04bb15d..d88c20cf 100644 --- a/xplan-ios/Main/Room/View/MenuContainerView/XPRoomSendTextView.m +++ b/xplan-ios/Main/Room/View/MenuContainerView/XPRoomSendTextView.m @@ -68,7 +68,9 @@ extModel.experUrl = userInfo.userLevelVo.experUrl; extModel.newUser = userInfo.newUser; extModel.vipIcon = userInfo.userVipInfoVO.vipIcon; - + extModel.androidBubbleUrl = userInfo.androidBubbleUrl; + extModel.iosBubbleUrl = userInfo.iosBubbleUrl; + NIMMessage * message = [[NIMMessage alloc] init]; message.text = self.inputMessage; NSMutableDictionary *remoteExt = [NSMutableDictionary dictionaryWithObject:extModel.model2dictionary forKey:[AccountInfoStorage instance].getUid]; diff --git a/xplan-ios/Main/Room/View/MessageContainerView/Model/XPMessageRemoteExtModel.h b/xplan-ios/Main/Room/View/MessageContainerView/Model/XPMessageRemoteExtModel.h index 47a65340..e22a5535 100644 --- a/xplan-ios/Main/Room/View/MessageContainerView/Model/XPMessageRemoteExtModel.h +++ b/xplan-ios/Main/Room/View/MessageContainerView/Model/XPMessageRemoteExtModel.h @@ -38,7 +38,10 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,copy) NSString *inRoomNameplateWord; ///贵族icon @property (nonatomic, copy) NSString *vipIcon; - +///安卓房间公屏气泡 +@property (nonatomic, copy) NSString *androidBubbleUrl; +///iOS房间公屏气泡 +@property (nonatomic, copy) NSString *iosBubbleUrl; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/MessageContainerView/View/XPRoomMessageTableViewCell.h b/xplan-ios/Main/Room/View/MessageContainerView/View/XPRoomMessageTableViewCell.h index 82e6cd92..94069a13 100644 --- a/xplan-ios/Main/Room/View/MessageContainerView/View/XPRoomMessageTableViewCell.h +++ b/xplan-ios/Main/Room/View/MessageContainerView/View/XPRoomMessageTableViewCell.h @@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN @interface XPRoomMessageTableViewCell : UITableViewCell @property (nonatomic,strong) NSAttributedString *attributedString; +///气泡url +@property (nonatomic, copy) NSString *bubbleImageUrl; @end diff --git a/xplan-ios/Main/Room/View/MessageContainerView/View/XPRoomMessageTableViewCell.m b/xplan-ios/Main/Room/View/MessageContainerView/View/XPRoomMessageTableViewCell.m index e3339263..bd772aa0 100644 --- a/xplan-ios/Main/Room/View/MessageContainerView/View/XPRoomMessageTableViewCell.m +++ b/xplan-ios/Main/Room/View/MessageContainerView/View/XPRoomMessageTableViewCell.m @@ -9,6 +9,7 @@ ///Third #import #import "XPNetImageYYLabel.h" +#import "NetImageView.h" ///Tool #import "XPMacro.h" #import "ThemeColor+Room.h" @@ -18,7 +19,7 @@ @interface XPRoomMessageTableViewCell () ///气泡 -@property (nonatomic,strong) UIImageView *bubbleImageView; +@property (nonatomic,strong) NetImageView *bubbleImageView; ///展示的内容 @property (nonatomic,strong) XPNetImageYYLabel *contentLabel; @end @@ -60,9 +61,14 @@ self.contentLabel.attributedText = attribute; } -- (UIImageView *)bubbleImageView { +- (void)setBubbleImageUrl:(NSString *)bubbleImageUrl { + _bubbleImageUrl = bubbleImageUrl; + self.bubbleImageView.imageUrl = bubbleImageUrl; +} + +- (NetImageView *)bubbleImageView { if (!_bubbleImageView) { - _bubbleImageView = [[UIImageView alloc] init]; + _bubbleImageView = [[NetImageView alloc] init]; _bubbleImageView.userInteractionEnabled = YES; _bubbleImageView.layer.masksToBounds = YES; _bubbleImageView.layer.cornerRadius = 7;