个播飘屏,结果弹窗,跨房连麦逻辑处理

This commit is contained in:
chenguilong
2022-04-13 20:24:26 +08:00
parent a84e844df5
commit ebd6a4aa1e
72 changed files with 1437 additions and 113 deletions

View File

@@ -168,6 +168,9 @@
9B8585F52788699400D7D5C6 /* FBKVOController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8585F42788699400D7D5C6 /* FBKVOController.m */; }; 9B8585F52788699400D7D5C6 /* FBKVOController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8585F42788699400D7D5C6 /* FBKVOController.m */; };
9B85B6D7279FDABA00A0A1AC /* XPUserCardSkillCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B85B6D6279FDABA00A0A1AC /* XPUserCardSkillCardView.m */; }; 9B85B6D7279FDABA00A0A1AC /* XPUserCardSkillCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B85B6D6279FDABA00A0A1AC /* XPUserCardSkillCardView.m */; };
9B85B6DA279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B85B6D9279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.m */; }; 9B85B6DA279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B85B6D9279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.m */; };
9B85F3502806A34B006EDF51 /* anchorPK_progress.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9B85F34F2806A34B006EDF51 /* anchorPK_progress.svga */; };
9B85F3532806AB9A006EDF51 /* XPAnchorPKResultView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B85F3522806AB9A006EDF51 /* XPAnchorPKResultView.m */; };
9B85F3562806DD8A006EDF51 /* XPAnchorPKFinishView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B85F3552806DD8A006EDF51 /* XPAnchorPKFinishView.m */; };
9B92A3392797BE4500AD168F /* XPMineSkillTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */; }; 9B92A3392797BE4500AD168F /* XPMineSkillTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */; };
9B92A33C2797E38100AD168F /* XPMineHeadItemTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A33B2797E38100AD168F /* XPMineHeadItemTableViewCell.m */; }; 9B92A33C2797E38100AD168F /* XPMineHeadItemTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A33B2797E38100AD168F /* XPMineHeadItemTableViewCell.m */; };
9B92A3442797EE6500AD168F /* XPMatchManagePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3432797EE6500AD168F /* XPMatchManagePresenter.m */; }; 9B92A3442797EE6500AD168F /* XPMatchManagePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3432797EE6500AD168F /* XPMatchManagePresenter.m */; };
@@ -950,6 +953,11 @@
9B85B6D6279FDABA00A0A1AC /* XPUserCardSkillCardView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPUserCardSkillCardView.m; sourceTree = "<group>"; }; 9B85B6D6279FDABA00A0A1AC /* XPUserCardSkillCardView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPUserCardSkillCardView.m; sourceTree = "<group>"; };
9B85B6D8279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPUserCardSkillCollectionViewCell.h; sourceTree = "<group>"; }; 9B85B6D8279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPUserCardSkillCollectionViewCell.h; sourceTree = "<group>"; };
9B85B6D9279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPUserCardSkillCollectionViewCell.m; sourceTree = "<group>"; }; 9B85B6D9279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPUserCardSkillCollectionViewCell.m; sourceTree = "<group>"; };
9B85F34F2806A34B006EDF51 /* anchorPK_progress.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchorPK_progress.svga; sourceTree = "<group>"; };
9B85F3512806AB9A006EDF51 /* XPAnchorPKResultView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorPKResultView.h; sourceTree = "<group>"; };
9B85F3522806AB9A006EDF51 /* XPAnchorPKResultView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorPKResultView.m; sourceTree = "<group>"; };
9B85F3542806DD8A006EDF51 /* XPAnchorPKFinishView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorPKFinishView.h; sourceTree = "<group>"; };
9B85F3552806DD8A006EDF51 /* XPAnchorPKFinishView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorPKFinishView.m; sourceTree = "<group>"; };
9B92A3372797BE4500AD168F /* XPMineSkillTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineSkillTipView.h; sourceTree = "<group>"; }; 9B92A3372797BE4500AD168F /* XPMineSkillTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineSkillTipView.h; sourceTree = "<group>"; };
9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineSkillTipView.m; sourceTree = "<group>"; }; 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineSkillTipView.m; sourceTree = "<group>"; };
9B92A33A2797E38100AD168F /* XPMineHeadItemTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineHeadItemTableViewCell.h; sourceTree = "<group>"; }; 9B92A33A2797E38100AD168F /* XPMineHeadItemTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineHeadItemTableViewCell.h; sourceTree = "<group>"; };
@@ -2598,18 +2606,10 @@
9B1B72A82800319B003FACE9 /* Presenter */, 9B1B72A82800319B003FACE9 /* Presenter */,
9B1B72A528003185003FACE9 /* View */, 9B1B72A528003185003FACE9 /* View */,
9B1B72A42800317F003FACE9 /* Api */, 9B1B72A42800317F003FACE9 /* Api */,
9B1B72A328003153003FACE9 /* Model */,
); );
path = AnchorPK; path = AnchorPK;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
9B1B72A328003153003FACE9 /* Model */ = {
isa = PBXGroup;
children = (
);
path = Model;
sourceTree = "<group>";
};
9B1B72A42800317F003FACE9 /* Api */ = { 9B1B72A42800317F003FACE9 /* Api */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -2643,6 +2643,10 @@
9B2EA7CB2804245500ED17BF /* XPAnchorPKPanelUserView.m */, 9B2EA7CB2804245500ED17BF /* XPAnchorPKPanelUserView.m */,
9B3A1DF2280571000058E2DD /* XPAnchorPKInviteView.h */, 9B3A1DF2280571000058E2DD /* XPAnchorPKInviteView.h */,
9B3A1DF3280571000058E2DD /* XPAnchorPKInviteView.m */, 9B3A1DF3280571000058E2DD /* XPAnchorPKInviteView.m */,
9B85F3512806AB9A006EDF51 /* XPAnchorPKResultView.h */,
9B85F3522806AB9A006EDF51 /* XPAnchorPKResultView.m */,
9B85F3542806DD8A006EDF51 /* XPAnchorPKFinishView.h */,
9B85F3552806DD8A006EDF51 /* XPAnchorPKFinishView.m */,
); );
path = SubViews; path = SubViews;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -4433,6 +4437,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E88863C2278E7BCC004BCFAB /* crossRoomPk_progress.svga */, E88863C2278E7BCC004BCFAB /* crossRoomPk_progress.svga */,
9B85F34F2806A34B006EDF51 /* anchorPK_progress.svga */,
E8937ABF276C3ECF00B2C7E1 /* enterroom */, E8937ABF276C3ECF00B2C7E1 /* enterroom */,
E8DEC98927637EA50078CB70 /* candyTree_open.svga */, E8DEC98927637EA50078CB70 /* candyTree_open.svga */,
E8DEC98A27637EA50078CB70 /* candyTree_transform.svga */, E8DEC98A27637EA50078CB70 /* candyTree_transform.svga */,
@@ -5310,6 +5315,7 @@
9B0997A127F19D8A00EB8F14 /* README.md in Resources */, 9B0997A127F19D8A00EB8F14 /* README.md in Resources */,
189DD53926DE255600AB55B1 /* Assets.xcassets in Resources */, 189DD53926DE255600AB55B1 /* Assets.xcassets in Resources */,
E8DEC98C27637EA50078CB70 /* candyTree_transform.svga in Resources */, E8DEC98C27637EA50078CB70 /* candyTree_transform.svga in Resources */,
9B85F3502806A34B006EDF51 /* anchorPK_progress.svga in Resources */,
186A52E726FC559700D67B2C /* yw_1222_0769.jpg in Resources */, 186A52E726FC559700D67B2C /* yw_1222_0769.jpg in Resources */,
E8937ACB276C3EDE00B2C7E1 /* svga_member_in_lv60.svga in Resources */, E8937ACB276C3EDE00B2C7E1 /* svga_member_in_lv60.svga in Resources */,
186A52E326FC559200D67B2C /* RPSDK.bundle in Resources */, 186A52E326FC559200D67B2C /* RPSDK.bundle in Resources */,
@@ -5789,6 +5795,7 @@
E8F9168427EC913C00F10D8F /* XPHomeLittleGameViewController.m in Sources */, E8F9168427EC913C00F10D8F /* XPHomeLittleGameViewController.m in Sources */,
E8E5E1B327C397A400F457D8 /* HomeMenuInfoModel.m in Sources */, E8E5E1B327C397A400F457D8 /* HomeMenuInfoModel.m in Sources */,
E8AEAEF027141C430017FCE0 /* XPRoomMenuContainerView.m in Sources */, E8AEAEF027141C430017FCE0 /* XPRoomMenuContainerView.m in Sources */,
9B85F3532806AB9A006EDF51 /* XPAnchorPKResultView.m in Sources */,
E8DEC99527648FA50078CB70 /* ClientConfig.m in Sources */, E8DEC99527648FA50078CB70 /* ClientConfig.m in Sources */,
E880B3A6278BD69900A83B0D /* XPAcrossRoomPKTableViewCell.m in Sources */, E880B3A6278BD69900A83B0D /* XPAcrossRoomPKTableViewCell.m in Sources */,
E8EEB90926FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.m in Sources */, E8EEB90926FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.m in Sources */,
@@ -5944,6 +5951,7 @@
E88863C9278EBA43004BCFAB /* XPAcrossRoomPKForceEndResultView.m in Sources */, E88863C9278EBA43004BCFAB /* XPAcrossRoomPKForceEndResultView.m in Sources */,
E896EFB22771C93B00AD2CC1 /* XPMineFriendNumberView.m in Sources */, E896EFB22771C93B00AD2CC1 /* XPMineFriendNumberView.m in Sources */,
9BB5495F2782E9DB0090CD26 /* NobleAuthInfo.m in Sources */, 9BB5495F2782E9DB0090CD26 /* NobleAuthInfo.m in Sources */,
9B85F3562806DD8A006EDF51 /* XPAnchorPKFinishView.m in Sources */,
E89DA67227008D59008483C1 /* WalletInfoModel.m in Sources */, E89DA67227008D59008483C1 /* WalletInfoModel.m in Sources */,
E80CBDEA27D0C53F001E1EC2 /* XPWeakTimer.m in Sources */, E80CBDEA27D0C53F001E1EC2 /* XPWeakTimer.m in Sources */,
189DD55026DE37F900AB55B1 /* MvpViewController.m in Sources */, 189DD55026DE37F900AB55B1 /* MvpViewController.m in Sources */,

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "anchorPK_result_mvp_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "anchorPK_result_mvp_icon@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: 2.2 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

