个播PK搜索、PK面板

This commit is contained in:
chenguilong
2022-04-11 19:11:34 +08:00
parent a685b8c70a
commit 1bb71681af
45 changed files with 1524 additions and 16 deletions

View File

@@ -143,6 +143,11 @@
9B2A12DE2783FEDD00CED41B /* UserVipInfoVo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12DD2783FEDD00CED41B /* UserVipInfoVo.m */; };
9B2A12E127845DD300CED41B /* XPNobleCenterMyNobleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12E027845DD300CED41B /* XPNobleCenterMyNobleView.m */; };
9B2A12E427846D7100CED41B /* NobleRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A12E327846D7100CED41B /* NobleRechargeModel.m */; };
9B2EA7C02804037700ED17BF /* AnchorPKStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2EA7BF2804037700ED17BF /* AnchorPKStageView.m */; };
9B2EA7C32804052E00ED17BF /* AnchorPKMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2EA7C22804052E00ED17BF /* AnchorPKMicroView.m */; };
9B2EA7C628041EFC00ED17BF /* XPAnchorPkPanelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2EA7C528041EFC00ED17BF /* XPAnchorPkPanelView.m */; };
9B2EA7C9280423E000ED17BF /* AnchorPKPanelModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2EA7C8280423E000ED17BF /* AnchorPKPanelModel.m */; };
9B2EA7CC2804245500ED17BF /* XPAnchorPKPanelUserView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2EA7CB2804245500ED17BF /* XPAnchorPKPanelUserView.m */; };
9B33E3CB27D85379003B0E62 /* UploadFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B33E3C927D85379003B0E62 /* UploadFile.m */; };
9B33E3CE27D8540C003B0E62 /* XPVoiceCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B33E3CD27D8540C003B0E62 /* XPVoiceCardViewController.m */; };
9B33E3D427D8A1A4003B0E62 /* XPSkillCardPlayerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B33E3D327D8A1A4003B0E62 /* XPSkillCardPlayerManager.m */; };
@@ -895,6 +900,16 @@
9B2A12E027845DD300CED41B /* XPNobleCenterMyNobleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleCenterMyNobleView.m; sourceTree = "<group>"; };
9B2A12E227846D7100CED41B /* NobleRechargeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NobleRechargeModel.h; sourceTree = "<group>"; };
9B2A12E327846D7100CED41B /* NobleRechargeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NobleRechargeModel.m; sourceTree = "<group>"; };
9B2EA7BE2804037700ED17BF /* AnchorPKStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorPKStageView.h; sourceTree = "<group>"; };
9B2EA7BF2804037700ED17BF /* AnchorPKStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorPKStageView.m; sourceTree = "<group>"; };
9B2EA7C12804052E00ED17BF /* AnchorPKMicroView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorPKMicroView.h; sourceTree = "<group>"; };
9B2EA7C22804052E00ED17BF /* AnchorPKMicroView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorPKMicroView.m; sourceTree = "<group>"; };
9B2EA7C428041EFC00ED17BF /* XPAnchorPkPanelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorPkPanelView.h; sourceTree = "<group>"; };
9B2EA7C528041EFC00ED17BF /* XPAnchorPkPanelView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorPkPanelView.m; sourceTree = "<group>"; };
9B2EA7C7280423E000ED17BF /* AnchorPKPanelModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorPKPanelModel.h; sourceTree = "<group>"; };
9B2EA7C8280423E000ED17BF /* AnchorPKPanelModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorPKPanelModel.m; sourceTree = "<group>"; };
9B2EA7CA2804245500ED17BF /* XPAnchorPKPanelUserView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorPKPanelUserView.h; sourceTree = "<group>"; };
9B2EA7CB2804245500ED17BF /* XPAnchorPKPanelUserView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorPKPanelUserView.m; sourceTree = "<group>"; };
9B33E3C927D85379003B0E62 /* UploadFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UploadFile.m; sourceTree = "<group>"; };
9B33E3CA27D85379003B0E62 /* UploadFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UploadFile.h; sourceTree = "<group>"; };
9B33E3CC27D8540C003B0E62 /* XPVoiceCardViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPVoiceCardViewController.h; sourceTree = "<group>"; };
@@ -2537,6 +2552,8 @@
9B0086C927BA4F570032BD2B /* AnchorMicroView.m */,
9B060B5627BCAEE20001B767 /* AnchorGiftValueView.h */,
9B060B5727BCAEE20001B767 /* AnchorGiftValueView.m */,
9B2EA7C12804052E00ED17BF /* AnchorPKMicroView.h */,
9B2EA7C22804052E00ED17BF /* AnchorPKMicroView.m */,
);
path = Anchor;
sourceTree = "<group>";
@@ -2594,6 +2611,8 @@
children = (
9B1B72B02800343F003FACE9 /* AnchorPKInfoModel.h */,
9B1B72B12800343F003FACE9 /* AnchorPKInfoModel.m */,
9B2EA7C7280423E000ED17BF /* AnchorPKPanelModel.h */,
9B2EA7C8280423E000ED17BF /* AnchorPKPanelModel.m */,
);
path = Model;
sourceTree = "<group>";
@@ -2625,6 +2644,10 @@
children = (
9B1B72BD2800422E003FACE9 /* XPAnchorPKRuleView.h */,
9B1B72BE2800422E003FACE9 /* XPAnchorPKRuleView.m */,
9B2EA7C428041EFC00ED17BF /* XPAnchorPkPanelView.h */,
9B2EA7C528041EFC00ED17BF /* XPAnchorPkPanelView.m */,
9B2EA7CA2804245500ED17BF /* XPAnchorPKPanelUserView.h */,
9B2EA7CB2804245500ED17BF /* XPAnchorPKPanelUserView.m */,
);
path = SubViews;
sourceTree = "<group>";
@@ -4596,6 +4619,8 @@
9B0086C527BA392B0032BD2B /* AnchorStageView.m */,
E8DBB6F727B639A300AA285D /* LittleGameStageView.h */,
E8DBB6F827B639A300AA285D /* LittleGameStageView.m */,
9B2EA7BE2804037700ED17BF /* AnchorPKStageView.h */,
9B2EA7BF2804037700ED17BF /* AnchorPKStageView.m */,
);
path = StageView;
sourceTree = "<group>";
@@ -5363,6 +5388,7 @@
buildActionMask = 2147483647;
files = (
E8E5E1AF27C3920100F457D8 /* XPHomeRecommendPresenter.m in Sources */,
9B2EA7C32804052E00ED17BF /* AnchorPKMicroView.m in Sources */,
181D7F1B2726CE2A00B7C059 /* StageView.m in Sources */,
18EE3FF12750D2AD00A452BF /* NIMTimeUtils.m in Sources */,
E8ACEFEF27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.m in Sources */,
@@ -5437,6 +5463,7 @@
9BDA3E7A27FD43EF00517FE6 /* XPAnchorFansTeamEntranceView.m in Sources */,
E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */,
E8C6FFD42754AA87004DC9F0 /* XPNoteView.m in Sources */,
9B2EA7C628041EFC00ED17BF /* XPAnchorPkPanelView.m in Sources */,
E84150BB27747BAF00A7F548 /* XPFirstRechargePresenter.m in Sources */,
9BEE3D1727858E5700C83219 /* XPNobleAuthorityDescView.m in Sources */,
E82325F9274E2E42003A3332 /* Api+UserCard.m in Sources */,
@@ -5450,6 +5477,7 @@
E8C1CD7327D8A16500376F83 /* XPRoomFaceTool.m in Sources */,
E8A03DE22762FA000098D9EA /* XPCandyTreeMoreView.m in Sources */,
E8B825CA26EA1231009E8E9F /* LoginVerifCodeViewController.m in Sources */,
9B2EA7C9280423E000ED17BF /* AnchorPKPanelModel.m in Sources */,
189DD76226E60DDC00AB55B1 /* Api+Login.m in Sources */,
E8412FA62779BED1006E1101 /* XPRoomSettingTableViewCell.m in Sources */,
9B7D80502753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m in Sources */,
@@ -5578,6 +5606,7 @@
9BC9DAEF27E33B3F009EE409 /* XPRoomGiftAnimationParser.m in Sources */,
9B2A12DB2783F88800CED41B /* XPNoblePrivilegeCell.m in Sources */,
E81366E326F0A1FC0076364C /* LoginBindPhoneViewController.m in Sources */,
9B2EA7CC2804245500ED17BF /* XPAnchorPKPanelUserView.m in Sources */,
9B85B6DA279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.m in Sources */,
189DD68426E1FDBB00AB55B1 /* XCHUDTool.m in Sources */,
E8A6C29B27CF53BF00AC7442 /* XPHomeLikePresenter.m in Sources */,
@@ -5644,6 +5673,7 @@
18A61BE8274F9CF000A09A54 /* SessionListViewController.m in Sources */,
E8C1CD6A27D8937800376F83 /* XPRoomFaceCollectionViewCell.m in Sources */,
E8DBB6F927B639A300AA285D /* LittleGameStageView.m in Sources */,
9B2EA7C02804037700ED17BF /* AnchorPKStageView.m in Sources */,
E811FFF72742367B00918544 /* XPGiftEmptyCollectionViewCell.m in Sources */,
E8A86E0827BA38DB001C21F9 /* UIImage+RW.m in Sources */,
189DD67E26E1FD8900AB55B1 /* UIImage+Utils.m in Sources */,

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -247,6 +247,19 @@ typedef NS_ENUM(NSUInteger, CustomMessageSubAcrossRoomPK) {
Custom_Message_Sub_AcrossRoomPK_End = 835,
/// 跨房PK结束飘屏
Custom_Message_Sub_AcrossRoomPK_Result = 836,
///收到个播PK邀请
Custom_Message_Sub_AnchorPK_Invite = 837,
///拒绝个播pk
Custom_Message_Sub_AnchorPK_Reject = 838,
///接收个播PK
Custom_Message_Sub_AnchorPK_Accept = 839,
///个播PK面板消息
Custom_Message_Sub_AnchorPK_Panel = 8310,
///个播PK结束通知
Custom_Message_Sub_AnchorPK_End = 8311,
///个播PK结束飘屏
Custom_Message_Sub_AnchorPK_Result = 8312,
};
///first = CustomMessageType_Noble_VIP

View File

@@ -30,6 +30,8 @@ typedef NS_ENUM(NSInteger, RoomModeType){
RoomModeType_Open_Blind = 5,
///开启跨房PK
RoomModeType_Open_AcrossRoomPK_mode = 7,
///开启个播PK
RoomModeType_Open_AnchorPK_Mode = 8,
};
typedef NS_ENUM(NSInteger, PermitRoomType) {

View File

@@ -44,12 +44,14 @@ NS_ASSUME_NONNULL_BEGIN
/// @param inviteUid 邀请房间的房主的id
/// @param operateUid 操作者的uid
/// @param playDesc 描述
/// @param pkType pk类型 个播2
+ (void)beginAnchorPK:(HttpRequestHelperCompletion)completion
acceptUid:(NSString *)acceptUid
duration:(NSString *)duration
inviteUid:(NSString *)inviteUid
operateUid:(NSString *)operateUid
playDesc:(NSString *)playDesc;
playDesc:(NSString *)playDesc
pkType:(NSString *)pkType;
@end

View File

@@ -17,7 +17,7 @@
/// @param pageSize
/// @param pkType pk
+ (void)searchAnchorPKRoomList:(HttpRequestHelperCompletion)completion erbanNo:(NSString *)erbanNo roomUid:(NSString *)roomUid pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize pkType:(NSString *)pkType {
[self makeRequest:@"search/permitRoom" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, erbanNo, roomUid, pageNum, pageSize, pkType, nil];
[self makeRequest:@"search/singleRoom" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, erbanNo, roomUid, pageNum, pageSize, pkType, nil];
}
/// PK
@@ -27,7 +27,7 @@
/// @param pageSize
/// @param pkType pk
+ (void)getAnchorPKRoomList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize pkType:(NSString *)pkType {
[self makeRequest:@"search/permitRoom" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, roomUid, pageNum, pageSize, pkType, nil];
[self makeRequest:@"search/singleRoom" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, roomUid, pageNum, pageSize, pkType, nil];
}
/// PK
@@ -37,8 +37,9 @@
/// @param inviteUid id
/// @param operateUid uid
/// @param playDesc
+ (void)beginAnchorPK:(HttpRequestHelperCompletion)completion acceptUid:(NSString *)acceptUid duration:(NSString *)duration inviteUid:(NSString *)inviteUid operateUid:(NSString *)operateUid playDesc:(NSString *)playDesc {
[self makeRequest:@"crossroompkround/initiateChallenge" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, acceptUid, duration, inviteUid, operateUid, playDesc, nil];
/// @param pkType pk
+ (void)beginAnchorPK:(HttpRequestHelperCompletion)completion acceptUid:(NSString *)acceptUid duration:(NSString *)duration inviteUid:(NSString *)inviteUid operateUid:(NSString *)operateUid playDesc:(NSString *)playDesc pkType:(NSString *)pkType{
[self makeRequest:@"crossroompkround/initiateChallenge" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, acceptUid, duration, inviteUid, operateUid, playDesc, pkType, nil];
}
@end

View File

@@ -23,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString * erbanNo;
///是否选中
@property (nonatomic, assign) BOOL hadSelected;
///是否PK中
@property (nonatomic, assign) BOOL crossPking;
@end

View File

@@ -0,0 +1,69 @@
//
// AnchorPKPanelModel.h
// xplan-ios
//
// Created by GreenLand on 2022/4/11.
//
#import <Foundation/Foundation.h>
#import "XPEnum.h"
NS_ASSUME_NONNULL_BEGIN
@class AnchorPkRankModel;
@interface AnchorPKPanelModel : NSObject
///当前时间
@property (nonatomic, assign) long now;
///对方流水
@property (nonatomic, assign) long long aAmount;
///对方头像
@property (nonatomic, copy) NSString *aAvatar;
/// 所有流水
@property (nonatomic, assign) long long allAmount;
///对方进度条比例
@property (nonatomic, assign) float aPercent;
///对方魅力榜
@property (nonatomic, strong) NSArray<AnchorPkRankModel *> *arRank;
///对方贡献榜
@property (nonatomic, strong) NSArray<AnchorPkRankModel *> *asRank;
///对方标题
@property (nonatomic, copy) NSString *aTitle;
///对方UID
@property (nonatomic, copy) NSString *aUid;
///我方流水
@property (nonatomic, assign) long long cAmount;
///我方头像
@property (nonatomic, copy) NSString *cAvatar;
///我方进度条比例
@property (nonatomic, assign) float cPercent;
///我方魅力榜
@property (nonatomic, strong) NSArray<AnchorPkRankModel *> *crRank;
///我方贡献榜
@property (nonatomic, strong) NSArray<AnchorPkRankModel *> *csRank;
///我方标题
@property (nonatomic, copy) NSString *cTitle;
///我方UID
@property (nonatomic, copy) NSString * cUid;
///结束时间戳
@property (nonatomic, assign) long long endTime;
/// 赢家uid
@property (nonatomic, copy) NSString * winUid;
///是否异常结束
@property (nonatomic, assign) BOOL isForce;
@end
@interface AnchorPkRankModel : NSObject
///金币
@property (nonatomic, copy) NSString *amount;
///性别
@property (nonatomic, assign) GenderType gender;
///昵称
@property (nonatomic, copy) NSString *nick;
///头像
@property (nonatomic, copy) NSString *avatar;
///Uid
@property (nonatomic, copy) NSString * uid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,28 @@
//
// AnchorPKPanelModel.m
// xplan-ios
//
// Created by GreenLand on 2022/4/11.
//
#import "AnchorPKPanelModel.h"
@implementation AnchorPKPanelModel
///
///
+ (NSDictionary *)objectClassInArray {
return @{@"arRank" : [AnchorPkRankModel class],
@"asRank" : [AnchorPkRankModel class],
@"crRank" : [AnchorPkRankModel class],
@"csRank" : [AnchorPkRankModel class]
};
}
@end
@implementation AnchorPkRankModel
@end

View File

@@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
/// @param duration 持续的时间
/// @param acceptUid 接收者的uid
/// @param playDesc 玩法
- (void)beginAnchorPK:(NSString *)roomUid duration:(NSInteger)duration acceptUid:(NSString *)acceptUid playDesc:(NSString *)playDesc;
/// @param pkType pk类型 个播2
- (void)beginAnchorPK:(NSString *)roomUid duration:(NSInteger)duration acceptUid:(NSString *)acceptUid playDesc:(NSString *)playDesc pkType:(NSString *)pkType;
@end

View File

@@ -17,14 +17,14 @@
/// @param duration
/// @param acceptUid uid
/// @param playDesc
- (void)beginAnchorPK:(NSString *)roomUid duration:(NSInteger)duration acceptUid:(NSString *)acceptUid playDesc:(NSString *)playDesc {
- (void)beginAnchorPK:(NSString *)roomUid duration:(NSInteger)duration acceptUid:(NSString *)acceptUid playDesc:(NSString *)playDesc pkType:(NSString *)pkType {
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * time = [NSString stringWithFormat:@"%ld", duration];
[Api beginAnchorPK:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] beginAnchorPKSuccess];
}fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] beginAnchorPKFail:msg];
} showLoading:YES errorToast:NO] acceptUid:acceptUid duration:time inviteUid:roomUid operateUid:uid playDesc:playDesc];
} showLoading:YES errorToast:NO] acceptUid:acceptUid duration:time inviteUid:roomUid operateUid:uid playDesc:playDesc pkType:pkType];
}
@end

