修复bug

This commit is contained in:
liyuhua
2023-12-27 16:13:11 +08:00
parent 6deb0573ab
commit 71a8a4067f
34 changed files with 693 additions and 253 deletions

View File

@@ -209,10 +209,10 @@
23844FB62B3932D9002AD661 /* MewMainHomeMakeFriendModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23844FB52B3932D9002AD661 /* MewMainHomeMakeFriendModel.m */; };
23844FBB2B39892B002AD661 /* MewMainHomeLittleGameInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23844FBA2B39892B002AD661 /* MewMainHomeLittleGameInfoModel.m */; };
23844FBE2B398F18002AD661 /* MewMainHomeMoreGameModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23844FBD2B398F18002AD661 /* MewMainHomeMoreGameModel.m */; };
23844FC12B3A6DAA002AD661 /* MewMainHomeMakeFriendEmptyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23844FC02B3A6DAA002AD661 /* MewMainHomeMakeFriendEmptyCell.m */; };
23844FC42B3AACB7002AD661 /* MewRefreshSvgaHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 23844FC32B3AACB7002AD661 /* MewRefreshSvgaHeader.m */; };
23844FC62B3AADA8002AD661 /* kMewMainHomePlayVoice.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23844FC52B3AADA8002AD661 /* kMewMainHomePlayVoice.svga */; };
23844FC82B3AADC5002AD661 /* kMewMainHoemloading.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23844FC72B3AADC5002AD661 /* kMewMainHoemloading.svga */; };
23844FCB2B3AC267002AD661 /* MewMineUserInfoOnRoomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23844FCA2B3AC267002AD661 /* MewMineUserInfoOnRoomView.m */; };
23CEFB692AFB32BE00576D89 /* XPRoomAnimationTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFB682AFB32BE00576D89 /* XPRoomAnimationTool.m */; };
23E1708C2AED2E080039DE62 /* YYTextAsyncLayer+XPTextAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E1708B2AED2E080039DE62 /* YYTextAsyncLayer+XPTextAsyncLayer.m */; };
23F8BFF82A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F8BFF72A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m */; };
@@ -1801,12 +1801,12 @@
23844FBA2B39892B002AD661 /* MewMainHomeLittleGameInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewMainHomeLittleGameInfoModel.m; sourceTree = "<group>"; };
23844FBC2B398F18002AD661 /* MewMainHomeMoreGameModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewMainHomeMoreGameModel.h; sourceTree = "<group>"; };
23844FBD2B398F18002AD661 /* MewMainHomeMoreGameModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewMainHomeMoreGameModel.m; sourceTree = "<group>"; };
23844FBF2B3A6DAA002AD661 /* MewMainHomeMakeFriendEmptyCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewMainHomeMakeFriendEmptyCell.h; sourceTree = "<group>"; };
23844FC02B3A6DAA002AD661 /* MewMainHomeMakeFriendEmptyCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewMainHomeMakeFriendEmptyCell.m; sourceTree = "<group>"; };
23844FC22B3AACB7002AD661 /* MewRefreshSvgaHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewRefreshSvgaHeader.h; sourceTree = "<group>"; };
23844FC32B3AACB7002AD661 /* MewRefreshSvgaHeader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewRefreshSvgaHeader.m; sourceTree = "<group>"; };
23844FC52B3AADA8002AD661 /* kMewMainHomePlayVoice.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = kMewMainHomePlayVoice.svga; sourceTree = "<group>"; };
23844FC72B3AADC5002AD661 /* kMewMainHoemloading.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = kMewMainHoemloading.svga; sourceTree = "<group>"; };
23844FC92B3AC267002AD661 /* MewMineUserInfoOnRoomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewMineUserInfoOnRoomView.h; sourceTree = "<group>"; };
23844FCA2B3AC267002AD661 /* MewMineUserInfoOnRoomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewMineUserInfoOnRoomView.m; sourceTree = "<group>"; };
23CEFB672AFB32BE00576D89 /* XPRoomAnimationTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomAnimationTool.h; sourceTree = "<group>"; };
23CEFB682AFB32BE00576D89 /* XPRoomAnimationTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomAnimationTool.m; sourceTree = "<group>"; };
23E1708A2AED2E080039DE62 /* YYTextAsyncLayer+XPTextAsyncLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "YYTextAsyncLayer+XPTextAsyncLayer.h"; path = "xplan-ios/Appdelegate/YYTextAsyncLayer+XPTextAsyncLayer.h"; sourceTree = SOURCE_ROOT; };
@@ -4924,8 +4924,6 @@
231EBB562B3532E4006F782E /* MewMainHomeMakeFriendHeadCell.m */,
231EBB582B355D9D006F782E /* MewMainHomeMakeFriendCell.h */,
231EBB592B355D9D006F782E /* MewMainHomeMakeFriendCell.m */,
23844FBF2B3A6DAA002AD661 /* MewMainHomeMakeFriendEmptyCell.h */,
23844FC02B3A6DAA002AD661 /* MewMainHomeMakeFriendEmptyCell.m */,
23844FAE2B3927B3002AD661 /* MewMainHomeMoreGameHeadCell.h */,
23844FAF2B3927B3002AD661 /* MewMainHomeMoreGameHeadCell.m */,
23844FB12B392A7B002AD661 /* MewMainHomeMoreGameCell.h */,
@@ -8071,6 +8069,8 @@
E8EEB8FD26FC2DF8007C6EBA /* XPMineUserInfoCustomNavView.m */,
E88B5CC326FB42B000DA9178 /* XPMineUserInfoHeaderView.h */,
E88B5CC426FB42B000DA9178 /* XPMineUserInfoHeaderView.m */,
23844FC92B3AC267002AD661 /* MewMineUserInfoOnRoomView.h */,
23844FCA2B3AC267002AD661 /* MewMineUserInfoOnRoomView.m */,
237B89E02A935701005DB380 /* XPMinePlaceOrderView.h */,
237B89E12A935701005DB380 /* XPMinePlaceOrderView.m */,
237B89E62A93574C005DB380 /* XPMinePlaceOrderCell.h */,
@@ -10491,6 +10491,7 @@
E8664EDF27E45EC7000171BA /* XPRoomPKRecordPresenter.m in Sources */,
E81C27A226EF23490031E639 /* XPEnum.h in Sources */,
9B9BBF7F288F8D4E004E2E74 /* XPFootPrintNavView.m in Sources */,
23844FCB2B3AC267002AD661 /* MewMineUserInfoOnRoomView.m in Sources */,
E80E900C27E0358900434B90 /* XPRoomTopicAlertView.m in Sources */,
9BB54966278303EB0090CD26 /* XPNobleCenterNavView.m in Sources */,
9B92A36327980DCC00AD168F /* Api+SkillCard.m in Sources */,
@@ -10585,7 +10586,6 @@
E80EC80B28ACD84000D133C5 /* QInputBarViewConfiguration.m in Sources */,
231EBB2C2B32EFE3006F782E /* MewMainHomePartyHeadView.m in Sources */,
E880B39E278BD49E00A83B0D /* XPAcrossRoomPKViewController.m in Sources */,
23844FC12B3A6DAA002AD661 /* MewMainHomeMakeFriendEmptyCell.m in Sources */,
E8AC723D26F4B6AA007D6E91 /* XPLoginBindPhoneResultViewController.m in Sources */,
E800806527FD37A20055A8AB /* XPGuildHeaderView.m in Sources */,
9B2A12D52783EEC700CED41B /* XPNobleCenterTableHeadView.m in Sources */,

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mew_main_home_friend_empty_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mew_main_home_friend_empty_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mew_mine_user_info_chat_arrow@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mew_mine_user_info_chat_arrow@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mew_mine_user_info_in_room_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mew_mine_user_info_in_room_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -46,7 +46,14 @@
/// @param complection
/// @param gender . 1: 2: null:
+ (void)mew_RequestMainHomeNewFriendListcomplection:(HttpRequestHelperCompletion)complection gender:(NSString *)gender gameId:(NSString *)gameId{
[self makeRequest:@"home/newFriend" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, gender,gameId, nil];
if(gender == nil && gameId != nil){
[self makeRequest:@"home/newFriend" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,gameId, nil];
}else if(gender != nil && gameId == nil){
[self makeRequest:@"home/newFriend" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, gender, nil];
}else{
[self makeRequest:@"home/newFriend" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, gender,gameId, nil];
}
}
///
+(void)mew_RequestMainHomeGameTabList:(HttpRequestHelperCompletion)complection{

View File

@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *tagPict;
///平台id
@property (nonatomic,copy) NSString *erbanNo;
///是否需要开自己的房间
@property(nonatomic,assign) BOOL needOpenSelfRoom;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,16 +0,0 @@
//
// MewMainHomeMakeFriendEmptyCell.h
// xplan-ios
//
// Created by duoban on 2023/12/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface MewMainHomeMakeFriendEmptyCell : UICollectionViewCell
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,97 +0,0 @@
//
// MewMainHomeMakeFriendEmptyCell.m
// xplan-ios
//
// Created by duoban on 2023/12/26.
//
#import "MewMainHomeMakeFriendEmptyCell.h"
@interface MewMainHomeMakeFriendEmptyCell()
@property(nonatomic,strong) UIImageView *mewIconView;
@property(nonatomic,strong) UILabel *mewTitleView;
@property(nonatomic,strong) UIView *mewHintBgView;
@property(nonatomic,strong) UIView *mewLineView;
@property(nonatomic,strong) UILabel *mewHintTextView;
@end
@implementation MewMainHomeMakeFriendEmptyCell
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self installUI];
[self installConstraints];
}
return self;
}
-(void)installUI{
[self.contentView addSubview:self.mewIconView];
[self.contentView addSubview:self.mewTitleView];
[self.contentView addSubview:self.mewHintBgView];
[self.mewHintBgView addSubview:self.mewLineView];
[self.mewHintBgView addSubview:self.mewHintTextView];
}
-(void)installConstraints{
[self.mewIconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(159));
make.height.mas_equalTo(kGetScaleWidth(138));
make.top.mas_equalTo(kGetScaleWidth(14));
make.centerX.equalTo(self.contentView);
}];
[self.mewTitleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mewIconView.mas_bottom).mas_offset(kGetScaleWidth(3));
make.centerX.equalTo(self.contentView);
make.height.mas_equalTo(kGetScaleWidth(20));
}];
[self.mewHintBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mewTitleView.mas_bottom).mas_offset(kGetScaleWidth(28));
make.height.mas_equalTo(kGetScaleWidth(48));
make.leading.trailing.equalTo(self.contentView).inset(kGetScaleWidth(0));
}];
[self.mewLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.equalTo(self.contentView).inset(kGetScaleWidth(28));
make.height.mas_equalTo(kGetScaleWidth(1));
make.centerY.equalTo(self.mewHintBgView);
}];
[self.mewHintTextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(96));
make.center.equalTo(self.mewHintBgView);
make.height.mas_equalTo(kGetScaleWidth(20));
}];
}
#pragma mark -
- (UIImageView *)mewIconView{
if(!_mewIconView){
_mewIconView = [UIImageView new];
_mewIconView.image = kImage(@"mew_main_home_friend_empty_icon");
}
return _mewIconView;
}
- (UILabel *)mewTitleView{
if(!_mewTitleView){
_mewTitleView = [UILabel labelInitWithText:@"暂未找到合适的伙伴" font:kFontRegular(14) textColor:UIColorFromRGB(0x696D7A)];
}
return _mewTitleView;
}
- (UIView *)mewHintBgView{
if(!_mewHintBgView){
_mewHintBgView = [UIView new];
_mewHintBgView.backgroundColor = [UIColor whiteColor];
}
return _mewHintBgView;
}
- (UIView *)mewLineView{
if(!_mewLineView){
_mewLineView = [UIView new];
_mewLineView.backgroundColor = UIColorFromRGB(0xE9EBF2);
}
return _mewLineView;
}
- (UILabel *)mewHintTextView{
if(!_mewHintTextView){
_mewHintTextView = [UILabel labelInitWithText:@"大神推荐" font:kFontMedium(14) textColor:UIColorFromRGB(0x2B2D33)];
_mewHintTextView.textAlignment = NSTextAlignmentCenter;
_mewHintTextView.backgroundColor = [UIColor whiteColor];
}
return _mewHintTextView;
}
@end