View File

@@ -41,6 +41,13 @@ NS_ASSUME_NONNULL_BEGIN
加入频道房间TRTC 进房需要动态签名。 加入频道房间TRTC 进房需要动态签名。
*/ */
- (BOOL)joinChannel:(NSString *)channelId sign:(NSString *)sign completion:(void(^ __nullable)(void))completion; - (BOOL)joinChannel:(NSString *)channelId sign:(NSString *)sign completion:(void(^ __nullable)(void))completion;
///发起跨房通话
- (void)connectOtherRoom:(NSString *)roomUId userId:(NSString *)userId;
///退出跨房通话
- (void)disconnectOtherRoom;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -47,6 +47,40 @@
return YES; return YES;
} }
///
- (void)connectOtherRoom:(NSString *)roomUid userId:(NSString *)uid {
NSMutableDictionary *jsonDict = [[NSMutableDictionary alloc] init];
[jsonDict setObject:@([roomUid intValue]) forKey:@"roomId"];
[jsonDict setObject:uid forKey:@"userId"];
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonDict options:NSJSONWritingPrettyPrinted error:nil];
NSString* jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[self.engine connectOtherRoom:jsonString];
}
///退
- (void)disconnectOtherRoom {
[self.engine disconnectOtherRoom];
}
///
- (void)onConnectOtherRoom:(NSString *)userId errCode:(TXLiteAVError)errCode errMsg:(NSString *)errMsg {
if (errCode == ERR_NULL) {
// self.delegate
}
}
///退
- (void)onDisconnectOtherRoom:(TXLiteAVError)errCode errMsg:(NSString *)errMsg {
}
- (void)onUserAudioAvailable:(NSString *)userId available:(BOOL)available {
NSLog(@"成功userid:%@", userId);
if (available) {
}
}
- (BOOL)muteRemote:(BOOL)mute { - (BOOL)muteRemote:(BOOL)mute {
[self.engine muteAllRemoteAudio:mute]; [self.engine muteAllRemoteAudio:mute];
return YES; return YES;

View File

@@ -100,6 +100,12 @@ typedef enum : NSUInteger {
*/ */
- (void)exitRoom; - (void)exitRoom;
///发起跨房PK
- (void)connectOtherRoom:(NSString *)roomUid userId:(NSString *)uid;
///退出跨房通话
- (void)disconnectOtherRoom;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -96,6 +96,16 @@
}]; }];
} }
///
- (void)connectOtherRoom:(NSString *)roomUid userId:(NSString *)uid {
[self.engine connectOtherRoom:roomUid userId:uid];
}
///退
- (void)disconnectOtherRoom {
[self.engine disconnectOtherRoom];
}
- (void)destory { - (void)destory {
[self.engine destory]; [self.engine destory];
} }

View File

@@ -154,11 +154,6 @@ NS_ASSUME_NONNULL_BEGIN
/// @param teamUid 房间uid /// @param teamUid 房间uid
+ (void)requestFansTeamTask:(HttpRequestHelperCompletion)completion teamUid:(NSString *)teamUid; + (void)requestFansTeamTask:(HttpRequestHelperCompletion)completion teamUid:(NSString *)teamUid;
/// 结束个播房PK
/// @param completion 完成
/// @param roundId PK场次id
+ (void)requestEndAnchorRoomPk:(HttpRequestHelperCompletion)completion roundId:(NSString *)roundId;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -174,11 +174,5 @@
[self makeRequest:@"anchorFansTeam/getFansTaskInfo" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, teamUid, nil]; [self makeRequest:@"anchorFansTeam/getFansTaskInfo" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, teamUid, nil];
} }
/// PK
/// @param completion
/// @param roundId PKid
+ (void)requestEndAnchorRoomPk:(HttpRequestHelperCompletion)completion roundId:(NSString *)roundId {
[self makeRequest:@"crossroompkround/endSingleRoomPk" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roundId, nil];
}
@end @end

View File

@@ -30,8 +30,6 @@ typedef NS_ENUM(NSInteger, RoomModeType){
RoomModeType_Open_Blind = 5, RoomModeType_Open_Blind = 5,
///开启跨房PK ///开启跨房PK
RoomModeType_Open_AcrossRoomPK_mode = 7, RoomModeType_Open_AcrossRoomPK_mode = 7,
///开启个播PK
RoomModeType_Open_AnchorPK_Mode = 8,
}; };
typedef NS_ENUM(NSInteger, PermitRoomType) { typedef NS_ENUM(NSInteger, PermitRoomType) {
@@ -128,6 +126,8 @@ typedef NS_ENUM(NSInteger, RoomDatingStateChangeType) {
@property (nonatomic, assign) int64_t mgId; @property (nonatomic, assign) int64_t mgId;
///小游戏名称 ///小游戏名称
@property (nonatomic, copy) NSString *mgName; @property (nonatomic, copy) NSString *mgName;
///pk场次id(本地字段)
@property (nonatomic, assign) NSInteger roundId;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -13,6 +13,12 @@ typedef NS_ENUM(NSUInteger, AcrossRoomPkType) {
AcrossRoomPkTypeAnchor, ///个播PK AcrossRoomPkTypeAnchor, ///个播PK
}; };
///PK处于什么阶段
typedef NS_ENUM(NSUInteger, AcrossRoomPkStateType) {
AcrossRoomPkStateTypePking = 1,//PK中
AcrossRoomPkStateTypePenalty, //惩罚阶段
};
@class AcrossRoomPkRankModel; @class AcrossRoomPkRankModel;
@interface AcrossRoomPKPanelModel : NSObject @interface AcrossRoomPKPanelModel : NSObject
///当前时间 ///当前时间
@@ -49,12 +55,16 @@ typedef NS_ENUM(NSUInteger, AcrossRoomPkType) {
@property (nonatomic, copy) NSString * cUid; @property (nonatomic, copy) NSString * cUid;
///结束时间戳 ///结束时间戳
@property (nonatomic, assign) long long endTime; @property (nonatomic, assign) long long endTime;
///惩罚结束时间戳
@property (nonatomic, assign) long long penaltyEndTime;
/// 赢家uid /// 赢家uid
@property (nonatomic, copy) NSString * winUid; @property (nonatomic, copy) NSString * winUid;
///是否异常结束 ///是否异常结束
@property (nonatomic, assign) BOOL isForce; @property (nonatomic, assign) BOOL isForce;
///PK类型 1牌照房 2个播房 ///PK类型 1牌照房 2个播房
@property (nonatomic, assign) AcrossRoomPkType pkType; @property (nonatomic, assign) AcrossRoomPkType pkType;
//PK进行状态(1pk中 2惩罚中
@property (nonatomic, assign) AcrossRoomPkStateType pkState;
///场次id ///场次id
@property (nonatomic, assign) NSInteger roundId; @property (nonatomic, assign) NSInteger roundId;
@end @end

View File

@@ -9,6 +9,10 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, AcrossRoomPKType) {
AcrossRoomPKTypeNormal = 0,
AcrossRoomPKTypeAnchor,
};
@interface AcrossRoomPKPrizeModel : NSObject @interface AcrossRoomPKPrizeModel : NSObject
///赢方UID ///赢方UID
@property (nonatomic, copy) NSString * winUid; @property (nonatomic, copy) NSString * winUid;
@@ -24,6 +28,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString *failTitle; @property (nonatomic, copy) NSString *failTitle;
///描述 ///描述
@property (nonatomic, copy) NSString *msg; @property (nonatomic, copy) NSString *msg;
///PK类型0 普通PK 1个播PK
@property (nonatomic, assign) AcrossRoomPKType pkType;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -114,6 +114,34 @@
self.redRoomTitleLabel.text = data.winTitle; self.redRoomTitleLabel.text = data.winTitle;
self.blueRoomTitleLabel.text = data.failTitle; self.blueRoomTitleLabel.text = data.failTitle;
self.titleLabel.text = data.msg; self.titleLabel.text = data.msg;
if (data.pkType == AcrossRoomPKTypeAnchor) {
self.titleLabel.numberOfLines = 0;
self.titleLabel.font = [UIFont systemFontOfSize:10];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.bgImageView.image = [UIImage imageNamed:@"anchorPK_prize_bg"];
self.middleImageView.image = [UIImage imageNamed:@"anchorPK_prize_KO"];
[self.onLookBtn setBackgroundImage:[UIImage imageNamed:@"anchorPK_prize_onLook_bg"] forState:UIControlStateNormal];
[self.onLookBtn setTitle:@"去围观" forState:UIControlStateNormal];
self.onLookBtn.layer.masksToBounds = NO;
self.onLookBtn.layer.borderWidth = 0;
[self.onLookBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(58);
make.height.mas_equalTo(20);
make.right.mas_equalTo(-70);
make.bottom.mas_equalTo(-14);
}];
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.onLookBtn);
make.width.mas_equalTo(152);
make.bottom.mas_equalTo(self.onLookBtn.mas_top).mas_offset(-5);
}];
[self.redRoomTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.redHeadImageView.mas_bottom).mas_offset(4);
}];
[self.blueRoomTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.blueHeadImageView.mas_bottom).mas_offset(4);
}];
}
} }
#pragma mark - getters and setters #pragma mark - getters and setters