View File

@@ -89,7 +89,14 @@
self.avatarImageView.imageUrl = _roomPKInfo.avatar;
self.nameLabel.text = _roomPKInfo.title;
self.idLabel.text = [NSString stringWithFormat:@"大鹅号:%@", _roomPKInfo.erbanNo];
// self.selectButton.selected = _roomPKInfo.hadSelected;
self.selectButton.userInteractionEnabled = !roomPKInfo.crossPking;
if (roomPKInfo.crossPking) {
[_selectButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x4C4C6A)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
[_selectButton setTitle:@"PK中" forState:UIControlStateNormal];
} else {
[_selectButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x1CD7FD), UIColorFromRGB(0x9377FF), UIColorFromRGB(0xFF6BA3)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
[_selectButton setTitle:@"选择" forState:UIControlStateNormal];
}
}
- (NetImageView *)avatarImageView {

View File

@@ -0,0 +1,33 @@
//
// XPAnchorPKPanelUserView.h
// xplan-ios
//
// Created by GreenLand on 2022/4/11.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class AnchorPkRankModel;
typedef NS_ENUM(NSInteger, AnchorPKPanelUserType) {
///红队贡献
AnchorPKPanelUserType_Red_Contribute = 1,
///红队魅力榜
AnchorPKPanelUserType_Red_Charm,
///蓝队魅力
AnchorPKPanelUserType_Blue_Contribute,
///蓝队贡献
AnchorPKPanelUserType_Blue_Charm,
};
@interface XPAnchorPKPanelUserView : UIView
///类型
@property (nonatomic,assign) AnchorPKPanelUserType type;
@property (nonatomic,strong, nullable) AnchorPkRankModel * panelInfo;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,161 @@
//
// XPAnchorPKPanelUserView.m
// xplan-ios
//
// Created by GreenLand on 2022/4/11.
//
#import "XPAnchorPKPanelUserView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "NetImageView.h"
#import "ThemeColor.h"
#import "UIImage+Utils.h"
///Model
#import "AnchorPKPanelModel.h"
@interface XPAnchorPKPanelUserView ()
///
@property (nonatomic, strong) UIImageView *headwearImageView;
///
@property (nonatomic, strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) UIButton *coinButton;
@end
@implementation XPAnchorPKPanelUserView
#pragma mark - Life Style
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.headwearImageView];
[self addSubview:self.avatarImageView];
[self addSubview:self.coinButton];
}
- (void)initSubViewConstraints {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(32);
make.height.mas_equalTo(38);
}];
[self.headwearImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.centerY.mas_equalTo(self);
make.height.mas_equalTo(38);
}];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self);
make.bottom.mas_equalTo(self.headwearImageView);
make.height.mas_equalTo(self.avatarImageView.mas_width);
}];
[self.coinButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(32);
make.height.mas_equalTo(10);
make.bottom.centerX.mas_equalTo(self);
}];
}
#pragma mark - getters and setters
- (void)setType:(AnchorPKPanelUserType)type {
_type = type;
NSString * headwearName;
NSString * avatarPlaceName;
UIColor * coinColorStart;
UIColor * coinColorEnd;
switch (type) {
case AnchorPKPanelUserType_Red_Contribute:
case AnchorPKPanelUserType_Blue_Contribute:
headwearName = @"room_across_pk_panel_contribute_head";
coinColorStart = UIColorFromRGB(0xFF9813);
coinColorEnd = UIColorFromRGB(0xFFB22B);
avatarPlaceName = @"room_across_pk_panel_contribute_avatar";
break;
case AnchorPKPanelUserType_Red_Charm:
case AnchorPKPanelUserType_Blue_Charm:
headwearName = @"room_across_pk_panel_charm_head";
coinColorStart = UIColorFromRGB(0xFF5FC1);
coinColorEnd = UIColorFromRGB(0xFA81FF);
avatarPlaceName = @"room_across_pk_panel_charm_avatar";
break;
default:
break;
}
self.headwearImageView.image = [UIImage imageNamed:headwearName];
self.avatarImageView.image = [UIImage imageNamed:avatarPlaceName];
[self.coinButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[coinColorStart, coinColorEnd] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
if (self.tag == 1000) {
self.headwearImageView.hidden = NO;
} else {
self.headwearImageView.hidden = YES;
}
}
- (void)setPanelInfo:(AnchorPkRankModel *)panelInfo {
_panelInfo = panelInfo;
if (_panelInfo) {
self.avatarImageView.imageUrl = _panelInfo.avatar;
NSString * amount = _panelInfo.amount.length > 0 ? _panelInfo.amount : @"";
[self.coinButton setTitle:amount forState:UIControlStateNormal];
self.coinButton.hidden = !amount;
} else {
if (self.type == AnchorPKPanelUserType_Red_Contribute || self.type == AnchorPKPanelUserType_Blue_Contribute) {
self.avatarImageView.image = [UIImage imageNamed:@"room_across_pk_panel_contribute_avatar"];
} else {
self.avatarImageView.image = [UIImage imageNamed:@"room_across_pk_panel_charm_avatar"];
}
[self.coinButton setTitle:@"0" forState:UIControlStateNormal];
self.coinButton.hidden = YES;
}
}
- (UIImageView *)headwearImageView {
if (!_headwearImageView) {
_headwearImageView = [[UIImageView alloc] init];
_headwearImageView.userInteractionEnabled = YES;
}
return _headwearImageView;
}
- (NetImageView *)avatarImageView {
if (!_avatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
_avatarImageView.layer.masksToBounds = YES;
_avatarImageView.layer.cornerRadius = 32 / 2;
}
return _avatarImageView;
}
- (UIButton *)coinButton {
if (!_coinButton) {
_coinButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_coinButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_coinButton.titleLabel.font = [UIFont systemFontOfSize:9 weight:UIFontWeightMedium];
_coinButton.layer.masksToBounds = YES;
_coinButton.layer.cornerRadius = 5;
_coinButton.hidden = YES;
}
return _coinButton;
}
@end

View File

@@ -0,0 +1,32 @@
//
// XPAnchorPkPanelView.h
// xplan-ios
//
// Created by GreenLand on 2022/4/11.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class XPAnchorPkPanelView, AnchorPKPanelModel;
@protocol XPAnchorPkPanelViewDelegate <NSObject>
///展示用户卡片
- (void)xPAnchorPKPanelView:(XPAnchorPkPanelView *)view showUserCard:(NSString *)uid;
@end
@interface XPAnchorPkPanelView : UIView
///开启pk
- (void)openCountdownWithTime:(long)time;
///pk 信息
@property (nonatomic,strong, nullable) AnchorPKPanelModel *pkPanelInfo;
///代理
@property (nonatomic,weak) id<XPAnchorPkPanelViewDelegate> delegate;
///重置数据
- (void)resetAcrossPKViewData;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,436 @@
//
// XPAnchorPkPanelView.m
// xplan-ios
//
// Created by GreenLand on 2022/4/11.
//
#import "XPAnchorPkPanelView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "XPMacro.h"
#import "UIImage+Utils.h"
#import "UIButton+EnlargeTouchArea.h"
#import "Timestamp.h"
///Model
#import "UserInfoModel.h"
#import "AnchorPKPanelModel.h"
///View
#import "XPAnchorPKPanelUserView.h"
@interface XPAnchorPkPanelView ()
///
@property (nonatomic, strong) UIImageView *backImageView;
#pragma mark - view
///
@property (nonatomic, strong) UIImageView *redStarImageView;
///
@property (nonatomic, strong) UIImageView *blueStarImageView;
///
@property (nonatomic, strong) UILabel *timeLabel;
///
@property (nonatomic,strong) UIStackView *stackView;
#pragma mark -
///PK
@property (nonatomic, strong) UIView *progressView;
///PK
@property (nonatomic, strong) UIView *progressContentView;
///
@property (nonatomic, strong) UIImageView *redCountImageView;
///
@property (nonatomic, strong) UILabel *redCountLabel;
///
@property (nonatomic, strong) UIImageView *buleCountImageView;
///
@property (nonatomic, strong) UILabel *buleCountLabel;
#pragma mark -
#pragma mark - view
///
@property (nonatomic,strong) UIStackView *redContributeStackView;
///
@property (nonatomic,strong) UIStackView *blueContributeStackView;
///
@property (strong, nonatomic) dispatch_source_t timer;
@end
@implementation XPAnchorPkPanelView
#pragma mark - life cycle
- (void)dealloc {
NSLog(@"销毁了");
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Public Method
- (void)resetAcrossPKViewData {
if (self.timer) {
dispatch_source_cancel(self.timer);
self.timer = nil;
}
self.pkPanelInfo = nil;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.backImageView];
[self.backImageView addSubview:self.timeLabel];
[self.backImageView addSubview:self.redStarImageView];
[self.backImageView addSubview:self.blueStarImageView];
[self.backImageView addSubview:self.progressView];
///
[self.progressView addSubview:self.progressContentView];
[self.progressContentView addSubview:self.redCountImageView];
[self.progressContentView addSubview:self.buleCountImageView];
[self.progressContentView addSubview:self.redCountLabel];
[self.progressContentView addSubview:self.buleCountLabel];
///
[self.backImageView addSubview:self.redContributeStackView];
[self.backImageView addSubview:self.blueContributeStackView];
[self initUserSubViews];
}
- (void)initUserSubViews {
for (int i = 0; i < 3; i++) {
XPAnchorPKPanelUserView * userView = [[XPAnchorPKPanelUserView alloc] init];
userView.tag = (1000 + i);
userView.type = AnchorPKPanelUserType_Red_Contribute;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapUserRecognizer:)];
[userView addGestureRecognizer:tap];
[self.redContributeStackView addArrangedSubview:userView];
}
for (int i = 0; i < 3; i++) {
XPAnchorPKPanelUserView * userView = [[XPAnchorPKPanelUserView alloc] init];
userView.tag = (1000 + i);
userView.type = AnchorPKPanelUserType_Blue_Contribute;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapUserRecognizer:)];
[userView addGestureRecognizer:tap];
[self.blueContributeStackView addArrangedSubview:userView];
}
}
- (void)initSubViewConstraints {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(KScreenWidth);
make.height.mas_equalTo(330);
}];
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-16);
make.width.mas_equalTo(284);
make.height.mas_equalTo(84);
make.centerX.mas_equalTo(self);
}];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.backImageView).mas_offset(3);
make.centerX.mas_equalTo(self);
}];
[self.redStarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(15);
make.left.mas_equalTo(-30);
make.width.height.mas_equalTo(26);
}];
[self.blueStarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(15);
make.left.mas_equalTo(self.backImageView.mas_right).mas_offset(4);
make.width.height.mas_equalTo(26);
}];
///
[self.progressView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.backImageView);
make.width.mas_equalTo(174);
make.height.mas_equalTo(12);
make.top.mas_equalTo(self.mas_bottom).offset(8);
}];
[self.progressContentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.progressView);
}];
[self.redCountImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.height.mas_equalTo(12);
make.top.mas_equalTo(0);
make.right.mas_equalTo(self.buleCountImageView.mas_left);
}];
[self.redCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.progressContentView.mas_left).offset(6);
make.centerY.mas_equalTo(self.progressContentView);
}];
[self.buleCountImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(0);
make.height.mas_equalTo(12);
make.centerY.mas_equalTo(self.redCountImageView);
make.width.mas_equalTo(174 * 0.5);
}];
[self.buleCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.progressContentView.mas_right).offset(-6);
make.centerY.mas_equalTo(self.progressContentView);
}];
[self.redContributeStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.backImageView);
make.left.mas_equalTo(self.backImageView).mas_offset(12);
}];
[self.blueContributeStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(self.redContributeStackView);
make.right.mas_equalTo(self.backImageView).mas_offset(-12);
}];
}
#pragma mark -
- (void)openCountdownWithTime:(long)time {
__block long tempTime = time; //
if (self.timer == nil) {
@kWeakify(self);
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
dispatch_source_set_timer(self.timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //
dispatch_source_set_event_handler(self.timer, ^{
@kStrongify(self);
if(tempTime <= 0){ //
dispatch_source_cancel(self.timer);
self.timer = nil;
dispatch_async(dispatch_get_main_queue(), ^{
self.timeLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
self.timeLabel.text = @"PK结果计算中";
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
//
[self AnchorPKCutdownOpen:tempTime];
});
tempTime--;
}
});
dispatch_resume(self.timer);
}
}
///pk,
- (void)AnchorPKCutdownOpen:(NSInteger)time {
NSInteger minute = time / 60;
NSInteger second = (time % 60);
NSInteger hour = time/3600;
NSString *timeStr;
if (hour > 0) {
minute = minute % 60;
timeStr = [NSString stringWithFormat:@"%02zd:%02zd:%02zd", hour, minute, second];
} else {
timeStr = [NSString stringWithFormat:@"%02zd:%02zd", minute, second];
}
self.timeLabel.text = timeStr;
if (time <= 30) {
self.timeLabel.textColor = UIColorFromRGB(0xFF87A1);
} else {
self.timeLabel.textColor = UIColorFromRGB(0xFFF600);
}
}
- (void)tapUserRecognizer:(UITapGestureRecognizer *)tap {
XPAnchorPKPanelUserView * userView= (XPAnchorPKPanelUserView *)tap.view;
if (userView.panelInfo && userView.panelInfo.uid.length > 0 && self.delegate && [self.delegate respondsToSelector:@selector(xPAnchorPKPanelView:showUserCard:)]) {
[self.delegate xPAnchorPKPanelView:self showUserCard:userView.panelInfo.uid];
}
}
#pragma mark - getters and setters
- (void)setPkPanelInfo:(AnchorPKPanelModel *)pkPanelInfo {
_pkPanelInfo = pkPanelInfo;
if (_pkPanelInfo) {
[Timestamp getInternetDateWithSuccess:^(NSTimeInterval timeInterval) {
timeInterval = timeInterval * 1000;
long aTime = (pkPanelInfo.endTime - timeInterval) / 1000;
[self openCountdownWithTime:aTime];
} failure:^(NSError * _Nonnull error) {
NSDate *datenow = [NSDate date];//
long time2 = (long)([datenow timeIntervalSince1970]*1000);
long aTime = (pkPanelInfo.endTime - time2) / 1000;
[self openCountdownWithTime:aTime];
}];
if (_pkPanelInfo.cTitle.length > 7) {
_pkPanelInfo.cTitle = [NSString stringWithFormat:@"%@…", [_pkPanelInfo.cTitle substringToIndex:7]];
}
if (_pkPanelInfo.aTitle.length > 7) {
_pkPanelInfo.aTitle = [NSString stringWithFormat:@"%@…", [_pkPanelInfo.aTitle substringToIndex:7]];
}
self.redCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.cAmount];
self.buleCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.aAmount];
for (int i = 0; i<_pkPanelInfo.csRank.count; i++) {
AnchorPkRankModel * rankModel = [_pkPanelInfo.csRank objectAtIndex:i];
if (i >= self.redContributeStackView.subviews.count) {
break;
}
XPAnchorPKPanelUserView *userView = self.redContributeStackView.subviews[i];
userView.panelInfo = rankModel;
}
for (int i = 0; i<_pkPanelInfo.asRank.count; i++) {
AnchorPkRankModel * rankModel = [_pkPanelInfo.asRank objectAtIndex:i];
if (i >= self.blueContributeStackView.subviews.count) {
break;
}
XPAnchorPKPanelUserView *userView = self.blueContributeStackView.subviews[i];
userView.panelInfo = rankModel;
}
if (_pkPanelInfo.aPercent > 1) {
_pkPanelInfo.aPercent = 1;
}
CGFloat width = 174;
[self.buleCountImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(width * _pkPanelInfo.aPercent);
}];
} else {
self.redCountLabel.text = @"0";
self.buleCountLabel.text = @"0";
for (int i = 0; i<self.redContributeStackView.subviews.count; i++) {
XPAnchorPKPanelUserView *userView = self.redContributeStackView.subviews[i];
userView.panelInfo = nil;
}
for (int i = 0; i<self.blueContributeStackView.subviews.count; i++) {
XPAnchorPKPanelUserView *userView = self.blueContributeStackView.subviews[i];
userView.panelInfo = nil;
}
CGFloat width = 174;
[self.buleCountImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(width * 0.5);
}];
}
}
- (UIImageView *)backImageView {
if (!_backImageView) {
_backImageView = [[UIImageView alloc] init];
_backImageView.image = [UIImage imageNamed:@"anchorPK_panel_bg"];
_backImageView.userInteractionEnabled = YES;
}
return _backImageView;
}
- (UILabel *)timeLabel {
if (!_timeLabel) {
_timeLabel = [[UILabel alloc] init];
_timeLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
_timeLabel.textColor = UIColorFromRGB(0xFFF600);
_timeLabel.text = @"00:00";
}
return _timeLabel;
}
- (UIImageView *)redStarImageView {
if (!_redStarImageView) {
_redStarImageView = [[UIImageView alloc] init];
_redStarImageView.image = [UIImage imageNamed:@"anchorPK_panel_red_star"];
}
return _redStarImageView;
}
- (UIImageView *)blueStarImageView {
if (!_blueStarImageView) {
_blueStarImageView = [[UIImageView alloc] init];
_blueStarImageView.image = [UIImage imageNamed:@"anchorPK_panel_blue_star"];
}
return _blueStarImageView;
}
- (UIView *)progressContentView {
if (!_progressContentView) {
_progressContentView = [[UIView alloc] init];
_progressContentView.backgroundColor = [UIColor clearColor];
_progressContentView.layer.cornerRadius = 6;
_progressContentView.layer.masksToBounds = YES;
}
return _progressContentView;
}
- (UIView *)progressView {
if (!_progressView) {
_progressView = [[UIView alloc] init];
_progressView.backgroundColor = [UIColor clearColor];
}
return _progressView;
}
- (UIImageView *)redCountImageView {
if (!_redCountImageView) {
_redCountImageView = [[UIImageView alloc] init];
_redCountImageView.backgroundColor = UIColorFromRGB(0xFF4D73);
}
return _redCountImageView;
}
- (UILabel *)redCountLabel {
if (!_redCountLabel) {
_redCountLabel = [[UILabel alloc] init];
_redCountLabel.font = [UIFont systemFontOfSize:12];
_redCountLabel.textColor = [UIColor whiteColor];
_redCountLabel.text = @"0";
_redCountLabel.textAlignment = NSTextAlignmentLeft;
}
return _redCountLabel;
}
- (UIImageView *)buleCountImageView {
if (!_buleCountImageView) {
_buleCountImageView = [[UIImageView alloc] init];
_buleCountImageView.backgroundColor = UIColorFromRGB(0x45C0FF);
}
return _buleCountImageView;
}
- (UILabel *)buleCountLabel {
if (!_buleCountLabel) {
_buleCountLabel = [[UILabel alloc] init];
_buleCountLabel.font = [UIFont systemFontOfSize:12];
_buleCountLabel.textColor = [UIColor whiteColor];
_buleCountLabel.text = @"0";
_buleCountLabel.textAlignment = NSTextAlignmentRight;
}
return _buleCountLabel;
}
- (UIStackView *)redContributeStackView {
if (!_redContributeStackView) {
_redContributeStackView = [[UIStackView alloc] init];
_redContributeStackView.axis = UILayoutConstraintAxisHorizontal;
_redContributeStackView.distribution = UIStackViewDistributionEqualSpacing;
_redContributeStackView.alignment = UIStackViewAlignmentFill;
}
return _redContributeStackView;
}
- (UIStackView *)blueContributeStackView {
if (!_blueContributeStackView) {
_blueContributeStackView = [[UIStackView alloc] init];
_blueContributeStackView.axis = UILayoutConstraintAxisHorizontal;
_blueContributeStackView.distribution = UIStackViewDistributionEqualSpacing;
_blueContributeStackView.alignment = UIStackViewAlignmentFill;
}
return _blueContributeStackView;
}
@end