View File

@@ -120,10 +120,12 @@
[self.mewMaskView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.mewBgImageView);
}];
[self.mewTagView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(46));
make.height.mas_equalTo(kGetScaleWidth(18));
make.top.leading.mas_equalTo(kGetScaleWidth(6));
make.top.mas_equalTo(kGetScaleWidth(14));
make.leading.mas_equalTo(kGetScaleWidth(6));
}];
[self.mewHeatGifView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(6));

View File

@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
#import "MewMainHomeMenuInfoModel.h"
#import "MewMainHomeGameTabModel.h"
@class MewMainHomeMakeFriendModel,MewMainHomeMakeFriendCell;
typedef enum : NSUInteger {
MewMainHomeMakeFriendHeadViewTyep_Game_Select,
MewMainHomeMakeFriendHeadViewTyep_Game_No_Select,
@@ -24,10 +24,18 @@ NS_ASSUME_NONNULL_BEGIN
-(void)mew_selectOneClickMatchingAction:(MewMainHomeMenuInfoModel *_Nullable)menuInfo;
///选择游戏
-(void)mew_selectGameFriendAction:(MewMainHomeGameTabModel *_Nullable)gameInfo type:(MewMainHomeMakeFriendHeadViewType)type sender:(UILabel *_Nullable)sender;
///点击播放声音
-(void)mew_clickMahoganyPlayVoiceActionWithCell:(MewMainHomeMakeFriendCell *)cell model:(MewMainHomeMakeFriendModel *)model isPlay:(BOOL)isPlay;
///点击房间
-(void)mew_clickMahoganyRoomBtnActionWithModel:(MewMainHomeMakeFriendModel *)model;
///点击头像
-(void)mew_clickMahoganyAvatarBtnActionWithModel:(MewMainHomeMakeFriendModel *)model;
@end
@interface MewMainHomeMakeFriendHeadView : UICollectionReusableView
@property(nonatomic,assign) BOOL isHiddenMahogany;
@property(nonatomic,assign) BOOL isNoChooseSex;
@property(nonatomic,strong) NSMutableArray *mewGameList;
@property(nonatomic,copy) NSArray *mewMahoganyList;
@property(nonatomic,strong) MewMainHomeMenuInfoModel *mewMeunInfo;
@property(nonatomic,weak) id<MewMainHomeMakeFriendHeadViewDelegate>delegate;
@end

View File

@@ -7,7 +7,9 @@
#import "MewMainHomeMakeFriendHeadView.h"
#import "MewMainHomeMakeFriendHeadCell.h"
@interface MewMainHomeMakeFriendHeadView()<UICollectionViewDelegate,UICollectionViewDataSource>
#import "MewMainHomeMakeFriendCell.h"
@interface MewMainHomeMakeFriendHeadView()<MewMainHomeMakeFriendCellDelegate,UICollectionViewDelegate,UICollectionViewDataSource>
///
@property(nonatomic,strong) NetImageView *mewMahoganyView;
///
@@ -26,6 +28,16 @@
@property(nonatomic,strong) UIButton *mewSelecteBtn;
@property(nonatomic,strong) UIImageView *mewSelecteImage;
@property(nonatomic,strong) UILabel *mewTitleView;
@property(nonatomic,strong) UIImageView *mewIconView;
@property(nonatomic,strong) UILabel *mewTipsView;
@property(nonatomic,strong) UIImageView *mewHintBgView;
@property(nonatomic,strong) UIView *mewLineView;
@property(nonatomic,strong) UILabel *mewHintTextView;
@property(nonatomic,strong) MewMainHomeMakeFriendCell *mewLeftView;
@property(nonatomic,strong) MewMainHomeMakeFriendCell *mewRightView;
@end
@implementation MewMainHomeMakeFriendHeadView
-(instancetype)initWithFrame:(CGRect)frame{
@@ -50,6 +62,21 @@
[self.mewSelecteBGView addSubview:self.mewSelecteTextView];
[self.mewSelecteBGView addSubview:self.mewSelecteImage];
[self.mewSelecteBGView addSubview:self.mewSelecteBtn];
[self addSubview:self.mewIconView];
[self addSubview:self.mewTipsView];
[self addSubview:self.mewHintBgView];
[self.mewHintBgView addSubview:self.mewLineView];
[self.mewHintBgView addSubview:self.mewHintTextView];
[self addSubview:self.mewLeftView];
[self addSubview:self.mewRightView];
}
- (void)setIsHiddenMahogany:(BOOL)isHiddenMahogany{
_isHiddenMahogany = isHiddenMahogany;
self.mewIconView.hidden = _isHiddenMahogany;
self.mewTipsView.hidden = _isHiddenMahogany;
self.mewHintBgView.hidden = _isHiddenMahogany;
}
-(void)installConstraints{
[self.mewMahoganyView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -112,6 +139,61 @@
make.edges.equalTo(self.mewChangeBGView);
}];
[self.mewIconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(159));
make.height.mas_equalTo(kGetScaleWidth(138));
make.top.equalTo(self.mewChangeBtn.mas_bottom).mas_offset(kGetScaleWidth(24));
make.centerX.equalTo(self);
}];
[self.mewTipsView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mewIconView.mas_bottom).mas_offset(kGetScaleWidth(3));
make.centerX.equalTo(self);
make.height.mas_equalTo(kGetScaleWidth(20));
}];
[self.mewHintBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mewTipsView.mas_bottom).mas_offset(kGetScaleWidth(28));
make.height.mas_equalTo(kGetScaleWidth(110));
make.leading.trailing.equalTo(self);
}];
[self.mewLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.equalTo(self).inset(kGetScaleWidth(28));
make.height.mas_equalTo(kGetScaleWidth(1));
make.top.mas_equalTo(kGetScaleWidth(21));
}];
[self.mewHintTextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(96));
make.top.mas_equalTo(kGetScaleWidth(12));
make.centerX.equalTo(self.mewHintBgView);
make.height.mas_equalTo(kGetScaleWidth(20));
}];
[self.mewLeftView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mewHintBgView.mas_top).mas_offset(kGetScaleWidth(48));
make.leading.mas_equalTo(kGetScaleWidth(15));
make.width.mas_equalTo(kGetScaleWidth(168));
make.height.mas_equalTo(kGetScaleWidth(184));
}];
[self.mewRightView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mewHintBgView.mas_top).mas_offset(kGetScaleWidth(48));
make.right.mas_equalTo(-kGetScaleWidth(15));
make.width.mas_equalTo(kGetScaleWidth(168));
make.height.mas_equalTo(kGetScaleWidth(184));
}];
}
- (void)setMewMahoganyList:(NSArray *)mewMahoganyList{
_mewMahoganyList = mewMahoganyList;
self.mewLeftView.hidden = YES;
self.mewRightView.hidden = YES;
if(_mewMahoganyList.count == 1){
self.mewLeftView.hidden = NO;
self.mewLeftView.friendModel = _mewMahoganyList[0];
}else if(_mewMahoganyList.count == 2){
self.mewLeftView.hidden = NO;
self.mewRightView.hidden = NO;
self.mewLeftView.friendModel = _mewMahoganyList[0];
self.mewRightView.friendModel = _mewMahoganyList[1];
}
}
-(void)setMewMeunInfo:(MewMainHomeMenuInfoModel *)mewMeunInfo{
_mewMeunInfo = mewMeunInfo;
@@ -192,6 +274,25 @@
[self.delegate mew_selectGameFriendAction:nil type:MewMainHomeMakeFriendHeadViewTyep_Sex sender:self.mewSelecteTextView];
}
}
#pragma mark- MewMainHomeMakeFriendCellDelegate
///
-(void)mew_clickPlayVoiceActionWithCell:(MewMainHomeMakeFriendCell *)cell model:(MewMainHomeMakeFriendModel *)model isPlay:(BOOL)isPlay{
if(self.delegate && [self.delegate respondsToSelector:@selector(mew_clickMahoganyPlayVoiceActionWithCell:model:isPlay:)]){
[self.delegate mew_clickMahoganyPlayVoiceActionWithCell:cell model:model isPlay:isPlay];
}
}
///
-(void)mew_clickRoomBtnActionWithModel:(MewMainHomeMakeFriendModel *)model{
if(self.delegate && [self.delegate respondsToSelector:@selector(mew_clickMahoganyRoomBtnActionWithModel:)]){
[self.delegate mew_clickMahoganyRoomBtnActionWithModel:model];
}
}
///
-(void)mew_clickAvatarBtnActionWithModel:(MewMainHomeMakeFriendModel *)model{
if(self.delegate && [self.delegate respondsToSelector:@selector(mew_clickMahoganyAvatarBtnActionWithModel:)]){
[self.delegate mew_clickMahoganyAvatarBtnActionWithModel:model];
}
}
#pragma mark -
- (NetImageView *)mewMahoganyView{
if(!_mewMahoganyView){
@@ -227,9 +328,13 @@
layout.sectionInset = UIEdgeInsetsMake(0, kGetScaleWidth(12), 0, kGetScaleWidth(12));
layout.minimumLineSpacing = 0;
layout.minimumInteritemSpacing = 0;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
_mewCollectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:layout];
_mewCollectionView.delegate = self;
_mewCollectionView.dataSource = self;
_mewCollectionView.tag = 4999;
_mewCollectionView.showsVerticalScrollIndicator = NO;
_mewCollectionView.showsHorizontalScrollIndicator = NO;
_mewCollectionView.backgroundColor = [UIColor clearColor];
[_mewCollectionView registerClass:[MewMainHomeMakeFriendHeadCell class] forCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendHeadCell class])];
}
@@ -303,4 +408,60 @@
}
return _mewTitleView;
}
- (UIImageView *)mewIconView{
if(!_mewIconView){
_mewIconView = [UIImageView new];
_mewIconView.image = kImage(@"mew_main_home_friend_empty_icon");
_mewIconView.hidden = YES;
}
return _mewIconView;
}
- (UILabel *)mewTipsView{
if(!_mewTipsView){
_mewTipsView = [UILabel labelInitWithText:@"暂未找到合适的伙伴" font:kFontRegular(14) textColor:UIColorFromRGB(0x696D7A)];
_mewTipsView.hidden = YES;
}
return _mewTipsView;
}
- (UIImageView *)mewHintBgView{
if(!_mewHintBgView){
_mewHintBgView = [UIImageView new];
_mewHintBgView.image = kImage(@"mew_main_home_friend_empty_bg");
_mewHintBgView.hidden = YES;
}
return _mewHintBgView;
}
- (UIView *)mewLineView{
if(!_mewLineView){
_mewLineView = [UIView new];
_mewLineView.backgroundColor = UIColorFromRGB(0xE9EBF2);
}
return _mewLineView;
}
- (UILabel *)mewHintTextView{
if(!_mewHintTextView){
_mewHintTextView = [UILabel labelInitWithText:@"大神推荐" font:kFontMedium(14) textColor:UIColorFromRGB(0x2B2D33)];
_mewHintTextView.textAlignment = NSTextAlignmentCenter;
_mewHintTextView.backgroundColor = [UIColor whiteColor];
}
return _mewHintTextView;
}
- (MewMainHomeMakeFriendCell *)mewLeftView{
if(!_mewLeftView){
_mewLeftView = [[MewMainHomeMakeFriendCell alloc]initWithFrame:CGRectZero];
_mewLeftView.hidden = YES;
_mewLeftView.delegate = self;
}
return _mewLeftView;
}
- (MewMainHomeMakeFriendCell *)mewRightView{
if(!_mewRightView){
_mewRightView = [[MewMainHomeMakeFriendCell alloc]initWithFrame:CGRectZero];
_mewRightView.hidden = YES;
_mewRightView.delegate = self;
}
return _mewRightView;
}
@end