View File

@@ -0,0 +1,19 @@
//
// XPAnchorPKFinishView.h
// xplan-ios
//
// Created by GreenLand on 2022/4/13.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class AcrossRoomPKPanelModel;
@interface XPAnchorPKFinishView : UIView
@property (nonatomic, strong) AcrossRoomPKPanelModel *data;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,236 @@
//
// XPAnchorPKFinishView.m
// xplan-ios
//
// Created by GreenLand on 2022/4/13.
//
#import "XPAnchorPKFinishView.h"
///Third
#import <Masonry/Masonry.h>
#import <SVGA.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "XPMacro.h"
#import "UIImage+Utils.h"
#import "TTPopup.h"
///Model
#import "AcrossRoomPKPanelModel.h"
@interface XPAnchorPKFinishView ()
///
@property (nonatomic, strong) UILabel *titleLabel;
///
@property (nonatomic, strong) UIImageView *backgroundImageView;
///
@property (nonatomic, strong) NetImageView *redAvatarImageView;
///
@property (nonatomic, strong) NetImageView *blueAvatarImageView;
///vs
@property (nonatomic, strong) UIImageView *vsImageView;
///pk
@property (nonatomic, strong) UIImageView *redValueBgImageView;
///pk
@property (nonatomic, strong) UIImageView *blueValueBgImageView;
///PK
@property (nonatomic, strong) UILabel *redValueLabel;
///PK
@property (nonatomic, strong) UILabel *blueValueLabel;
///
@property (nonatomic, strong) UIButton *closeBtn;
@end
@implementation XPAnchorPKFinishView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.backgroundImageView];
[self addSubview:self.titleLabel];
[self addSubview:self.redAvatarImageView];
[self addSubview:self.blueAvatarImageView];
[self addSubview:self.vsImageView];
[self addSubview:self.redValueBgImageView];
[self addSubview:self.blueValueBgImageView];
[self addSubview:self.redValueLabel];
[self addSubview:self.blueValueLabel];
[self addSubview:self.closeBtn];
}
- (void)initSubViewConstraints {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(300);
make.height.mas_equalTo(306);
make.bottom.mas_equalTo(self.backgroundImageView.mas_bottom);
}];
[self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(0);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self.backgroundImageView).mas_offset(64);
make.height.mas_equalTo(21);
}];
[self.redAvatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(52);
make.width.height.mas_equalTo(80);
make.left.mas_equalTo(24);
}];
[self.vsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.centerY.mas_equalTo(self.redAvatarImageView);
make.width.mas_equalTo(64);
make.height.mas_equalTo(74);
}];
[self.blueAvatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.redAvatarImageView);
make.width.height.mas_equalTo(80);
make.right.mas_equalTo(-24);
}];
[self.redValueBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.redAvatarImageView.mas_bottom).mas_offset(6);
make.height.mas_equalTo(26);
make.width.mas_equalTo(101);
make.centerX.mas_equalTo(self.redAvatarImageView);
}];
[self.blueValueBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.redValueBgImageView);
make.height.mas_equalTo(26);
make.width.mas_equalTo(101);
make.centerX.mas_equalTo(self.blueAvatarImageView);
}];
[self.redValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.mas_equalTo(self.redValueBgImageView);
}];
[self.blueValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.mas_equalTo(self.blueValueBgImageView);
}];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.top.mas_equalTo(self.backgroundImageView);
make.width.height.mas_equalTo(32);
}];
}
#pragma mark - Event Response
- (void)onCloseBtnClick:(UIButton *)button {
[TTPopup dismiss];
}
- (void)setData:(AcrossRoomPkRankModel *)data {
// self.redAvatarImageView.imageUrl = data.a
// self.titleLabel.text = data.nick ? data.nick : @"";
// self.contentLabel.text = [NSString stringWithFormat:@"PK值%@", data.amount? data.amount : @""];
// self.headImageView.imageUrl = data.avatar;
}
#pragma mark - Getters And Setters
- (UIImageView *)backgroundImageView {
if (!_backgroundImageView) {
_backgroundImageView = [[UIImageView alloc] init];
_backgroundImageView.image = [UIImage imageNamed:@"anchorPK_invite_bg"];
}
return _backgroundImageView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.text = @"PK结束";
_titleLabel.textColor = [UIColor whiteColor];
_titleLabel.font = [UIFont systemFontOfSize:15];
}
return _titleLabel;
}
- (UIButton *)closeBtn {
if (!_closeBtn) {
_closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_closeBtn addTarget:self action:@selector(onCloseBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[_closeBtn setBackgroundImage:[UIImage imageNamed:@"anchorPk_result_close"] forState:UIControlStateNormal];
}
return _closeBtn;
}
- (NetImageView *)redAvatarImageView {
if (!_redAvatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_redAvatarImageView = [[NetImageView alloc] initWithConfig:config];
_redAvatarImageView.layer.masksToBounds = YES;
_redAvatarImageView.layer.cornerRadius = 80 / 2;
_redAvatarImageView.layer.borderWidth = 2;
_redAvatarImageView.layer.borderColor = UIColorFromRGB(0xFE6464).CGColor;
}
return _redAvatarImageView;
}
- (NetImageView *)blueAvatarImageView {
if (!_blueAvatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_blueAvatarImageView = [[NetImageView alloc] initWithConfig:config];
_blueAvatarImageView.layer.masksToBounds = YES;
_blueAvatarImageView.layer.cornerRadius = 80 / 2;
_blueAvatarImageView.layer.borderWidth = 2;
_blueAvatarImageView.layer.borderColor = UIColorFromRGB(0x3794FE).CGColor;
}
return _blueAvatarImageView;
}
- (UIImageView *)redValueBgImageView {
if (!_redValueBgImageView) {
_redValueBgImageView = [[UIImageView alloc] init];
_redValueBgImageView.image = [UIImage imageNamed:@"anchorPK_invite_bg"];
}
return _redValueBgImageView;
}
- (UIImageView *)blueValueBgImageView {
if (!_blueValueBgImageView) {
_blueValueBgImageView = [[UIImageView alloc] init];
_blueValueBgImageView.image = [UIImage imageNamed:@"anchorPK_invite_bg"];
}
return _blueValueBgImageView;
}
- (UILabel *)redValueLabel {
if (!_redValueLabel) {
_redValueLabel = [[UILabel alloc] init];
_redValueLabel.font = [UIFont systemFontOfSize:12];
_redValueLabel.textColor = UIColorFromRGB(0xFF0000);
_redValueLabel.textAlignment = NSTextAlignmentCenter;
}
return _redValueLabel;
}
- (UILabel *)blueValueLabel {
if (!_blueValueLabel) {
_blueValueLabel = [[UILabel alloc] init];
_blueValueLabel.font = [UIFont systemFontOfSize:12];
_blueValueLabel.textColor = UIColorFromRGB(0x0060D1);
_blueValueLabel.textAlignment = NSTextAlignmentCenter;
}
return _blueValueLabel;
}
- (UIImageView *)vsImageView {
if (!_vsImageView) {
_vsImageView = [[UIImageView alloc] init];
_vsImageView.image = [UIImage imageNamed:@"anchorPk_panel_vs"];
}
return _vsImageView;
}
@end

View File

@@ -0,0 +1,19 @@
//
// XPAnchorPKResultView.h
// xplan-ios
//
// Created by GreenLand on 2022/4/13.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class AcrossRoomPKPanelModel;
@interface XPAnchorPKResultView : UIView
@property (nonatomic, strong) AcrossRoomPKPanelModel *data;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,437 @@
//
// XPAnchorPKResultView.m
// xplan-ios
//
// Created by GreenLand on 2022/4/13.
//
#import "XPAnchorPKResultView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "TTPopup.h"
#import "XPMacro.h"
///Model
#import "AcrossRoomPKPanelModel.h"
@interface XPAnchorPKResultContributeView : UIView
///
@property (nonatomic, strong) UIImageView *bgImageView;
///mvpIcon
@property (nonatomic, strong) UIImageView *mvpIconView;
///
@property (nonatomic, strong) NetImageView *headImageView;
///
@property (nonatomic,strong) UILabel *titleLabel;
///
@property (nonatomic,strong) UILabel *contentLabel;
@property (nonatomic, strong) AcrossRoomPkRankModel *data;
@end
@implementation XPAnchorPKResultContributeView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.bgImageView];
[self addSubview:self.headImageView];
[self addSubview:self.mvpIconView];
[self addSubview:self.titleLabel];
[self addSubview:self.contentLabel];
}
- (void)initSubViewConstraints {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(40);
make.width.mas_equalTo(159);
}];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(0);
}];
[self.headImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.left.mas_equalTo(16);
make.width.height.mas_equalTo(34);
}];
[self.mvpIconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(32);
make.height.mas_equalTo(12);
make.centerX.mas_equalTo(self.headImageView);
make.bottom.mas_equalTo(self.headImageView).mas_offset(1);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.headImageView).mas_offset(2);
make.left.mas_equalTo(self.headImageView.mas_right).mas_offset(8);
make.height.mas_equalTo(13);
make.right.mas_equalTo(0);
}];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.titleLabel);
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(4);
make.height.mas_equalTo(11);
}];
}
#pragma mark - Getters And Setters
- (void)setData:(AcrossRoomPkRankModel *)data {
self.titleLabel.text = data.nick ? data.nick : @"";
self.contentLabel.text = [NSString stringWithFormat:@"PK值%@", data.amount? data.amount : @""];
self.headImageView.imageUrl = data.avatar;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textColor = [UIColor whiteColor];
_titleLabel.font = [UIFont systemFontOfSize:12];
_titleLabel.text = @"";
}
return _titleLabel;
}
- (UILabel *)contentLabel {
if (!_contentLabel) {
_contentLabel = [[UILabel alloc] init];
_contentLabel.textColor = [UIColor whiteColor];
_contentLabel.font = [UIFont systemFontOfSize:10];
}
return _contentLabel;
}
- (UIImageView *)bgImageView {
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] init];
_bgImageView.image = [UIImage imageNamed:@"anchorPK_result_contribute_bg"];
}
return _bgImageView;
}
- (UIImageView *)mvpIconView {
if (!_mvpIconView) {
_mvpIconView = [[UIImageView alloc] init];
_mvpIconView.image = [UIImage imageNamed:@"anchorPK_result_mvp_icon"];
_mvpIconView.hidden = YES;
}
return _mvpIconView;
}
- (NetImageView *)headImageView {
if (!_headImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_headImageView = [[NetImageView alloc] initWithConfig:config];
_headImageView.layer.masksToBounds = YES;
_headImageView.layer.cornerRadius = 17;
_headImageView.layer.borderColor = [UIColor whiteColor].CGColor;
_headImageView.layer.borderWidth = 0.5;
}
return _headImageView;
}
@end
@interface XPAnchorPKResultView()
/** bgImageView */
@property (nonatomic, strong) UIImageView *bgImageView;
///
@property (nonatomic, strong) UIButton *closeBtn;
///view
@property (nonatomic, strong) UIView *mainView;
///
@property (nonatomic, strong) UIImageView *headWearImageView;
///
@property (nonatomic, strong) NetImageView *avatarImageView;
///
@property (nonatomic, strong) UILabel *roomTitleLabel;
///pk
@property (nonatomic, strong) UILabel *pkValueLabel;
///
@property (nonatomic, strong) UIImageView *contributeTitleBgImageView;
///
@property (nonatomic, strong) UILabel *contributeTitleLabel;
///tip
@property (nonatomic, strong) UILabel *noneContrbuteLabel;
///
@property (strong, nonatomic) dispatch_source_t timer;
@end
@implementation XPAnchorPKResultView
- (void)dealloc {
NSLog(@"销毁了");
if (self.timer) {
dispatch_source_cancel(self.timer);
self.timer = nil;
}
}
#pragma mark - life cycle
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initView];
[self initConstrations];
}
return self;
}
- (void)initView {
[self addSubview:self.bgImageView];
[self addSubview:self.closeBtn];
[self addSubview:self.mainView];
[self addSubview:self.avatarImageView];
[self addSubview:self.headWearImageView];
[self.mainView addSubview:self.roomTitleLabel];
[self.mainView addSubview:self.pkValueLabel];
[self.mainView addSubview:self.contributeTitleBgImageView];
[self.mainView addSubview:self.contributeTitleLabel];
[self.mainView addSubview:self.noneContrbuteLabel];
}
- (void)initConstrations {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(0);
make.top.mas_equalTo(47);
make.height.mas_equalTo(370);
}];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self.bgImageView.mas_bottom).mas_offset(23);
make.width.mas_equalTo(72);
make.height.mas_equalTo(32);
}];
[self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.bgImageView);
}];
[self.headWearImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(0);
make.centerX.mas_equalTo(self);
make.width.mas_equalTo(148);
make.height.mas_equalTo(114);
}];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(27);
make.width.height.mas_equalTo(64);
make.centerX.mas_equalTo(self);
}];
[self.roomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.headWearImageView.mas_bottom).mas_offset(15);
make.centerX.mas_equalTo(self.avatarImageView);
make.height.mas_equalTo(15);
}];
[self.pkValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.avatarImageView);
make.top.mas_equalTo(self.roomTitleLabel.mas_bottom).offset(8);
make.height.mas_equalTo(13);
}];
[self.contributeTitleBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.pkValueLabel.mas_bottom).mas_offset(17);
make.centerX.mas_equalTo(self.mainView);
make.width.mas_equalTo(160);
make.height.mas_equalTo(24);
}];
[self.contributeTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.mas_equalTo(self.contributeTitleBgImageView);
}];
[self.noneContrbuteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.pkValueLabel.mas_bottom).mas_offset(92);
make.centerX.mas_equalTo(self);
}];
}
- (void)setData:(AcrossRoomPKPanelModel *)data {
if (data.winUid == data.cUid) {//
self.bgImageView.image = [UIImage imageNamed:@"anchorPK_result_win_bg"];
self.headWearImageView.image = [UIImage imageNamed:@"anchorPK_result_win_headWear"];
self.contributeTitleBgImageView.image = [UIImage imageNamed:@"anchorPK_result_win_title_bg"];
} else if (data.winUid == data.aUid) {//
self.bgImageView.image = [UIImage imageNamed:@"anchorPK_result_fail_bg"];
self.headWearImageView.image = [UIImage imageNamed:@"anchorPK_result_fail_headWear"];
self.contributeTitleBgImageView.image = [UIImage imageNamed:@"anchorPK_result_fail_title_bg"];
} else {//
self.bgImageView.image = [UIImage imageNamed:@"anchorPK_result_tie_bg"];
self.headWearImageView.image = [UIImage imageNamed:@"anchorPK_result_tie_headWear"];
self.contributeTitleBgImageView.image = [UIImage imageNamed:@"anchorPK_result_tie_title_bg"];
}
self.avatarImageView.imageUrl = data.cAvatar;
self.roomTitleLabel.text = data.cTitle;
self.pkValueLabel.text = [NSString stringWithFormat:@"PK值%lld", data.cAmount];
if (data.csRank.count > 0) {//
self.contributeTitleBgImageView.hidden = NO;
self.contributeTitleLabel.hidden = NO;
self.noneContrbuteLabel.hidden = YES;
for (int i = 0; i<data.csRank.count; i++) {
AcrossRoomPkRankModel *contributeInfo = [data.csRank objectAtIndex:i];
XPAnchorPKResultContributeView *view = [[XPAnchorPKResultContributeView alloc] init];
[self.mainView addSubview:view];
view.data = contributeInfo;
[view mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.mainView);
make.height.mas_equalTo(159);
make.top.mas_equalTo(self.contributeTitleBgImageView.mas_bottom).mas_offset(7 + 167 * i);
}];
view.mvpIconView.hidden = i != 0;
}
} else {
self.contributeTitleBgImageView.hidden = YES;
self.contributeTitleLabel.hidden = YES;
self.noneContrbuteLabel.hidden = NO;
}
[self openCountdownWithTime:6];
}
#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(), ^{
[TTPopup dismiss];
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
//
[self.closeBtn setTitle:[NSString stringWithFormat:@"关闭(%ld)", tempTime] forState:UIControlStateNormal];
});
tempTime--;
}
});
dispatch_resume(self.timer);
}
}
- (void)onCloseBtnClick:(UIButton *)btn {
[TTPopup dismiss];
}
#pragma mark - getters and setters
- (UIImageView *)bgImageView {
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] init];
_bgImageView.image = [UIImage imageNamed:@"anchorPK_result_win_bg"];
}
return _bgImageView;
}
- (UIButton *)closeBtn {
if (!_closeBtn) {
_closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_closeBtn addTarget:self action:@selector(onCloseBtnClick:) forControlEvents:UIControlEventTouchUpInside];
[_closeBtn setTitle:@"关闭(5)" forState:UIControlStateNormal];
_closeBtn.titleLabel.font = [UIFont systemFontOfSize:12];
[_closeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_closeBtn setBackgroundColor:UIColorRGBAlpha(0xFFFFFF, 0.37)];
_closeBtn.layer.cornerRadius = 16;
_closeBtn.layer.masksToBounds = YES;
}
return _closeBtn;
}
- (UIView *)mainView {
if (!_mainView) {
_mainView = [[UIView alloc] init];
}
return _mainView;
}
- (UIImageView *)headWearImageView {
if (!_headWearImageView) {
_headWearImageView = [[UIImageView alloc] init];
_headWearImageView.image = [UIImage imageNamed:@"anchorPK_result_win_headWear"];
}
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.cornerRadius = 32;
_avatarImageView.layer.masksToBounds = YES;
}
return _avatarImageView;
}
- (UILabel *)roomTitleLabel {
if (!_roomTitleLabel) {
_roomTitleLabel = [[UILabel alloc] init];
_roomTitleLabel.textColor = [UIColor whiteColor];
_roomTitleLabel.font = [UIFont systemFontOfSize:14];
_roomTitleLabel.textAlignment = NSTextAlignmentCenter;
}
return _roomTitleLabel;
}
- (UILabel *)pkValueLabel {
if (!_pkValueLabel) {
_pkValueLabel = [[UILabel alloc] init];
_pkValueLabel.textColor = [UIColor whiteColor];
_pkValueLabel.font = [UIFont systemFontOfSize:12];
_pkValueLabel.textAlignment = NSTextAlignmentCenter;
}
return _pkValueLabel;
}
- (UIImageView *)contributeTitleBgImageView {
if (!_contributeTitleBgImageView) {
_contributeTitleBgImageView = [[UIImageView alloc] init];
_contributeTitleBgImageView.image = [UIImage imageNamed:@"anchorPK_result_win_title_bg"];
}
return _contributeTitleBgImageView;
}
- (UILabel *)contributeTitleLabel {
if (!_contributeTitleLabel) {
_contributeTitleLabel = [[UILabel alloc] init];
_contributeTitleLabel.textColor = UIColorFromRGB(0xE5E5E5);
_contributeTitleLabel.font = [UIFont systemFontOfSize:10];
_contributeTitleLabel.textAlignment = NSTextAlignmentCenter;
_contributeTitleLabel.text = @"本场PK贡献值前三";
}
return _contributeTitleLabel;
}
- (UILabel *)noneContrbuteLabel {
if (!_noneContrbuteLabel) {
_noneContrbuteLabel = [[UILabel alloc] init];
_noneContrbuteLabel.text = @"暂时无人送礼,再玩一局吧~";
_noneContrbuteLabel.textColor = UIColorFromRGB(0xDAD7FF);
_noneContrbuteLabel.font = [UIFont systemFontOfSize:10];
_noneContrbuteLabel.textAlignment = NSTextAlignmentCenter;
_noneContrbuteLabel.hidden = YES;
}
return _noneContrbuteLabel;
}
@end