View File

@@ -355,7 +355,7 @@
[self.customTimeTextField resignFirstResponder];
[self.pkPlayModeTextField resignFirstResponder];
NSString * pkDes = self.pkPlayModeTextField.text.length > 0 ? self.pkPlayModeTextField.text : @"";
[self.presenter beginAnchorPK:self.roomUid duration:self.pkDuration acceptUid:self.selectRoomInfo.uid playDesc:pkDes];
[self.presenter beginAnchorPK:self.roomUid duration:self.pkDuration acceptUid:self.selectRoomInfo.uid playDesc:pkDes pkType:@"2"];
}
- (void)cancelButtonAction:(UIButton *)sender {

View File

@@ -35,6 +35,7 @@
#import "XPAnchorFansRelationModel.h"
#import "XPAnchorFansJoinModel.h"
#import "XPAnchorFansTaskModel.h"
#import "AnchorPKPanelModel.h"
///View
#import "XPRoomHalfWebView.h"
#import "XPAnchorAudienceUpMicView.h"
@@ -52,12 +53,14 @@
#import "XPRoomViewController.h"
#import "XPLittleGameMiniStageView.h"
#import "XPLittleGameRoomListView.h"
///PK
#import "XPAnchorFansTeamEntranceView.h"
#import "XPAnchorFansTeamViewController.h"
#import "XPAnchorFansTaskViewController.h"
#import "XPAnchorPkPanelView.h"
#import "XPWebViewController.h"
@interface XPRoomFunctionContainerView ()<XPAcrpssRoomPKPanelViewDelegate, XPRoomLittleGameListViewDelegate>
@interface XPRoomFunctionContainerView ()<XPAcrpssRoomPKPanelViewDelegate, XPRoomLittleGameListViewDelegate, XPAnchorPkPanelViewDelegate>
///host
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
///
@@ -82,8 +85,11 @@
@property (nonatomic,strong) XPLittleGameMiniStageView *littleGameMiniView;
///
@property (nonatomic,strong) XPLittleGameRoomListView *gameListView;
///
@property (nonatomic, strong) XPAnchorFansRelationModel *relationFansModel;
///PK
@property (nonatomic, strong) XPAnchorPkPanelView *anchorPKPanelView;
@end
@implementation XPRoomFunctionContainerView
@@ -332,7 +338,34 @@
[XCHUDTool showErrorWithMessage:msg];
}
} roomUid:roomUid];
}
} else if (roomInfo.roomModeType == RoomModeType_Open_AnchorPK_Mode) {
[Api getAcrossRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
AnchorPKPanelModel * anchorPKPanelInfo = [AnchorPKPanelModel modelWithJSON:data.data];
if (anchorPKPanelInfo.aUid.integerValue > 0) {
if (!self.anchorPKPanelView.superview) {
[self addSubview:self.anchorPKPanelView];
[self.anchorPKPanelView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.bottom.mas_equalTo(330);
}];
}
self.anchorPKPanelView.pkPanelInfo = anchorPKPanelInfo;
}
} else {
[XCHUDTool showErrorWithMessage:msg];
}
} roomUid:roomUid];
} else {
if (!self.anchorPKPanelView.superview) {
[self addSubview:self.anchorPKPanelView];
[self.anchorPKPanelView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(kNavigationHeight);
make.left.mas_equalTo(0);
}];
}
}
if (roomInfo.type == RoomType_Anchor) {
[self.contributionButton setTitle:@"主播榜" forState:UIControlStateNormal];
self.anchorGiftValueView.hidden = !roomInfo.showGiftValue;
@@ -474,6 +507,108 @@
[TTPopup popupView:view style:TTPopupStyleAlert];
}
}
break;
case Custom_Message_Sub_AnchorPK_Invite:
{
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
if (error == nil) {
NIMChatroomMember * member = [members firstObject];
if (member.type == NIMTeamMemberTypeOwner) {
XPAcrossRoomPKInviteView * inviteView = [[XPAcrossRoomPKInviteView alloc] init];
inviteView.roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
inviteView.dataDic = attachment.data;
[self addSubview:inviteView];
[inviteView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self);
}];
}
}
}];
}
break;
case Custom_Message_Sub_AnchorPK_Accept:
{
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
if (error == nil) {
NIMChatroomMember * member = [members firstObject];
if (member.type == NIMTeamMemberTypeOwner) {
XPAcrossRoomPKInviteResultView * inviteResutView = [[XPAcrossRoomPKInviteResultView alloc] init];
inviteResutView.isAccept = YES;
[self addSubview:inviteResutView];
[inviteResutView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).offset(114 + kSafeAreaTopHeight);
make.centerX.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(281, 42));
}];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[inviteResutView removeFromSuperview];
});
}
}
}];
}
break;
case Custom_Message_Sub_AnchorPK_Reject:
{
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
if (error == nil) {
NIMChatroomMember * member = [members firstObject];
if (member.type == NIMTeamMemberTypeOwner) {
XPAcrossRoomPKInviteResultView * inviteResutView = [[XPAcrossRoomPKInviteResultView alloc] init];
inviteResutView.isAccept = NO;
[self addSubview:inviteResutView];
[inviteResutView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).offset(114 + kSafeAreaTopHeight);
make.centerX.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(201, 42));
}];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[inviteResutView removeFromSuperview];
});
}
}
}];
}
break;
case Custom_Message_Sub_AnchorPK_Panel:
{
if (!self.acrossPKPanelView.superview) {
[self addSubview:self.acrossPKPanelView];
[self.acrossPKPanelView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).offset(354 + kSafeAreaTopHeight);
make.centerX.mas_equalTo(self);
}];
}
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
self.acrossPKPanelView.pkPanelInfo = acrossPKPanelInfo;
}
break;
case Custom_Message_Sub_AnchorPK_End:
{
[self.acrossPKPanelView resetAcrossPKViewData];
[self.acrossPKPanelView removeFromSuperview];
AcrossRoomPKPanelModel * model = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
if (model.isForce) {
XPAcrossRoomPKForceEndResultView *view = [[XPAcrossRoomPKForceEndResultView alloc] initWithFrame:CGRectMake(0, 0, 281, 208)];
view.data = model;
[TTPopup popupView:view style:TTPopupStyleAlert];
} else {
XPAcrossRoomPKResultView *view = [[XPAcrossRoomPKResultView alloc] initWithFrame:CGRectMake(0, 0, 320, 453)];
view.data = model;
[TTPopup popupView:view style:TTPopupStyleAlert];
}
}
break;
default:
break;
}
@@ -581,6 +716,28 @@
[self.delegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
}
#pragma mark - XPAnchorPkPanelViewDelegate
- (void)xPAnchorPKPanelView:(XPAnchorPkPanelView *)view showUserCard:(NSString *)uid {
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
NSString * targetUid = uid;
XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init];
[[self.delegate.getMicroQueue allValues] enumerateObjectsUsingBlock:^(MicroQueueModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (targetUid.integerValue == obj.userInfo.uid) {
model.position = [NSString stringWithFormat:@"%d", obj.microState.position];
model.posState = obj.microState.posState;
model.micState = obj.microState.micState;
*stop = YES;
}
}];
model.nick = self.delegate.getUserInfo.nick;
model.uid = targetUid;
model.delegate = self.delegate;
model.roomInfo = roomInfo;
model.micQueue = self.delegate.getMicroQueue;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
[self.delegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
}
#pragma mark - Event Response
- (void)contributionButtonAction:(UIButton *)sender {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
@@ -1005,5 +1162,12 @@
return _gameListView;
}
- (XPAnchorPkPanelView *)anchorPKPanelView {
if (!_anchorPKPanelView) {
_anchorPKPanelView = [[XPAnchorPkPanelView alloc] init];
_anchorPKPanelView.delegate = self;
}
return _anchorPKPanelView;
}
@end

