diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index ddf42d81..5b048ce4 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -175,6 +175,7 @@ 237B8A132A95DCBC005DB380 /* UserGameInfoVo.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B8A122A95DCBC005DB380 /* UserGameInfoVo.m */; }; 237B8A162A973B7E005DB380 /* XPMineGameOrderItemPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B8A152A973B7E005DB380 /* XPMineGameOrderItemPresenter.m */; }; 237B8A1A2A973C54005DB380 /* Api+GameOrder.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B8A192A973C54005DB380 /* Api+GameOrder.m */; }; + 237B94C32A98B46E007853E3 /* XPSessionMessageGameInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94C22A98B46E007853E3 /* XPSessionMessageGameInfoView.m */; }; 23F8BFF82A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F8BFF72A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m */; }; 73FFADDC93E195344047A2EC /* Pods_xplan_ios.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACF623970097D653132D69A /* Pods_xplan_ios.framework */; }; 9B0086C627BA392B0032BD2B /* AnchorStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C527BA392B0032BD2B /* AnchorStageView.m */; }; @@ -1690,6 +1691,8 @@ 237B8A172A973BB7005DB380 /* XPMineGameOrderItemProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineGameOrderItemProtocol.h; sourceTree = ""; }; 237B8A182A973C54005DB380 /* Api+GameOrder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+GameOrder.h"; sourceTree = ""; }; 237B8A192A973C54005DB380 /* Api+GameOrder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+GameOrder.m"; sourceTree = ""; }; + 237B94C12A98B46E007853E3 /* XPSessionMessageGameInfoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionMessageGameInfoView.h; sourceTree = ""; }; + 237B94C22A98B46E007853E3 /* XPSessionMessageGameInfoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSessionMessageGameInfoView.m; sourceTree = ""; }; 23F8BFF62A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessagePrivilegeCardCell.h; sourceTree = ""; }; 23F8BFF72A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMessagePrivilegeCardCell.m; sourceTree = ""; }; 7DB00EC07F1D0ADFF900B38D /* Pods-xplan-ios.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-xplan-ios.debug.xcconfig"; path = "Target Support Files/Pods-xplan-ios/Pods-xplan-ios.debug.xcconfig"; sourceTree = ""; }; @@ -5037,6 +5040,8 @@ 9B9DFD9927DB2194000F95B3 /* XPSessionMessageHeadView.m */, 237B89F52A949BDC005DB380 /* XPSessionMessageGameCell.h */, 237B89F62A949BDC005DB380 /* XPSessionMessageGameCell.m */, + 237B94C12A98B46E007853E3 /* XPSessionMessageGameInfoView.h */, + 237B94C22A98B46E007853E3 /* XPSessionMessageGameInfoView.m */, 237B89F82A94A7B6005DB380 /* XPSessionMessageGamePageControl.h */, 237B89F92A94A7B6005DB380 /* XPSessionMessageGamePageControl.m */, E86B911828102AF90007DEE7 /* SessionToolbarView.h */, @@ -10298,6 +10303,7 @@ 9B86D88328192DC000494FCD /* XPRoomRankEntranceView.m in Sources */, 18F404B7276095D700A6C548 /* SessionChatLimitView.m in Sources */, E8788942273A55AD00BF1D57 /* XPGiftUsersView.m in Sources */, + 237B94C32A98B46E007853E3 /* XPSessionMessageGameInfoView.m in Sources */, 9B8585D3278837CE00D7D5C6 /* NobleLevelUpModel.m in Sources */, 9BD9A17927A0EC57004186FE /* XPMineVisitorPresenter.m in Sources */, E8BD0F8828A9E9E400DE050D /* RoomSailingPrizeModel.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Mine/mine_game_new_diamond.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_game_new_diamond.imageset/Contents.json new file mode 100644 index 00000000..07881a2d --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_game_new_diamond.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_game_new_diamond@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_game_new_diamond@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_game_new_diamond.imageset/mine_game_new_diamond@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_game_new_diamond.imageset/mine_game_new_diamond@2x.png new file mode 100644 index 00000000..933ecab2 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_game_new_diamond.imageset/mine_game_new_diamond@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_game_new_diamond.imageset/mine_game_new_diamond@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_game_new_diamond.imageset/mine_game_new_diamond@3x.png new file mode 100644 index 00000000..1194da50 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_game_new_diamond.imageset/mine_game_new_diamond@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_new_attention_select.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_new_attention_select.imageset/Contents.json new file mode 100644 index 00000000..3100a0e9 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_new_attention_select.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_info_bottom_new_attention_select@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_info_bottom_new_attention_select@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_new_attention_select.imageset/mine_user_info_bottom_new_attention_select@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_new_attention_select.imageset/mine_user_info_bottom_new_attention_select@2x.png new file mode 100644 index 00000000..d3264bd0 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_new_attention_select.imageset/mine_user_info_bottom_new_attention_select@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_new_attention_select.imageset/mine_user_info_bottom_new_attention_select@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_new_attention_select.imageset/mine_user_info_bottom_new_attention_select@3x.png new file mode 100644 index 00000000..5aae6115 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_info_bottom_new_attention_select.imageset/mine_user_info_bottom_new_attention_select@3x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/Session_Message_Game_InfoView_arrow.imageset/Contents.json b/xplan-ios/Assets.xcassets/SessionMessage/Session_Message_Game_InfoView_arrow.imageset/Contents.json new file mode 100644 index 00000000..75ea0dbd --- /dev/null +++ b/xplan-ios/Assets.xcassets/SessionMessage/Session_Message_Game_InfoView_arrow.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Session_Message_Game_InfoView_arrow@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Session_Message_Game_InfoView_arrow@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/SessionMessage/Session_Message_Game_InfoView_arrow.imageset/Session_Message_Game_InfoView_arrow@2x.png b/xplan-ios/Assets.xcassets/SessionMessage/Session_Message_Game_InfoView_arrow.imageset/Session_Message_Game_InfoView_arrow@2x.png new file mode 100644 index 00000000..5aaa6085 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/Session_Message_Game_InfoView_arrow.imageset/Session_Message_Game_InfoView_arrow@2x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/Session_Message_Game_InfoView_arrow.imageset/Session_Message_Game_InfoView_arrow@3x.png b/xplan-ios/Assets.xcassets/SessionMessage/Session_Message_Game_InfoView_arrow.imageset/Session_Message_Game_InfoView_arrow@3x.png new file mode 100644 index 00000000..111bb9d8 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/Session_Message_Game_InfoView_arrow.imageset/Session_Message_Game_InfoView_arrow@3x.png differ diff --git a/xplan-ios/Base/MVP/Model/UserGameInfoVo.h b/xplan-ios/Base/MVP/Model/UserGameInfoVo.h index 127f1805..4d013f3d 100644 --- a/xplan-ios/Base/MVP/Model/UserGameInfoVo.h +++ b/xplan-ios/Base/MVP/Model/UserGameInfoVo.h @@ -30,7 +30,10 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic,copy) NSString *toErBanNo; @property(nonatomic,copy) NSString *toNick; @property(nonatomic,copy) NSString *toAvatar; +@property(nonatomic,copy) NSString *fromNick; +@property(nonatomic,copy) NSString *fromAvatar; @property(nonatomic,copy) NSString *createTime; +@property(nonatomic,copy) NSString *orderTime; @property(nonatomic,copy) NSString *toUid; @property(nonatomic,copy) NSString *fromUid; @property(nonatomic,copy) NSString *tagRgb; diff --git a/xplan-ios/Main/IM/Model/AttachmentModel.h b/xplan-ios/Main/IM/Model/AttachmentModel.h index f28425f6..fb349a19 100644 --- a/xplan-ios/Main/IM/Model/AttachmentModel.h +++ b/xplan-ios/Main/IM/Model/AttachmentModel.h @@ -551,10 +551,10 @@ typedef NS_ENUM(NSInteger, CustomMessageStarredKitchen) { ///发起邀请 CustomMessageType_Initiat_Invitation typedef NS_ENUM(NSInteger, CustomMessageTypeInitiatInvitation) { - ///发起用户 + ///发起用户或接单用户 Custom_Message_Sub_Initiat_Invitation_Initiating_User = 1030, - ///接单用户 - Custom_Message_Sub_Initiat_Invitation_Incoming_subscriber = 1031 , + + }; @interface AttachmentModel : NSObject @property (nonatomic,assign) int first; diff --git a/xplan-ios/Main/Message/View/Session/SessionToolbarView.h b/xplan-ios/Main/Message/View/Session/SessionToolbarView.h index 84702738..6dcb70f8 100644 --- a/xplan-ios/Main/Message/View/Session/SessionToolbarView.h +++ b/xplan-ios/Main/Message/View/Session/SessionToolbarView.h @@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SessionToolbarView : UIView ///代理 @property (nonatomic,weak) id delegate; +@property(nonatomic,assign) int model; @property (nonatomic, assign, getter=isSendDisabled) BOOL sendDisabled; ///折叠 菜单view - (void)foldMenuView; diff --git a/xplan-ios/Main/Message/View/Session/SessionToolbarView.m b/xplan-ios/Main/Message/View/Session/SessionToolbarView.m index dabf03f6..0a9e0b54 100644 --- a/xplan-ios/Main/Message/View/Session/SessionToolbarView.m +++ b/xplan-ios/Main/Message/View/Session/SessionToolbarView.m @@ -331,7 +331,7 @@ self.userInteractionEnabled = !sendDisabled; if (sendDisabled) { self.inputView.text = @""; - NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:@"暂时无法私聊" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [ThemeColor secondTextColor]}]; + NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:_model == 2 ? @"互相关注成为好友可发起聊天" : @"暂时无法私聊" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [ThemeColor secondTextColor]}]; self.inputView.attributedPlaceholder = attribute; } else { NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:@"请输入消息" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [ThemeColor secondTextColor]}]; diff --git a/xplan-ios/Main/Message/View/Session/SessionViewController.h b/xplan-ios/Main/Message/View/Session/SessionViewController.h index d3cdeedc..80d18475 100644 --- a/xplan-ios/Main/Message/View/Session/SessionViewController.h +++ b/xplan-ios/Main/Message/View/Session/SessionViewController.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SessionViewController : MvpViewController @property (nonatomic, strong,readonly) NIMSession * session; - +@property(nonatomic,assign) BOOL isFormGame; @property (nonatomic, assign) SessionListOpenType openType; - (instancetype)initWithSession:(NIMSession *)session; @end diff --git a/xplan-ios/Main/Message/View/Session/SessionViewController.m b/xplan-ios/Main/Message/View/Session/SessionViewController.m index 1781bb65..76a03ae5 100644 --- a/xplan-ios/Main/Message/View/Session/SessionViewController.m +++ b/xplan-ios/Main/Message/View/Session/SessionViewController.m @@ -44,13 +44,12 @@ ///P #import "MessagePresenter.h" #import "MessageProtocol.h" -#import #import "XPSessionMessageGameCell.h" #import "XPSessionMessageGamePageControl.h" #import "XPMinePlaceOrderView.h" - +#import "XPSessionMessageGameInfoView.h" #import "XPMineNewRechargeViewController.h" -@interface SessionViewController () +@interface SessionViewController () @property (nonatomic, strong) NIMSession * session; @property (nonatomic, strong) NSMutableArray * messages; @@ -66,8 +65,9 @@ @property (nonatomic,strong) NIMMessage *lastMessage; ///私聊风险提示 @property (nonatomic,strong) SessionRiskView *riskAlertView; -///轮播 -@property (nonatomic, strong) SDCycleScrollView *pi_BannerView; +///游戏点单轮播 +@property(nonatomic,strong) UICollectionView *collectionView; + @property(nonatomic,strong) XPSessionMessageGamePageControl *pageControl; @property (nonatomic, strong) UIStackView *stackView; @@ -106,15 +106,17 @@ [super viewDidLoad]; [self initViews]; [self initLayout]; - + [IQKeyboardManager sharedManager].enable = NO; [IQKeyboardManager sharedManager].enableAutoToolbar = NO; [self initHeaderAndFooterRrfresh]; [[NIMSDK sharedSDK].chatManager addDelegate:self]; [[NIMSDK sharedSDK].conversationManager addDelegate:self]; - + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(getAttentionUserNotification) name:@"kAttentionUserNotification" object:nil]; +} +-(void)getAttentionUserNotification{ + [self.presenter getChatLimitReceiverUid:self.session.sessionId]; } - - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.presenter getFansLike:self.session.sessionId]; @@ -174,7 +176,7 @@ [self.view addSubview:self.sessionTableView]; [self.view addSubview:self.toolbarView]; if (self.openType != SessionListOpenTypeRoom) { - [self.stackView addArrangedSubview:self.pi_BannerView]; + [self.stackView addArrangedSubview:self.collectionView]; [self.stackView addArrangedSubview:self.pageControl]; } @@ -189,7 +191,7 @@ [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.view); make.top.equalTo(self.self.sessionNavView.mas_bottom); - + }]; [self.riskAlertView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(self.view); @@ -206,15 +208,15 @@ make.bottom.mas_equalTo(self.view); }]; if (self.openType != SessionListOpenTypeRoom) { - [self.pi_BannerView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(76)); - }]; - [self.pageControl mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self.view); - make.height.mas_equalTo(kGetScaleWidth(4)); - }]; - + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self.view); + make.height.mas_equalTo(kGetScaleWidth(76)); + }]; + [self.pageControl mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self.view); + make.height.mas_equalTo(kGetScaleWidth(4)); + }]; + } } @@ -238,7 +240,7 @@ [self getUserWallet]; } -(void)getUserWallet{ - + [Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if(code == 200){ WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data]; @@ -298,23 +300,24 @@ gameInfo.tags = tagList; } self.gameArray = [NSMutableArray arrayWithArray:list]; - - if(self.isShowfollowInRoomView == YES){ + + if(self.isShowfollowInRoomView == YES && list.count == 0){ UserGameInfoVo *gameModel = [UserGameInfoVo new]; gameModel.gameName = @"跟随房间"; [self.gameArray addObject:gameModel]; [gameTextArray addObject:gameModel.gameName]; + self.collectionView.hidden = NO; + [self.collectionView reloadData]; + return; } if(gameTextArray.count > 0){ - - self.pi_BannerView.hidden = NO; + self.collectionView.hidden = NO; self.pageControl.hidden = NO; - self.pi_BannerView.imageURLStringsGroup = gameTextArray; self.pageControl.pageList = gameTextArray; self.pageControl.curPage = 0; - [self.pi_BannerView autoScroll]; + [self.collectionView reloadData]; } - + } - (void)onGetLimitChat:(ChatLimitModel *)chatLimit { BOOL chatDisabled ; @@ -330,6 +333,7 @@ } else { self.sessionTableView.tableHeaderView = nil; } + self.toolbarView.model = chatLimit.model; self.toolbarView.sendDisabled = chatDisabled; } @@ -387,25 +391,75 @@ [[self getKeyWindowNav] pushViewController:infoVC animated:YES]; } } -#pragma mark - SDCycleScrollViewDelegate -- (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view { - return XPSessionMessageGameCell.class; +#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + return self.gameArray.count; +} +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ + + return CGSizeMake(KScreenWidth, kGetScaleWidth(76));; } -- (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view { - XPSessionMessageGameCell *myCell = (XPSessionMessageGameCell *)cell; - UserGameInfoVo *gameInfo = [self.gameArray safeObjectAtIndex1:index]; +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section{ + UserGameInfoVo *gameInfo = [self.gameArray safeObjectAtIndex1:0]; + + if([gameInfo.gameName isEqualToString:@"跟随房间"]){ + return CGSizeMake(0, 0); + } + return CGSizeMake(kGetScaleWidth(102), kGetScaleWidth(76)); +} + +-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath + +{ + + UICollectionReusableView *reusableView = nil; + + UserGameInfoVo *gameInfo = [self.gameArray safeObjectAtIndex1:indexPath.row]; + + if([gameInfo.gameName isEqualToString:@"跟随房间"]){ + return reusableView; + } + + if (kind ==UICollectionElementKindSectionFooter){ + + XPSessionMessageGameInfoView *footerV = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:NSStringFromClass([XPSessionMessageGameInfoView class]) forIndexPath:indexPath]; + footerV.headUrl = self.userInfo.avatar; + footerV.delegate = self; + reusableView = footerV; + + } + + return reusableView; + +} + +-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + XPSessionMessageGameCell *myCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPSessionMessageGameCell class]) forIndexPath:indexPath]; + UserGameInfoVo *gameInfo = [self.gameArray safeObjectAtIndex1:indexPath.row]; if([gameInfo.gameName isEqualToString:@"跟随房间"]){ myCell.userInfo = self.userInfo; }else{ myCell.gameInfo = gameInfo; } myCell.delegate = self; - + return myCell; +} +-(void)scrollViewDidScroll:(UIScrollView *)scrollView{ + if(self.collectionView == scrollView){ + CGFloat width = KScreenWidth - kGetScaleWidth(16); + int x = (int)(scrollView.contentOffset.x / width); + if(x < self.gameArray.count){ + self.pageControl.curPage = x; + } + } } -- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index{ - self.pageControl.curPage = index; +#pragma mark - XPSessionMessageGameInfoView +- (void)clicTokMineUserInfo{ + XPMineUserInfoViewController * infoVC = [[XPMineUserInfoViewController alloc] init]; + infoVC.uid = self.userInfo.uid; + [self.getKeyWindowNav pushViewController:infoVC animated:YES]; } #pragma mark - SessionNavViewDelegate - (void)sessionNavView:(SessionNavView *)view didClickLike:(UIButton *)sender { @@ -461,7 +515,7 @@ } } } - + } } @@ -644,6 +698,11 @@ orderVeiw.delegate = self; [self.view addSubview:orderVeiw]; } +- (void)xpSessionMessageGameCell:(XPSessionMessageGameCell *)cell chooseGame:(nonnull NSString *)uid{ + XPMineUserInfoViewController * infoVC = [[XPMineUserInfoViewController alloc] initWithChooseGame]; + infoVC.uid = self.userInfo.uid; + [[self getKeyWindowNav] pushViewController:infoVC animated:YES]; +} #pragma mark - XPMinePlaceOrderViewDelegate ///发起邀请 -(void)initiateInvitationWithGameInfo:(UserGameInfoVo *)gameInfo count:(NSString *)count{ @@ -657,7 +716,7 @@ [self showErrorToast:msg]; } gameId:gameInfo.gameId gameUid:gameInfo.uid inning:count uid:[AccountInfoStorage instance].getUid]; - + } ///充值 -(void)payHandleWithShowView:(BOOL)isShow{ @@ -810,6 +869,7 @@ if (!_toolbarView) { _toolbarView = [[SessionToolbarView alloc] init]; _toolbarView.delegate = self; + _toolbarView.sendDisabled = YES; } return _toolbarView; } @@ -829,18 +889,26 @@ } return _riskAlertView; } -- (SDCycleScrollView *)pi_BannerView { - if (!_pi_BannerView) { - _pi_BannerView = [[SDCycleScrollView alloc] init]; - _pi_BannerView.backgroundColor = [UIColor clearColor]; - _pi_BannerView.layer.masksToBounds = YES; - _pi_BannerView.delegate = self; - _pi_BannerView.showPageControl = NO; - _pi_BannerView.autoScrollTimeInterval = 5; - _pi_BannerView.hidden = YES; +- (UICollectionView *)collectionView{ + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + layout.minimumLineSpacing = 0; + layout.minimumInteritemSpacing = 0; + layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0); + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.dataSource = self; + _collectionView.delegate = self; + _collectionView.pagingEnabled = YES; + _collectionView.hidden = YES; + _collectionView.backgroundColor = [UIColor clearColor]; + _collectionView.showsHorizontalScrollIndicator = NO; + [_collectionView registerClass:[XPSessionMessageGameCell class] forCellWithReuseIdentifier:NSStringFromClass([XPSessionMessageGameCell class])]; + [_collectionView registerClass:[XPSessionMessageGameInfoView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:NSStringFromClass([XPSessionMessageGameInfoView class])]; } - return _pi_BannerView; + return _collectionView; } + - (XPSessionMessageGamePageControl *)pageControl{ if(!_pageControl){ _pageControl = [[XPSessionMessageGamePageControl alloc]initWithFrame:CGRectZero]; diff --git a/xplan-ios/Main/Message/View/Session/XPSessionMessageGameCell.h b/xplan-ios/Main/Message/View/Session/XPSessionMessageGameCell.h index 470e52ac..3456fc66 100644 --- a/xplan-ios/Main/Message/View/Session/XPSessionMessageGameCell.h +++ b/xplan-ios/Main/Message/View/Session/XPSessionMessageGameCell.h @@ -18,12 +18,16 @@ NS_ASSUME_NONNULL_BEGIN - (void)xpSessionMessageGameCell:(XPSessionMessageGameCell *)cell onFollowInRoom:(NSString *)roomUid; ///下单 - (void)xpSessionMessageGameCell:(XPSessionMessageGameCell *)cell onPlaceOrder:(NSString *)uid; +///跳到游戏下单 +- (void)xpSessionMessageGameCell:(XPSessionMessageGameCell *)cell chooseGame:(NSString *)uid; @end @interface XPSessionMessageGameCell : UICollectionViewCell @property(nonatomic,weak) iddelegate; @property(nonatomic,strong) UserInfoModel *userInfo; @property(nonatomic,strong) UserGameInfoVo *gameInfo; + + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Message/View/Session/XPSessionMessageGameCell.m b/xplan-ios/Main/Message/View/Session/XPSessionMessageGameCell.m index 58c1cb72..8705d798 100644 --- a/xplan-ios/Main/Message/View/Session/XPSessionMessageGameCell.m +++ b/xplan-ios/Main/Message/View/Session/XPSessionMessageGameCell.m @@ -7,6 +7,7 @@ #import "XPSessionMessageGameCell.h" #import "XPSessionMessageHeadView.h" + @interface XPSessionMessageGameCell () ///背景 @property(nonatomic,strong) NetImageView *bgImageView; @@ -45,6 +46,7 @@ self.contentView.backgroundColor = [UIColor clearColor]; [self.contentView addSubview:self.bgImageView]; [self.contentView addSubview:self.followInRoomView]; + [self.bgImageView addSubview:self.iconView]; [self.bgImageView addSubview:self.titleView]; [self.bgImageView addSubview:self.tierBgView]; @@ -60,6 +62,7 @@ make.top.mas_equalTo(kGetScaleWidth(0)); make.bottom.mas_equalTo(-kGetScaleWidth(0)); make.leading.trailing.equalTo(self.contentView).inset(kGetScaleWidth(16)); + }]; [self.followInRoomView mas_remakeConstraints:^(MASConstraintMaker *make) { @@ -67,6 +70,7 @@ make.top.mas_equalTo(0); make.bottom.mas_equalTo(0); }]; + [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.height.mas_equalTo(kGetScaleWidth(48)); make.top.mas_equalTo(kGetScaleWidth(14)); @@ -88,9 +92,10 @@ [self.tierBgView mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(kGetScaleWidth(16)); - make.width.mas_greaterThanOrEqualTo(10); + make.width.mas_lessThanOrEqualTo(kGetScaleWidth(72)); make.centerY.equalTo(self.titleView); make.leading.equalTo(self.titleView.mas_trailing).mas_offset(kGetScaleWidth(4)); + make.trailing.equalTo(self.priceView.mas_leading).mas_offset(-kGetScaleWidth(2)); }]; [self.tierView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.trailing.equalTo(self.tierBgView).inset(kGetScaleWidth(6)); @@ -114,6 +119,7 @@ make.top.mas_equalTo(kGetScaleWidth(36)); }]; } + #pragma mark - XPSessionMessageHeadViewDelegate - (void)onAvatarClick:(NSInteger)uid{ if(self.delegate && [self.delegate respondsToSelector:@selector(xpSessionMessageGameCell:onAvatarClick:)]){ @@ -136,13 +142,14 @@ self.followInRoomView.userInfo = _userInfo; self.followInRoomView.hidden = NO; self.bgImageView.hidden = YES; + } - (void)setGameInfo:(UserGameInfoVo *)gameInfo{ _gameInfo = gameInfo; self.followInRoomView.hidden = YES; self.bgImageView.hidden = NO; - + _iconView.imageUrl = _gameInfo.logo; _payBtn.imageUrl = _gameInfo.btnRgb; [_payTitleBnt setTitleColor:UIColorFromRGB(0xBBBCBD) forState:UIControlStateNormal]; @@ -154,11 +161,21 @@ self.bgImageView.image = image; [self.payTitleBnt setTitleColor:[ThemeColor colorWithHexString:gameInfo.btnRgb] forState:UIControlStateNormal]; }]; - _titleView.text = _gameInfo.gameName; + _tierView.text = _gameInfo.tier; _tierBgView.hidden = _gameInfo.tier.length == 0; - + _titleView.text = _gameInfo.gameName; + + NSMutableAttributedString *gameNameAtt = [[NSMutableAttributedString alloc]initWithString:_gameInfo.gameName attributes:@{NSFontAttributeName:kFontMedium(16),NSForegroundColorAttributeName:[UIColor whiteColor]}]; + NSString *gameName = @""; + if(_gameInfo.gameName.length > 5 ){ + gameName = [_gameInfo.gameName substringWithRange:NSMakeRange(4, _gameInfo.gameName.length-4)]; + [gameNameAtt addAttributes:@{NSFontAttributeName:kFontMedium(12),NSForegroundColorAttributeName:[UIColor whiteColor]} range:[_gameInfo.gameName rangeOfString:gameName]]; + _titleView.attributedText = gameNameAtt; + }else{ + _titleView.attributedText = gameNameAtt; + } NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@ 钻/局",_gameInfo.price] attributes:@{NSFontAttributeName:kFontMedium(16),NSForegroundColorAttributeName:[UIColor whiteColor]}]; @@ -170,11 +187,16 @@ [textAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:attachment] atIndex:0]; _priceView.textAlignment = NSTextAlignmentRight; _priceView.attributedText = textAtt; - + _gameInfo.finishNum = _gameInfo.finishNum ?: @"0"; NSMutableAttributedString *numAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"接单 %@ 次>",_gameInfo.finishNum] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:[UIColor whiteColor]}]; [numAtt addAttributes:@{NSFontAttributeName:kFontMedium(16),NSForegroundColorAttributeName:UIColorFromRGB(0xFFDA24)} range:[numAtt.string rangeOfString:_gameInfo.finishNum]]; _numView.attributedText = numAtt; } +-(void)jumToChooseGameVC{ + if(self.delegate && [self.delegate respondsToSelector:@selector(xpSessionMessageGameCell:chooseGame:)]){ + [self.delegate xpSessionMessageGameCell:self chooseGame:@""]; + } +} #pragma mark - 懒加载 - (NetImageView *)bgImageView{ if(!_bgImageView){ @@ -243,7 +265,7 @@ if(!_payTitleBnt){ UIButton *payTitleBnt = [[UIButton alloc]init]; [payTitleBnt setTitleColor:UIColorFromRGB(0xBBBCBD) forState:UIControlStateNormal]; - [payTitleBnt setTitle:@"咨询下单" forState:UIControlStateNormal]; + [payTitleBnt setTitle:@"下单" forState:UIControlStateNormal]; payTitleBnt.titleLabel.font = kFontMedium(12); [payTitleBnt addTarget:self action:@selector(payAtion) forControlEvents:UIControlEventTouchUpInside]; _payTitleBnt = payTitleBnt; @@ -253,6 +275,9 @@ - (UILabel *)numView{ if(!_numView){ _numView = [UILabel new]; + _numView.userInteractionEnabled = YES; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(jumToChooseGameVC)]; + [_numView addGestureRecognizer:tap]; } return _numView; @@ -265,4 +290,5 @@ } return _followInRoomView; } + @end diff --git a/xplan-ios/Main/Message/View/Session/XPSessionMessageGameInfoView.h b/xplan-ios/Main/Message/View/Session/XPSessionMessageGameInfoView.h new file mode 100644 index 00000000..02de65be --- /dev/null +++ b/xplan-ios/Main/Message/View/Session/XPSessionMessageGameInfoView.h @@ -0,0 +1,23 @@ +// +// XPSessionMessageGameInfoView.h +// xplan-ios +// +// Created by duoban on 2023/8/25. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol XPSessionMessageGameInfoViewDelegate + +-(void)clicTokMineUserInfo; + +@end + +@interface XPSessionMessageGameInfoView : UICollectionReusableView +@property(nonatomic,copy) NSString *headUrl; +@property(nonatomic,weak) iddelegate; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Message/View/Session/XPSessionMessageGameInfoView.m b/xplan-ios/Main/Message/View/Session/XPSessionMessageGameInfoView.m new file mode 100644 index 00000000..dc4af2e0 --- /dev/null +++ b/xplan-ios/Main/Message/View/Session/XPSessionMessageGameInfoView.m @@ -0,0 +1,106 @@ +// +// XPSessionMessageGameInfoView.m +// xplan-ios +// +// Created by duoban on 2023/8/25. +// + +#import "XPSessionMessageGameInfoView.h" +@interface XPSessionMessageGameInfoView() +@property(nonatomic,strong) UIButton *tapBtn; +@property(nonatomic,strong) UIView *bgView; +@property(nonatomic,strong) NetImageView *headView; +@property(nonatomic,strong) UILabel *nameView; +@property(nonatomic,strong) UIImageView *arrowView; +@end +@implementation XPSessionMessageGameInfoView + +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + [self addSubview:self.bgView]; + [self.bgView addSubview:self.headView]; + [self.bgView addSubview:self.nameView]; + [self.bgView addSubview:self.arrowView]; + [self.bgView addSubview:self.tapBtn]; +} +-(void)installConstraints{ + [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(kGetScaleWidth(88)); + make.height.mas_equalTo(kGetScaleWidth(76)); + make.top.leading.equalTo(self); + }]; + [self.headView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kGetScaleWidth(11)); + make.width.height.mas_equalTo(kGetScaleWidth(34)); + make.centerX.equalTo(self.bgView); + }]; + [self.arrowView mas_makeConstraints:^(MASConstraintMaker *make) { + make.trailing.mas_equalTo(-kGetScaleWidth(5)); + make.top.equalTo(self.headView.mas_bottom).mas_offset(kGetScaleWidth(9)); + make.width.height.mas_equalTo(kGetScaleWidth(10)); + }]; + [self.nameView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.equalTo(self.arrowView); + make.trailing.equalTo(self.arrowView.mas_leading).mas_offset(-kGetScaleWidth(0)); + }]; + [self.tapBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.bgView); + }]; +} +-(void)setHeadUrl:(NSString *)headUrl{ + _headUrl = headUrl; + _headView.imageUrl = _headUrl; +} +-(void)tapAction{ + if(self.delegate && [self.delegate respondsToSelector:@selector(clicTokMineUserInfo)]){ + [self.delegate clicTokMineUserInfo]; + } +} +#pragma mark - 懒加载 +- (UIView *)bgView{ + if(!_bgView){ + _bgView = [UIView new]; + _bgView.backgroundColor = [UIColor whiteColor]; + _bgView.layer.cornerRadius = kGetScaleWidth(10); + _bgView.layer.masksToBounds = YES; + } + return _bgView; +} +-(NetImageView *)headView{ + if(!_headView){ + NetImageConfig *config = [[NetImageConfig alloc]init]; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _headView = [[NetImageView alloc]initWithConfig:config]; + _headView.layer.cornerRadius = kGetScaleWidth(34)/2; + _headView.layer.masksToBounds = YES; + } + return _headView; +} +-(UILabel *)nameView{ + if(!_nameView){ + _nameView = [UILabel labelInitWithText:@"去TA的主页" font:kFontRegular(12) textColor:UIColorFromRGB(0x2B2D33)]; + } + return _nameView; +} +-(UIImageView *)arrowView{ + if(!_arrowView){ + _arrowView = [UIImageView new]; + _arrowView.image = kImage(@"Session_Message_Game_InfoView_arrow"); + } + return _arrowView; +} +- (UIButton *)tapBtn{ + if(!_tapBtn){ + _tapBtn = [UIButton new]; + [_tapBtn addTarget:self action:@selector(tapAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _tapBtn; +} +@end diff --git a/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.m b/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.m index 97c4c9d9..86d89f4b 100644 --- a/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.m +++ b/xplan-ios/Main/Mine/Presenter/XPMineUserInfoPresenter.m @@ -77,6 +77,7 @@ -(void)initiateInvitationGameWithGameId:(NSString *)gameId gameUid:(NSString *)gameUid inning:(NSString *)inning uid:(NSString *)uid{ [Api sendInitiateInvitationGame:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView]sendInitiateInvitationGameSuccess]; + [XCHUDTool showSuccessWithMessage:@"邀请成功"]; } fail:^(NSInteger code, NSString * _Nullable msg) { }showLoading:YES errorToast:YES ] gameId:gameId gameUid:gameUid inning:inning uid:uid]; diff --git a/xplan-ios/Main/Mine/Protocol/XPMineProtocol.h b/xplan-ios/Main/Mine/Protocol/XPMineProtocol.h index 60b74a8b..1a706bea 100644 --- a/xplan-ios/Main/Mine/Protocol/XPMineProtocol.h +++ b/xplan-ios/Main/Mine/Protocol/XPMineProtocol.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @class XPMineItemModel, UserInfoModel, NobleCenterModel, ClanDetailInfoModel, XPMineFuntionItemModel, LittleGameInfoModel, HomeBannerInfoModel, WalletInfoModel, HomeLittleGameRoomModel, AnchorLevelModel; @protocol XPMineProtocol - +@optional ///获取用户信息成功 - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo; ///获取账户余额 diff --git a/xplan-ios/Main/Mine/View/GameOrder/Presenter/XPMineGameOrderItemPresenter.m b/xplan-ios/Main/Mine/View/GameOrder/Presenter/XPMineGameOrderItemPresenter.m index 385167a1..9f6776a9 100644 --- a/xplan-ios/Main/Mine/View/GameOrder/Presenter/XPMineGameOrderItemPresenter.m +++ b/xplan-ios/Main/Mine/View/GameOrder/Presenter/XPMineGameOrderItemPresenter.m @@ -22,6 +22,7 @@ -(void)initiateInvitationGameWithGameId:(NSString *)gameId gameUid:(NSString *)gameUid inning:(NSString *)inning uid:(NSString *)uid { [Api sendInitiateInvitationGame:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView]sendInitiateInvitationGameSuccess]; + [XCHUDTool showSuccessWithMessage:@"邀请成功"]; } fail:^(NSInteger code, NSString * _Nullable msg) { }showLoading:YES errorToast:YES ] gameId:gameId gameUid:gameUid inning:inning uid:uid]; diff --git a/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderDetailsView.h b/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderDetailsView.h index 305f4eab..1eeeb181 100644 --- a/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderDetailsView.h +++ b/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderDetailsView.h @@ -9,7 +9,7 @@ #import "UserGameInfoVo.h" NS_ASSUME_NONNULL_BEGIN @protocol XPMineGameOrderDetailsViewDelegate - +@optional ///再次邀请 -(void)againinitiateInvitationWithGameInfo:(UserGameInfoVo *)gameInfo; ///发信息 diff --git a/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderDetailsView.m b/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderDetailsView.m index 6a56911d..a9b5e889 100644 --- a/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderDetailsView.m +++ b/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderDetailsView.m @@ -149,6 +149,12 @@ [self.delegate againinitiateInvitationWithGameInfo:self.gameInfo]; } } +-(void)setIsFormChat:(BOOL)isFormChat{ + _isFormChat = isFormChat; + if(_isFormChat == YES){ + _sendMessageBtn.hidden = YES; + } +} - (void)setGameInfo:(UserGameInfoVo *)gameInfo{ _gameInfo = gameInfo; _nameView.text = _gameInfo.toNick; @@ -159,19 +165,19 @@ - NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@ 钻/局",_gameInfo.price] attributes:@{NSFontAttributeName:kFontRegular(14),NSForegroundColorAttributeName:UIColorFromRGB(0x696D7A)}]; - [textAtt addAttributes:@{NSFontAttributeName:kFontMedium(20),NSForegroundColorAttributeName:UIColorFromRGB(0xFFA024)} range:[textAtt.string rangeOfString:_gameInfo.price]]; - UIImage *iconImage = kImage(@"mine_game_diamond"); + NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@ 钻/局",_gameInfo.price] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0x696D7A)}]; + [textAtt addAttributes:@{NSFontAttributeName:kFontMedium(16),NSForegroundColorAttributeName:UIColorFromRGB(0xFFA024)} range:[textAtt.string rangeOfString:_gameInfo.price]]; + UIImage *iconImage = kImage(@"mine_game_new_diamond"); NSTextAttachment * attachment = [[NSTextAttachment alloc] init]; - attachment.bounds = CGRectMake(0, roundf(kFontRegular(14).capHeight - iconImage.size.height)/2.f, iconImage.size.width, iconImage.size.height);; + attachment.bounds = CGRectMake(0, roundf(kFontMedium(16).capHeight - iconImage.size.height)/2.f, iconImage.size.width, iconImage.size.height);; attachment.image = iconImage; [textAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:attachment] atIndex:0]; _priceView.textAlignment = NSTextAlignmentRight; _priceView.attributedText = textAtt; - NSMutableAttributedString *tiemAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"下单时间:%@ ",_gameInfo.createTime] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0x696D7A)}]; - [tiemAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0xA2A7B8)} range:[textAtt.string rangeOfString:@"下单时间:"]]; + NSMutableAttributedString *tiemAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"邀请时间:%@ ",_gameInfo.orderTime] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0x696D7A)}]; + [tiemAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0xA2A7B8)} range:[textAtt.string rangeOfString:@"邀请时间:"]]; _timeView.attributedText = tiemAtt; @@ -179,7 +185,7 @@ [textAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:UIColorFromRGB(0xA2A7B8)} range:[textAtt.string rangeOfString:@"订单编号:"]]; UIImage *orderIconImage = kImage(@"mine_game_copy"); NSTextAttachment * orderAttachment = [[NSTextAttachment alloc] init]; - attachment.bounds = CGRectMake(0, roundf(kFontRegular(12).capHeight - orderIconImage.size.height)/2.f, orderIconImage.size.width, orderIconImage.size.height);; + orderAttachment.bounds = CGRectMake(0, roundf(kFontRegular(12).capHeight - orderIconImage.size.height)/2.f, orderIconImage.size.width, orderIconImage.size.height);; orderAttachment.image = orderIconImage; [orderAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:orderAttachment] atIndex:[NSString stringWithFormat:@"订单编号:%@ ",_gameInfo.orderNo].length]; _orderNumView.attributedText = orderAtt; diff --git a/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderItemCell.h b/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderItemCell.h index c434fa25..387edb2d 100644 --- a/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderItemCell.h +++ b/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderItemCell.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMineGameOrderItemCell : UITableViewCell @property(nonatomic,strong) UserGameInfoVo *gameInfo; +@property(nonatomic,copy) NSString *type; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderItemCell.m b/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderItemCell.m index 5465658f..f2445286 100644 --- a/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderItemCell.m +++ b/xplan-ios/Main/Mine/View/GameOrder/View/SubViews/XPMineGameOrderItemCell.m @@ -93,9 +93,9 @@ -(void)setGameInfo:(UserGameInfoVo *)gameInfo{ _gameInfo = gameInfo; _gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo; - _gameNameVeiw.text = _gameInfo.gameName; - _headView.imageUrl = _gameInfo.toAvatar; - _nameView.text = _gameInfo.toNick; + _gameNameVeiw.text = _gameInfo.gameName; + _headView.imageUrl = [_type isEqualToString:@"0"] ? _gameInfo.fromAvatar : _gameInfo.toAvatar; + _nameView.text = [_type isEqualToString:@"0"] ?_gameInfo.fromNick : _gameInfo.toNick; _numView.text = [NSString stringWithFormat:@"%@ 局",_gameInfo.inning]; } #pragma mark - 懒加载 diff --git a/xplan-ios/Main/Mine/View/GameOrder/View/XPMineGameOrderVC.m b/xplan-ios/Main/Mine/View/GameOrder/View/XPMineGameOrderVC.m index f43def80..f963bc92 100644 --- a/xplan-ios/Main/Mine/View/GameOrder/View/XPMineGameOrderVC.m +++ b/xplan-ios/Main/Mine/View/GameOrder/View/XPMineGameOrderVC.m @@ -101,7 +101,8 @@ } - (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { - + [[NSUserDefaults standardUserDefaults]setInteger:index forKey:@"kSelectGameRecords"]; + [[NSUserDefaults standardUserDefaults]synchronize]; } - (void)xPHomePartyNavViewDidClickBack{ [self.navigationController popViewControllerAnimated:YES]; @@ -207,7 +208,8 @@ _titleView.cellSpacing = kGetScaleWidth(15); _titleView.cellWidth = (KScreenWidth - 60) / 2; _titleView.averageCellSpacingEnabled = NO; - _titleView.defaultSelectedIndex = 0; + id index = [[NSUserDefaults standardUserDefaults]valueForKey:@"kSelectGameRecords"]; + _titleView.defaultSelectedIndex = index != nil ? [index integerValue] :0; _titleView.listContainer = self.contentView; diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserGameVC.h b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserGameVC.h index 65475a4d..a5f9a18a 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserGameVC.h +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserGameVC.h @@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN ///个人详情资料的点单游戏信息 @property(nonatomic,strong) NSArray *gameList; @property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserGameVC.m b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserGameVC.m index f27eb0eb..07e1660b 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserGameVC.m +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserGameVC.m @@ -10,16 +10,18 @@ #import "XPMineUserGameCell.h" @interface XPMineUserGameVC () @property(nonatomic,strong) UITableView *tableView; + @end @implementation XPMineUserGameVC + - (BOOL)isHiddenNavBar { return YES; } - (void)viewDidLoad { -[super viewDidLoad]; -[self installUI]; -[self installConstraints]; + [super viewDidLoad]; + [self installUI]; + [self installConstraints]; } -(void)installUI{ [self.view addSubview:self.tableView]; @@ -51,10 +53,10 @@ } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - UserGameInfoVo *gameInfo = [self.gameList safeObjectAtIndex1:indexPath.row]; + UserGameInfoVo *gameInfo = [self.gameList safeObjectAtIndex1:indexPath.row]; CGFloat height = 98; if(gameInfo.tags.count > 2){ - height = (gameInfo.tags.count - 2) * 24; + height = (gameInfo.tags.count - 2) * 22; } return kGetScaleWidth(height); } @@ -67,11 +69,11 @@ cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; -// XPHomeListEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])]; -// if (cell == nil) { -// cell = [[XPHomeListEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])]; -// } -// return cell; + // XPHomeListEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])]; + // if (cell == nil) { + // cell = [[XPHomeListEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])]; + // } + // return cell; } #pragma mark - XPMineUserGameCellDelegate - (void)consultingOrderActionWithGameInfo:(UserGameInfoVo *)gameInfo{ @@ -101,7 +103,7 @@ _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; _tableView.delegate = self; _tableView.dataSource = self; -// _tableView.tableFooterView = [UIView new]; + // _tableView.tableFooterView = [UIView new]; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; _tableView.backgroundColor = [UIColor clearColor]; if (@available(iOS 11.0, *)) { diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.h b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.h index ee932d9f..89cffa10 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.h +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMineUserInfoViewController : MvpViewController ///用户的id @property (nonatomic,assign) NSInteger uid; - +-(instancetype)initWithChooseGame; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.m b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.m index b54978f5..8c91ec63 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.m +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoViewController.m @@ -81,10 +81,17 @@ ///余额 @property(nonatomic, copy)NSString *diamonds; +@property(nonatomic,assign) int index; @end @implementation XPMineUserInfoViewController - +-(instancetype)initWithChooseGame{ + self = [super init]; + if(self){ + self.index = 1; + } + return self; +} - (XPMineUserInfoPresenter *)createPresenter { return [[XPMineUserInfoPresenter alloc] init]; } @@ -363,7 +370,7 @@ self.userDataVC.userInfo = userInfo; self.monentsVC.dynamicInfo = userInfo.dynamicInfo; self.headView.roomUid = userInfo.roomUid; - if (self.uid != [AccountInfoStorage instance].getUid.integerValue) { + if(userInfo.userGamePartner.count > 0){ self.banButton.hidden = NO; self.gameVC.gameList = userInfo.userGamePartner; @@ -377,6 +384,10 @@ self.headView.attentionButton.hidden = YES; self.titles = @[@"资料", @"动态"]; } + if(self.uid == [AccountInfoStorage instance].getUid.integerValue){ + self.banButton.hidden = YES; + self.headView.attentionButton.hidden = YES; + self.attentionButton.hidden = YES; } self.titleView.titles = self.titles; [self.titleView reloadData]; @@ -392,18 +403,19 @@ }else{ self.attentionButton.backgroundColor = [ThemeColor appMainColor]; self.attentionButton.layer.borderColor = UIColor.clearColor.CGColor; - self.headView.attentionButton.backgroundColor = [ThemeColor appMainColor]; - self.headView.attentionButton.layer.borderColor = UIColor.clearColor.CGColor; + + + } self.headView.attentionButton.selected = status; - if (self.headView.attentionButton.selected) { - self.headView.attentionButton.backgroundColor = [ThemeColor colorWithHexString:@"#FFFACF"]; - self.headView.attentionButton.layer.borderColor = [ThemeColor appMainColor].CGColor; + if (!self.headView.attentionButton.selected) { + self.headView.attentionButton.backgroundColor = [ThemeColor colorWithHexString:@"#FFDA24"]; + }else{ - self.headView.attentionButton.backgroundColor = [ThemeColor appMainColor]; - self.headView.attentionButton.layer.borderColor = UIColor.clearColor.CGColor; + self.headView.attentionButton.backgroundColor = UIColorRGBAlpha(0xFFDA24, 0.4); + } } @@ -419,7 +431,7 @@ self.attentionButton.layer.borderColor = UIColor.clearColor.CGColor; } - + [[NSNotificationCenter defaultCenter]postNotificationName:@"kAttentionUserNotification" object:nil]; self.headView.attentionButton.selected = status; if (self.headView.attentionButton.selected) { @@ -587,7 +599,8 @@ _titleView.titleSelectedFont = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium]; _titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter; _titleView.contentScrollViewClickTransitionAnimationEnabled = NO; - _titleView.defaultSelectedIndex = 0; + + _titleView.defaultSelectedIndex = self.index > 0 ? self.index : 0; _titleView.averageCellSpacingEnabled = NO; _titleView.contentEdgeInsetLeft = 20; _titleView.titles = self.titles; @@ -646,6 +659,7 @@ } - (XPMineUserGameVC *)gameVC{ if(!_gameVC){ + _gameVC = [[XPMineUserGameVC alloc]init]; _gameVC.delegate = self; } diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMinePlaceOrderView.m b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMinePlaceOrderView.m index 829d13c7..d06bec97 100644 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMinePlaceOrderView.m +++ b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMinePlaceOrderView.m @@ -57,6 +57,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHidden:) name:UIKeyboardWillHideNotification object:nil]; [[NIMSDK sharedSDK].systemNotificationManager addDelegate:self]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(hiddenCurView) name:@"kGameOrderListRefreshData" object:nil]; + [self endEditing:YES]; } return self; } diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserGameCell.h b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserGameCell.h index ef02f336..1e759f34 100644 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserGameCell.h +++ b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserGameCell.h @@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMineUserGameCell : UITableViewCell @property(nonatomic,weak) iddelegate; @property(nonatomic,strong) UserGameInfoVo *gameInfo; +@property(nonatomic,copy) NSString *uid; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserGameCell.m b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserGameCell.m index 21c076c9..dc5b1904 100644 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserGameCell.m +++ b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserGameCell.m @@ -78,16 +78,18 @@ make.leading.equalTo(self.iconView.mas_trailing).mas_offset(kGetScaleWidth(14)); make.top.mas_equalTo(kGetScaleWidth(10)); make.height.mas_equalTo(kGetScaleWidth(22)); + }]; [self.tierBgView mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(kGetScaleWidth(16)); - make.width.mas_greaterThanOrEqualTo(10); + make.width.mas_lessThanOrEqualTo(kGetScaleWidth(72)); make.centerY.equalTo(self.titleView); make.leading.equalTo(self.titleView.mas_trailing).mas_offset(kGetScaleWidth(4)); + make.trailing.equalTo(self.priceView.mas_leading).mas_offset(-kGetScaleWidth(2)); }]; [self.tierView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.tierBgView).inset(kGetScaleWidth(6)); + make.leading.trailing.equalTo(self.tierBgView).inset(kGetScaleWidth(5)); make.centerY.equalTo(self.tierBgView); }]; [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -113,23 +115,34 @@ - (void)setGameInfo:(UserGameInfoVo *)gameInfo{ _gameInfo = gameInfo; _iconView.imageUrl = _gameInfo.logo; - - _payBtn.imageUrl = _gameInfo.btnRgb; [_payTitleBnt setTitleColor:UIColorFromRGB(0xBBBCBD) forState:UIControlStateNormal]; self.tierView.textColor = UIColorFromRGB(0xBBBCBD); - self.tierBgView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.6];; + self.tierBgView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.6]; [_bgImageView loadImageWithUrl:_gameInfo.background completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { self.tierView.textColor = [ThemeColor colorWithHexString:gameInfo.tagRgb]; self.tierBgView.backgroundColor = [ThemeColor colorWithHexString:gameInfo.tagBg]; self.bgImageView.image = image; [self.payTitleBnt setTitleColor:[ThemeColor colorWithHexString:gameInfo.btnRgb] forState:UIControlStateNormal]; }]; - _titleView.text = _gameInfo.gameName; + _tierView.text = _gameInfo.tier; _tierBgView.hidden = _gameInfo.tier.length == 0; - + _titleView.text = _gameInfo.gameName; + + NSMutableAttributedString *gameNameAtt = [[NSMutableAttributedString alloc]initWithString:_gameInfo.gameName attributes:@{NSFontAttributeName:kFontMedium(16),NSForegroundColorAttributeName:[UIColor whiteColor]}]; + NSString *gameName = @""; + if(_gameInfo.gameName.length > 5 ){ + gameName = [_gameInfo.gameName substringWithRange:NSMakeRange(4, _gameInfo.gameName.length-4)]; + [gameNameAtt addAttributes:@{NSFontAttributeName:kFontMedium(12),NSForegroundColorAttributeName:[UIColor whiteColor]} range:[_gameInfo.gameName rangeOfString:gameName]]; + _titleView.attributedText = gameNameAtt; + }else{ + _titleView.attributedText = gameNameAtt; + } + + _payBtn.hidden = [_gameInfo.uid isEqualToString:[AccountInfoStorage instance].getUid]; + _payTitleBnt.hidden = [_gameInfo.uid isEqualToString:[AccountInfoStorage instance].getUid]; NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@ 钻/局",_gameInfo.price] attributes:@{NSFontAttributeName:kFontMedium(16),NSForegroundColorAttributeName:[UIColor whiteColor]}]; [textAtt addAttributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:[UIColor colorWithWhite:1 alpha:0.8]} range:[textAtt.string rangeOfString:@"钻/局"]]; @@ -143,6 +156,7 @@ _itemList = _gameInfo.tags; [self.tableView reloadData]; } + #pragma mark - UITableViewDelegate,UITableViewDataSource -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return self.itemList.count; @@ -240,7 +254,7 @@ _tableView.delegate = self; _tableView.dataSource = self; _tableView.scrollEnabled = NO; - _tableView.rowHeight = kGetScaleWidth(24); + _tableView.rowHeight = kGetScaleWidth(22); _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; _tableView.backgroundColor = [UIColor clearColor]; [_tableView registerClass:[XPMineUserGameTypeCell class] forCellReuseIdentifier:NSStringFromClass([XPMineUserGameTypeCell class])]; diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m index bc676c9e..27fe7f38 100644 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m +++ b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m @@ -867,18 +867,17 @@ [_attentionButton setTitle:@"关注" forState:UIControlStateNormal]; [_attentionButton setTitle:@"已关注" forState:UIControlStateSelected]; [_attentionButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal]; - [_attentionButton setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateSelected]; + [_attentionButton setTitleColor:UIColorRGBAlpha(0x2B2D33, 0.6) forState:UIControlStateSelected]; [_attentionButton setImage:[UIImage imageNamed:@"mine_user_info_bottom_attention_normal"] forState:UIControlStateNormal]; - [_attentionButton setImage:[UIImage imageNamed:@"mine_user_info_bottom_attention_select"] forState:UIControlStateSelected]; + [_attentionButton setImage:[UIImage imageNamed:@"mine_user_info_bottom_new_attention_select"] forState:UIControlStateSelected]; _attentionButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; _attentionButton.backgroundColor = [ThemeColor appMainColor]; _attentionButton.layer.masksToBounds = YES; _attentionButton.hidden = YES; _attentionButton.layer.cornerRadius = 6; [_attentionButton addTarget:self action:@selector(attentionButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - _attentionButton.imageTitleSpace = 4; - _attentionButton.layer.borderWidth = 1; - _attentionButton.layer.borderColor = UIColor.clearColor.CGColor; + _attentionButton.imageTitleSpace = 2; + } return _attentionButton; } diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m index 3ea99817..0b9098a6 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m @@ -457,6 +457,10 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc [self.delegate xPGiftInfoView:self didClickPrivilegeItem:cardModel type:self.segmentType]; } cardModel.isSelected = YES; + }else{ + if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickPrivilegeItem:type:)]) { + [self.delegate xPGiftInfoView:self didClickPrivilegeItem:nil type:self.segmentType]; + } } [self.giftcollectionView reloadData]; if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickSegment:)]) { diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftUsersView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftUsersView.h index 72285b13..a0f8368a 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftUsersView.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftUsersView.h @@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN @end @interface XPGiftUsersView : UIView +///原始的数据 +@property (nonatomic,strong,readonly) NSArray *userArray; ///选中的人 送给谁礼物 @property (nonatomic,strong, readonly) NSMutableArray *selectUserArray; ///是不是选择了全部麦上的人 diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m index a0826148..b429cb4b 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m @@ -64,8 +64,8 @@ @property (nonatomic, strong) XPGiftHeadTypeView *headTypeView; ///送礼物的人 @property (nonatomic,strong) XPGiftUsersView *userView; -///送礼物的人的隐藏状态 -@property(nonatomic,assign) BOOL isHiddenUserView; + + ///送的什么礼物 @property (nonatomic,strong) XPGiftInfoView *giftInfoView; ///送多少礼物 @@ -545,7 +545,9 @@ } - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type { - self.userView.hidden = self.isHiddenUserView; + self.userView.hidden = self.userView.userArray.count == 0; + + if (type == GiftSegmentType_Graffiti) { self.giftInfoView.hidden = YES; self.graffitiView.hidden = NO; @@ -564,10 +566,15 @@ } } - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickPrivilegeItem:(XPPrivilegeCardItemModel *)cardModel type:(GiftSegmentType)type{ + if(cardModel == nil){ + self.userView.hidden = YES; + return; + } self.giftBarView.privilegeCount = cardModel.dailyNum; self.giftBarView.privilegeArray = self.giftInfoView.privilegeArray; - self.isHiddenUserView = self.userView.hidden; - self.userView.hidden = YES; + + + } #pragma mark - XPGiftUsersViewDelegate - (void)xPGiftUsersView:(XPGiftUsersView *)view didSelectUsers:(NSArray *)selectUids { diff --git a/xplan-ios/Main/Room/PrivilegeCard/Subviews/XPPrivilegeCardConfirmView.m b/xplan-ios/Main/Room/PrivilegeCard/Subviews/XPPrivilegeCardConfirmView.m index 86bdebff..f87bd2af 100644 --- a/xplan-ios/Main/Room/PrivilegeCard/Subviews/XPPrivilegeCardConfirmView.m +++ b/xplan-ios/Main/Room/PrivilegeCard/Subviews/XPPrivilegeCardConfirmView.m @@ -10,6 +10,8 @@ @property(nonatomic,strong) UIView *bgView; @property(nonatomic,strong) UILabel *titleView; @property(nonatomic,strong) UILabel *contentView; +@property(nonatomic,strong) UILabel *contentView1; +@property(nonatomic,strong) UILabel *contentView2; ///取消 @property(nonatomic,strong) UIButton *cancelBtn; ///确认 @@ -51,31 +53,45 @@ [self addSubview:self.bgView]; [self.bgView addSubview:self.titleView]; [self.bgView addSubview:self.contentView]; + [self.bgView addSubview:self.contentView1]; + [self.bgView addSubview:self.contentView2]; [self.bgView addSubview:self.verifyBtn]; self.titleView.text = @"关于特权卡"; - self.titleView.font = kFontMedium(16); - self.contentView.font = kFontRegular(14); - self.contentView.text = @"1. 特权卡是用户在房间内身份的象征,\n 送出特权卡可增加用户之间互动。\n\n2. 特权卡由房主和房间管理员发放"; + self.titleView.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; + self.contentView.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; + self.contentView.text = @"1. 特权卡是用户在房间内身份的象征,"; + self.contentView1.text = @"送出特权卡可增加用户之间互动。"; + self.contentView2.text = @"2. 特权卡由房主和房间管理员发放"; + self.contentView.numberOfLines = 1; [self.verifyBtn setTitle:@"知道了" forState:UIControlStateNormal]; } -(void)installConstraintsWithInstructions{ [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(kGetScaleWidth(307)); - make.height.mas_greaterThanOrEqualTo(kGetScaleWidth(223)); + make.width.mas_equalTo(307); + make.height.mas_equalTo(223); make.center.equalTo(self); }]; [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kGetScaleWidth(28)); + make.top.mas_equalTo(28); + make.height.mas_equalTo(24); make.centerX.equalTo(self.bgView); }]; [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kGetScaleWidth(68)); - make.leading.trailing.equalTo(self.bgView).inset(kGetScaleWidth(32)); - make.centerX.equalTo(self.bgView); - make.bottom.mas_equalTo(-kGetScaleWidth(84)); + make.top.mas_equalTo(68); + make.leading.mas_equalTo(32); + make.height.mas_equalTo(21); + }]; + [self.contentView1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.contentView.mas_bottom); + make.leading.mas_equalTo(48); + make.height.mas_equalTo(21); + }]; + [self.contentView2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.contentView1.mas_bottom).mas_offset(8); + make.leading.mas_equalTo(32); + make.height.mas_equalTo(21); }]; - [self.verifyBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.mas_equalTo(-kGetScaleWidth(24)); make.width.mas_equalTo(kGetScaleWidth(244)); @@ -218,4 +234,21 @@ } return _contentView; } +- (UILabel *)contentView1{ + if(!_contentView1){ + _contentView1 = [UILabel labelInitWithText:@"" font:kFontRegular(15) textColor:UIColorFromRGB(0x2B2D33)]; + _contentView1.textAlignment = NSTextAlignmentCenter; + _contentView1.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; + + } + return _contentView1; +} +- (UILabel *)contentView2{ + if(!_contentView2){ + _contentView2 = [UILabel labelInitWithText:@"" font:kFontRegular(15) textColor:UIColorFromRGB(0x2B2D33)]; + _contentView2.textAlignment = NSTextAlignmentCenter; + _contentView2.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; + } + return _contentView2; +} @end diff --git a/xplan-ios/Main/Room/View/AnimationView/XPRoomGameInviteBannerView.m b/xplan-ios/Main/Room/View/AnimationView/XPRoomGameInviteBannerView.m index eebf7dab..bc55e558 100644 --- a/xplan-ios/Main/Room/View/AnimationView/XPRoomGameInviteBannerView.m +++ b/xplan-ios/Main/Room/View/AnimationView/XPRoomGameInviteBannerView.m @@ -85,6 +85,7 @@ make.leading.equalTo(self.headVeiw.mas_trailing).mas_offset(kGetScaleWidth(10)); make.top.equalTo(self.nameView.mas_bottom).mas_offset(kGetScaleWidth(2)); make.height.mas_equalTo(kGetScaleWidth(17)); + }]; [self.gameIcomView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.height.mas_equalTo(kGetScaleWidth(16)); @@ -95,7 +96,7 @@ [self.gameTypeView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.equalTo(self.gameIcomView.mas_trailing).mas_offset(kGetScaleWidth(4)); make.centerY.equalTo(self.inviteView); - make.trailing.mas_greaterThanOrEqualTo(kGetScaleWidth(103)); + make.trailing.equalTo(self.inspectView.mas_leading).mas_offset(-kGetScaleWidth(5)); }]; } @@ -118,20 +119,53 @@ } -(void)setGameInfo:(UserGameInfoVo *)gameInfo{ _gameInfo = gameInfo; - _headVeiw.imageUrl = _gameInfo.toAvatar; - _nameView.text = _gameInfo.toNick; + _headVeiw.imageUrl = _gameInfo.fromAvatar; + _nameView.text = _gameInfo.fromNick; _gameIcomView.imageUrl = _gameInfo.gameLogo.length > 0 ? _gameInfo.gameLogo : _gameInfo.logo; _gameTypeView.text = _gameInfo.gameName; + _gameTypeView.text = @"拖泥带水清晨"; NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"邀请你玩 %@ 局",_gameInfo.inning] attributes:@{NSFontAttributeName:kFontRegular(12),NSForegroundColorAttributeName:[UIColor whiteColor]}]; [textAtt addAttributes:@{NSFontAttributeName:kFontBold(12),NSForegroundColorAttributeName:[UIColor whiteColor]} range:[textAtt.string rangeOfString:_gameInfo.inning]]; _inviteView.attributedText = textAtt; } +-(UIImage *)setBlurImage:(UIImage *)image{ + + + CIContext *context = [CIContext contextWithOptions:nil]; + CIImage * sourceImage = [CIImage imageWithCGImage:image.CGImage];//将图片转换成CIImage + + ///图片仿射滤镜 + + CIFilter * clamp = [CIFilter filterWithName:@"CIAffineClamp"];//设置绘制类型 + + [clamp setValue:sourceImage forKey:kCIInputImageKey];//设置要绘制的图片 + + CIImage *clampResult = [clamp valueForKey:kCIOutputImageKey]; + + ///高斯模糊滤镜 + + CIFilter* gaussianBlur = [CIFilter filterWithName:@"CIGaussianBlur"]; + + [gaussianBlur setValue:clampResult forKey:kCIInputImageKey]; + + [gaussianBlur setValue:[NSNumber numberWithFloat:1] forKey:@"inputRadius"];//设置模糊值 + + CIImage * gaussianBlurResult = [gaussianBlur valueForKey:kCIOutputImageKey]; + + ///转化获取图片 + + CGImageRef cgImage = [context createCGImage:gaussianBlurResult fromRect:[sourceImage extent]]; + + UIImage * resultImage = [UIImage imageWithCGImage:cgImage]; + return resultImage; + +} #pragma mark - 懒加载 - (UIImageView *)bgImageView{ if(!_bgImageView){ _bgImageView = [UIImageView new]; _bgImageView.userInteractionEnabled = YES; - _bgImageView.image = kImage(@"room_game_invite_banner_bg"); + _bgImageView.image = [self setBlurImage:kImage(@"room_game_invite_banner_bg")]; } return _bgImageView; } diff --git a/xplan-ios/Main/Tabbar/View/TabbarViewController.m b/xplan-ios/Main/Tabbar/View/TabbarViewController.m index f61232b8..e261c2ec 100644 --- a/xplan-ios/Main/Tabbar/View/TabbarViewController.m +++ b/xplan-ios/Main/Tabbar/View/TabbarViewController.m @@ -566,7 +566,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; [self.getKeyWindowNav.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if ([obj isKindOfClass:[SessionViewController class]]) { SessionViewController *chatVC = (SessionViewController *)obj; - if(![gameInfo.fromUid isEqualToString:chatVC.session.sessionId]){ + if(![gameInfo.toUid isEqualToString:chatVC.session.sessionId]){ isInChat = YES; } *stop = YES; @@ -591,10 +591,11 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; } #pragma mark - XPRoomGameInviteBannerViewDelegate -(void)sendGameInviteMessageWithGameInfo:(UserGameInfoVo *)gameInfo{ + NSString * sessionId = [NSString stringWithFormat:@"%@",gameInfo.fromUid]; NIMSession * session = [NIMSession session:sessionId type:NIMSessionTypeP2P]; SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session]; - [self.navigationController pushViewController:sessionVC animated:YES]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:sessionVC animated:YES]; } - (UINavigationController *)getKeyWindowNav { if ([XCCurrentVCStackManager shareManager].getCurrentVC) {