View File

@@ -11,6 +11,7 @@
///Tool ///Tool
#import "ThemeColor.h" #import "ThemeColor.h"
#import "TTPopup.h" #import "TTPopup.h"
#import "UIImage+Utils.h"
@interface XPAnchorPKRuleView () @interface XPAnchorPKRuleView ()
/// ///
@@ -18,13 +19,13 @@
/// ///
@property (nonatomic, strong) UIImageView *backgroundImageView; @property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) UIView *firstLineView; @property (nonatomic, strong) UIImageView *firstLineView;
@property (nonatomic, strong) UILabel *firstLineLabel; @property (nonatomic, strong) UILabel *firstLineLabel;
/// ///
@property (nonatomic, strong) UITextView *ruleTextView; @property (nonatomic, strong) UITextView *ruleTextView;
@property (nonatomic, strong) UIView *secondLineView; @property (nonatomic, strong) UIImageView *secondLineView;
@property (nonatomic, strong) UILabel *secondLineLabel; @property (nonatomic, strong) UILabel *secondLineLabel;
@@ -47,7 +48,12 @@
- (void)initSubViews { - (void)initSubViews {
[self addSubview:self.backgroundImageView]; [self addSubview:self.backgroundImageView];
[self addSubview:self.titleLabel]; [self addSubview:self.titleLabel];
[self addSubview:self.firstLineView];
[self addSubview:self.firstLineLabel];
[self addSubview:self.ruleTextView]; [self addSubview:self.ruleTextView];
[self addSubview:self.secondLineView];
[self addSubview:self.secondLineLabel];
[self addSubview:self.secondTextView];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
@@ -56,20 +62,45 @@
make.height.mas_equalTo(306); make.height.mas_equalTo(306);
make.bottom.mas_equalTo(self.backgroundImageView.mas_bottom); make.bottom.mas_equalTo(self.backgroundImageView.mas_bottom);
}]; }];
[self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(0); make.edges.mas_equalTo(0);
}]; }];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self); make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self.backgroundImageView).mas_offset(64); make.top.mas_equalTo(self.backgroundImageView).mas_offset(64);
make.height.mas_equalTo(21);
}];
[self.firstLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(30);
make.height.mas_equalTo(8);
make.width.mas_equalTo(88);
make.centerX.mas_equalTo(self);
}];
[self.firstLineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.firstLineView);
make.bottom.mas_equalTo(self.firstLineView);
}]; }];
[self.ruleTextView mas_makeConstraints:^(MASConstraintMaker *make) { [self.ruleTextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(23); make.top.mas_equalTo(self.firstLineView.mas_bottom).mas_offset(8);
make.left.mas_equalTo(17); make.left.mas_equalTo(17);
make.right.mas_equalTo(-18); make.right.mas_equalTo(-18);
make.bottom.mas_equalTo(-17); make.height.mas_equalTo(56);
}];
[self.secondLineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.ruleTextView.mas_bottom).mas_offset(26);
make.height.mas_equalTo(8);
make.width.mas_equalTo(88);
make.centerX.mas_equalTo(self);
}];
[self.firstLineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.secondLineView);
make.bottom.mas_equalTo(self.secondLineView);
}];
[self.secondTextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.secondLineView.mas_bottom).mas_offset(8);
make.left.mas_equalTo(17);
make.right.mas_equalTo(-18);
make.height.mas_equalTo(35);
}]; }];
} }
@@ -97,6 +128,46 @@
return _titleLabel; return _titleLabel;
} }
- (UIImageView *)firstLineView {
if (!_firstLineView) {
_firstLineView = [[UIImageView alloc] init];
_firstLineView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x58ECFF), UIColorFromRGB(0x1CD7FD), UIColorFromRGB(0x9377FF), UIColorFromRGB(0xFF6BA3)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
_firstLineView.layer.cornerRadius = 4;
_firstLineView.layer.masksToBounds = YES;
}
return _firstLineView;
}
- (UILabel *)firstLineLabel {
if (!_firstLineLabel) {
_firstLineLabel = [[UILabel alloc] init];
_firstLineLabel.text = @"什么是PK";
_firstLineLabel.textColor = [ThemeColor mainTextColor];
_firstLineLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
}
return _firstLineLabel;
}
- (UIImageView *)secondLineView {
if (!_secondLineView) {
_secondLineView = [[UIImageView alloc] init];
_secondLineView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x58ECFF), UIColorFromRGB(0x1CD7FD), UIColorFromRGB(0x9377FF), UIColorFromRGB(0xFF6BA3)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
_secondLineView.layer.cornerRadius = 4;
_secondLineView.layer.masksToBounds = YES;
}
return _secondLineView;
}
- (UILabel *)secondLineLabel {
if (!_secondLineLabel) {
_secondLineLabel = [[UILabel alloc] init];
_secondLineLabel.text = @"首杀暴击";
_firstLineLabel.textColor = [ThemeColor mainTextColor];
_firstLineLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
}
return _secondLineLabel;
}
- (UITextView *)ruleTextView { - (UITextView *)ruleTextView {
if (!_ruleTextView) { if (!_ruleTextView) {
_ruleTextView = [[UITextView alloc] init]; _ruleTextView = [[UITextView alloc] init];
@@ -109,5 +180,17 @@
} }
return _ruleTextView; return _ruleTextView;
} }
- (UITextView *)secondTextView {
if (!_secondTextView) {
_secondTextView = [[UITextView alloc] init];
_secondTextView.textColor = UIColorFromRGB(0xffffff);
_secondTextView.backgroundColor = [UIColor clearColor];
_secondTextView.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
_secondTextView.scrollEnabled = NO;
_secondTextView.editable = NO;
_secondTextView.text = @"1只有牌照房房主和超管才可以发起跨房pk一次只能选择一个牌照房发起\n2只有房主和超管才可以接受或拒绝跨房pk请求若10秒内不点击pk邀请弹窗弹窗消失视为自动拒绝\n3发起pk时需选择pk时间和pk对象自定义时间下限为5上限为180只能填写整数\n4pk发起后未到pk时间无法自行结束若有特殊情况需提前结束可联系客服但本场pk不算胜负。\n";
}
return _secondTextView;
}
@end @end