View File

@@ -39,14 +39,14 @@
-(void)installConstraints{
[self.mewSvgaView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self);
make.width.height.mas_equalTo(kGetScaleWidth(68));
make.width.height.mas_equalTo(68);
}];
}
#pragma mark -
- (void)prepare
{
[super prepare];
self.mj_h = kGetScaleWidth(68);
self.mj_h = 68;
}
- (void)placeSubviews {

View File

@@ -26,15 +26,20 @@
#import "XPSkillCardPlayerManager.h"
#import "UploadFile.h"
#import "XPMineUserInfoViewController.h"
#import "MewMainHomeMakeFriendEmptyCell.h"
@interface MewMainHomeMakeFriendVC ()<MewMainHomeMakeFriendHeadViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,XPHomeRecommendOtherRoomViewDelegate,MewMainHomeMakeFriendCellDelegate,CountDownHelperDelegate>
///CollectionView
@property(nonatomic,strong) UICollectionView *mewCollectionView;
///
@property(nonatomic,strong) NSMutableArray *mewFriendList;
///
@property(nonatomic,strong) NSMutableArray *mewRecommendList;
///
@property(nonatomic,strong) NSMutableArray *mewHeadList;
//
@property(nonatomic,strong) NSMutableArray *mewTabList;
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
@property(nonatomic,strong) MewMainHomeMenuInfoModel *mewMenuInfo;
@property(nonatomic,strong) MewMainHomeMakeFriendCell *mewPlayCell;
@property(nonatomic,copy) NSString *gameId;
@@ -139,7 +144,25 @@
}
///
-(void)mew_RequestMainHomeFriendMahoganyListSuccess:(NSArray *)list{
self.mewRecommendList = [NSMutableArray arrayWithArray:list];
if(list.count == 0){
self.mewHeadList = [NSMutableArray array];;
self.mewRecommendList = [NSMutableArray array];
}else if(list.count < 3){
self.mewHeadList = [NSMutableArray arrayWithArray:list];
self.mewRecommendList = [NSMutableArray array];
}else {
self.mewHeadList = [NSMutableArray array];
self.mewRecommendList = [NSMutableArray array];
for (int i = 0; i < list.count; i++) {
if(i < 2){
[self.mewHeadList addObject:list[i]];
}else{
[self.mewRecommendList addObject:list[i]];
}
}
}
}
///
-(void)mew_getMainHomeGameTabList:(NSArray *)list{
@@ -182,6 +205,20 @@
}
#pragma mark - MewMainHomeMakeFriendHeadViewDelegate
///
-(void)mew_clickMahoganyPlayVoiceActionWithCell:(MewMainHomeMakeFriendCell *)cell model:(MewMainHomeMakeFriendModel *)model isPlay:(BOOL)isPlay{
[self mew_clickPlayVoiceActionWithCell:cell model:model isPlay:isPlay];
}
///
-(void)mew_clickMahoganyRoomBtnActionWithModel:(MewMainHomeMakeFriendModel *)model{
[self mew_clickRoomBtnActionWithModel:model];
}
///
-(void)mew_clickMahoganyAvatarBtnActionWithModel:(MewMainHomeMakeFriendModel *)model{
[self mew_clickAvatarBtnActionWithModel:model];
}
///
-(void)mew_selectGodFlightAction:(MewMainHomeMenuInfoModel *_Nullable)menuInfo{
if (menuInfo.resourceType == MewMainHomeMenuInfoModelType_H5) {
@@ -194,6 +231,10 @@
[Api mew_RequestMainHomePickResource:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
MewMainHomeMenuDataModel * sourceModel = [MewMainHomeMenuDataModel modelWithDictionary:data.data];
if(sourceModel.needOpenSelfRoom == YES){
[self mew_clickMyRoom:[AccountInfoStorage instance].getUid];
return;
}
if (sourceModel.isPick) {
if([sourceModel.uid isEqualToString:[AccountInfoStorage instance].getUid]){
[self mew_clickMyRoom:sourceModel.uid];
@@ -395,20 +436,23 @@
#pragma mark- UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if(self.gameId != nil && self.mewFriendList.count == 0){
return self.mewRecommendList.count + 1;
return self.mewRecommendList.count > 0 ? self.mewRecommendList.count : 1 ;
}
return self.mewFriendList.count > 0 ? self.mewFriendList.count : 1;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
if(self.gameId != nil && self.mewFriendList.count == 0){
return self.mewHeadList.count > 0 ? CGSizeMake(0, kGetScaleWidth(206)+ kGetScaleWidth(445)) : CGSizeMake(0, kGetScaleWidth(206)+kGetScaleWidth(326));
}
return CGSizeMake(0, kGetScaleWidth(206));
}
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
if(self.gameId != nil && self.mewFriendList.count == 0){
return indexPath.row == 0 ? CGSizeMake(KScreenWidth, 255):CGSizeMake(kGetScaleWidth(168), kGetScaleWidth(184));
return self.mewRecommendList.count == 0 ? CGSizeMake(KScreenWidth, 300):CGSizeMake(kGetScaleWidth(168), kGetScaleWidth(184));
}
return self.mewFriendList.count == 0 ? CGSizeMake(KScreenWidth, 150):CGSizeMake(kGetScaleWidth(168), kGetScaleWidth(184));
}
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
if(kind == UICollectionElementKindSectionHeader){
@@ -417,7 +461,13 @@
headView.mewMeunInfo = self.mewMenuInfo;
headView.mewGameList = self.mewTabList;
headView.delegate = self;
if(self.gameId != nil && self.mewFriendList.count == 0){
headView.isHiddenMahogany = NO;
headView.mewMahoganyList = self.mewHeadList;
}else{
headView.isHiddenMahogany = YES;
headView.mewMahoganyList = @[];
}
return headView;
}
@@ -427,14 +477,12 @@
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
///gameIdmewRecommendList
if(self.gameId != nil && self.mewFriendList.count == 0){
if(indexPath.row == 0){
MewMainHomeMakeFriendEmptyCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendEmptyCell class]) forIndexPath:indexPath];
return cell;
if(self.mewRecommendList.count == 0){
XPHomeListEmptyCollectionViewCell * emptyCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeListEmptyCollectionViewCell class]) forIndexPath:indexPath];
return emptyCell;
}
MewMainHomeMakeFriendCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendCell class]) forIndexPath:indexPath];
cell.friendModel = [self.mewRecommendList safeObjectAtIndex1:indexPath.row];
cell.delegate = self;
@@ -486,7 +534,7 @@
[_mewCollectionView registerClass:[XPHomeListEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPHomeListEmptyCollectionViewCell class])];
[_mewCollectionView registerClass:[MewMainHomeMakeFriendHeadView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendHeadView class])];
[_mewCollectionView registerClass:[MewMainHomeMakeFriendCell class] forCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendCell class])];
[_mewCollectionView registerClass:[MewMainHomeMakeFriendEmptyCell class] forCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendEmptyCell class])];
}
return _mewCollectionView;