View File

@@ -6,7 +6,243 @@
//
#import "AnchorPKStageView.h"
///Third
#import <Masonry/Masonry.h>
#import <NIMSDK/NIMSDK.h>
///Tool
#import "AccountInfoStorage.h"
#import "XPMacro.h"
#import "TTPopup.h"
#import "XCHUDTool.h"
#import "Api.h"
#import "NetImageView.h"
///Model
#import "RoomInfoModel.h"
#import "MicroExtModel.h"
#import "XPUserCardInfoModel.h"
///View
#import "AnchorPKMicroView.h"
#import "XPUserCardViewController.h"
// 58 + 5
#define ownerWidth (90 + 5) * kScreenScale
// 12 6
#define ownerHeight (ownerWidth + 6 + 12)
// 8 50 + 5
#define mcWidth (50 + 5) * kScreenScale
#define mcHeight (mcWidth + 6 + 12)
// padding 12
#define paddingH 12 * kScreenScale
// 33
#define marginV1 33
// 8
#define marginH (KScreenWidth - paddingH * 2 - mcWidth * 4 - datingWidth) / 2
//
#define marginV2 27 * kScreenScale
//
#define secondRowTop (firstRowTop + mcHeight + marginV2)
// padding
#define marginV3 15
///
#define topMargin 87
@interface AnchorPKStageView()
///vs
@property (nonatomic, strong) UIImageView *vsImageView;
@property (nonatomic, strong) UIButton *ruleButton;
///PK
@property (nonatomic, strong) NetImageView *otherMicroImageView;
@end
@implementation AnchorPKStageView
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
if (self = [super initWithDelegate:delegate]) {
[self addSubview:self.vsImageView];
[self addSubview:self.ruleButton];
[self.vsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(64);
make.height.mas_equalTo(74);
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(82);
}];
[self.ruleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(46);
make.height.mas_equalTo(18);
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self.vsImageView.mas_bottom).mas_offset(7);
}];
}
return self;
}
- (NSInteger)countOfMircoView {
return 1;
}
- (UIView<MicroViewProtocol> *)findMicroViewByIndex:(NSInteger)index {
UIView<MicroViewProtocol> * microView = [super findMicroViewByIndex:index];
return microView;
}
- (UIView<MicroViewProtocol> *)microViewForIndex:(NSInteger)index {
UIView<MicroViewProtocol> * microView = [super microViewForIndex:index];
if (microView) {
return microView;
}
return [[AnchorPKMicroView alloc]init];
}
/**
* | | * 150 + 5
* | 20 20 | * padding 20
* | 15 | * 15
* | | * 3 40 + 5
* * 12 6
*/
- (CGRect)rectForViewAtIndex:(NSInteger)index {
if (index == 0) {
return CGRectMake((KScreenWidth - 64) * 0.5 - 26 - ownerWidth, topMargin, ownerWidth, ownerHeight);
} else {
return CGRectMake((KScreenWidth + 64) * 0.5 + 26, topMargin, ownerWidth, ownerHeight);
}
return [super rectForViewAtIndex:index];
}
- (CGFloat)hightForStageView {
return 330;
}
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid {
NSInteger index = [self getIndexByUid:uid];
CGPoint point = CGPointZero;
if (index == 0) {
point = CGPointMake(KScreenWidth / 2 - 32 - 26 - ownerWidth * 0.5, topMargin + ownerWidth / 2 - 10);
} else {
point = CGPointMake(KScreenWidth / 2 + 32 + 26 + ownerWidth * 0.5, topMargin + ownerWidth / 2 - 10);
}
point = [self convertPoint:point toView:nil];
return point;
}
- (void)onRoomEntered {
[super onRoomEntered];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self autoUpMicAtIndex:-1];
});
}
- (void)autoUpMicAtIndex:(NSInteger)index {
NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init];
request.key = [NSString stringWithFormat:@"%zd", index];
UserInfoModel* userInfo = self.hostDelegate.getUserInfo;
RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo;
if (roomInfo.uid != [[AccountInfoStorage instance].getUid integerValue]) {
return;
}
NSString* roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
request.value = [[self userInfoToQueueExt:userInfo] toJSONString];
request.roomId = roomId;
request.transient = YES;
[[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) {
}];
}
/**
*
*/
- (NSDictionary *)userInfoToQueueExt:(UserInfoModel *)userInfo {
MicroExtModel * extModel = [[MicroExtModel alloc] init];
extModel.gender = userInfo.gender;
extModel.avatar = userInfo.avatar;
extModel.uid = userInfo.uid;
extModel.nick = userInfo.nick;
extModel.vipMic = userInfo.uid == self.hostDelegate.getRoomInfo.blindDateVipUid;
extModel.headWearUrl = userInfo.headwearEffect.length > 0 ? userInfo.headwearEffect : userInfo.headwearPic;
extModel.micCircle = userInfo.micCircle;
extModel.micNickColor = userInfo.micNickColor;
return [extModel model2dictionary];
}
/**
* index
*/
- (void)didSelectAtIndex:(NSInteger)index {
MicroQueueModel* micModel = [self.getMicroQueue objectForKey:[self indexToPosition:index]];
UserInfoModel* userInfo = self.hostDelegate.getUserInfo;
RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo;
NSString* position = [self indexToPosition:index];
NSString* uid = [NSString stringWithFormat:@"%ld", userInfo.uid];
NSString* roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
// 1.
NSString * targetUid;
if (roomInfo.leaveMode && [position isEqualToString:@"-1"]) {
targetUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
}
if (micModel.userInfo && micModel.userInfo.uid > 0) {
targetUid = [NSString stringWithFormat:@"%ld", micModel.userInfo.uid];
}
if (targetUid && targetUid.length > 0) {
XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init];
model.uid = targetUid;
model.position = position;
model.posState = micModel.microState.posState;
model.micState = micModel.microState.micState;
model.nick = userInfo.nick;
model.roomInfo = roomInfo;
model.micQueue = self.getMicroQueue;
model.delegate = self.hostDelegate;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
[self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
return;
}
}
- (NSString *)indexToPosition:(NSInteger)index {
if (index == 9) {
return @"999";
}
return [super indexToPosition:index];
}
- (NSInteger)positionToIndex:(NSString *)position {
if (position.intValue == 999) {
return 9;
}
return [super positionToIndex:position];
}
#pragma mark - event
- (void)onRuleButtonClick:(UIButton *)button {
}
#pragma mark - getter
- (UIImageView *)vsImageView {
if (!_vsImageView) {
_vsImageView = [[UIImageView alloc] init];
_vsImageView.image = [UIImage imageNamed:@"anchorPk_panel_vs"];
}
return _vsImageView;
}
- (UIButton *)ruleButton {
if (!_ruleButton) {
_ruleButton = [[UIButton alloc] init];
[_ruleButton setTitle:@"规则" forState:UIControlStateNormal];
[_ruleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_ruleButton.titleLabel.font = [UIFont systemFontOfSize:12];
[_ruleButton setBackgroundImage:[UIImage imageNamed:@"anchorPk_panel_ruleBg"] forState:UIControlStateNormal];
[_ruleButton addTarget:self action:@selector(onRuleButtonClick:) forControlEvents:UIControlEventTouchUpInside];
}
return _ruleButton;
}
@end

View File

@@ -7,6 +7,117 @@
#import "AnchorPKMicroView.h"
@implementation AnchorPKMicroView
///Third
#import <Masonry/Masonry.h>
///Tool
#import "NetImageView.h"
#import "AccountInfoStorage.h"
@interface AnchorPKMicroView ()
///
@property (nonatomic,strong) UIButton *followButton;
///
@property (nonatomic, strong) UIImageView *resultImageView;
///
@property (nonatomic, assign) NSInteger position;
@end
@implementation AnchorPKMicroView
- (void)initSubViews {
[super initSubViews];
[self.stackView addArrangedSubview:self.followButton];
[self addSubview:self.resultImageView];
}
- (void)initSubViewConstraints {
[super initSubViewConstraints];
[self.followButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(50, 20));
}];
[self.resultImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.avatarImageView);
make.bottom.mas_equalTo(self.avatarImageView).mas_offset(12);
make.width.mas_equalTo(66);
make.height.mas_equalTo(48);
}];
}
#pragma mark - MicroViewProtocol
- (void)showGiftValueMode:(BOOL)isGiftValue {
self.giftValueView.hidden = YES;
}
///
- (void)showLeaveMode:(BOOL)isLeaveMode {
}
- (void)configMicroView:(MicroQueueModel *)model {
[super configMicroView:model];
RoomInfoModel * roomInfo = self.getRoomInfo;
UserInfoModel * userInfo = model.userInfo;
NSMutableDictionary * micQueue = [self getMicroQueue];
int position = model.microState.position;
self.position = position;
if (position != -1 && userInfo == nil) {
self.nickLabel.text = @"";
}
self.nickLabel.hidden = NO;
self.postionLabel.hidden = YES;
NSString *nickStr = userInfo.nick;
if (userInfo.nick.length > 5) {
nickStr = [NSString stringWithFormat:@"%@…", [userInfo.nick substringToIndex:5]];
}
///
if (position == -1) {
if (userInfo) {
if ([self.subviews containsObject:self.leaveLabel]) {
[self.leaveLabel removeFromSuperview];
}
} else {
if (![self.subviews containsObject:self.leaveLabel]) {
[self insertSubview:self.leaveLabel belowSubview:self.giftValueView];
[self.leaveLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.avatarImageView);
}];
self.leaveLabel.layer.cornerRadius = self.frame.size.width * 0.5;
self.leaveLabel.layer.masksToBounds = YES;
}
}
self.micStateImageView.image = [UIImage imageNamed:@"room_position_mute_Anchor"];
[self.micStateImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.avatarImageView).mas_offset(-2);
make.right.mas_equalTo(self.avatarImageView).mas_offset(-(120 / 4) +11);
make.width.height.mas_equalTo(22);
}];
}
}
#pragma mark - event
- (void)onFollowButtonClick:(UIButton *)button {
}
- (UIButton *)followButton {
if (!_followButton) {
_followButton = [[UIButton alloc] init];
[_followButton setImage:[UIImage imageNamed:@"anchorPk_micro_attention"] forState:UIControlStateNormal];
[_followButton addTarget:self action:@selector(onFollowButtonClick:) forControlEvents:UIControlEventTouchUpInside];
}
return _followButton;
}
- (UIImageView *)resultImageView {
if (!_resultImageView) {
_resultImageView = [[UIImageView alloc] init];
_resultImageView.image = [UIImage imageNamed:@"anchorPk_micro_result_win"];
}
return _resultImageView;
}
@end