View File

@@ -8,6 +8,7 @@
#import "XPAnchorPkPanelView.h" #import "XPAnchorPkPanelView.h"
///Third ///Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import <SVGA.h>
///Tool ///Tool
#import "ThemeColor.h" #import "ThemeColor.h"
#import "NetImageView.h" #import "NetImageView.h"
@@ -30,6 +31,8 @@
@property (nonatomic, strong) UIImageView *redStarImageView; @property (nonatomic, strong) UIImageView *redStarImageView;
/// ///
@property (nonatomic, strong) UIImageView *blueStarImageView; @property (nonatomic, strong) UIImageView *blueStarImageView;
///PK
@property (nonatomic, strong) UILabel *pkStateLabel;
/// ///
@property (nonatomic, strong) UILabel *timeLabel; @property (nonatomic, strong) UILabel *timeLabel;
/// ///
@@ -44,11 +47,13 @@
/// ///
@property (nonatomic, strong) UILabel *redCountLabel; @property (nonatomic, strong) UILabel *redCountLabel;
/// ///
@property (nonatomic, strong) UIImageView *buleCountImageView; @property (nonatomic, strong) UIImageView *blueCountImageView;
/// ///
@property (nonatomic, strong) UILabel *buleCountLabel; @property (nonatomic, strong) UILabel *blueCountLabel;
/// ///
@property (nonatomic, strong) UIImageView *middleImageView; @property (strong, nonatomic) SVGAParser *parser;
///
@property (nonatomic, strong) SVGAImageView *svgDisplayView;
#pragma mark - view #pragma mark - view
/// ///
@property (nonatomic,strong) UIStackView *redContributeStackView; @property (nonatomic,strong) UIStackView *redContributeStackView;
@@ -98,21 +103,22 @@
- (void)initSubViews { - (void)initSubViews {
self.userInteractionEnabled = NO; self.userInteractionEnabled = NO;
[self addSubview:self.backImageView]; [self addSubview:self.backImageView];
[self.backImageView addSubview:self.stackView];
[self.backImageView addSubview:self.timeLabel]; [self.stackView addArrangedSubview:self.pkStateLabel];
[self.stackView addArrangedSubview:self.timeLabel];
/// ///
[self.backImageView addSubview:self.progressView]; [self.backImageView addSubview:self.progressView];
[self.progressView addSubview:self.progressContentView]; [self.progressView addSubview:self.progressContentView];
[self.progressContentView addSubview:self.redCountImageView]; [self.progressContentView addSubview:self.redCountImageView];
[self.progressContentView addSubview:self.buleCountImageView]; [self.progressContentView addSubview:self.blueCountImageView];
[self.progressContentView addSubview:self.svgDisplayView];
/// ///
[self.backImageView addSubview:self.redContributeStackView]; [self.backImageView addSubview:self.redContributeStackView];
[self.backImageView addSubview:self.blueContributeStackView]; [self.backImageView addSubview:self.blueContributeStackView];
[self.progressContentView addSubview:self.redCountLabel]; [self.progressContentView addSubview:self.redCountLabel];
[self.progressContentView addSubview:self.buleCountLabel]; [self.progressContentView addSubview:self.blueCountLabel];
[self.backImageView addSubview:self.redStarImageView]; [self.backImageView addSubview:self.redStarImageView];
[self.backImageView addSubview:self.blueStarImageView]; [self.backImageView addSubview:self.blueStarImageView];
[self.backImageView addSubview:self.middleImageView];
[self addSubview:self.otherAvatarImageView]; [self addSubview:self.otherAvatarImageView];
[self addSubview:self.otherResultImageView]; [self addSubview:self.otherResultImageView];
@@ -120,6 +126,14 @@
[self.otherStackView addArrangedSubview:self.otherNickLabel]; [self.otherStackView addArrangedSubview:self.otherNickLabel];
[self.otherStackView addArrangedSubview:self.followButton]; [self.otherStackView addArrangedSubview:self.followButton];
[self initUserSubViews]; [self initUserSubViews];
[self.parser parseWithNamed:@"anchorPK_progress" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
self.svgDisplayView.loops = INT_MAX;
self.svgDisplayView.clearsAfterStop = NO;
self.svgDisplayView.videoItem = videoItem;
[self.svgDisplayView startAnimation];
} failureBlock:^(NSError * _Nonnull error) {
}];
} }
- (void)initUserSubViews { - (void)initUserSubViews {
@@ -154,9 +168,10 @@
make.height.mas_equalTo(84); make.height.mas_equalTo(84);
make.centerX.mas_equalTo(self); make.centerX.mas_equalTo(self);
}]; }];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.backImageView).mas_offset(3); make.top.mas_equalTo(self.backImageView);
make.centerX.mas_equalTo(self); make.centerX.mas_equalTo(self);
make.height.mas_equalTo(21);
}]; }];
[self.redStarImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.redStarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -186,7 +201,7 @@
make.left.mas_equalTo(0); make.left.mas_equalTo(0);
make.height.mas_equalTo(16); make.height.mas_equalTo(16);
make.top.mas_equalTo(0); make.top.mas_equalTo(0);
make.right.mas_equalTo(self.buleCountImageView.mas_left); make.right.mas_equalTo(self.blueCountImageView.mas_left);
}]; }];
[self.redCountLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.redCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -194,23 +209,23 @@
make.centerY.mas_equalTo(self.progressContentView); make.centerY.mas_equalTo(self.progressContentView);
}]; }];
[self.buleCountImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.blueCountImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(0); make.right.mas_equalTo(0);
make.height.mas_equalTo(self.redCountImageView); make.height.mas_equalTo(self.redCountImageView);
make.centerY.mas_equalTo(self.redCountImageView); make.centerY.mas_equalTo(self.redCountImageView);
make.width.mas_equalTo(305 * 0.5); make.width.mas_equalTo(305 * 0.5);
}]; }];
[self.buleCountLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.blueCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.progressContentView.mas_right).offset(-17); make.right.mas_equalTo(self.progressContentView.mas_right).offset(-17);
make.centerY.mas_equalTo(self.progressContentView); make.centerY.mas_equalTo(self.progressContentView);
}]; }];
[self.middleImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.svgDisplayView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.buleCountImageView.mas_left); make.centerX.mas_equalTo(self.blueCountImageView.mas_left);
make.centerY.mas_equalTo(self.progressView); make.centerY.mas_equalTo(self.redCountImageView);
make.height.mas_equalTo(26); make.height.mas_equalTo(26);
make.width.mas_equalTo(40); make.width.mas_equalTo(25);
}]; }];
[self.redContributeStackView mas_makeConstraints:^(MASConstraintMaker *make) { [self.redContributeStackView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -260,8 +275,11 @@
dispatch_source_cancel(self.timer); dispatch_source_cancel(self.timer);
self.timer = nil; self.timer = nil;
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
self.timeLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold]; if (self.pkPanelInfo.pkState == AcrossRoomPkStateTypePking) {
self.timeLabel.text = @"PK结果计算中"; self.timeLabel.text = @"结果计算中";
} else {
self.timeLabel.text = @"00:00";
}
}); });
} else { } else {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
@@ -291,7 +309,7 @@
if (time <= 30) { if (time <= 30) {
self.timeLabel.textColor = UIColorFromRGB(0xFF87A1); self.timeLabel.textColor = UIColorFromRGB(0xFF87A1);
} else { } else {
self.timeLabel.textColor = UIColorFromRGB(0xFFF600); self.timeLabel.textColor = UIColorFromRGB(0xFFFFFF);
} }
} }
@@ -310,17 +328,31 @@
- (void)setPkPanelInfo:(AcrossRoomPKPanelModel *)pkPanelInfo { - (void)setPkPanelInfo:(AcrossRoomPKPanelModel *)pkPanelInfo {
_pkPanelInfo = pkPanelInfo; _pkPanelInfo = pkPanelInfo;
if (_pkPanelInfo) { if (_pkPanelInfo) {
[Timestamp getInternetDateWithSuccess:^(NSTimeInterval timeInterval) { if (pkPanelInfo.pkState == AcrossRoomPkStateTypePenalty) {
timeInterval = timeInterval * 1000; self.pkStateLabel.text = @"惩罚时间";
long aTime = (pkPanelInfo.endTime - timeInterval) / 1000; [Timestamp getInternetDateWithSuccess:^(NSTimeInterval timeInterval) {
[self openCountdownWithTime:aTime]; timeInterval = timeInterval * 1000;
} failure:^(NSError * _Nonnull error) { long aTime = (pkPanelInfo.penaltyEndTime - timeInterval) / 1000;
NSDate *datenow = [NSDate date];// [self openCountdownWithTime:aTime];
long time2 = (long)([datenow timeIntervalSince1970]*1000); } failure:^(NSError * _Nonnull error) {
long aTime = (pkPanelInfo.endTime - time2) / 1000; NSDate *datenow = [NSDate date];//
[self openCountdownWithTime:aTime]; long time2 = (long)([datenow timeIntervalSince1970]*1000);
}]; long aTime = (pkPanelInfo.penaltyEndTime - time2) / 1000;
[self openCountdownWithTime:aTime];
}];
} else {
self.pkStateLabel.text = @"PK";
[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) { if (_pkPanelInfo.cTitle.length > 7) {
_pkPanelInfo.cTitle = [NSString stringWithFormat:@"%@…", [_pkPanelInfo.cTitle substringToIndex:7]]; _pkPanelInfo.cTitle = [NSString stringWithFormat:@"%@…", [_pkPanelInfo.cTitle substringToIndex:7]];
} }
@@ -330,7 +362,7 @@
} }
self.redCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.cAmount]; self.redCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.cAmount];
self.buleCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.aAmount]; self.blueCountLabel.text = [NSString stringWithFormat:@"%lld", _pkPanelInfo.aAmount];
for (int i = 0; i<_pkPanelInfo.csRank.count; i++) { for (int i = 0; i<_pkPanelInfo.csRank.count; i++) {
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.csRank objectAtIndex:i]; AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.csRank objectAtIndex:i];
if (i >= self.redContributeStackView.subviews.count) { if (i >= self.redContributeStackView.subviews.count) {
@@ -353,14 +385,14 @@
_pkPanelInfo.aPercent = 1; _pkPanelInfo.aPercent = 1;
} }
CGFloat width = 305; CGFloat width = 305;
[self.buleCountImageView mas_updateConstraints:^(MASConstraintMaker *make) { [self.blueCountImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(width * _pkPanelInfo.aPercent); make.width.mas_equalTo(width * _pkPanelInfo.aPercent);
}]; }];
self.otherAvatarImageView.imageUrl = pkPanelInfo.aAvatar; self.otherAvatarImageView.imageUrl = pkPanelInfo.aAvatar;
self.otherNickLabel.text = pkPanelInfo.aTitle; self.otherNickLabel.text = pkPanelInfo.aTitle;
} else { } else {
self.redCountLabel.text = @"0"; self.redCountLabel.text = @"0";
self.buleCountLabel.text = @"0"; self.blueCountLabel.text = @"0";
for (int i = 0; i<self.redContributeStackView.subviews.count; i++) { for (int i = 0; i<self.redContributeStackView.subviews.count; i++) {
XPAnchorPKPanelUserView *userView = self.redContributeStackView.subviews[i]; XPAnchorPKPanelUserView *userView = self.redContributeStackView.subviews[i];
userView.panelInfo = nil; userView.panelInfo = nil;
@@ -371,7 +403,7 @@
} }
CGFloat width = 305; CGFloat width = 305;
[self.buleCountImageView mas_updateConstraints:^(MASConstraintMaker *make) { [self.blueCountImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(width * 0.5); make.width.mas_equalTo(width * 0.5);
}]; }];
} }
@@ -386,11 +418,32 @@
return _backImageView; return _backImageView;
} }
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionEqualSpacing;
_stackView.alignment = UIStackViewAlignmentFill;
_stackView.spacing = 4;
}
return _stackView;
}
- (UILabel *)pkStateLabel {
if (!_pkStateLabel) {
_pkStateLabel = [[UILabel alloc] init];
_pkStateLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
_pkStateLabel.textColor = UIColorFromRGB(0xFFFFFF);
_pkStateLabel.text = @"PK";
}
return _pkStateLabel;
}
- (UILabel *)timeLabel { - (UILabel *)timeLabel {
if (!_timeLabel) { if (!_timeLabel) {
_timeLabel = [[UILabel alloc] init]; _timeLabel = [[UILabel alloc] init];
_timeLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold]; _timeLabel.font = [UIFont systemFontOfSize:12];
_timeLabel.textColor = UIColorFromRGB(0xFFF600); _timeLabel.textColor = UIColorFromRGB(0xFFFFFF);
_timeLabel.text = @"00:00"; _timeLabel.text = @"00:00";
} }
return _timeLabel; return _timeLabel;
@@ -448,23 +501,23 @@
return _redCountLabel; return _redCountLabel;
} }
- (UIImageView *)buleCountImageView { - (UIImageView *)blueCountImageView {
if (!_buleCountImageView) { if (!_blueCountImageView) {
_buleCountImageView = [[UIImageView alloc] init]; _blueCountImageView = [[UIImageView alloc] init];
_buleCountImageView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"anchorPK_panel_blue_progress"]]; _blueCountImageView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"anchorPK_panel_blue_progress"]];
} }
return _buleCountImageView; return _blueCountImageView;
} }
- (UILabel *)buleCountLabel { - (UILabel *)blueCountLabel {
if (!_buleCountLabel) { if (!_blueCountLabel) {
_buleCountLabel = [[UILabel alloc] init]; _blueCountLabel = [[UILabel alloc] init];
_buleCountLabel.font = [UIFont systemFontOfSize:12]; _blueCountLabel.font = [UIFont systemFontOfSize:12];
_buleCountLabel.textColor = [UIColor whiteColor]; _blueCountLabel.textColor = [UIColor whiteColor];
_buleCountLabel.text = @"0"; _blueCountLabel.text = @"0";
_buleCountLabel.textAlignment = NSTextAlignmentRight; _blueCountLabel.textAlignment = NSTextAlignmentRight;
} }
return _buleCountLabel; return _blueCountLabel;
} }
- (UIStackView *)redContributeStackView { - (UIStackView *)redContributeStackView {
@@ -487,14 +540,6 @@
return _blueContributeStackView; return _blueContributeStackView;
} }
- (UIImageView *)middleImageView {
if (!_middleImageView) {
_middleImageView = [[UIImageView alloc] init];
_middleImageView.image = [UIImage imageNamed:@"anchorPK_panel_middle_indicator"];
}
return _middleImageView;
}
- (NetImageView *)otherAvatarImageView { - (NetImageView *)otherAvatarImageView {
if (!_otherAvatarImageView) { if (!_otherAvatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init]; NetImageConfig * config = [[NetImageConfig alloc]init];
@@ -545,5 +590,21 @@
return _followButton; return _followButton;
} }
- (SVGAImageView *)svgDisplayView {
if (_svgDisplayView == nil) {
_svgDisplayView = [[SVGAImageView alloc]init];
_svgDisplayView.contentMode = UIViewContentModeScaleToFill;
_svgDisplayView.userInteractionEnabled = NO;
_svgDisplayView.backgroundColor = [UIColor clearColor];
}
return _svgDisplayView;
}
- (SVGAParser *)parser {
if (!_parser) {
_parser = [[SVGAParser alloc]init];
}
return _parser;
}
@end @end

View File

@@ -19,7 +19,7 @@
#import "AcrossRoomPKInfoModel.h" #import "AcrossRoomPKInfoModel.h"
///View ///View
#import "XPAnchorPKSelectRoomView.h" #import "XPAnchorPKSelectRoomView.h"
#import "XPAcrossRoomPKRuleView.h" #import "XPAnchorPKRuleView.h"
///P ///P
#import "XPAnchorPKPresenter.h" #import "XPAnchorPKPresenter.h"
#import "XPAnchorPKProtocol.h" #import "XPAnchorPKProtocol.h"
@@ -323,7 +323,7 @@
- (void)helpButtonAction:(UIButton *)sender { - (void)helpButtonAction:(UIButton *)sender {
[self.customTimeTextField resignFirstResponder]; [self.customTimeTextField resignFirstResponder];
[self.pkPlayModeTextField resignFirstResponder]; [self.pkPlayModeTextField resignFirstResponder];
XPAcrossRoomPKRuleView *view = [[XPAcrossRoomPKRuleView alloc] init]; XPAnchorPKRuleView *view = [[XPAnchorPKRuleView alloc] init];
[TTPopup popupView:view style:TTPopupStyleAlert]; [TTPopup popupView:view style:TTPopupStyleAlert];
} }

View File

@@ -213,6 +213,8 @@
receiveInfo.giftInfo = giftInfo; receiveInfo.giftInfo = giftInfo;
[self receiveFansTeamGiftHandleSendGiftAnimation:attachment]; [self receiveFansTeamGiftHandleSendGiftAnimation:attachment];
[self receiveGift:receiveInfo]; [self receiveGift:receiveInfo];
} else if (attachment.first == CustomMessageType_Across_Room_PK && attachment.second == Custom_Message_Sub_AnchorPK_Result) {//PK
[self acrossRoomPKBannerAnimation:attachment];
} }
} }
} }
@@ -230,6 +232,11 @@
#pragma mark - PK #pragma mark - PK
- (void)acrossRoomPKBannerAnimation:(AttachmentModel *)attacment { - (void)acrossRoomPKBannerAnimation:(AttachmentModel *)attacment {
AcrossRoomPKPrizeModel * prizeModel = [AcrossRoomPKPrizeModel modelWithJSON:attacment.data]; AcrossRoomPKPrizeModel * prizeModel = [AcrossRoomPKPrizeModel modelWithJSON:attacment.data];
if (attacment.second == Custom_Message_Sub_AnchorPK_Result) {
prizeModel.pkType = 1;
} else {
prizeModel.pkType = 0;
}
[self.acrossRoomPKQueue addObject:prizeModel]; [self.acrossRoomPKQueue addObject:prizeModel];
if (self.acrossRoomPKQueue.count > 0) { if (self.acrossRoomPKQueue.count > 0) {
[self startAcrossRoomPKAnimation:self.acrossRoomPKQueue.firstObject]; [self startAcrossRoomPKAnimation:self.acrossRoomPKQueue.firstObject];

View File

@@ -24,6 +24,7 @@
#import "XCCurrentVCStackManager.h" #import "XCCurrentVCStackManager.h"
#import "XPConstant.h" #import "XPConstant.h"
#import "Api+RoomSetting.h" #import "Api+RoomSetting.h"
#import "RtcManager.h"
///Model ///Model
#import "RoomInfoModel.h" #import "RoomInfoModel.h"
#import "MicroQueueModel.h" #import "MicroQueueModel.h"
@@ -50,11 +51,15 @@
#import "XPAcrossRoomPKForceEndResultView.h" #import "XPAcrossRoomPKForceEndResultView.h"
#import "XPAnchorPKInviteView.h" #import "XPAnchorPKInviteView.h"
#import "XPAnchorPKRuleView.h" #import "XPAnchorPKRuleView.h"
#import "XPAnchorPKResultView.h"
#import "XPAnchorPKFinishView.h"
#import "XPSendGiftView.h" #import "XPSendGiftView.h"
#import "XPUserCardViewController.h" #import "XPUserCardViewController.h"
#import "XPRoomViewController.h" #import "XPRoomViewController.h"
#import "XPLittleGameMiniStageView.h" #import "XPLittleGameMiniStageView.h"
#import "XPLittleGameRoomListView.h" #import "XPLittleGameRoomListView.h"
#import "XPAcrossRoomPKPrizeView.h"
#import "AcrossRoomPKPrizeModel.h"
///PK ///PK
#import "XPAnchorFansTeamEntranceView.h" #import "XPAnchorFansTeamEntranceView.h"
#import "XPAnchorFansTeamViewController.h" #import "XPAnchorFansTeamViewController.h"
@@ -326,6 +331,7 @@
[Api getAcrossRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { [Api getAcrossRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) { if (code == 200) {
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data]; AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data];
self.delegate.getRoomInfo.roundId = acrossPKPanelInfo.roundId;
if (acrossPKPanelInfo.pkType == AcrossRoomPkTypeAnchor) { if (acrossPKPanelInfo.pkType == AcrossRoomPkTypeAnchor) {
if (acrossPKPanelInfo.aUid.integerValue > 0) { if (acrossPKPanelInfo.aUid.integerValue > 0) {
if (!self.anchorPKPanelView.superview) { if (!self.anchorPKPanelView.superview) {
@@ -350,9 +356,6 @@
self.acrossPKPanelView.pkPanelInfo = acrossPKPanelInfo; self.acrossPKPanelView.pkPanelInfo = acrossPKPanelInfo;
} }
} }
// [Api requestEndAnchorRoomPk:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
// NSLog(@"%@", msg);
// } roundId:[NSString stringWithFormat:@"%ld", acrossPKPanelInfo.roundId]];
} else { } else {
[XCHUDTool showErrorWithMessage:msg]; [XCHUDTool showErrorWithMessage:msg];
} }
@@ -501,7 +504,7 @@
} }
break; break;
///PK ///PK
case Custom_Message_Sub_AnchorPK_Invite: case Custom_Message_Sub_AnchorPK_Invite://PK
{ {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init]; NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId]; request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
@@ -520,10 +523,9 @@
} }
} }
}]; }];
} }
break; break;
case Custom_Message_Sub_AnchorPK_Accept: case Custom_Message_Sub_AnchorPK_Accept://PK
{ {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init]; NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId]; request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
@@ -543,12 +545,17 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[inviteResutView removeFromSuperview]; [inviteResutView removeFromSuperview];
}); });
NSNumber *aRoomId = (NSNumber *)attachment.data[@"aRoomId"];
NSNumber *aUid = (NSNumber *)attachment.data[@"aUid"];
NSString *otherRoomId = [NSString stringWithFormat:@"%@", aRoomId];
NSString *otherUid =[NSString stringWithFormat:@"%@", aUid];
[[RtcManager instance] connectOtherRoom:otherRoomId userId:otherUid];
} }
} }
}]; }];
} }
break; break;
case Custom_Message_Sub_AnchorPK_Reject: case Custom_Message_Sub_AnchorPK_Reject://PK
{ {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init]; NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId]; request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
@@ -573,7 +580,7 @@
}]; }];
} }
break; break;
case Custom_Message_Sub_AnchorPK_Panel: case Custom_Message_Sub_AnchorPK_Panel://PK
{ {
if (!self.anchorPKPanelView.superview) { if (!self.anchorPKPanelView.superview) {
[self addSubview:self.anchorPKPanelView]; [self addSubview:self.anchorPKPanelView];
@@ -586,7 +593,7 @@
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo; self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
} }
break; break;
case Custom_Message_Sub_AnchorPK_End: case Custom_Message_Sub_AnchorPK_End://PK
{ {
if (!self.anchorPKPanelView.superview) { if (!self.anchorPKPanelView.superview) {
[self addSubview:self.anchorPKPanelView]; [self addSubview:self.anchorPKPanelView];
@@ -597,22 +604,19 @@
} }
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data]; AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo; self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
XPAnchorPKResultView *view = [[XPAnchorPKResultView alloc] initWithFrame:CGRectMake(0, 0, 300, 472)];
view.data = acrossPKPanelInfo;
[TTPopup popupView:view style:TTPopupStyleAlert];
} }
break; break;
case Custom_Message_Sub_AnchorPK_Finish: case Custom_Message_Sub_AnchorPK_Finish://PK
{ {
[self.anchorPKPanelView resetAcrossPKViewData]; [self.anchorPKPanelView resetAcrossPKViewData];
[self.anchorPKPanelView removeFromSuperview]; [self.anchorPKPanelView removeFromSuperview];
AcrossRoomPKPanelModel * model = [AcrossRoomPKPanelModel modelWithJSON:attachment.data]; self.anchorPKPanelView = nil;
if (model.isForce) { [[RtcManager instance] disconnectOtherRoom];
XPAcrossRoomPKForceEndResultView *view = [[XPAcrossRoomPKForceEndResultView alloc] initWithFrame:CGRectMake(0, 0, 281, 208)]; XPAnchorPKFinishView *view = [[XPAnchorPKFinishView alloc] init];
view.data = model; [TTPopup popupView:view style:TTPopupStyleAlert];
[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; break;
default: default:

View File

@@ -59,6 +59,11 @@ NS_ASSUME_NONNULL_BEGIN
/// @param roomUid 房主的uid /// @param roomUid 房主的uid
+ (void)getUserVipRoomTrumpet:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid; + (void)getUserVipRoomTrumpet:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid;
/// 结束个播房PK
/// @param completion 完成
/// @param roundId PK场次id
+ (void)requestEndAnchorRoomPk:(HttpRequestHelperCompletion)completion roundId:(NSString *)roundId;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -74,4 +74,10 @@
[self makeRequest:@"vip/getUserVipRoomHorn" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, nil]; [self makeRequest:@"vip/getUserVipRoomHorn" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, nil];
} }
/// PK
/// @param completion
/// @param roundId PKid
+ (void)requestEndAnchorRoomPk:(HttpRequestHelperCompletion)completion roundId:(NSString *)roundId {
[self makeRequest:@"crossroompkround/endSingleRoomPk" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roundId, nil];
}
@end @end

View File

@@ -42,6 +42,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 获取房间贵族小喇叭信息 /// 获取房间贵族小喇叭信息
- (void)getRoomgetUserVipRoomTrumpet:(NSString *)roomUid; - (void)getRoomgetUserVipRoomTrumpet:(NSString *)roomUid;
///结束个播跨房PK
- (void)requestFinishAnchorPK:(NSString *)roundId;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -184,4 +184,10 @@
}] roomUid:roomUid]; }] roomUid:roomUid];
} }
///PK
- (void)requestFinishAnchorPK:(NSString *)roundId {
[Api requestEndAnchorRoomPk:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
// NSLog(@"%@", msg);
} roundId:roundId];
}
@end @end