View File

@@ -85,6 +85,10 @@
[Api mew_RequestMainHomePickResource:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
MewMainHomeMenuDataModel * sourceModel = [MewMainHomeMenuDataModel modelWithDictionary:data.data];
if(sourceModel.needOpenSelfRoom == YES){
[self mew_clickMyRoom:[AccountInfoStorage instance].getUid];
return;
}
if (sourceModel.isPick) {
if([sourceModel.uid isEqualToString:[AccountInfoStorage instance].getUid]){
[self mew_clickMyRoom:sourceModel.uid];

View File

@@ -151,7 +151,11 @@
[Api mew_RequestMainHomePickResource:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
MewMainHomeMenuDataModel * sourceModel = [MewMainHomeMenuDataModel modelWithDictionary:data.data];
if (sourceModel.isPick) {
if(sourceModel.needOpenSelfRoom == YES){
[self mew_clickMyRoom:[AccountInfoStorage instance].getUid];
return;
}
if (sourceModel.isPick == YES ) {
if([sourceModel.uid isEqualToString:[AccountInfoStorage instance].getUid]){
[self mew_clickMyRoom:sourceModel.uid];
return;

View File

@@ -179,7 +179,7 @@
- (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
///1000scrollView 1001collectionView 9999
if (otherGestureRecognizer.view.tag == 1000 || otherGestureRecognizer.view.tag == 1001 || otherGestureRecognizer.view.tag == 9999) {
if (otherGestureRecognizer.view.tag == 1000 || otherGestureRecognizer.view.tag == 1001 || otherGestureRecognizer.view.tag == 9999 || otherGestureRecognizer.view.tag == 4999) {
return NO;
}
return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]];
@@ -260,7 +260,7 @@
_mewTopTitleView.titleSelectedFont = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
_mewTopTitleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_mewTopTitleView.contentScrollViewClickTransitionAnimationEnabled = NO;
if([ClientConfig shareConfig].defaultTab.intValue == 1){
if([ClientConfig shareConfig].defaultTab.intValue == 2){
_mewTopTitleView.defaultSelectedIndex = 1;
}else{
_mewTopTitleView.defaultSelectedIndex = 0;

View File

@@ -420,9 +420,9 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
return;
}
if (value > 0) {
[self.tabBarController.tabBar.items[3] setBadgeValue:[NSString stringWithFormat:@"%ld", value]];
[self.tabBarController.tabBar.items[2] setBadgeValue:[NSString stringWithFormat:@"%ld", value]];
} else {
[self.tabBarController.tabBar.items[3] setBadgeValue:nil];
[self.tabBarController.tabBar.items[2] setBadgeValue:nil];
}
}

View File

@@ -357,6 +357,7 @@
if (userInfo.uid == self.uid) {
self.userInfo = userInfo;
self.headView.userInfo = userInfo;
[self.pagingView resizeTableHeaderViewHeightWithAnimatable:NO duration:0 curve:0];
} else {
if (!userInfo.userVipInfoVO.lookHomepageHide) {
@@ -370,7 +371,7 @@
self.userDataVC.userInfo = userInfo;
self.monentsVC.dynamicInfo = userInfo.dynamicInfo;
self.headView.roomUid = userInfo.roomUid;
self.headView.mewDetailModel = userInfo;
if(userInfo.userGamePartner.count > 0){
self.banButton.hidden = NO;
self.gameVC.gameList = userInfo.userGamePartner;

View File

@@ -0,0 +1,21 @@
//
// MewMineUserInfoOnRoomView.h
// xplan-ios
//
// Created by duoban on 2023/12/26.
//
#import <UIKit/UIKit.h>
@class MewMineUserInfoOnRoomView;
NS_ASSUME_NONNULL_BEGIN
@protocol MewMineUserInfoOnRoomViewDelegate <NSObject>
-(void)mew_didClickRoomAction;
@end
@interface MewMineUserInfoOnRoomView : UIView
@property(nonatomic,copy) NSString *text;
@property(nonatomic,weak) id<MewMineUserInfoOnRoomViewDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,125 @@
//
// MewMineUserInfoOnRoomView.m
// xplan-ios
//
// Created by duoban on 2023/12/26.
//
#import "MewMineUserInfoOnRoomView.h"
#import <SDWebImageFLPlugin/SDWebImageFLPlugin.h>
@interface MewMineUserInfoOnRoomView()
///
@property(nonatomic,strong) UIImageView *mewBgImageView;
///
@property(nonatomic,strong) FLAnimatedImageView *mewHeatGifView;
///
@property(nonatomic,strong) UILabel *mewInRoomView;
//
@property(nonatomic,strong) UILabel *mewRoomTextVeiw;
//
@property(nonatomic,strong) UIButton *mewChatBtn;
@end
@implementation MewMineUserInfoOnRoomView
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self installUI];
[self installConstraints];
}
return self;
}
-(void)installUI{
[self addSubview:self.mewBgImageView];
[self addSubview:self.mewHeatGifView];
[self addSubview:self.mewInRoomView];
[self addSubview:self.mewRoomTextVeiw];
[self addSubview:self.mewChatBtn];
}
-(void)installConstraints{
[self.mewBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
[self.mewHeatGifView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(10);
make.height.mas_equalTo(9);
make.left.mas_equalTo(16);
make.top.mas_equalTo(10);
}];
[self.mewInRoomView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(7);
make.left.mas_equalTo(30);
make.height.mas_equalTo(14);
}];
[self.mewRoomTextVeiw mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.mas_equalTo(22);
make.height.mas_equalTo(17);
}];
[self.mewChatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(62);
make.right.mas_equalTo(-16);
make.height.mas_equalTo(24);
make.top.mas_equalTo(12);
}];
}
-(void)setText:(NSString *)text{
_text = text;
_mewRoomTextVeiw.text = text;
}
-(void)mew_didClickRoomSender{
if(self.delegate && [self.delegate respondsToSelector:@selector(mew_didClickRoomAction)]){
[self.delegate mew_didClickRoomAction];
}
}
#pragma mark -
- (UIImageView *)mewBgImageView{
if(!_mewBgImageView){
_mewBgImageView = [UIImageView new];
_mewBgImageView.image = kImage(@"mew_mine_user_info_in_room_bg");
_mewBgImageView.userInteractionEnabled = YES;
_mewBgImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _mewBgImageView;
}
- (UILabel *)mewInRoomView{
if(!_mewInRoomView){
_mewInRoomView = [UILabel labelInitWithText:@"正在房间" font:[UIFont systemFontOfSize:10 weight:UIFontWeightRegular] textColor:[UIColor whiteColor]];
}
return _mewInRoomView;
}
- (UILabel *)mewRoomTextVeiw{
if(!_mewRoomTextVeiw){
_mewRoomTextVeiw = [UILabel labelInitWithText:@"" font:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium] textColor:[UIColor whiteColor]];
}
return _mewRoomTextVeiw;
}
- (UIButton *)mewChatBtn{
if(!_mewChatBtn){
_mewChatBtn = [UIButton new];
[_mewChatBtn setTitle:@"热聊中" forState:UIControlStateNormal];
[_mewChatBtn setTitleColor:UIColorFromRGB(0x347ACA) forState:UIControlStateNormal];
_mewChatBtn.titleLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightMedium];
[_mewChatBtn setImage:kImage(@"mew_mine_user_info_chat_arrow") forState:UIControlStateNormal];
[_mewChatBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 43, 0, 0)];
[_mewChatBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 15)];
_mewChatBtn.backgroundColor = [UIColor whiteColor];
_mewChatBtn.layer.cornerRadius = 12;
_mewChatBtn.layer.masksToBounds = YES;
[_mewChatBtn addTarget:self action:@selector(mew_didClickRoomSender) forControlEvents:UIControlEventTouchUpInside];
}
return _mewChatBtn;
}
- (FLAnimatedImageView *)mewHeatGifView{
if(!_mewHeatGifView){
_mewHeatGifView = [FLAnimatedImageView new];
NSData *localData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"mew_main_home_heat.gif" ofType:nil]];
FLAnimatedImage *animatedImage = [FLAnimatedImage animatedImageWithGIFData:localData];
_mewHeatGifView.animatedImage = animatedImage;
}
return _mewHeatGifView;
}
@end

