diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 12e54e1b..f71af357 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -404,8 +404,6 @@ E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E84150C127747BF700A7F548 /* FirstRechargeModel.m */; }; E84150C527747E0900A7F548 /* FirstRechargeRewardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E84150C427747E0900A7F548 /* FirstRechargeRewardModel.m */; }; E841ED61280FB0BD00904808 /* ContentLevelUpgradeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E841ED60280FB0BD00904808 /* ContentLevelUpgradeModel.m */; }; - E84843AF27F59E7E0050D365 /* XPRoomPKResultView.m in Sources */ = {isa = PBXBuildFile; fileRef = E84843AE27F59E7E0050D365 /* XPRoomPKResultView.m */; }; - E84843B227F5A0740050D365 /* XPRomPKResultTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = E84843B127F5A0740050D365 /* XPRomPKResultTitleLabel.m */; }; E84B0E3F2727EDF6008818C6 /* XPRoomMessageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E84B0E3E2727EDF6008818C6 /* XPRoomMessageTableViewCell.m */; }; E84B0E422727EE0A008818C6 /* XPRoomMessageHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = E84B0E412727EE0A008818C6 /* XPRoomMessageHeaderView.m */; }; E84B0E462727EF9D008818C6 /* XPRoomMessageParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E84B0E452727EF9D008818C6 /* XPRoomMessageParser.m */; }; @@ -738,6 +736,7 @@ E8EEB91D26FC9D58007C6EBA /* XPMineUserInfoDateView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8EEB91C26FC9D58007C6EBA /* XPMineUserInfoDateView.m */; }; E8F1558D28124D5200EE8C06 /* MessageConentAudioView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F1558C28124D5200EE8C06 /* MessageConentAudioView.m */; }; E8F1559028125E2D00EE8C06 /* MessageAudioCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F1558F28125E2D00EE8C06 /* MessageAudioCenter.m */; }; + E8F1559328129EBA00EE8C06 /* ContentSecretaryModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F1559228129EBA00EE8C06 /* ContentSecretaryModel.m */; }; E8F9168427EC913C00F10D8F /* XPHomeLittleGameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168327EC913C00F10D8F /* XPHomeLittleGameViewController.m */; }; E8F9168727EC927C00F10D8F /* XPHomeLittleGamePesenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168627EC927C00F10D8F /* XPHomeLittleGamePesenter.m */; }; E8F9168B27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */; }; @@ -1547,10 +1546,6 @@ E84150C427747E0900A7F548 /* FirstRechargeRewardModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirstRechargeRewardModel.m; sourceTree = ""; }; E841ED5F280FB0BD00904808 /* ContentLevelUpgradeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentLevelUpgradeModel.h; sourceTree = ""; }; E841ED60280FB0BD00904808 /* ContentLevelUpgradeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContentLevelUpgradeModel.m; sourceTree = ""; }; - E84843AD27F59E7E0050D365 /* XPRoomPKResultView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPKResultView.h; sourceTree = ""; }; - E84843AE27F59E7E0050D365 /* XPRoomPKResultView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPKResultView.m; sourceTree = ""; }; - E84843B027F5A0740050D365 /* XPRomPKResultTitleLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRomPKResultTitleLabel.h; sourceTree = ""; }; - E84843B127F5A0740050D365 /* XPRomPKResultTitleLabel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRomPKResultTitleLabel.m; sourceTree = ""; }; E84B0E3D2727EDF6008818C6 /* XPRoomMessageTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessageTableViewCell.h; sourceTree = ""; }; E84B0E3E2727EDF6008818C6 /* XPRoomMessageTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMessageTableViewCell.m; sourceTree = ""; }; E84B0E402727EE0A008818C6 /* XPRoomMessageHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessageHeaderView.h; sourceTree = ""; }; @@ -2220,6 +2215,8 @@ E8F1558C28124D5200EE8C06 /* MessageConentAudioView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageConentAudioView.m; sourceTree = ""; }; E8F1558E28125E2D00EE8C06 /* MessageAudioCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageAudioCenter.h; sourceTree = ""; }; E8F1558F28125E2D00EE8C06 /* MessageAudioCenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageAudioCenter.m; sourceTree = ""; }; + E8F1559128129EBA00EE8C06 /* ContentSecretaryModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentSecretaryModel.h; sourceTree = ""; }; + E8F1559228129EBA00EE8C06 /* ContentSecretaryModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContentSecretaryModel.m; sourceTree = ""; }; E8F9168227EC913C00F10D8F /* XPHomeLittleGameViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLittleGameViewController.h; sourceTree = ""; }; E8F9168327EC913C00F10D8F /* XPHomeLittleGameViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLittleGameViewController.m; sourceTree = ""; }; E8F9168527EC927C00F10D8F /* XPHomeLittleGamePesenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLittleGamePesenter.h; sourceTree = ""; }; @@ -4282,6 +4279,8 @@ E83ABF02280EC90C00322EE4 /* ContentApplicationShareModel.m */, E841ED5F280FB0BD00904808 /* ContentLevelUpgradeModel.h */, E841ED60280FB0BD00904808 /* ContentLevelUpgradeModel.m */, + E8F1559128129EBA00EE8C06 /* ContentSecretaryModel.h */, + E8F1559228129EBA00EE8C06 /* ContentSecretaryModel.m */, ); path = SessionContent; sourceTree = ""; @@ -6402,8 +6401,6 @@ E8E70D7A26F2F16600F03460 /* XPMinePresent.m in Sources */, E855516128059228005F293F /* XPMineGuildIncomeDetailViewController.m in Sources */, E8A1E45B27620F4900B294CA /* XPRoomHalfWebView.m in Sources */, - 9B7D80562753C595003DAC0C /* SendMessageView.m in Sources */, - E8A88D3027E85EEA00CA8837 /* RoomPKInfoModel.m in Sources */, E8A86E0527BA38DB001C21F9 /* NSString+RW.m in Sources */, E800162C2803FE4900D6D17A /* GuildIncomeRecordModel.m in Sources */, E83ABF03280EC90C00322EE4 /* ContentApplicationShareModel.m in Sources */, @@ -6702,7 +6699,6 @@ 18E7B33226F317A20064BC9B /* XPWebViewController.m in Sources */, E8AEAEF927141CA30017FCE0 /* RoomHeaderView.m in Sources */, 9B1B729828002147003FACE9 /* XPMineFansTeamPresenter.m in Sources */, - E8A88D2A27E81C8600CA8837 /* XPRoomPKUserCollectionViewCell.m in Sources */, E8D55CA0281186D6006935A5 /* SessionAudioRecordView.m in Sources */, 9B7B606627BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m in Sources */, E81C1B29277069DD0020D1E4 /* XPArrangeMicEmptyTableViewCell.m in Sources */, @@ -6810,6 +6806,7 @@ 9B0997A327F19DE500EB8F14 /* QGHWDShaders.metal in Sources */, 187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */, E896EFA92771AEEC00AD2CC1 /* XPMineAttentionTableViewCell.m in Sources */, + E8F1559328129EBA00EE8C06 /* ContentSecretaryModel.m in Sources */, 9BBC02912786FC570007C24B /* XPMineNobleCardTableViewCell.m in Sources */, E8F9168727EC927C00F10D8F /* XPHomeLittleGamePesenter.m in Sources */, E8AC722126F47E23007D6E91 /* XPMineAboutUsViewController.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_charm.imageset/Contents.json b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_charm.imageset/Contents.json new file mode 100644 index 00000000..7306c502 --- /dev/null +++ b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_charm.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "message_content_upgrade_charm@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "message_content_upgrade_charm@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_charm.imageset/message_content_upgrade_charm@2x.png b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_charm.imageset/message_content_upgrade_charm@2x.png new file mode 100644 index 00000000..1f20a022 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_charm.imageset/message_content_upgrade_charm@2x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_charm.imageset/message_content_upgrade_charm@3x.png b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_charm.imageset/message_content_upgrade_charm@3x.png new file mode 100644 index 00000000..f281ebf3 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_charm.imageset/message_content_upgrade_charm@3x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_expre.imageset/Contents.json b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_expre.imageset/Contents.json new file mode 100644 index 00000000..baecfffe --- /dev/null +++ b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_expre.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "message_content_upgrade_expre@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "message_content_upgrade_expre@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_expre.imageset/message_content_upgrade_expre@2x.png b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_expre.imageset/message_content_upgrade_expre@2x.png new file mode 100644 index 00000000..e456a2a5 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_expre.imageset/message_content_upgrade_expre@2x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_expre.imageset/message_content_upgrade_expre@3x.png b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_expre.imageset/message_content_upgrade_expre@3x.png new file mode 100644 index 00000000..f00ef345 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/message_content_upgrade_expre.imageset/message_content_upgrade_expre@3x.png differ diff --git a/xplan-ios/Main/Message/Model/SessionContent/ContentSecretaryModel.h b/xplan-ios/Main/Message/Model/SessionContent/ContentSecretaryModel.h new file mode 100644 index 00000000..0e86f666 --- /dev/null +++ b/xplan-ios/Main/Message/Model/SessionContent/ContentSecretaryModel.h @@ -0,0 +1,50 @@ +// +// ContentSecretaryModel.h +// xplan-ios +// +// Created by 冯硕 on 2022/4/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, SecretaryRouterType) { + ///房间 + SecretaryRouterType_Room = 1, + ///跳转网页 + SecretaryRouterType_H5 = 2, + ///钱包页 + SecretaryRouterType_Purse = 3, + ///充值页 + SecretaryRouterType_Recharge = 5, + ///用户信息 + SecretaryRouterType_UserInfo = 6, + ///座驾 + SecretaryRouterType_Car = 7, + ///头饰 + SecretaryRouterType_Headwear = 8, + ///铭牌 + SecretaryRouterType_Nameplate = 9, + ///设置密码 + SecretaryRouterType_Set_Password = 53, + ///贵族中心 + SecretaryRouterType_Nobel_Center = 54, + ///资料卡装扮 + SecretaryRouterType_User_Card = 55, + ///贵族气泡 + SecretaryRouterType_Nobel_Bubble = 56, +}; + +@interface ContentSecretaryModel : NSObject +///最近回话列表需要显示的内容 推送的内容 +@property (nonatomic,copy) NSString *msg; +///私聊消息需要显示的内容 +@property (nonatomic,copy) NSString *title; +///跳转的类型 +@property (nonatomic,assign) SecretaryRouterType routerType; +///(转跳当前界面需要传的参) +@property (nonatomic,strong) NSString *routerValue; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Message/Model/SessionContent/ContentSecretaryModel.m b/xplan-ios/Main/Message/Model/SessionContent/ContentSecretaryModel.m new file mode 100644 index 00000000..8337567e --- /dev/null +++ b/xplan-ios/Main/Message/Model/SessionContent/ContentSecretaryModel.m @@ -0,0 +1,12 @@ +// +// ContentSecretaryModel.m +// xplan-ios +// +// Created by 冯硕 on 2022/4/22. +// + +#import "ContentSecretaryModel.h" + +@implementation ContentSecretaryModel + +@end diff --git a/xplan-ios/Main/Message/View/NIMMessageUtils.m b/xplan-ios/Main/Message/View/NIMMessageUtils.m index 5de3b57e..5e37bb08 100644 --- a/xplan-ios/Main/Message/View/NIMMessageUtils.m +++ b/xplan-ios/Main/Message/View/NIMMessageUtils.m @@ -39,7 +39,7 @@ AttachmentModel *attachment = (AttachmentModel *) obj.attachment; if (attachment.first == CustomMessageType_Secretary) { if (attachment.second == Custom_Message_Sub_Secretary_Router) { - text = attachment.data[@"msg"]; + text = attachment.data[@"title"]; } } else if(attachment.first == CustomMessageType_Gift) { if (attachment.second == Custom_Message_Sub_Gift_Send) { diff --git a/xplan-ios/Main/Message/View/Session/Content/MessageConentAudioView.m b/xplan-ios/Main/Message/View/Session/Content/MessageConentAudioView.m index 76f83339..1e85a4a5 100644 --- a/xplan-ios/Main/Message/View/Session/Content/MessageConentAudioView.m +++ b/xplan-ios/Main/Message/View/Session/Content/MessageConentAudioView.m @@ -113,7 +113,7 @@ - (UILabel *)timeLabel { if (!_timeLabel) { _timeLabel = [[UILabel alloc] init]; - _timeLabel.font = [UIFont systemFontOfSize:16]; + _timeLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; _timeLabel.textColor = [ThemeColor mainTextColor]; } return _timeLabel; diff --git a/xplan-ios/Main/Message/View/Session/Content/MessageContentLevelUpgradeView.m b/xplan-ios/Main/Message/View/Session/Content/MessageContentLevelUpgradeView.m index d758a4f2..82da57a3 100644 --- a/xplan-ios/Main/Message/View/Session/Content/MessageContentLevelUpgradeView.m +++ b/xplan-ios/Main/Message/View/Session/Content/MessageContentLevelUpgradeView.m @@ -35,7 +35,7 @@ @implementation MessageContentLevelUpgradeView + (CGFloat)measureHeight:(NIMMessage *)message { - return (101 + CONTENT_PADDING_V_TOTAL); + return (116 + CONTENT_PADDING_V_TOTAL + MESSAGE_PADDING); } - (void)render:(NIMMessage *)message { @@ -62,13 +62,14 @@ - (void)initSubViewConstraints { [super initSubViewConstraints]; - [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(220, 101)); + [self.backView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self).insets(UIEdgeInsetsMake(MESSAGE_PADDING, MESSAGE_PADDING, 0, MESSAGE_PADDING)); + make.size.mas_equalTo(CGSizeMake(220, 116)); }]; [self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(50, 50)); + make.size.mas_equalTo(CGSizeMake(64,64)); make.left.mas_equalTo(self.backView); make.top.mas_equalTo(self.backView); }]; @@ -76,12 +77,12 @@ [self.levelLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(self.logoImageView.mas_right).offset(10); make.right.mas_equalTo(self.backView); - make.top.mas_equalTo(self.logoImageView); + make.top.mas_equalTo(self.logoImageView).offset(10); }]; [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(self.backView); - make.height.mas_equalTo(1); + make.height.mas_equalTo(0.5); make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(10); }]; @@ -107,7 +108,6 @@ - (UIImageView *)logoImageView { if (!_logoImageView) { _logoImageView = [[UIImageView alloc] init]; - _logoImageView.backgroundColor = [UIColor redColor]; } return _logoImageView; } @@ -115,7 +115,7 @@ - (UILabel *)levelLabel { if (!_levelLabel) { _levelLabel = [[UILabel alloc] init]; - _levelLabel.font = [UIFont systemFontOfSize:14]; + _levelLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; _levelLabel.textColor = [ThemeColor mainTextColor]; _levelLabel.numberOfLines = 2; } @@ -126,8 +126,8 @@ if (!_checkButton) { _checkButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_checkButton setTitle:@"立即查看" forState:UIControlStateNormal]; - [_checkButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal]; - _checkButton.titleLabel.font = [UIFont systemFontOfSize:12]; + [_checkButton setTitleColor:UIColorFromRGB(0x4C5AF1) forState:UIControlStateNormal]; + _checkButton.titleLabel.font = [UIFont systemFontOfSize:14]; [_checkButton addTarget:self action:@selector(checkButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } return _checkButton; diff --git a/xplan-ios/Main/Message/View/Session/Content/MessageContentOpenLiveView.m b/xplan-ios/Main/Message/View/Session/Content/MessageContentOpenLiveView.m index 9d6d11df..548495f7 100644 --- a/xplan-ios/Main/Message/View/Session/Content/MessageContentOpenLiveView.m +++ b/xplan-ios/Main/Message/View/Session/Content/MessageContentOpenLiveView.m @@ -18,7 +18,6 @@ ///View #import "XPRoomViewController.h" -#define MESSAGE_PADDING 10 @interface MessageContentOpenLiveView () ///头像 @@ -33,7 +32,7 @@ @implementation MessageContentOpenLiveView + (CGFloat)measureHeight:(NIMMessage *)message { - return (50 + CONTENT_PADDING_V_TOTAL); + return (50 + CONTENT_PADDING_V_TOTAL + MESSAGE_PADDING * 2); } - (void)render:(NIMMessage *)message { @@ -73,7 +72,7 @@ [super initSubViewConstraints]; [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self).insets(UIEdgeInsetsMake(MESSAGE_PADDING, MESSAGE_PADDING, MESSAGE_PADDING, MESSAGE_PADDING)); - make.size.mas_equalTo(CGSizeMake(180, 50)); + make.size.mas_equalTo(CGSizeMake(200, 50)); }]; [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { diff --git a/xplan-ios/Main/Message/View/Session/Content/MessageContentTextClickable.m b/xplan-ios/Main/Message/View/Session/Content/MessageContentTextClickable.m index 97efe559..0256556a 100644 --- a/xplan-ios/Main/Message/View/Session/Content/MessageContentTextClickable.m +++ b/xplan-ios/Main/Message/View/Session/Content/MessageContentTextClickable.m @@ -6,30 +6,33 @@ // #import "MessageContentTextClickable.h" -#import "ThemeColor.h" -#import "AttachmentModel.h" - -#import "XPWebViewController.h" - -#import +///Third #import - -#define MESSAGE_TEXT_PADDING 10 - +#import +///Tool +#import "ThemeColor.h" +#import "NSObject+MJExtension.h" +#import "XCCurrentVCStackManager.h" +///Model +#import "AttachmentModel.h" +#import "ContentSecretaryModel.h" +///View +#import "XPRoomViewController.h" +#import "XPWebViewController.h" +#import "XPMineRechargeViewController.h" +#import "XPMineUserInfoViewController.h" +#import "XPMineDressUpViewController.h" +#import "XPNobleCenterViewController.h" +///P +#import "RoomHostDelegate.h" @interface MessageContentTextClickable() /** 消息文本 */ @property (nonatomic, strong) UILabel * messageText; - -/** - 点击事件的参数。 - 目前仅用于点击跳转网页,扩展后再进行整理。 - */ -@property (nonatomic, assign) int type; -@property (nonatomic, strong) NSString * value; - +///获取的模型 +@property (nonatomic,strong) ContentSecretaryModel *contentInfo; @end @implementation MessageContentTextClickable @@ -49,11 +52,11 @@ messageText = @"未知消息类型"; } - CGSize dstRect = CGSizeMake(CONTENT_WIDTH_MAX - MESSAGE_TEXT_PADDING * 2, MAXFLOAT); + CGSize dstRect = CGSizeMake(CONTENT_WIDTH_MAX - MESSAGE_PADDING * 2, MAXFLOAT); CGFloat msgHeight = [messageText boundingRectWithSize:dstRect options:NSStringDrawingUsesLineFragmentOrigin attributes:[MessageContentTextClickable messageTextAttibutes] context:nil].size.height; - return msgHeight + MESSAGE_TEXT_PADDING * 2 + CONTENT_PADDING_V_TOTAL; + return msgHeight + MESSAGE_PADDING * 2 + CONTENT_PADDING_V_TOTAL; } + (NSDictionary *)messageTextAttibutes { @@ -87,9 +90,8 @@ AttachmentModel *attachment = (AttachmentModel *) obj.attachment; if (attachment.first == CustomMessageType_Secretary) { if (attachment.second == Custom_Message_Sub_Secretary_Router) { - messageText = attachment.data[@"msg"]; - self.type = [attachment.data[@"routerType"] intValue]; - self.value = attachment.data[@"routerValue"]; + self.contentInfo = [ContentSecretaryModel modelWithJSON:attachment.data]; + messageText = self.contentInfo.msg; } } } @@ -101,16 +103,95 @@ } - (void)event:(UITapGestureRecognizer *)gesture { - switch (self.type) { - case Custom_Message_Router_H5: { - if (self.value) { + SecretaryRouterType type = self.contentInfo.routerType; + NSString * value = self.contentInfo.routerValue; + switch (type) { + case SecretaryRouterType_H5: { + if (value.length) { XPWebViewController * webVC =[[XPWebViewController alloc] init]; - webVC.url = self.value; + webVC.url = value; [self.nim_viewController.navigationController pushViewController:webVC animated:YES]; } } break; - + case SecretaryRouterType_Room: + { + if (value.length > 0) { + UIViewController * controllerView = [XCCurrentVCStackManager shareManager].getCurrentVC; + //退出原来的房间 如果有的话 TODO 总感觉这种处理不太优雅 进房入口多了 怎么办 进房需要整合 + [controllerView.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if ([obj isKindOfClass:[XPRoomViewController class]]) { + [controllerView.navigationController popToRootViewControllerAnimated:NO]; + XPRoomViewController * rooomVC = obj; + [rooomVC exitRoom]; + *stop = YES; + } + }]; + [XPRoomViewController openRoom:value viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; + } + } + break; + case SecretaryRouterType_Purse: + case SecretaryRouterType_Recharge: + { + XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES]; + } + break; + case SecretaryRouterType_UserInfo: + { + if (value.length > 0) { + XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init]; + userInfoVC.uid = value.integerValue; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:userInfoVC animated:YES]; + } + } + case SecretaryRouterType_Car: + { + XPMineDressUpViewController * dressUpVC = [[XPMineDressUpViewController alloc] init]; + dressUpVC.currentIndex = 1; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:dressUpVC animated:YES]; + } + break; + case SecretaryRouterType_Headwear: + { + XPMineDressUpViewController * dressUpVC = [[XPMineDressUpViewController alloc] init]; + dressUpVC.currentIndex = 0; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:dressUpVC animated:YES]; + } + break; + case SecretaryRouterType_Nameplate: + { + XPMineDressUpViewController * dressUpVC = [[XPMineDressUpViewController alloc] init]; + dressUpVC.currentIndex = 2; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:dressUpVC animated:YES]; + } + break; + case SecretaryRouterType_Nobel_Bubble: + { + XPMineDressUpViewController * dressUpVC = [[XPMineDressUpViewController alloc] init]; + dressUpVC.currentIndex = 4; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:dressUpVC animated:YES]; + } + break; + case SecretaryRouterType_User_Card: + { + XPMineDressUpViewController * dressUpVC = [[XPMineDressUpViewController alloc] init]; + dressUpVC.currentIndex = 3; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:dressUpVC animated:YES]; + } + break; + case SecretaryRouterType_Nobel_Center: + { + XPNobleCenterViewController * nobelCenterVC = [[XPNobleCenterViewController alloc] init]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:nobelCenterVC animated:YES]; + } + break; + case SecretaryRouterType_Set_Password: + { + + } + break; default: break; } @@ -119,7 +200,7 @@ - (UILabel *)messageText { if (!_messageText) { _messageText = [[UILabel alloc]initWithFrame:CGRectZero]; - _messageText.preferredMaxLayoutWidth = CONTENT_WIDTH_MAX - MESSAGE_TEXT_PADDING * 2; + _messageText.preferredMaxLayoutWidth = CONTENT_WIDTH_MAX - MESSAGE_PADDING * 2; _messageText.textColor = ThemeColor.mainTextColor; _messageText.numberOfLines = 0; } diff --git a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.h b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.h index d80831dc..2ea67398 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.h +++ b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.h @@ -10,6 +10,9 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMineDressUpViewController : BaseViewController +///当前的index @[@"头饰", @"座驾", @"铭牌", @"资料卡", @"聊天气泡"] +@property (nonatomic,assign) NSInteger currentIndex; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.m b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.m index b9af6b6d..f8fa0f92 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/XPMineDressUpViewController.m @@ -153,6 +153,12 @@ } #pragma mark - Getters And Setters +- (void)setCurrentIndex:(NSInteger)currentIndex { + if (currentIndex < self.titles.count) { + [self.titleView setDefaultSelectedIndex:currentIndex]; + } +} + - (JXCategoryTitleView *)titleView { if (!_titleView) { _titleView = [[JXCategoryTitleView alloc] init];