房间PK结果的展示

This commit is contained in:
fengshuo
2022-03-31 22:09:46 +08:00
parent 7a9e70eb44
commit 77646e1e76
36 changed files with 1151 additions and 4 deletions

View File

@@ -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 */,

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View 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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View 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

View 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