View File

@@ -32,6 +32,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong, readonly) MicroWaveView *animationView;
///0 号麦位显示性别
@property (nonatomic,strong, readonly) UIImageView *sexImageView;
///昵称容器
@property (nonatomic, strong, readonly) UIStackView *stackView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -36,6 +36,7 @@
#import "DatingStageView.h"
#import "AnchorStageView.h"
#import "LittleGameStageView.h"
#import "AnchorPkStageView.h"
#import "XPRoomAnimationView.h"
#import "XPRoomFunctionContainerView.h"
#import "XPArrangeMicViewController.h"
@@ -274,10 +275,10 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
[self.stageView removeFromSuperview];
self.stageView = nil;
self.stageView = [[SocialStageView alloc] initWithDelegate:self];
} else if (self.roomInfo.type == RoomType_Anchor && ![self.stageView isKindOfClass:[AnchorStageView class]]) {
} else if (self.roomInfo.type == RoomType_Anchor && ![self.stageView isKindOfClass:[AnchorPKStageView class]]) {
[self.stageView removeFromSuperview];
self.stageView = nil;
self.stageView = [[AnchorStageView alloc] initWithDelegate:self];
self.stageView = [[AnchorPKStageView alloc] initWithDelegate:self];
} else if(self.roomInfo.type == RoomType_MiniGame && ![self.stageView isKindOfClass:[LittleGameStageView class]]) {
[self.stageView removeFromSuperview];
self.stageView = nil;