房间PK结果的展示
@@ -419,6 +419,8 @@
|
||||
E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E84150C127747BF700A7F548 /* FirstRechargeModel.m */; };
|
||||
E84150C527747E0900A7F548 /* FirstRechargeRewardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E84150C427747E0900A7F548 /* FirstRechargeRewardModel.m */; };
|
||||
E841ED61280FB0BD00904808 /* ContentLevelUpgradeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E841ED60280FB0BD00904808 /* ContentLevelUpgradeModel.m */; };
|
||||
E84843AF27F59E7E0050D365 /* XPRoomPKResultView.m in Sources */ = {isa = PBXBuildFile; fileRef = E84843AE27F59E7E0050D365 /* XPRoomPKResultView.m */; };
|
||||
E84843B227F5A0740050D365 /* XPRomPKResultTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = E84843B127F5A0740050D365 /* XPRomPKResultTitleLabel.m */; };
|
||||
E84B0E3F2727EDF6008818C6 /* XPRoomMessageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E84B0E3E2727EDF6008818C6 /* XPRoomMessageTableViewCell.m */; };
|
||||
E84B0E422727EE0A008818C6 /* XPRoomMessageHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = E84B0E412727EE0A008818C6 /* XPRoomMessageHeaderView.m */; };
|
||||
E84B0E462727EF9D008818C6 /* XPRoomMessageParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E84B0E452727EF9D008818C6 /* XPRoomMessageParser.m */; };
|
||||
@@ -1655,6 +1657,10 @@
|
||||
E84150C427747E0900A7F548 /* FirstRechargeRewardModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirstRechargeRewardModel.m; sourceTree = "<group>"; };
|
||||
E841ED5F280FB0BD00904808 /* ContentLevelUpgradeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentLevelUpgradeModel.h; sourceTree = "<group>"; };
|
||||
E841ED60280FB0BD00904808 /* ContentLevelUpgradeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContentLevelUpgradeModel.m; sourceTree = "<group>"; };
|
||||
E84843AD27F59E7E0050D365 /* XPRoomPKResultView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPKResultView.h; sourceTree = "<group>"; };
|
||||
E84843AE27F59E7E0050D365 /* XPRoomPKResultView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPKResultView.m; sourceTree = "<group>"; };
|
||||
E84843B027F5A0740050D365 /* XPRomPKResultTitleLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRomPKResultTitleLabel.h; sourceTree = "<group>"; };
|
||||
E84843B127F5A0740050D365 /* XPRomPKResultTitleLabel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRomPKResultTitleLabel.m; sourceTree = "<group>"; };
|
||||
E84B0E3D2727EDF6008818C6 /* XPRoomMessageTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessageTableViewCell.h; sourceTree = "<group>"; };
|
||||
E84B0E3E2727EDF6008818C6 /* XPRoomMessageTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMessageTableViewCell.m; sourceTree = "<group>"; };
|
||||
E84B0E402727EE0A008818C6 /* XPRoomMessageHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessageHeaderView.h; sourceTree = "<group>"; };
|
||||
@@ -4030,6 +4036,8 @@
|
||||
E81AF32427F1D5B8003B9E43 /* XPRoomPKProgressView.m */,
|
||||
E80A086327F318620027B30C /* XPRoomPKPlayingView.h */,
|
||||
E80A086427F318620027B30C /* XPRoomPKPlayingView.m */,
|
||||
E84843AD27F59E7E0050D365 /* XPRoomPKResultView.h */,
|
||||
E84843AE27F59E7E0050D365 /* XPRoomPKResultView.m */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -4175,6 +4183,8 @@
|
||||
E8A88D2627E8193400CA8837 /* XPRoomPKSelectUserView.m */,
|
||||
E81AF32627F1EE69003B9E43 /* XPRoomPKPanelUserView.h */,
|
||||
E81AF32727F1EE69003B9E43 /* XPRoomPKPanelUserView.m */,
|
||||
E84843B027F5A0740050D365 /* XPRomPKResultTitleLabel.h */,
|
||||
E84843B127F5A0740050D365 /* XPRomPKResultTitleLabel.m */,
|
||||
);
|
||||
path = SubViews;
|
||||
sourceTree = "<group>";
|
||||
@@ -6891,6 +6901,7 @@
|
||||
9BCF58562798FE86008401A4 /* XPSkillCardPropModel.m in Sources */,
|
||||
E8AC721E26F472BF007D6E91 /* XPMineSettingProtocol.h in Sources */,
|
||||
9BC5C91F277C902B007C8719 /* XPReleaseRadioView.m in Sources */,
|
||||
E84843AF27F59E7E0050D365 /* XPRoomPKResultView.m in Sources */,
|
||||
E83DB47A27462C4500D8CBD1 /* XPGiftBigPrizeModel.m in Sources */,
|
||||
E8A03DF3276328FC0098D9EA /* CandyTreeRecordModel.m in Sources */,
|
||||
E81366F826F0C12A0076364C /* LoginFullInfoProtocol.h in Sources */,
|
||||
@@ -7497,6 +7508,7 @@
|
||||
E8ACEFF827C9034C00F66D1A /* XPHomeListEmptyTableViewCell.m in Sources */,
|
||||
E89D60BA271D643A001F8895 /* Api+Room.m in Sources */,
|
||||
E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */,
|
||||
E84843B227F5A0740050D365 /* XPRomPKResultTitleLabel.m in Sources */,
|
||||
E8C6FFEA2755040B004DC9F0 /* XPHomeSearchNavView.m in Sources */,
|
||||
E8E859C628264C2300EE4857 /* HTTPAsyncFileResponse.m in Sources */,
|
||||
E877A7EB2783E24700EFACED /* DatingStageView.m in Sources */,
|
||||
|
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_blue_victory_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_blue_victory_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_blue_victory_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 938 B |
After Width: | Height: | Size: 1.9 KiB |
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_bottom_loser_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_bottom_loser_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_bottom_loser_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 6.4 KiB |
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_bottom_win_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_bottom_win_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_bottom_win_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 6.5 KiB |
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_content_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_content_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_content_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 687 B |
After Width: | Height: | Size: 1.4 KiB |
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_loser_result_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_loser_result_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_loser_result_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 4.9 KiB |
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_red_victory_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_red_victory_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_red_victory_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.7 KiB |
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_top_draw_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_top_draw_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_top_draw_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 66 KiB |
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_top_loser_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_top_loser_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_top_loser_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 67 KiB |
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_top_win_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_top_win_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_top_win_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 72 KiB |
22
xplan-ios/Assets.xcassets/Room/RoomPK/room_pk_result_user_mvp.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_user_mvp@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_pk_result_user_mvp@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// XPRomPKResultTitleLabel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/31.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "XPEnum.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPRomPKResultTitleLabel : UIView
|
||||
///类型
|
||||
@property (nonatomic,assign) GroupType groupType;
|
||||
///显示标题
|
||||
@property (nonatomic,copy) NSString *title;
|
||||
///显示内容
|
||||
@property (nonatomic,copy) NSString *content;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// XPRomPKResultTitleLabel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/31.
|
||||
//
|
||||
|
||||
#import "XPRomPKResultTitleLabel.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "ThemeColor.h"
|
||||
|
||||
@interface XPRomPKResultTitleLabel ()
|
||||
///显示标题
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
///显示内容
|
||||
@property (nonatomic,strong) UILabel *contentLabel;
|
||||
@end
|
||||
|
||||
@implementation XPRomPKResultTitleLabel
|
||||
|
||||
- (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.titleLabel];
|
||||
[self addSubview:self.contentLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.titleLabel.mas_right).offset(10);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setGroupType:(GroupType)groupType {
|
||||
_groupType = groupType;
|
||||
if (_groupType == GroupTyp_Red) {
|
||||
self.contentLabel.textColor = UIColorFromRGB(0xfd4d0e);
|
||||
} else if(_groupType == GroupType_Blue) {
|
||||
self.contentLabel.textColor = UIColorFromRGB(0x59b9fb);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setContent:(NSString *)content {
|
||||
_content = content;
|
||||
if (_content) {
|
||||
self.contentLabel.text = _content;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString *)title {
|
||||
_title = title;
|
||||
if (_title) {
|
||||
self.titleLabel.text = _title;
|
||||
}
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
_titleLabel.textColor = [UIColor whiteColor];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)contentLabel {
|
||||
if (!_contentLabel) {
|
||||
_contentLabel = [[UILabel alloc] init];
|
||||
_contentLabel.font = [UIFont systemFontOfSize:14];
|
||||
}
|
||||
return _contentLabel;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -31,6 +31,7 @@
|
||||
#import "XPRoomPKSelectUserView.h"
|
||||
#import "XPRoomPKPlayingView.h"
|
||||
#import "XPRoomPKPlayingView.h"
|
||||
#import "XPRoomPKResultView.h"
|
||||
|
||||
@interface XPRoomPKProgressView ()<XPRoomPKPanelUserViewDelegate, XPRoomPKSelectUserViewDelegate, XPRoomPKPlayingViewDelegate>
|
||||
///背景
|
||||
@@ -99,16 +100,20 @@
|
||||
- (void)handleRoomPKCustomMessage:(AttachmentModel *)attachment {
|
||||
if (attachment.second == Custom_Message_Sub_Room_PK_Start) {
|
||||
RoomPKInfoModel * pkInfo = [RoomPKInfoModel modelWithDictionary:attachment.data];
|
||||
self.pkDetailInfo.roomPK = pkInfo;;
|
||||
self.pkDetailInfo.roomPK = pkInfo;
|
||||
self.beginButton.hidden = YES;
|
||||
[self startRoomPKCountDown:pkInfo.duration];
|
||||
[self handleRoomPKInfoChangeState];
|
||||
}else if (attachment.second == Custom_Message_Sub_Room_PK_Mode_Open){
|
||||
RoomPKInfoModel * pkInfo = [RoomPKInfoModel modelWithDictionary:attachment.data];
|
||||
self.pkDetailInfo.roomPK = pkInfo;
|
||||
[self handleRoomPKInfoChangeState];
|
||||
} else if(attachment.second == Custom_Message_Sub_Room_PK_Re_Start) {
|
||||
RoomPKInfoModel * pkInfo = [RoomPKInfoModel modelWithDictionary:attachment.data];
|
||||
self.pkDetailInfo.roomPK = pkInfo;
|
||||
[self handleRoomPKInfoChangeState];
|
||||
} else if(attachment.second == Custom_Message_Sub_Room_PK_Result) {
|
||||
|
||||
[TTPopup dismiss];
|
||||
RoomPKInfoModel * pkInfo = [RoomPKInfoModel modelWithDictionary:attachment.data];
|
||||
self.isReceivePKResult = YES;
|
||||
@@ -121,8 +126,15 @@
|
||||
[self clearRoomPKTeamData];
|
||||
self.pkDetailInfo.roomPK = pkInfo;
|
||||
[self resetRoomPKGroupType];
|
||||
|
||||
}
|
||||
}
|
||||
if (pkInfo.pkStatus == RoomPKStatusType_End) {
|
||||
XPRoomPKResultView * result = [[XPRoomPKResultView alloc] init];
|
||||
result.roomPKResultInfoModel = pkInfo;
|
||||
[TTPopup popupView:result style:TTPopupStyleAlert];
|
||||
}
|
||||
[self handleRoomPKInfoChangeState];
|
||||
} else if(attachment.second == Custom_Message_Sub_Room_PK_Mode_Close) {
|
||||
[self stopRoomPKCountDown];
|
||||
[self clearRoomPKTeamData];
|
||||
@@ -553,12 +565,12 @@
|
||||
if (self.pkDetailInfo) {
|
||||
switch (_pkDetailInfo.roomPK.pkStatus) {
|
||||
case RoomPKStatusType_End:
|
||||
|
||||
self.beginButton.hidden = self.isManager ? NO : YES;
|
||||
break;
|
||||
case RoomPKStatusType_Playing:
|
||||
{
|
||||
[TTPopup dismiss];
|
||||
self.beginButton.hidden = self.isManager ? NO : YES;
|
||||
self.beginButton.hidden = YES;
|
||||
self.roomPKPlayingView.pkDetailInfo = self.pkDetailInfo;
|
||||
self.roomPKPlayingView.redChooseArray = self.redChooseArray;
|
||||
self.roomPKPlayingView.blueChooseArray = self.blueChooseArray;
|
||||
@@ -567,7 +579,7 @@
|
||||
}
|
||||
break;
|
||||
case RoomPKStatusType_ReStart:
|
||||
|
||||
self.beginButton.hidden = self.isManager ? NO : YES;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
16
xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKResultView.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPRoomPKResultView.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/31.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoomPKInfoModel;
|
||||
@interface XPRoomPKResultView : UIView
|
||||
@property (nonatomic,strong) RoomPKInfoModel *roomPKResultInfoModel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
774
xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKResultView.m
Normal file
@@ -0,0 +1,774 @@
|
||||
//
|
||||
// XPRoomPKResultView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/3/31.
|
||||
//
|
||||
|
||||
#import "XPRoomPKResultView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "XPMacro.h"
|
||||
#import "NetImageView.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "ThemeColor.h"
|
||||
///Model
|
||||
#import "RoomPKInfoModel.h"
|
||||
///View
|
||||
#import "XPRomPKResultTitleLabel.h"
|
||||
|
||||
#define kRedTeamColor UIColorFromRGB(0xfd4d0e)
|
||||
#define kBlueTeamColor UIColorFromRGB(0x59b9fb)
|
||||
|
||||
|
||||
@interface XPRoomPKResultView ()
|
||||
///
|
||||
@property (nonatomic,strong) UIImageView *topImageView;
|
||||
///
|
||||
@property (nonatomic,strong) UIImageView *bottomImageView;
|
||||
///背景
|
||||
@property (nonatomic,strong) UIImageView *contentImageView;
|
||||
///第一个人
|
||||
@property (nonatomic,strong) NetImageView *firstUserView;
|
||||
///第二个人
|
||||
@property (nonatomic,strong) NetImageView *secondUserView;
|
||||
///第三个人
|
||||
@property (nonatomic,strong) NetImageView *thirdUserView;
|
||||
///第四个人
|
||||
@property (nonatomic,strong) NetImageView *fourthUserView;
|
||||
///第五个人
|
||||
@property (nonatomic,strong) NetImageView *fifthUserView;
|
||||
///是否是MVP
|
||||
@property (nonatomic,strong) UIImageView *mvpImageView;
|
||||
///容器
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
///选手的容器
|
||||
@property (nonatomic,strong) UIView * pkUserContaierView;
|
||||
///PK选手
|
||||
@property (nonatomic,strong) UILabel *pkUserLabel;
|
||||
///战斗值
|
||||
@property (nonatomic,strong) XPRomPKResultTitleLabel *fightScoreLable;
|
||||
///守护者
|
||||
@property (nonatomic,strong) XPRomPKResultTitleLabel *guardPersonLable;
|
||||
///守护值
|
||||
@property (nonatomic,strong) XPRomPKResultTitleLabel *guardScoreLable;
|
||||
///红队后者蓝队战绩
|
||||
@property (nonatomic,strong) UIButton *resultButton;
|
||||
///查看对方的战绩
|
||||
@property (nonatomic,strong) UIButton *checkButton;
|
||||
///存放用户的数组
|
||||
@property (nonatomic,strong) NSArray *userViewArray;
|
||||
///查看其他的
|
||||
@property (nonatomic,assign) BOOL isChecOther;
|
||||
@end
|
||||
|
||||
@implementation XPRoomPKResultView
|
||||
|
||||
- (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.contentImageView];
|
||||
[self addSubview:self.topImageView];
|
||||
[self addSubview:self.bottomImageView];
|
||||
|
||||
[self.contentImageView addSubview:self.stackView];
|
||||
[self.contentImageView addSubview:self.resultButton];
|
||||
[self.contentImageView addSubview:self.checkButton];
|
||||
|
||||
[self.stackView addArrangedSubview:self.pkUserContaierView];
|
||||
[self.stackView addArrangedSubview:self.fightScoreLable];
|
||||
[self.stackView addArrangedSubview:self.guardPersonLable];
|
||||
[self.stackView addArrangedSubview:self.guardScoreLable];
|
||||
|
||||
[self.pkUserContaierView addSubview:self.pkUserLabel];
|
||||
[self.pkUserContaierView addSubview:self.firstUserView];
|
||||
[self.pkUserContaierView addSubview:self.secondUserView];
|
||||
[self.pkUserContaierView addSubview:self.thirdUserView];
|
||||
[self.pkUserContaierView addSubview:self.fourthUserView];
|
||||
[self.pkUserContaierView addSubview:self.fifthUserView];
|
||||
[self.pkUserContaierView addSubview:self.mvpImageView];
|
||||
self.userViewArray = @[self.firstUserView, self.secondUserView, self.thirdUserView, self.fourthUserView, self.fifthUserView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.bottom.mas_equalTo(self.bottomImageView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.top.mas_equalTo(self);
|
||||
make.width.mas_equalTo(375);
|
||||
make.height.mas_equalTo(243);
|
||||
}];
|
||||
|
||||
[self.contentImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.topImageView).offset(97);
|
||||
make.left.right.mas_equalTo(self);
|
||||
make.height.mas_equalTo(170); // 根据类型变化
|
||||
}];
|
||||
|
||||
[self.bottomImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.contentImageView.mas_bottom).offset(-6);
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.width.mas_equalTo(375);
|
||||
make.height.mas_equalTo(16);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.contentImageView).offset(48);
|
||||
make.left.mas_equalTo(self.contentImageView).offset(20);
|
||||
make.right.mas_equalTo(self.contentImageView);
|
||||
}];
|
||||
|
||||
[self.pkUserContaierView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(35);
|
||||
}];
|
||||
|
||||
[self.fightScoreLable mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(15);
|
||||
}];
|
||||
|
||||
[self.guardScoreLable mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(15);
|
||||
}];
|
||||
|
||||
[self.guardPersonLable mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(15);
|
||||
}];
|
||||
|
||||
[self.resultButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.bottom.mas_equalTo(self.checkButton.mas_top).offset(-10);
|
||||
make.width.mas_equalTo(230);
|
||||
make.height.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
[self.checkButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(16);
|
||||
make.left.right.mas_equalTo(self.contentImageView);
|
||||
make.bottom.mas_equalTo(self.contentImageView.mas_bottom).offset(-15);
|
||||
}];
|
||||
|
||||
[self.pkUserLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.centerY.mas_equalTo(self.pkUserContaierView);
|
||||
}];
|
||||
|
||||
[self.firstUserView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(35, 35));
|
||||
make.left.mas_equalTo(self.pkUserLabel.mas_right).offset(10);
|
||||
make.centerY.mas_equalTo(self.pkUserContaierView);
|
||||
}];
|
||||
|
||||
[self.secondUserView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.centerY.mas_equalTo(self.firstUserView);
|
||||
make.left.mas_equalTo(self.firstUserView.mas_right).offset(5);
|
||||
}];
|
||||
|
||||
[self.thirdUserView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.centerY.mas_equalTo(self.firstUserView);
|
||||
make.left.mas_equalTo(self.secondUserView.mas_right).offset(5);
|
||||
}];
|
||||
|
||||
[self.fourthUserView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.centerY.mas_equalTo(self.firstUserView);
|
||||
make.left.mas_equalTo(self.thirdUserView.mas_right).offset(5);
|
||||
}];
|
||||
|
||||
[self.fifthUserView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.centerY.mas_equalTo(self.firstUserView);
|
||||
make.left.mas_equalTo(self.fourthUserView.mas_right).offset(5);
|
||||
}];
|
||||
|
||||
[self.mvpImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.firstUserView);
|
||||
make.top.mas_equalTo(self.firstUserView.mas_top).offset(-3);
|
||||
make.width.mas_equalTo(35);
|
||||
make.height.mas_equalTo(17);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadTeamMemberUserAvatar:(NSArray *)members mvpUserId:(NSInteger)mvpUserId{
|
||||
self.mvpImageView.hidden = YES;
|
||||
for (int i = 0; i< self.userViewArray.count; i++) {
|
||||
NetImageView * imageView = [self.userViewArray objectAtIndex:i];
|
||||
if (i < members.count) {
|
||||
RoomPKTeamUserModel * userInfo = [members objectAtIndex:i];
|
||||
imageView.imageUrl = userInfo.avatar;
|
||||
imageView.hidden = NO;
|
||||
if (mvpUserId == userInfo.uid.integerValue) {
|
||||
self.mvpImageView.hidden = NO;
|
||||
[self.mvpImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(imageView);
|
||||
make.top.mas_equalTo(self.firstUserView.mas_top).offset(3);
|
||||
make.width.mas_equalTo(35);
|
||||
make.height.mas_equalTo(17);
|
||||
}];
|
||||
}
|
||||
} else {
|
||||
imageView.hidden = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)checkButtonAction:(UIButton *)sender {
|
||||
self.isChecOther = !self.isChecOther;
|
||||
if (self.roomPKResultInfoModel) {
|
||||
RoomPKTeamModel * redTeam;
|
||||
RoomPKTeamModel * blueTeam;
|
||||
GroupType myType = GroupType_default;
|
||||
for (RoomPKTeamModel * teamInfo in _roomPKResultInfoModel.teams) {
|
||||
if (myType == GroupType_default) {
|
||||
for (RoomPKTeamUserModel * userInfo in teamInfo.teamMembers) {
|
||||
if (userInfo.uid.integerValue == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
myType = teamInfo.team;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (teamInfo.team == GroupTyp_Red) {
|
||||
redTeam = teamInfo;
|
||||
} else if(teamInfo.team == GroupType_Blue) {
|
||||
blueTeam = teamInfo;
|
||||
}
|
||||
}
|
||||
if (myType == GroupTyp_Red) {///我是红队的
|
||||
[self handleMyInRedPKTeam:redTeam bluePKTeam:blueTeam];
|
||||
} else if(myType == GroupType_Blue) {///我是蓝队的
|
||||
[self handleMyInBluePKTeam:redTeam bluePKTeam:blueTeam];
|
||||
} else {
|
||||
[self handleMyInAudiencePKTeam:redTeam bluePKTeam:blueTeam];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setRoomPKResultInfoModel:(RoomPKInfoModel *)roomPKResultInfoModel {
|
||||
_roomPKResultInfoModel = roomPKResultInfoModel;
|
||||
if (_roomPKResultInfoModel) {
|
||||
RoomPKTeamModel * redTeam;
|
||||
RoomPKTeamModel * blueTeam;
|
||||
GroupType myType = GroupType_default;
|
||||
for (RoomPKTeamModel * teamInfo in _roomPKResultInfoModel.teams) {
|
||||
if (teamInfo.team == GroupTyp_Red) {
|
||||
redTeam = teamInfo;
|
||||
} else if(teamInfo.team == GroupType_Blue) {
|
||||
blueTeam = teamInfo;
|
||||
}
|
||||
|
||||
if (myType == GroupType_default) {
|
||||
for (RoomPKTeamUserModel * userInfo in teamInfo.teamMembers) {
|
||||
if (userInfo.uid.integerValue == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
myType = teamInfo.team;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (myType == GroupTyp_Red) {///我是红队的
|
||||
[self handleMyInRedPKTeam:redTeam bluePKTeam:blueTeam];
|
||||
} else if(myType == GroupType_Blue) {///我是蓝队的
|
||||
[self handleMyInBluePKTeam:redTeam bluePKTeam:blueTeam];
|
||||
} else {
|
||||
[self handleMyInAudiencePKTeam:redTeam bluePKTeam:blueTeam];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 自己是红队时布局
|
||||
- (void)handleMyInRedPKTeam:(RoomPKTeamModel *)redPKTeam bluePKTeam:(RoomPKTeamModel *)bluePKTeam {
|
||||
if (self.isChecOther) { // 查看对方战绩
|
||||
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Draw) { // win
|
||||
// 看到的是 平局
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_draw_bg"];
|
||||
} else if(self.roomPKResultInfoModel.result == RoomPKResultType_Blue) { // loser
|
||||
// 看到的是 蓝队 win
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_win_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_win_bg"];
|
||||
} else {
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_loser_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
}
|
||||
|
||||
[self.resultButton setTitle:@"· 蓝队战绩 ·" forState:UIControlStateNormal];
|
||||
[self.resultButton setTitleColor:kBlueTeamColor forState:UIControlStateNormal];
|
||||
[self.checkButton setTitle:@"查看我的战绩>" forState:UIControlStateNormal];
|
||||
[self.checkButton setTitleColor:kRedTeamColor forState:UIControlStateNormal];
|
||||
self.fightScoreLable.groupType = GroupType_Blue;
|
||||
self.guardScoreLable.groupType = GroupType_Blue;
|
||||
self.guardPersonLable.groupType = GroupType_Blue;
|
||||
self.fightScoreLable.content = [NSString stringWithFormat:@"%lld", bluePKTeam.score];
|
||||
if (bluePKTeam.protector.nick.length) {
|
||||
self.guardPersonLable.content = [NSString stringWithFormat:@"%@", bluePKTeam.protector.nick];
|
||||
} else {
|
||||
self.guardPersonLable.content = @"无";
|
||||
}
|
||||
self.guardScoreLable.content = [NSString stringWithFormat:@"%lld", bluePKTeam.protecScore];
|
||||
[self loadTeamMemberUserAvatar:bluePKTeam.teamMembers mvpUserId:bluePKTeam.mvp];
|
||||
CGFloat bgHeight = 224;
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Draw || self.roomPKResultInfoModel.voteMode == RoomPKVoteModeType_NumberPerson) {
|
||||
self.guardScoreLable.hidden = YES;
|
||||
self.guardPersonLable.hidden = YES;
|
||||
} else {
|
||||
self.guardScoreLable.hidden = NO;
|
||||
self.guardPersonLable.hidden = NO;
|
||||
bgHeight = 264;
|
||||
}
|
||||
[self.contentImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(bgHeight); // 根据类型变化
|
||||
}];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Red) { // win
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_win_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_win_bg"];
|
||||
[self.resultButton setTitle:@"· 您胜利了 ·" forState:UIControlStateNormal];
|
||||
[self.checkButton setTitle:@"查看蓝队战绩>" forState:UIControlStateNormal];
|
||||
} else if (self.roomPKResultInfoModel.result == RoomPKResultType_Blue) { // loser
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_loser_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
[self.resultButton setTitle:@"· 您失败了 ·" forState:UIControlStateNormal];
|
||||
} else { // 平局
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_draw_bg"];
|
||||
[self.resultButton setTitle:@"· 势均力敌 ·" forState:UIControlStateNormal];
|
||||
}
|
||||
[self.resultButton setTitleColor:kRedTeamColor forState:UIControlStateNormal];
|
||||
[self.checkButton setTitleColor:kBlueTeamColor forState:UIControlStateNormal];
|
||||
self.fightScoreLable.groupType = GroupTyp_Red;
|
||||
self.guardScoreLable.groupType = GroupTyp_Red;
|
||||
self.guardPersonLable.groupType = GroupTyp_Red;
|
||||
self.fightScoreLable.content = [NSString stringWithFormat:@"%lld", redPKTeam.score];
|
||||
if (redPKTeam.protector.nick.length) {
|
||||
self.guardPersonLable.content = [NSString stringWithFormat:@"%@", redPKTeam.protector.nick];
|
||||
} else {
|
||||
self.guardPersonLable.content = @"无";
|
||||
}
|
||||
self.guardScoreLable.content = [NSString stringWithFormat:@"%lld", redPKTeam.protecScore];
|
||||
[self loadTeamMemberUserAvatar:redPKTeam.teamMembers mvpUserId:redPKTeam.mvp];
|
||||
|
||||
CGFloat bgHeight = 224;
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Draw || self.roomPKResultInfoModel.voteMode == RoomPKVoteModeType_NumberPerson) {
|
||||
self.guardScoreLable.hidden = YES;
|
||||
self.guardPersonLable.hidden = YES;
|
||||
} else {
|
||||
self.guardScoreLable.hidden = NO;
|
||||
self.guardPersonLable.hidden = NO;
|
||||
bgHeight = 264;
|
||||
}
|
||||
[self.contentImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(bgHeight); // 根据类型变化
|
||||
}];
|
||||
}
|
||||
|
||||
// 自己是蓝队时布局
|
||||
- (void)handleMyInBluePKTeam:(RoomPKTeamModel *)redPKTeam bluePKTeam:(RoomPKTeamModel *)bluePKTeam {
|
||||
if (self.isChecOther) { // 查看对方战绩
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Draw) { // win
|
||||
// 看到的是 平局
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_draw_bg"];
|
||||
} else if(self.roomPKResultInfoModel.result == RoomPKResultType_Blue) { // loser
|
||||
// 看到的是 蓝队 win
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_loser_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
} else {
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_win_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_win_bg"];
|
||||
}
|
||||
|
||||
[self.resultButton setTitle:@"· 红队战绩 ·" forState:UIControlStateNormal];
|
||||
[self.resultButton setTitleColor:kRedTeamColor forState:UIControlStateNormal];
|
||||
[self.checkButton setTitle:@"查看我的战绩>" forState:UIControlStateNormal];
|
||||
[self.checkButton setTitleColor:kBlueTeamColor forState:UIControlStateNormal];
|
||||
self.fightScoreLable.groupType = GroupTyp_Red;
|
||||
self.guardScoreLable.groupType = GroupTyp_Red;
|
||||
self.guardPersonLable.groupType = GroupTyp_Red;
|
||||
self.fightScoreLable.content = [NSString stringWithFormat:@"%lld", redPKTeam.score];
|
||||
if (redPKTeam.protector.nick.length) {
|
||||
self.guardPersonLable.content = [NSString stringWithFormat:@"%@", redPKTeam.protector.nick];
|
||||
} else {
|
||||
self.guardPersonLable.content = @"无";
|
||||
}
|
||||
self.guardScoreLable.content = [NSString stringWithFormat:@"%lld", redPKTeam.protecScore];
|
||||
[self loadTeamMemberUserAvatar:redPKTeam.teamMembers mvpUserId:redPKTeam.mvp];
|
||||
CGFloat bgHeight = 224;
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Draw || self.roomPKResultInfoModel.voteMode == RoomPKVoteModeType_NumberPerson) {
|
||||
self.guardScoreLable.hidden = YES;
|
||||
self.guardPersonLable.hidden = YES;
|
||||
} else {
|
||||
self.guardScoreLable.hidden = NO;
|
||||
self.guardPersonLable.hidden = NO;
|
||||
bgHeight = 264;
|
||||
}
|
||||
[self.contentImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(bgHeight); // 根据类型变化
|
||||
}];
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Blue) { // win
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_win_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_win_bg"];
|
||||
[self.resultButton setTitle:@"· 您胜利啦! ·" forState:UIControlStateNormal];
|
||||
} else if (self.roomPKResultInfoModel.result == RoomPKResultType_Red) { // loser
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_loser_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
[self.resultButton setTitle:@"· 你失败啦! ·" forState:UIControlStateNormal];
|
||||
[self.checkButton setTitle:@"查看红队战绩>" forState:UIControlStateNormal];
|
||||
} else { // 平局
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_draw_bg"];
|
||||
[self.resultButton setTitle:@"· 势均力敌 ·" forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
[self.resultButton setTitleColor:kBlueTeamColor forState:UIControlStateNormal];
|
||||
[self.checkButton setTitle:@"查看红队战绩>" forState:UIControlStateNormal];
|
||||
[self.checkButton setTitleColor:kRedTeamColor forState:UIControlStateNormal];
|
||||
|
||||
self.fightScoreLable.groupType = GroupType_Blue;
|
||||
self.guardScoreLable.groupType = GroupType_Blue;
|
||||
self.guardPersonLable.groupType = GroupType_Blue;
|
||||
self.fightScoreLable.content = [NSString stringWithFormat:@"%lld", bluePKTeam.score];
|
||||
if (bluePKTeam.protector.nick.length) {
|
||||
self.guardPersonLable.content = [NSString stringWithFormat:@"%@", bluePKTeam.protector.nick];
|
||||
} else {
|
||||
self.guardPersonLable.content = @"无";
|
||||
}
|
||||
self.guardScoreLable.content = [NSString stringWithFormat:@"%lld", bluePKTeam.protecScore];
|
||||
[self loadTeamMemberUserAvatar:bluePKTeam.teamMembers mvpUserId:bluePKTeam.mvp];
|
||||
CGFloat bgHeight = 204;
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Draw || self.roomPKResultInfoModel.voteMode == RoomPKVoteModeType_NumberPerson) {
|
||||
self.guardScoreLable.hidden = YES;
|
||||
self.guardPersonLable.hidden = YES;
|
||||
} else {
|
||||
self.guardScoreLable.hidden = NO;
|
||||
self.guardPersonLable.hidden = NO;
|
||||
bgHeight = 264;
|
||||
}
|
||||
[self.contentImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(bgHeight); // 根据类型变化
|
||||
}];
|
||||
}
|
||||
|
||||
// 观众时的布局
|
||||
- (void)handleMyInAudiencePKTeam:(RoomPKTeamModel *)redPKTeam bluePKTeam:(RoomPKTeamModel *)bluePKTeam {
|
||||
// 观众弹的是胜利方, 点击查看其它的则是查看失败方, 平局没有查看对方的情况
|
||||
if (self.isChecOther) { // 查看失败方战绩
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_loser_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Blue) {
|
||||
[self.resultButton setTitle:@"· 红队战绩 ·" forState:UIControlStateNormal];
|
||||
[self.resultButton setTitleColor:kRedTeamColor forState:UIControlStateNormal];
|
||||
[self.checkButton setTitle:@"查看我的战绩>" forState:UIControlStateNormal];
|
||||
[self.checkButton setTitleColor:kBlueTeamColor forState:UIControlStateNormal];
|
||||
self.fightScoreLable.groupType = GroupTyp_Red;
|
||||
self.guardScoreLable.groupType = GroupTyp_Red;
|
||||
self.guardPersonLable.groupType = GroupTyp_Red;
|
||||
self.fightScoreLable.content = [NSString stringWithFormat:@"%lld", redPKTeam.score];
|
||||
if (redPKTeam.protector.nick.length) {
|
||||
self.guardPersonLable.content = [NSString stringWithFormat:@"%@", redPKTeam.protector.nick];
|
||||
} else {
|
||||
self.guardPersonLable.content = @"无";
|
||||
}
|
||||
self.guardScoreLable.content = [NSString stringWithFormat:@"%lld", redPKTeam.protecScore];
|
||||
} else {
|
||||
[self.resultButton setTitle:@"· 蓝队战绩 ·" forState:UIControlStateNormal];
|
||||
[self.resultButton setTitleColor:kBlueTeamColor forState:UIControlStateNormal];
|
||||
[self.checkButton setTitle:@"查看我的战绩>" forState:UIControlStateNormal];
|
||||
[self.checkButton setTitleColor:kRedTeamColor forState:UIControlStateNormal];
|
||||
self.fightScoreLable.groupType = GroupType_Blue;
|
||||
self.guardScoreLable.groupType = GroupType_Blue;
|
||||
self.guardPersonLable.groupType = GroupType_Blue;
|
||||
self.fightScoreLable.content = [NSString stringWithFormat:@"%lld", bluePKTeam.score];
|
||||
if (bluePKTeam.protector.nick.length) {
|
||||
self.guardPersonLable.content = [NSString stringWithFormat:@"%@", bluePKTeam.protector.nick];
|
||||
} else {
|
||||
self.guardPersonLable.content = @"无";
|
||||
}
|
||||
self.guardScoreLable.content = [NSString stringWithFormat:@"%lld", bluePKTeam.protecScore];
|
||||
}
|
||||
CGFloat bgHeight = 204;
|
||||
if (self.roomPKResultInfoModel.voteMode == RoomPKVoteModeType_GiftValue) {
|
||||
self.guardScoreLable.hidden = NO;
|
||||
self.guardPersonLable.hidden = NO;
|
||||
bgHeight = 264;
|
||||
} else { // RoomPKVoteModeType_NumberPerson
|
||||
self.guardScoreLable.hidden = YES;
|
||||
self.guardPersonLable.hidden = YES;
|
||||
bgHeight = 204;
|
||||
}
|
||||
|
||||
[self loadTeamMemberUserAvatar:bluePKTeam.teamMembers mvpUserId:bluePKTeam.mvp];
|
||||
[self.contentImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(bgHeight); // 根据类型变化
|
||||
}];
|
||||
return; // 返回
|
||||
}
|
||||
|
||||
// 弹胜利方的框
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Blue) { // win
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_win_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_win_bg"];
|
||||
[self.resultButton setTitle:@"· 蓝队胜利 ·" forState:UIControlStateNormal];
|
||||
[self.resultButton setTitleColor:kBlueTeamColor forState:UIControlStateNormal];
|
||||
[self.checkButton setTitle:@"查看红队战绩>" forState:UIControlStateNormal];
|
||||
[self.checkButton setTitleColor:kRedTeamColor forState:UIControlStateNormal];
|
||||
|
||||
self.fightScoreLable.groupType = GroupType_Blue;
|
||||
self.guardScoreLable.groupType = GroupType_Blue;
|
||||
self.guardPersonLable.groupType = GroupType_Blue;
|
||||
self.fightScoreLable.content = [NSString stringWithFormat:@"%lld", bluePKTeam.score];
|
||||
if (bluePKTeam.protector.nick.length) {
|
||||
self.guardPersonLable.content = [NSString stringWithFormat:@"%@", bluePKTeam.protector.nick];
|
||||
} else {
|
||||
self.guardPersonLable.content = @"无";
|
||||
}
|
||||
self.guardScoreLable.content = [NSString stringWithFormat:@"%lld", bluePKTeam.protecScore];
|
||||
[self loadTeamMemberUserAvatar:bluePKTeam.teamMembers mvpUserId:bluePKTeam.mvp];
|
||||
} else if (self.roomPKResultInfoModel.result == RoomPKResultType_Red) { // loser
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_loser_bg"];
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
[self.resultButton setTitle:@"· 红队胜利 ·" forState:UIControlStateNormal];
|
||||
[self.resultButton setTitleColor:kRedTeamColor forState:UIControlStateNormal];
|
||||
[self.checkButton setTitle:@"查看蓝队战绩>" forState:UIControlStateNormal];
|
||||
[self.checkButton setTitleColor:kBlueTeamColor forState:UIControlStateNormal];
|
||||
|
||||
self.fightScoreLable.groupType = GroupTyp_Red;
|
||||
self.guardScoreLable.groupType = GroupTyp_Red;
|
||||
self.guardPersonLable.groupType = GroupTyp_Red;
|
||||
self.fightScoreLable.content = [NSString stringWithFormat:@"%lld", redPKTeam.score];
|
||||
if (redPKTeam.protector.nick.length) {
|
||||
self.guardPersonLable.content = [NSString stringWithFormat:@"%@", redPKTeam.protector.nick];
|
||||
} else {
|
||||
self.guardPersonLable.content = @"无";
|
||||
}
|
||||
self.guardScoreLable.content = [NSString stringWithFormat:@"%lld", redPKTeam.protecScore];
|
||||
[self loadTeamMemberUserAvatar:redPKTeam.teamMembers mvpUserId:redPKTeam.mvp];
|
||||
} else { // 平局
|
||||
self.bottomImageView.image = [UIImage imageNamed:@"room_pk_result_bottom_loser_bg"];
|
||||
self.topImageView.image = [UIImage imageNamed:@"room_pk_result_top_draw_bg"];
|
||||
[self.resultButton setTitle:@"· 势均力敌 ·" forState:UIControlStateNormal];
|
||||
[self.resultButton setTitleColor:kRedTeamColor forState:UIControlStateNormal];
|
||||
self.checkButton.hidden = YES;
|
||||
self.fightScoreLable.groupType = GroupTyp_Red;
|
||||
self.pkUserContaierView.hidden = YES;
|
||||
self.fightScoreLable.content = @"本局平局 战斗值";
|
||||
self.fightScoreLable.content = [NSString stringWithFormat:@"%lld", redPKTeam.score];
|
||||
[self loadTeamMemberUserAvatar:redPKTeam.teamMembers mvpUserId:redPKTeam.mvp];
|
||||
}
|
||||
|
||||
CGFloat bgHeight = 200;
|
||||
if (self.roomPKResultInfoModel.result == RoomPKResultType_Draw || self.roomPKResultInfoModel.voteMode == RoomPKVoteModeType_NumberPerson) {
|
||||
self.guardScoreLable.hidden = YES;
|
||||
self.guardPersonLable.hidden = YES;
|
||||
} else {
|
||||
self.guardScoreLable.hidden = NO;
|
||||
self.guardPersonLable.hidden = NO;
|
||||
bgHeight = 264;
|
||||
}
|
||||
[self.contentImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(bgHeight); // 根据类型变化
|
||||
}];
|
||||
}
|
||||
|
||||
- (UIImageView *)topImageView {
|
||||
if (!_topImageView) {
|
||||
_topImageView = [[UIImageView alloc] init];
|
||||
_topImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _topImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)contentImageView {
|
||||
if (!_contentImageView) {
|
||||
_contentImageView = [[UIImageView alloc] init];
|
||||
_contentImageView.userInteractionEnabled = YES;
|
||||
_contentImageView.image = [UIImage imageNamed:@"room_pk_result_content_bg"];
|
||||
}
|
||||
return _contentImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)bottomImageView {
|
||||
if (!_bottomImageView) {
|
||||
_bottomImageView = [[UIImageView alloc] init];
|
||||
_bottomImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _bottomImageView;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisVertical;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = 10;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
- (UIView *)pkUserContaierView {
|
||||
if (!_pkUserContaierView) {
|
||||
_pkUserContaierView = [[UIView alloc] init];
|
||||
_pkUserContaierView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _pkUserContaierView;
|
||||
}
|
||||
|
||||
- (UILabel *)pkUserLabel {
|
||||
if (!_pkUserLabel) {
|
||||
_pkUserLabel = [[UILabel alloc] init];
|
||||
_pkUserLabel.font = [UIFont systemFontOfSize:14];
|
||||
_pkUserLabel.textColor = [UIColor whiteColor];
|
||||
_pkUserLabel.text = @"PK选手:";
|
||||
}
|
||||
return _pkUserLabel;
|
||||
}
|
||||
|
||||
- (XPRomPKResultTitleLabel *)fightScoreLable {
|
||||
if (!_fightScoreLable) {
|
||||
_fightScoreLable = [[XPRomPKResultTitleLabel alloc] init];
|
||||
_fightScoreLable.title = @"战斗值:";
|
||||
}
|
||||
return _fightScoreLable;
|
||||
}
|
||||
|
||||
- (XPRomPKResultTitleLabel *)guardPersonLable {
|
||||
if (!_guardPersonLable) {
|
||||
_guardPersonLable = [[XPRomPKResultTitleLabel alloc] init];
|
||||
_guardPersonLable.title = @"守护者:";
|
||||
}
|
||||
return _guardPersonLable;
|
||||
}
|
||||
|
||||
- (XPRomPKResultTitleLabel *)guardScoreLable {
|
||||
if (!_guardScoreLable) {
|
||||
_guardScoreLable = [[XPRomPKResultTitleLabel alloc] init];
|
||||
_guardScoreLable.title = @"守护值:";
|
||||
}
|
||||
return _guardScoreLable;
|
||||
}
|
||||
|
||||
- (UIButton *)resultButton {
|
||||
if (!_resultButton) {
|
||||
_resultButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_resultButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_resultButton.titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
[_resultButton setBackgroundImage:[UIImage imageNamed:@"room_pk_result_loser_result_bg"] forState:UIControlStateNormal];
|
||||
}
|
||||
return _resultButton;
|
||||
}
|
||||
|
||||
- (UIButton *)checkButton {
|
||||
if (!_checkButton) {
|
||||
_checkButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_checkButton setTitle:@"查看对方战绩" forState:UIControlStateNormal];
|
||||
[_checkButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_checkButton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
_checkButton.layer.masksToBounds = YES;
|
||||
_checkButton.layer.cornerRadius = 10;
|
||||
[_checkButton addTarget:self action:@selector(checkButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _checkButton;
|
||||
}
|
||||
|
||||
- (NetImageView *)firstUserView {
|
||||
if (!_firstUserView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_firstUserView = [[NetImageView alloc] initWithConfig:config];
|
||||
_firstUserView.layer.masksToBounds = YES;
|
||||
_firstUserView.layer.cornerRadius = 35/2;
|
||||
_firstUserView.layer.borderWidth = 1;
|
||||
_firstUserView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _firstUserView;
|
||||
}
|
||||
|
||||
- (NetImageView *)secondUserView {
|
||||
if (!_secondUserView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_secondUserView = [[NetImageView alloc] initWithConfig:config];
|
||||
_secondUserView.layer.masksToBounds = YES;
|
||||
_secondUserView.layer.cornerRadius = 35/2;
|
||||
_secondUserView.layer.borderWidth = 1;
|
||||
_secondUserView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _secondUserView;
|
||||
}
|
||||
|
||||
|
||||
- (NetImageView *)thirdUserView {
|
||||
if (!_thirdUserView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_thirdUserView = [[NetImageView alloc] initWithConfig:config];
|
||||
_thirdUserView.layer.masksToBounds = YES;
|
||||
_thirdUserView.layer.cornerRadius = 35/2;
|
||||
_thirdUserView.layer.borderWidth = 1;
|
||||
_thirdUserView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _thirdUserView;
|
||||
}
|
||||
|
||||
- (NetImageView *)fourthUserView {
|
||||
if (!_fourthUserView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_fourthUserView = [[NetImageView alloc] initWithConfig:config];
|
||||
_fourthUserView.layer.masksToBounds = YES;
|
||||
_fourthUserView.layer.cornerRadius = 35/2;
|
||||
_fourthUserView.layer.borderWidth = 1;
|
||||
_fourthUserView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _fourthUserView;
|
||||
}
|
||||
|
||||
- (NetImageView *)fifthUserView {
|
||||
if (!_fifthUserView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_fifthUserView = [[NetImageView alloc] initWithConfig:config];
|
||||
_fifthUserView.layer.masksToBounds = YES;
|
||||
_fifthUserView.layer.cornerRadius = 35/2;
|
||||
_fifthUserView.layer.borderWidth = 1;
|
||||
_fifthUserView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _fifthUserView;
|
||||
}
|
||||
|
||||
- (UIImageView *)mvpImageView {
|
||||
if (!_mvpImageView) {
|
||||
_mvpImageView = [[UIImageView alloc] init];
|
||||
_mvpImageView.userInteractionEnabled = YES;
|
||||
_mvpImageView.image = [UIImage imageNamed:@"room_pk_result_user_mvp"];
|
||||
_mvpImageView.hidden = YES;
|
||||
}
|
||||
return _mvpImageView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|