View File

@@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)xPMineUserInfoHeaderViewDidClickClan:(ClanDetailInfoModel *)clanInfo;
///关注
-(void)attentionUserHandleWithBtn:(XPButton *)sender;
@end
@interface XPMineUserInfoHeaderView : UIView
@@ -30,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *roomUid;
///家族信息
@property (nonatomic,strong) ClanDetailInfoModel *clanDetailInfo;
@property(nonatomic,strong) UserInfoModel *mewDetailModel;
/// 获取头部高度
- (CGFloat)getHeaderHeight:(UserInfoModel *)userInfo;

View File

@@ -8,6 +8,7 @@
#import "XPMineUserInfoHeaderView.h"
///Third
#import <Masonry/Masonry.h>
#import <YYImage/YYAnimatedImageView.h>
#import <SDCycleScrollView/SDCycleScrollView.h>
#import "SDPhotoBrowser.h"
#import <ReactiveObjC/ReactiveObjC.h>
@@ -21,13 +22,16 @@
#import "NSArray+Safe.h"
#import "XCHUDTool.h"
#import "StatisticsServiceHelper.h"
#import "XPNoteView.h"
#import "XPButton.h"
///Model
#import "UserInfoModel.h"
#import "ClanDetailInfoModel.h"
#import "SpriteSheetImageManager.h"
#import "MewMineUserInfoOnRoomView.h"
@interface XPMineUserInfoHeaderView ()<SDCycleScrollViewDelegate, SDPhotoBrowserDelegate>
@interface XPMineUserInfoHeaderView ()<SDCycleScrollViewDelegate, SDPhotoBrowserDelegate,MewMineUserInfoOnRoomViewDelegate>
///
@property (nonatomic,strong) SDCycleScrollView *cycleScrollView;
///view
@@ -47,16 +51,20 @@
@property (nonatomic,strong) UIStackView *nickStackView;
///
@property (nonatomic,strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) YYAnimatedImageView *mewAvatarWearView;
@property(nonatomic,strong) SpriteSheetImageManager *mewManager;
///线
@property(nonatomic,strong) UIView *mewOnLivePointView;
@property(nonatomic,strong) UILabel *mewOnLiveTextView;
///
@property (nonatomic,strong) UILabel *nameLabel;
///sex
@property (nonatomic,strong) UIImageView *sexImageView;
///
@property (nonatomic,strong) UIButton *constellationBtn;
///
@property (nonatomic,strong) UIView *onlineView;
///
@property (nonatomic,strong) XPNoteView *noteView;
///
@property (nonatomic,strong) UIStackView *idStackView;
///
@@ -95,6 +103,8 @@
@property (nonatomic,strong) UserPhoto *avatarPhoto;
///
@property(nonatomic,strong) XPButton *attentionButton;
///
@property(nonatomic,strong) MewMineUserInfoOnRoomView *mewInLiveView;
@end
@implementation XPMineUserInfoHeaderView
@@ -116,7 +126,8 @@
[self addSubview:self.userInfoView];
[self addSubview:self.pageButton];
[self addSubview:self.avatarImageView];
[self addSubview:self.onlineView];
[self addSubview:self.mewAvatarWearView];
[self.userInfoView addSubview:self.lineView];
[self.userInfoView addSubview:self.fansNumLabel];
@@ -124,10 +135,13 @@
[self.userInfoView addSubview:self.nickStackView];
[self.userInfoView addSubview:self.idStackView];
[self.userInfoView addSubview:self.tagStackView];
[self.userInfoView addSubview:self.mewOnLivePointView];
[self.userInfoView addSubview:self.mewOnLiveTextView];
[self.userInfoView addSubview:self.attentionButton];
[self.onlineView addSubview:self.noteView];
[self.userInfoView addSubview:self.mewInLiveView];
[self.nickStackView addArrangedSubview:self.nobleImageView];
[self.nickStackView addArrangedSubview:self.nameLabel];
[self.nickStackView addArrangedSubview:self.sexImageView];
@@ -154,7 +168,7 @@
- (void)initSubViewConstraints {
[self.cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self);
make.height.mas_equalTo(237);
make.height.mas_equalTo(234);
}];
[self.coverImageView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -173,19 +187,24 @@
make.height.mas_equalTo(170);
}];
[self.pageButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-15);
make.width.mas_equalTo(42);
make.height.mas_equalTo(22);
make.bottom.mas_equalTo(self.userInfoView.mas_top).offset(-8);
}];
[self.mewInLiveView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.tagStackView.mas_bottom).offset(10);
make.left.mas_equalTo(12);
make.height.mas_equalTo(0);
make.right.mas_equalTo(-12);
}];
[self.signBackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(self.signLabel.mas_height).offset(22);
make.left.mas_equalTo(15);
make.right.mas_equalTo(-15);
make.top.mas_equalTo(self.tagStackView.mas_bottom).offset(10);
make.top.mas_equalTo(self.self.mewInLiveView.mas_bottom).offset(15);
}];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -199,6 +218,10 @@
make.centerY.mas_equalTo(self.userInfoView.mas_top);
make.width.height.mas_equalTo(72);
}];
[self.mewAvatarWearView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self.avatarImageView);
make.width.height.mas_equalTo(95);
}];
[self.fansNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(12);
make.top.mas_equalTo(10);
@@ -207,6 +230,16 @@
[self.nobleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(20);
}];
[self.mewOnLiveTextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-20);
make.top.mas_equalTo(10);
make.height.mas_equalTo(16);
}];
[self.mewOnLivePointView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(6);
make.right.mas_equalTo(-46);
make.centerY.equalTo(self.mewOnLiveTextView);
}];
[self.attentionButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.width.mas_equalTo(68);
@@ -231,16 +264,8 @@
make.size.mas_equalTo(CGSizeMake(40, 14));
}];
[self.onlineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20, 20));
make.right.mas_equalTo(self.avatarImageView.mas_right).offset(-2);
make.bottom.mas_equalTo(self.avatarImageView.mas_bottom).offset(-2);
}];
[self.noteView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(0);
make.width.height.mas_equalTo(10);
}];
[self.idStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.nickStackView);
@@ -336,7 +361,10 @@
browser.isMe = NO;
[browser show];
}
#pragma mark - MewMineUserInfoOnRoomView
- (void)mew_didClickRoomAction{
[self didTapAvatarGuest];
}
#pragma mark - Event Response
- (void)didTapAvatarGuest {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoHeaderView:didClickGoToRoom:)]) {
@@ -407,7 +435,7 @@
- (CGFloat)getHeaderHeight:(UserInfoModel *)userInfo {
CGSize size = [self.signLabel.text boundingRectWithSize:CGSizeMake(self.signLabel.bounds.size.width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:self.signLabel.font} context:nil].size;
return 366+size.height;
return _roomUid.length <= 0 ? 366 + size.height:443+size.height;
}
- (void)setUserInfo:(UserInfoModel *)userInfo {
@@ -422,10 +450,7 @@
self.idLabel.text = [NSString stringWithFormat:@"ID%ld", (long)_userInfo.erbanNo];
self.copysIdImageView.hidden = NO;
self.signLabel.text = _userInfo.userDesc.length > 0 ? _userInfo.userDesc : @"我是个默认签名";
CGSize size = [self.signLabel.text boundingRectWithSize:CGSizeMake(self.signLabel.bounds.size.width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:self.signLabel.font} context:nil].size;
[self.userInfoView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(153+size.height);
}];
NSString *fansNum = [NSString stringWithFormat:@"%ld",_userInfo.fansNum];
NSString *fansStr = [NSString stringWithFormat:@"粉丝 %@", fansNum];
@@ -495,23 +520,87 @@
//
self.reviewIcon.hidden = ![self.userPhtotArray objectAtIndex:0].isReview;
}
NSString * headWearUrl = userInfo.headwearEffect.length ? userInfo.headwearEffect : userInfo.headWearUrl.length ? userInfo.headWearUrl : userInfo.headwearPic;
if (headWearUrl.length > 0) {
self.mewAvatarWearView.hidden = NO;
NSURL *url = [NSURL URLWithString: headWearUrl];
@kWeakify(self);
[self.mewManager loadSpriteSheetImageWithURL:url completionBlock:^(YYSpriteSheetImage * _Nullable sprit) {
@kStrongify(self);
self.mewAvatarWearView.image = sprit;
} failureBlock:^(NSError * _Nullable error) {
}];
} else {
self.mewAvatarWearView.hidden = YES;
}
}
}
- (void)setMewDetailModel:(UserInfoModel *)mewDetailModel{
_mewDetailModel = mewDetailModel;
if(_mewDetailModel.userGamePartner.count > 0 && _mewDetailModel.inOnline == YES){
self.mewOnLiveTextView.hidden = NO;
self.mewOnLivePointView.hidden = NO;
}else{
self.mewOnLiveTextView.hidden = YES;
self.mewOnLivePointView.hidden = YES;
}
self.mewInLiveView.text = _mewDetailModel.roomTitle;
}
- (void)attentionButtonAction:(XPButton *)sender {
if(self.delegate && [self.delegate respondsToSelector:@selector(attentionUserHandleWithBtn:)]){
[self.delegate attentionUserHandleWithBtn:self.attentionButton];
}
}
- (void)setRoomUid:(NSString *)roomUid {
_roomUid = roomUid;
-(void)mew_setViewConstraints{
if (_roomUid.length <= 0) {
self.onlineView.hidden = YES;
self.avatarImageView.layer.borderColor = UIColor.whiteColor.CGColor;
self.avatarImageView.userInteractionEnabled = NO;
[self.cycleScrollView mas_updateConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self);
make.height.mas_equalTo(234);
}];
[self.userInfoView mas_updateConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self);
make.bottom.mas_equalTo(self);
make.height.mas_equalTo(170);
}];
[self.mewInLiveView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.tagStackView.mas_bottom).offset(-5);
make.height.mas_equalTo(0);
}];
CGSize size = [self.signLabel.text boundingRectWithSize:CGSizeMake(self.signLabel.bounds.size.width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:self.signLabel.font} context:nil].size;
[self.userInfoView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(153+size.height);
}];
self.mewInLiveView.hidden = YES;
}else{
self.onlineView.hidden = NO;
self.avatarImageView.layer.borderColor = [ThemeColor appMainColor].CGColor;
self.avatarImageView.userInteractionEnabled = YES;
[self.mewInLiveView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(62);
make.top.mas_equalTo(self.tagStackView.mas_bottom).offset(10);
}];
[self.cycleScrollView mas_updateConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self);
make.height.mas_equalTo(251);
}];
[self.userInfoView mas_updateConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self);
make.bottom.mas_equalTo(self);
make.height.mas_equalTo(247);
}];
CGSize size = [self.signLabel.text boundingRectWithSize:CGSizeMake(self.signLabel.bounds.size.width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:self.signLabel.font} context:nil].size;
[self.userInfoView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(230+size.height);
}];
self.mewInLiveView.hidden = NO;
}
}
@@ -525,7 +614,10 @@
self.clanBtn.hidden = YES;
}
}
-(void)setRoomUid:(NSString *)roomUid{
_roomUid = roomUid;
[self mew_setViewConstraints];
}
- (UIImageView *)coverImageView {
if (!_coverImageView) {
@@ -624,26 +716,9 @@
return _idLabel;
}
- (UIView *)onlineView {
if (!_onlineView) {
_onlineView = [[UIView alloc] init];
_onlineView.backgroundColor = [ThemeColor appMainColor];
_onlineView.layer.cornerRadius = 10;
_onlineView.clipsToBounds = YES;
_onlineView.hidden = YES;
}
return _onlineView;
}
- (XPNoteView *)noteView {
if (!_noteView) {
_noteView = [[XPNoteView alloc] init];
_noteView.pillarColor = [UIColor blackColor];
_noteView.pillarWidth = 1.5;
[_noteView startAnimation];
}
return _noteView;
}
- (SDCycleScrollView *)cycleScrollView {
if (!_cycleScrollView) {
@@ -820,8 +895,7 @@
_avatarImageView.layer.borderColor = UIColor.whiteColor.CGColor;
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
_avatarImageView.userInteractionEnabled = NO;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapAvatarGuest)];
[_avatarImageView addGestureRecognizer:tap];
}
return _avatarImageView;
}
@@ -883,4 +957,45 @@
}
return _attentionButton;
}
- (YYAnimatedImageView *)mewAvatarWearView {
if (!_mewAvatarWearView) {
_mewAvatarWearView = [[YYAnimatedImageView alloc] init];
_mewAvatarWearView.backgroundColor = [UIColor clearColor];
_mewAvatarWearView.contentMode = UIViewContentModeScaleAspectFit;
}
return _mewAvatarWearView;
}
- (SpriteSheetImageManager *)mewManager {
if (!_mewManager) {
_mewManager = [[SpriteSheetImageManager alloc] init];
}
return _mewManager;
}
- (UIView *)mewOnLivePointView{
if(!_mewOnLivePointView){
_mewOnLivePointView = [UIView new];
_mewOnLivePointView.backgroundColor = UIColorFromRGB(0x4DFF91);
_mewOnLivePointView.layer.cornerRadius = 3;
_mewOnLivePointView.layer.masksToBounds = YES;
_mewOnLivePointView.hidden = YES;
}
return _mewOnLivePointView;
}
- (UILabel *)mewOnLiveTextView{
if(!_mewOnLiveTextView){
_mewOnLiveTextView = [UILabel labelInitWithText:@"在线" font:[UIFont systemFontOfSize:11 weight:UIFontWeightRegular] textColor:UIColorFromRGB(0x696D7A)];
_mewOnLiveTextView.hidden = YES;
}
return _mewOnLiveTextView;
}
- (MewMineUserInfoOnRoomView *)mewInLiveView{
if(!_mewInLiveView){
_mewInLiveView = [[MewMineUserInfoOnRoomView alloc]initWithFrame:CGRectZero];
_mewInLiveView.hidden = YES;
_mewInLiveView.delegate = self;
}
return _mewInLiveView;
}
@end

