个播飘屏,结果弹窗,跨房连麦逻辑处理
@@ -168,6 +168,9 @@
|
||||
9B8585F52788699400D7D5C6 /* FBKVOController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8585F42788699400D7D5C6 /* FBKVOController.m */; };
|
||||
9B85B6D7279FDABA00A0A1AC /* XPUserCardSkillCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B85B6D6279FDABA00A0A1AC /* XPUserCardSkillCardView.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 */; };
|
||||
9B92A33C2797E38100AD168F /* XPMineHeadItemTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A33B2797E38100AD168F /* XPMineHeadItemTableViewCell.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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
@@ -2598,18 +2606,10 @@
|
||||
9B1B72A82800319B003FACE9 /* Presenter */,
|
||||
9B1B72A528003185003FACE9 /* View */,
|
||||
9B1B72A42800317F003FACE9 /* Api */,
|
||||
9B1B72A328003153003FACE9 /* Model */,
|
||||
);
|
||||
path = AnchorPK;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B1B72A328003153003FACE9 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9B1B72A42800317F003FACE9 /* Api */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -2643,6 +2643,10 @@
|
||||
9B2EA7CB2804245500ED17BF /* XPAnchorPKPanelUserView.m */,
|
||||
9B3A1DF2280571000058E2DD /* XPAnchorPKInviteView.h */,
|
||||
9B3A1DF3280571000058E2DD /* XPAnchorPKInviteView.m */,
|
||||
9B85F3512806AB9A006EDF51 /* XPAnchorPKResultView.h */,
|
||||
9B85F3522806AB9A006EDF51 /* XPAnchorPKResultView.m */,
|
||||
9B85F3542806DD8A006EDF51 /* XPAnchorPKFinishView.h */,
|
||||
9B85F3552806DD8A006EDF51 /* XPAnchorPKFinishView.m */,
|
||||
);
|
||||
path = SubViews;
|
||||
sourceTree = "<group>";
|
||||
@@ -4433,6 +4437,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E88863C2278E7BCC004BCFAB /* crossRoomPk_progress.svga */,
|
||||
9B85F34F2806A34B006EDF51 /* anchorPK_progress.svga */,
|
||||
E8937ABF276C3ECF00B2C7E1 /* enterroom */,
|
||||
E8DEC98927637EA50078CB70 /* candyTree_open.svga */,
|
||||
E8DEC98A27637EA50078CB70 /* candyTree_transform.svga */,
|
||||
@@ -5310,6 +5315,7 @@
|
||||
9B0997A127F19D8A00EB8F14 /* README.md in Resources */,
|
||||
189DD53926DE255600AB55B1 /* Assets.xcassets in Resources */,
|
||||
E8DEC98C27637EA50078CB70 /* candyTree_transform.svga in Resources */,
|
||||
9B85F3502806A34B006EDF51 /* anchorPK_progress.svga in Resources */,
|
||||
186A52E726FC559700D67B2C /* yw_1222_0769.jpg in Resources */,
|
||||
E8937ACB276C3EDE00B2C7E1 /* svga_member_in_lv60.svga in Resources */,
|
||||
186A52E326FC559200D67B2C /* RPSDK.bundle in Resources */,
|
||||
@@ -5789,6 +5795,7 @@
|
||||
E8F9168427EC913C00F10D8F /* XPHomeLittleGameViewController.m in Sources */,
|
||||
E8E5E1B327C397A400F457D8 /* HomeMenuInfoModel.m in Sources */,
|
||||
E8AEAEF027141C430017FCE0 /* XPRoomMenuContainerView.m in Sources */,
|
||||
9B85F3532806AB9A006EDF51 /* XPAnchorPKResultView.m in Sources */,
|
||||
E8DEC99527648FA50078CB70 /* ClientConfig.m in Sources */,
|
||||
E880B3A6278BD69900A83B0D /* XPAcrossRoomPKTableViewCell.m in Sources */,
|
||||
E8EEB90926FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.m in Sources */,
|
||||
@@ -5944,6 +5951,7 @@
|
||||
E88863C9278EBA43004BCFAB /* XPAcrossRoomPKForceEndResultView.m in Sources */,
|
||||
E896EFB22771C93B00AD2CC1 /* XPMineFriendNumberView.m in Sources */,
|
||||
9BB5495F2782E9DB0090CD26 /* NobleAuthInfo.m in Sources */,
|
||||
9B85F3562806DD8A006EDF51 /* XPAnchorPKFinishView.m in Sources */,
|
||||
E89DA67227008D59008483C1 /* WalletInfoModel.m in Sources */,
|
||||
E80CBDEA27D0C53F001E1EC2 /* XPWeakTimer.m in Sources */,
|
||||
189DD55026DE37F900AB55B1 /* MvpViewController.m in Sources */,
|
||||
|
22
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_prize_KO.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_prize_KO.imageset/anchorPK_prize_KO@2x.png
vendored
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_prize_KO.imageset/anchorPK_prize_KO@3x.png
vendored
Normal file
After Width: | Height: | Size: 6.8 KiB |
22
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_prize_bg.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_prize_bg.imageset/anchorPK_prize_bg@2x.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_prize_bg.imageset/anchorPK_prize_bg@3x.png
vendored
Normal file
After Width: | Height: | Size: 22 KiB |
22
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_prize_onLook_bg.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 4.3 KiB |
@@ -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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.1 KiB |
22
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_result_fail_bg.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 71 KiB |
@@ -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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 37 KiB |
@@ -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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.5 KiB |
22
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_result_mvp_icon.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.2 KiB |
22
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_result_tie_bg.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 73 KiB |
@@ -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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 34 KiB |
@@ -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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.5 KiB |
22
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPK_result_win_bg.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 75 KiB |
@@ -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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 33 KiB |
@@ -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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.6 KiB |
22
xplan-ios/Assets.xcassets/Room/Anchor/AnchorPk/anchorPk_result_close.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 677 B |
After Width: | Height: | Size: 829 B |
@@ -41,6 +41,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
加入频道(房间),TRTC 进房需要动态签名。
|
||||
*/
|
||||
- (BOOL)joinChannel:(NSString *)channelId sign:(NSString *)sign completion:(void(^ __nullable)(void))completion;
|
||||
|
||||
///发起跨房通话
|
||||
- (void)connectOtherRoom:(NSString *)roomUId userId:(NSString *)userId;
|
||||
|
||||
///退出跨房通话
|
||||
- (void)disconnectOtherRoom;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -47,6 +47,40 @@
|
||||
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 {
|
||||
[self.engine muteAllRemoteAudio:mute];
|
||||
return YES;
|
||||
|
@@ -100,6 +100,12 @@ typedef enum : NSUInteger {
|
||||
*/
|
||||
- (void)exitRoom;
|
||||
|
||||
///发起跨房PK
|
||||
- (void)connectOtherRoom:(NSString *)roomUid userId:(NSString *)uid;
|
||||
|
||||
///退出跨房通话
|
||||
- (void)disconnectOtherRoom;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -96,6 +96,16 @@
|
||||
}];
|
||||
}
|
||||
|
||||
///发起跨房通话
|
||||
- (void)connectOtherRoom:(NSString *)roomUid userId:(NSString *)uid {
|
||||
[self.engine connectOtherRoom:roomUid userId:uid];
|
||||
}
|
||||
|
||||
///退出跨房通话
|
||||
- (void)disconnectOtherRoom {
|
||||
[self.engine disconnectOtherRoom];
|
||||
}
|
||||
|
||||
- (void)destory {
|
||||
[self.engine destory];
|
||||
}
|
||||
|
@@ -154,11 +154,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param teamUid 房间uid
|
||||
+ (void)requestFansTeamTask:(HttpRequestHelperCompletion)completion teamUid:(NSString *)teamUid;
|
||||
|
||||
/// 结束个播房PK
|
||||
/// @param completion 完成
|
||||
/// @param roundId PK场次id
|
||||
+ (void)requestEndAnchorRoomPk:(HttpRequestHelperCompletion)completion roundId:(NSString *)roundId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -174,11 +174,5 @@
|
||||
[self makeRequest:@"anchorFansTeam/getFansTaskInfo" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, teamUid, nil];
|
||||
}
|
||||
|
||||
/// 结束个播房PK
|
||||
/// @param completion 完成
|
||||
/// @param roundId PK场次id
|
||||
+ (void)requestEndAnchorRoomPk:(HttpRequestHelperCompletion)completion roundId:(NSString *)roundId {
|
||||
[self makeRequest:@"crossroompkround/endSingleRoomPk" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roundId, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -30,8 +30,6 @@ 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) {
|
||||
@@ -128,6 +126,8 @@ typedef NS_ENUM(NSInteger, RoomDatingStateChangeType) {
|
||||
@property (nonatomic, assign) int64_t mgId;
|
||||
///小游戏名称
|
||||
@property (nonatomic, copy) NSString *mgName;
|
||||
///pk场次id(本地字段)
|
||||
@property (nonatomic, assign) NSInteger roundId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -13,6 +13,12 @@ typedef NS_ENUM(NSUInteger, AcrossRoomPkType) {
|
||||
AcrossRoomPkTypeAnchor, ///个播PK
|
||||
};
|
||||
|
||||
///PK处于什么阶段
|
||||
typedef NS_ENUM(NSUInteger, AcrossRoomPkStateType) {
|
||||
AcrossRoomPkStateTypePking = 1,//PK中
|
||||
AcrossRoomPkStateTypePenalty, //惩罚阶段
|
||||
};
|
||||
|
||||
@class AcrossRoomPkRankModel;
|
||||
@interface AcrossRoomPKPanelModel : NSObject
|
||||
///当前时间
|
||||
@@ -49,12 +55,16 @@ typedef NS_ENUM(NSUInteger, AcrossRoomPkType) {
|
||||
@property (nonatomic, copy) NSString * cUid;
|
||||
///结束时间戳
|
||||
@property (nonatomic, assign) long long endTime;
|
||||
///惩罚结束时间戳
|
||||
@property (nonatomic, assign) long long penaltyEndTime;
|
||||
/// 赢家uid
|
||||
@property (nonatomic, copy) NSString * winUid;
|
||||
///是否异常结束
|
||||
@property (nonatomic, assign) BOOL isForce;
|
||||
///PK类型 1:牌照房 2:个播房
|
||||
@property (nonatomic, assign) AcrossRoomPkType pkType;
|
||||
//PK进行状态(1:pk中 2:惩罚中)
|
||||
@property (nonatomic, assign) AcrossRoomPkStateType pkState;
|
||||
///场次id
|
||||
@property (nonatomic, assign) NSInteger roundId;
|
||||
@end
|
||||
|
@@ -9,6 +9,10 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSUInteger, AcrossRoomPKType) {
|
||||
AcrossRoomPKTypeNormal = 0,
|
||||
AcrossRoomPKTypeAnchor,
|
||||
};
|
||||
@interface AcrossRoomPKPrizeModel : NSObject
|
||||
///赢方UID
|
||||
@property (nonatomic, copy) NSString * winUid;
|
||||
@@ -24,6 +28,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, copy) NSString *failTitle;
|
||||
///描述
|
||||
@property (nonatomic, copy) NSString *msg;
|
||||
///PK类型(0 :普通PK, 1:个播PK)
|
||||
@property (nonatomic, assign) AcrossRoomPKType pkType;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -114,6 +114,34 @@
|
||||
self.redRoomTitleLabel.text = data.winTitle;
|
||||
self.blueRoomTitleLabel.text = data.failTitle;
|
||||
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
|
||||
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -11,6 +11,7 @@
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "TTPopup.h"
|
||||
#import "UIImage+Utils.h"
|
||||
|
||||
@interface XPAnchorPKRuleView ()
|
||||
///标题
|
||||
@@ -18,13 +19,13 @@
|
||||
///背景
|
||||
@property (nonatomic, strong) UIImageView *backgroundImageView;
|
||||
|
||||
@property (nonatomic, strong) UIView *firstLineView;
|
||||
@property (nonatomic, strong) UIImageView *firstLineView;
|
||||
|
||||
@property (nonatomic, strong) UILabel *firstLineLabel;
|
||||
///显示内容
|
||||
@property (nonatomic, strong) UITextView *ruleTextView;
|
||||
|
||||
@property (nonatomic, strong) UIView *secondLineView;
|
||||
@property (nonatomic, strong) UIImageView *secondLineView;
|
||||
|
||||
@property (nonatomic, strong) UILabel *secondLineLabel;
|
||||
|
||||
@@ -47,7 +48,12 @@
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backgroundImageView];
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.firstLineView];
|
||||
[self addSubview:self.firstLineLabel];
|
||||
[self addSubview:self.ruleTextView];
|
||||
[self addSubview:self.secondLineView];
|
||||
[self addSubview:self.secondLineLabel];
|
||||
[self addSubview:self.secondTextView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -56,20 +62,45 @@
|
||||
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.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) {
|
||||
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.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;
|
||||
}
|
||||
|
||||
- (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 {
|
||||
if (!_ruleTextView) {
|
||||
_ruleTextView = [[UITextView alloc] init];
|
||||
@@ -109,5 +180,17 @@
|
||||
}
|
||||
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,只能填写整数;\n4)pk发起后,未到pk时间无法自行结束,若有特殊情况需提前结束可联系客服,但本场pk不算胜负。\n";
|
||||
}
|
||||
return _secondTextView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#import "XPAnchorPkPanelView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SVGA.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "NetImageView.h"
|
||||
@@ -30,6 +31,8 @@
|
||||
@property (nonatomic, strong) UIImageView *redStarImageView;
|
||||
///蓝方⭐️
|
||||
@property (nonatomic, strong) UIImageView *blueStarImageView;
|
||||
///PK状态
|
||||
@property (nonatomic, strong) UILabel *pkStateLabel;
|
||||
///显示倒计时
|
||||
@property (nonatomic, strong) UILabel *timeLabel;
|
||||
///最大的容器
|
||||
@@ -44,11 +47,13 @@
|
||||
///红方的礼物值
|
||||
@property (nonatomic, strong) UILabel *redCountLabel;
|
||||
///蓝方的进度图片
|
||||
@property (nonatomic, strong) UIImageView *buleCountImageView;
|
||||
@property (nonatomic, strong) UIImageView *blueCountImageView;
|
||||
///蓝方的礼物值
|
||||
@property (nonatomic, strong) UILabel *buleCountLabel;
|
||||
///中间分割图片
|
||||
@property (nonatomic, strong) UIImageView *middleImageView;
|
||||
@property (nonatomic, strong) UILabel *blueCountLabel;
|
||||
///动画管理类
|
||||
@property (strong, nonatomic) SVGAParser *parser;
|
||||
///中间进度的动画
|
||||
@property (nonatomic, strong) SVGAImageView *svgDisplayView;
|
||||
#pragma mark - 队伍的队友的view
|
||||
///红方的贡献用户容器
|
||||
@property (nonatomic,strong) UIStackView *redContributeStackView;
|
||||
@@ -98,21 +103,22 @@
|
||||
- (void)initSubViews {
|
||||
self.userInteractionEnabled = NO;
|
||||
[self addSubview:self.backImageView];
|
||||
|
||||
[self.backImageView addSubview:self.timeLabel];
|
||||
[self.backImageView addSubview:self.stackView];
|
||||
[self.stackView addArrangedSubview:self.pkStateLabel];
|
||||
[self.stackView addArrangedSubview:self.timeLabel];
|
||||
///进度条
|
||||
[self.backImageView addSubview:self.progressView];
|
||||
[self.progressView addSubview:self.progressContentView];
|
||||
[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.blueContributeStackView];
|
||||
[self.progressContentView addSubview:self.redCountLabel];
|
||||
[self.progressContentView addSubview:self.buleCountLabel];
|
||||
[self.progressContentView addSubview:self.blueCountLabel];
|
||||
[self.backImageView addSubview:self.redStarImageView];
|
||||
[self.backImageView addSubview:self.blueStarImageView];
|
||||
[self.backImageView addSubview:self.middleImageView];
|
||||
|
||||
[self addSubview:self.otherAvatarImageView];
|
||||
[self addSubview:self.otherResultImageView];
|
||||
@@ -120,6 +126,14 @@
|
||||
[self.otherStackView addArrangedSubview:self.otherNickLabel];
|
||||
[self.otherStackView addArrangedSubview:self.followButton];
|
||||
[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 {
|
||||
@@ -154,9 +168,10 @@
|
||||
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);
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.backImageView);
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.height.mas_equalTo(21);
|
||||
}];
|
||||
|
||||
[self.redStarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -186,7 +201,7 @@
|
||||
make.left.mas_equalTo(0);
|
||||
make.height.mas_equalTo(16);
|
||||
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) {
|
||||
@@ -194,23 +209,23 @@
|
||||
make.centerY.mas_equalTo(self.progressContentView);
|
||||
}];
|
||||
|
||||
[self.buleCountImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
[self.blueCountImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(self.redCountImageView);
|
||||
make.centerY.mas_equalTo(self.redCountImageView);
|
||||
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.centerY.mas_equalTo(self.progressContentView);
|
||||
}];
|
||||
|
||||
[self.middleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.buleCountImageView.mas_left);
|
||||
make.centerY.mas_equalTo(self.progressView);
|
||||
[self.svgDisplayView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.blueCountImageView.mas_left);
|
||||
make.centerY.mas_equalTo(self.redCountImageView);
|
||||
make.height.mas_equalTo(26);
|
||||
make.width.mas_equalTo(40);
|
||||
make.width.mas_equalTo(25);
|
||||
}];
|
||||
|
||||
[self.redContributeStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -260,8 +275,11 @@
|
||||
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结果计算中";
|
||||
if (self.pkPanelInfo.pkState == AcrossRoomPkStateTypePking) {
|
||||
self.timeLabel.text = @"结果计算中";
|
||||
} else {
|
||||
self.timeLabel.text = @"00:00";
|
||||
}
|
||||
});
|
||||
} else {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
@@ -291,7 +309,7 @@
|
||||
if (time <= 30) {
|
||||
self.timeLabel.textColor = UIColorFromRGB(0xFF87A1);
|
||||
} else {
|
||||
self.timeLabel.textColor = UIColorFromRGB(0xFFF600);
|
||||
self.timeLabel.textColor = UIColorFromRGB(0xFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,17 +328,31 @@
|
||||
- (void)setPkPanelInfo:(AcrossRoomPKPanelModel *)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.pkState == AcrossRoomPkStateTypePenalty) {
|
||||
self.pkStateLabel.text = @"惩罚时间";
|
||||
[Timestamp getInternetDateWithSuccess:^(NSTimeInterval timeInterval) {
|
||||
timeInterval = timeInterval * 1000;
|
||||
long aTime = (pkPanelInfo.penaltyEndTime - timeInterval) / 1000;
|
||||
[self openCountdownWithTime:aTime];
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
NSDate *datenow = [NSDate date];//现在时间
|
||||
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) {
|
||||
_pkPanelInfo.cTitle = [NSString stringWithFormat:@"%@…", [_pkPanelInfo.cTitle substringToIndex:7]];
|
||||
}
|
||||
@@ -330,7 +362,7 @@
|
||||
}
|
||||
|
||||
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++) {
|
||||
AcrossRoomPkRankModel * rankModel = [_pkPanelInfo.csRank objectAtIndex:i];
|
||||
if (i >= self.redContributeStackView.subviews.count) {
|
||||
@@ -353,14 +385,14 @@
|
||||
_pkPanelInfo.aPercent = 1;
|
||||
}
|
||||
CGFloat width = 305;
|
||||
[self.buleCountImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
[self.blueCountImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(width * _pkPanelInfo.aPercent);
|
||||
}];
|
||||
self.otherAvatarImageView.imageUrl = pkPanelInfo.aAvatar;
|
||||
self.otherNickLabel.text = pkPanelInfo.aTitle;
|
||||
} else {
|
||||
self.redCountLabel.text = @"0";
|
||||
self.buleCountLabel.text = @"0";
|
||||
self.blueCountLabel.text = @"0";
|
||||
for (int i = 0; i<self.redContributeStackView.subviews.count; i++) {
|
||||
XPAnchorPKPanelUserView *userView = self.redContributeStackView.subviews[i];
|
||||
userView.panelInfo = nil;
|
||||
@@ -371,7 +403,7 @@
|
||||
}
|
||||
|
||||
CGFloat width = 305;
|
||||
[self.buleCountImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
[self.blueCountImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(width * 0.5);
|
||||
}];
|
||||
}
|
||||
@@ -386,11 +418,32 @@
|
||||
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 {
|
||||
if (!_timeLabel) {
|
||||
_timeLabel = [[UILabel alloc] init];
|
||||
_timeLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
|
||||
_timeLabel.textColor = UIColorFromRGB(0xFFF600);
|
||||
_timeLabel.font = [UIFont systemFontOfSize:12];
|
||||
_timeLabel.textColor = UIColorFromRGB(0xFFFFFF);
|
||||
_timeLabel.text = @"00:00";
|
||||
}
|
||||
return _timeLabel;
|
||||
@@ -448,23 +501,23 @@
|
||||
return _redCountLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)buleCountImageView {
|
||||
if (!_buleCountImageView) {
|
||||
_buleCountImageView = [[UIImageView alloc] init];
|
||||
_buleCountImageView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"anchorPK_panel_blue_progress"]];
|
||||
- (UIImageView *)blueCountImageView {
|
||||
if (!_blueCountImageView) {
|
||||
_blueCountImageView = [[UIImageView alloc] init];
|
||||
_blueCountImageView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"anchorPK_panel_blue_progress"]];
|
||||
}
|
||||
return _buleCountImageView;
|
||||
return _blueCountImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)buleCountLabel {
|
||||
if (!_buleCountLabel) {
|
||||
_buleCountLabel = [[UILabel alloc] init];
|
||||
_buleCountLabel.font = [UIFont systemFontOfSize:12];
|
||||
_buleCountLabel.textColor = [UIColor whiteColor];
|
||||
_buleCountLabel.text = @"0";
|
||||
_buleCountLabel.textAlignment = NSTextAlignmentRight;
|
||||
- (UILabel *)blueCountLabel {
|
||||
if (!_blueCountLabel) {
|
||||
_blueCountLabel = [[UILabel alloc] init];
|
||||
_blueCountLabel.font = [UIFont systemFontOfSize:12];
|
||||
_blueCountLabel.textColor = [UIColor whiteColor];
|
||||
_blueCountLabel.text = @"0";
|
||||
_blueCountLabel.textAlignment = NSTextAlignmentRight;
|
||||
}
|
||||
return _buleCountLabel;
|
||||
return _blueCountLabel;
|
||||
}
|
||||
|
||||
- (UIStackView *)redContributeStackView {
|
||||
@@ -487,14 +540,6 @@
|
||||
return _blueContributeStackView;
|
||||
}
|
||||
|
||||
- (UIImageView *)middleImageView {
|
||||
if (!_middleImageView) {
|
||||
_middleImageView = [[UIImageView alloc] init];
|
||||
_middleImageView.image = [UIImage imageNamed:@"anchorPK_panel_middle_indicator"];
|
||||
}
|
||||
return _middleImageView;
|
||||
}
|
||||
|
||||
- (NetImageView *)otherAvatarImageView {
|
||||
if (!_otherAvatarImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
@@ -545,5 +590,21 @@
|
||||
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
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#import "AcrossRoomPKInfoModel.h"
|
||||
///View
|
||||
#import "XPAnchorPKSelectRoomView.h"
|
||||
#import "XPAcrossRoomPKRuleView.h"
|
||||
#import "XPAnchorPKRuleView.h"
|
||||
///P
|
||||
#import "XPAnchorPKPresenter.h"
|
||||
#import "XPAnchorPKProtocol.h"
|
||||
@@ -323,7 +323,7 @@
|
||||
- (void)helpButtonAction:(UIButton *)sender {
|
||||
[self.customTimeTextField resignFirstResponder];
|
||||
[self.pkPlayModeTextField resignFirstResponder];
|
||||
XPAcrossRoomPKRuleView *view = [[XPAcrossRoomPKRuleView alloc] init];
|
||||
XPAnchorPKRuleView *view = [[XPAnchorPKRuleView alloc] init];
|
||||
[TTPopup popupView:view style:TTPopupStyleAlert];
|
||||
}
|
||||
|
||||
|
@@ -213,6 +213,8 @@
|
||||
receiveInfo.giftInfo = giftInfo;
|
||||
[self receiveFansTeamGiftHandleSendGiftAnimation:attachment];
|
||||
[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横幅动画
|
||||
- (void)acrossRoomPKBannerAnimation:(AttachmentModel *)attacment {
|
||||
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];
|
||||
if (self.acrossRoomPKQueue.count > 0) {
|
||||
[self startAcrossRoomPKAnimation:self.acrossRoomPKQueue.firstObject];
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "XPConstant.h"
|
||||
#import "Api+RoomSetting.h"
|
||||
#import "RtcManager.h"
|
||||
///Model
|
||||
#import "RoomInfoModel.h"
|
||||
#import "MicroQueueModel.h"
|
||||
@@ -50,11 +51,15 @@
|
||||
#import "XPAcrossRoomPKForceEndResultView.h"
|
||||
#import "XPAnchorPKInviteView.h"
|
||||
#import "XPAnchorPKRuleView.h"
|
||||
#import "XPAnchorPKResultView.h"
|
||||
#import "XPAnchorPKFinishView.h"
|
||||
#import "XPSendGiftView.h"
|
||||
#import "XPUserCardViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
#import "XPLittleGameMiniStageView.h"
|
||||
#import "XPLittleGameRoomListView.h"
|
||||
#import "XPAcrossRoomPKPrizeView.h"
|
||||
#import "AcrossRoomPKPrizeModel.h"
|
||||
///个播PK
|
||||
#import "XPAnchorFansTeamEntranceView.h"
|
||||
#import "XPAnchorFansTeamViewController.h"
|
||||
@@ -326,6 +331,7 @@
|
||||
[Api getAcrossRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data];
|
||||
self.delegate.getRoomInfo.roundId = acrossPKPanelInfo.roundId;
|
||||
if (acrossPKPanelInfo.pkType == AcrossRoomPkTypeAnchor) {
|
||||
if (acrossPKPanelInfo.aUid.integerValue > 0) {
|
||||
if (!self.anchorPKPanelView.superview) {
|
||||
@@ -350,9 +356,6 @@
|
||||
self.acrossPKPanelView.pkPanelInfo = acrossPKPanelInfo;
|
||||
}
|
||||
}
|
||||
// [Api requestEndAnchorRoomPk:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
// NSLog(@"%@", msg);
|
||||
// } roundId:[NSString stringWithFormat:@"%ld", acrossPKPanelInfo.roundId]];
|
||||
} else {
|
||||
[XCHUDTool showErrorWithMessage:msg];
|
||||
}
|
||||
@@ -501,7 +504,7 @@
|
||||
}
|
||||
break;
|
||||
///个播跨房PK
|
||||
case Custom_Message_Sub_AnchorPK_Invite:
|
||||
case Custom_Message_Sub_AnchorPK_Invite://收到个播PK邀请
|
||||
{
|
||||
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
|
||||
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
|
||||
@@ -520,10 +523,9 @@
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
break;
|
||||
case Custom_Message_Sub_AnchorPK_Accept:
|
||||
case Custom_Message_Sub_AnchorPK_Accept://对方接受个播PK邀请
|
||||
{
|
||||
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
|
||||
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(), ^{
|
||||
[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;
|
||||
case Custom_Message_Sub_AnchorPK_Reject:
|
||||
case Custom_Message_Sub_AnchorPK_Reject://对方拒绝个播PK邀请
|
||||
{
|
||||
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
|
||||
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
|
||||
@@ -573,7 +580,7 @@
|
||||
}];
|
||||
}
|
||||
break;
|
||||
case Custom_Message_Sub_AnchorPK_Panel:
|
||||
case Custom_Message_Sub_AnchorPK_Panel://个播PK面板消息
|
||||
{
|
||||
if (!self.anchorPKPanelView.superview) {
|
||||
[self addSubview:self.anchorPKPanelView];
|
||||
@@ -586,7 +593,7 @@
|
||||
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
|
||||
}
|
||||
break;
|
||||
case Custom_Message_Sub_AnchorPK_End:
|
||||
case Custom_Message_Sub_AnchorPK_End://个播PK结束,进入惩罚阶段
|
||||
{
|
||||
if (!self.anchorPKPanelView.superview) {
|
||||
[self addSubview:self.anchorPKPanelView];
|
||||
@@ -597,22 +604,19 @@
|
||||
}
|
||||
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
|
||||
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
|
||||
XPAnchorPKResultView *view = [[XPAnchorPKResultView alloc] initWithFrame:CGRectMake(0, 0, 300, 472)];
|
||||
view.data = acrossPKPanelInfo;
|
||||
[TTPopup popupView:view style:TTPopupStyleAlert];
|
||||
}
|
||||
break;
|
||||
case Custom_Message_Sub_AnchorPK_Finish:
|
||||
case Custom_Message_Sub_AnchorPK_Finish://个播PK完成
|
||||
{
|
||||
[self.anchorPKPanelView resetAcrossPKViewData];
|
||||
[self.anchorPKPanelView 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];
|
||||
}
|
||||
self.anchorPKPanelView = nil;
|
||||
[[RtcManager instance] disconnectOtherRoom];
|
||||
XPAnchorPKFinishView *view = [[XPAnchorPKFinishView alloc] init];
|
||||
[TTPopup popupView:view style:TTPopupStyleAlert];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@@ -59,6 +59,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param roomUid 房主的uid
|
||||
+ (void)getUserVipRoomTrumpet:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid;
|
||||
|
||||
/// 结束个播房PK
|
||||
/// @param completion 完成
|
||||
/// @param roundId PK场次id
|
||||
+ (void)requestEndAnchorRoomPk:(HttpRequestHelperCompletion)completion roundId:(NSString *)roundId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -74,4 +74,10 @@
|
||||
[self makeRequest:@"vip/getUserVipRoomHorn" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomUid, nil];
|
||||
}
|
||||
|
||||
/// 结束个播房PK
|
||||
/// @param completion 完成
|
||||
/// @param roundId PK场次id
|
||||
+ (void)requestEndAnchorRoomPk:(HttpRequestHelperCompletion)completion roundId:(NSString *)roundId {
|
||||
[self makeRequest:@"crossroompkround/endSingleRoomPk" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roundId, nil];
|
||||
}
|
||||
@end
|
||||
|
@@ -42,6 +42,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 获取房间贵族小喇叭信息
|
||||
- (void)getRoomgetUserVipRoomTrumpet:(NSString *)roomUid;
|
||||
|
||||
///结束个播跨房PK
|
||||
- (void)requestFinishAnchorPK:(NSString *)roundId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -184,4 +184,10 @@
|
||||
}] roomUid:roomUid];
|
||||
}
|
||||
|
||||
///结束个播跨房PK
|
||||
- (void)requestFinishAnchorPK:(NSString *)roundId {
|
||||
[Api requestEndAnchorRoomPk:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
// NSLog(@"%@", msg);
|
||||
} roundId:roundId];
|
||||
}
|
||||
@end
|
||||
|
@@ -298,8 +298,11 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
|
||||
break;
|
||||
case RoomMoreMenuType_Room_Anchor_PK_Close:
|
||||
{
|
||||
[self showErrorToast:@"主播正在PK中!"];
|
||||
// [self showErrorToast:@"主播正在PK中!"];
|
||||
[self dismissViewControllerAnimated:NO completion:nil];
|
||||
if (self.roomInfo.roundId) {
|
||||
[self.presenter requestFinishAnchorPK:[NSString stringWithFormat:@"%ld", self.roomInfo.roundId]];
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
@@ -275,10 +275,16 @@ 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]]) {
|
||||
[self.stageView removeFromSuperview];
|
||||
self.stageView = nil;
|
||||
self.stageView = [[AnchorStageView alloc] initWithDelegate:self];
|
||||
} else if (self.roomInfo.type == RoomType_Anchor) {
|
||||
if (self.roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode && ![self.stageView isKindOfClass:[AnchorPKStageView class]]) {
|
||||
[self.stageView removeFromSuperview];
|
||||
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]]) {
|
||||
[self.stageView removeFromSuperview];
|
||||
self.stageView = nil;
|
||||
|