View File

@@ -298,8 +298,11 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
break; break;
case RoomMoreMenuType_Room_Anchor_PK_Close: case RoomMoreMenuType_Room_Anchor_PK_Close:
{ {
[self showErrorToast:@"主播正在PK中!"]; // [self showErrorToast:@"主播正在PK中!"];
[self dismissViewControllerAnimated:NO completion:nil]; [self dismissViewControllerAnimated:NO completion:nil];
if (self.roomInfo.roundId) {
[self.presenter requestFinishAnchorPK:[NSString stringWithFormat:@"%ld", self.roomInfo.roundId]];
}
} }
break; break;

View File

@@ -275,10 +275,16 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
[self.stageView removeFromSuperview]; [self.stageView removeFromSuperview];
self.stageView = nil; self.stageView = nil;
self.stageView = [[SocialStageView alloc] initWithDelegate:self]; 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 removeFromSuperview]; if (self.roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode && ![self.stageView isKindOfClass:[AnchorPKStageView class]]) {
self.stageView = nil; [self.stageView removeFromSuperview];
self.stageView = [[AnchorStageView alloc] initWithDelegate:self]; self.stageView = nil;
self.stageView = [[AnchorPKStageView alloc] initWithDelegate:self];
} else if(self.roomInfo.roomModeType == RoomModeType_Normal_Mode && ![self.stageView isKindOfClass:[AnchorStageView class]]) {
[self.stageView removeFromSuperview];
self.stageView = nil;
self.stageView = [[AnchorStageView alloc] initWithDelegate:self];
}
} else if(self.roomInfo.type == RoomType_MiniGame && ![self.stageView isKindOfClass:[LittleGameStageView class]]) { } else if(self.roomInfo.type == RoomType_MiniGame && ![self.stageView isKindOfClass:[LittleGameStageView class]]) {
[self.stageView removeFromSuperview]; [self.stageView removeFromSuperview];
self.stageView = nil; self.stageView = nil;

Binary file not shown.