View File

@@ -54,6 +54,9 @@
[room sendNext:model];
[room sendCompleted];
} fail:^(NSInteger code, NSString * _Nullable msg) {
if([msg containsString:@"当前版本过低"]){
[XCHUDTool showErrorWithMessage:msg];
}
[user sendError:nil];
} showLoading:NO errorToast:NO] uid:roomUid intoUid:uid];
}

View File

@@ -999,28 +999,9 @@
if (!self.musicEnterButton.superview) {
[self addSubview:self.musicEnterButton];
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) {//
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.mas_equalTo(kNavigationHeight+38);
make.width.mas_equalTo(22);
make.height.mas_equalTo(22);
}];
[self mew_setViewRestraint];
} else {
if (self.hourRankEntranceView.superview) {
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.hourRankEntranceView.mas_right).mas_offset(4);
make.top.mas_equalTo(kNavigationHeight+38);
make.width.mas_equalTo(22);
make.height.mas_equalTo(22);
}];
} else {
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.mas_equalTo(kNavigationHeight+38);
make.width.mas_equalTo(22);
make.height.mas_equalTo(22);
}];
}
[self mew_setViewRestraint];
}
}
} else {
@@ -1715,34 +1696,31 @@
if (!self.musicEnterButton.superview) {
[self addSubview:self.musicEnterButton];
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) {//
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.mas_equalTo(kNavigationHeight+38);
make.width.mas_equalTo(22);
make.height.mas_equalTo(22);
}];
[self mew_setViewRestraint];
} else {
if (self.hourRankEntranceView.superview) {
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.hourRankEntranceView.mas_right).mas_offset(4);
make.top.mas_equalTo(kNavigationHeight+38);
make.width.mas_equalTo(22);
make.height.mas_equalTo(22);
}];
} else {
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.mas_equalTo(kNavigationHeight+38);
make.width.mas_equalTo(22);
make.height.mas_equalTo(22);
}];
}
[self mew_setViewRestraint];
}
}
}
}
}
-(void)mew_setViewRestraint{
if (self.hourRankEntranceView.superview) {
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.hourRankEntranceView.mas_right).mas_offset(4);
make.top.mas_equalTo(kNavigationHeight+38);
make.width.mas_equalTo(22);
make.height.mas_equalTo(22);
}];
} else {
[self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.mas_equalTo(kNavigationHeight+38);
make.width.mas_equalTo(22);
make.height.mas_equalTo(22);
}];
}
}
///PK
- (void)showAcrossPkCountDownViewWithTime:(long long)time {
if (self.acrossPKCountView.superview) {

View File

@@ -271,6 +271,7 @@
[super onRoomUpdate];
if (self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) {
self.datingProgressView.blindDateState = self.hostDelegate.getRoomInfo.blindDateState;
}
}

View File

@@ -146,10 +146,7 @@
self.pickButton.hidden = YES;
if (position == -1) {return;}
if (userInfo) {
self.pickButton.hidden = NO;
[self configPickTitle:@"未选择" backmImageName:@"room_mode_dating_not_select"];
}
///
if (roomInfo.blindDateState == RoomPlayDateingType_Pick) {
///

View File

@@ -94,6 +94,7 @@ NS_ASSUME_NONNULL_BEGIN
* 获取当前的麦序
*/
- (NSMutableDictionary<NSString *, MicroQueueModel *>*)getMicroQueue;
@end
NS_ASSUME_NONNULL_END

View File

@@ -535,7 +535,15 @@
UIView<MicroViewProtocol> * view = [self findMicroViewByIndex:i];
[view showGiftValueMode:roomInfo.showGiftValue];
}
// [self microQueueUpdated];
if (self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind && self.hostDelegate.getRoomInfo.blindDateState == RoomPlayDateingType_Pick) {
for (int i = 0; i < self.countOfMircoView; i++) {
MicroQueueModel * model = [self.micQueue objectForKey:[self indexToPosition:i]];
UIView<MicroViewProtocol> * view = [self findMicroViewByIndex:i];
[view configRoomInfo:roomInfo];
[view configMicroView:model];
}
}
}
- (void)handleNIMNotificationMessage:(NIMMessage *)message {