个播增加随机PK的UI
This commit is contained in:
@@ -155,6 +155,7 @@
|
||||
9B3353BB2881527A00AC2F24 /* XPHomeLivesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3353BA2881527A00AC2F24 /* XPHomeLivesViewController.m */; };
|
||||
9B3353BE288156DB00AC2F24 /* XPHomeLivePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3353BD288156DB00AC2F24 /* XPHomeLivePresenter.m */; };
|
||||
9B3353C228816E6F00AC2F24 /* HomeLiveTagModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3353C128816E6F00AC2F24 /* HomeLiveTagModel.m */; };
|
||||
9B335B492925D8A00048A116 /* XPAnchorPKSelectTypeController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B335B482925D8A00048A116 /* XPAnchorPKSelectTypeController.m */; };
|
||||
9B33E3CB27D85379003B0E62 /* UploadFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B33E3C927D85379003B0E62 /* UploadFile.m */; };
|
||||
9B33E3CE27D8540C003B0E62 /* XPVoiceCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B33E3CD27D8540C003B0E62 /* XPVoiceCardViewController.m */; };
|
||||
9B33E3D427D8A1A4003B0E62 /* XPSkillCardPlayerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B33E3D327D8A1A4003B0E62 /* XPSkillCardPlayerManager.m */; };
|
||||
@@ -1527,6 +1528,8 @@
|
||||
9B3353BF2881570400AC2F24 /* XPHomeLiveProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLiveProtocol.h; sourceTree = "<group>"; };
|
||||
9B3353C028816E6F00AC2F24 /* HomeLiveTagModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeLiveTagModel.h; sourceTree = "<group>"; };
|
||||
9B3353C128816E6F00AC2F24 /* HomeLiveTagModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeLiveTagModel.m; sourceTree = "<group>"; };
|
||||
9B335B472925D8A00048A116 /* XPAnchorPKSelectTypeController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorPKSelectTypeController.h; sourceTree = "<group>"; };
|
||||
9B335B482925D8A00048A116 /* XPAnchorPKSelectTypeController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorPKSelectTypeController.m; sourceTree = "<group>"; };
|
||||
9B33E3C927D85379003B0E62 /* UploadFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UploadFile.m; sourceTree = "<group>"; };
|
||||
9B33E3CA27D85379003B0E62 /* UploadFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UploadFile.h; sourceTree = "<group>"; };
|
||||
9B33E3CC27D8540C003B0E62 /* XPVoiceCardViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPVoiceCardViewController.h; sourceTree = "<group>"; };
|
||||
@@ -4337,6 +4340,8 @@
|
||||
9B1B72AB280031DB003FACE9 /* XPAnchorPKViewController.m */,
|
||||
9B1B72AD280031F8003FACE9 /* XPAnchorPKSelectRoomView.h */,
|
||||
9B1B72AE280031F8003FACE9 /* XPAnchorPKSelectRoomView.m */,
|
||||
9B335B472925D8A00048A116 /* XPAnchorPKSelectTypeController.h */,
|
||||
9B335B482925D8A00048A116 /* XPAnchorPKSelectTypeController.m */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -9891,6 +9896,7 @@
|
||||
9BCF585C279909D7008401A4 /* XPSkillCardEditPropCell.m in Sources */,
|
||||
E88863C6278EAFC3004BCFAB /* XPAcrossRoomPKResultView.m in Sources */,
|
||||
E8AC722C26F49580007D6E91 /* XPMineNotificaViewController.m in Sources */,
|
||||
9B335B492925D8A00048A116 /* XPAnchorPKSelectTypeController.m in Sources */,
|
||||
E8098CAE282E07C00090B9F0 /* XPMonentsEmptyTableViewCell.m in Sources */,
|
||||
9B044DA0282D32F700DE4859 /* MicroInviteExtModel.m in Sources */,
|
||||
E8D7D74B282BA1EC0007D7BD /* XPMonentsTableViewCell.m in Sources */,
|
||||
|
22
xplan-ios/Assets.xcassets/Room/AcrossRoomPK/anchor_pk_invite_icon.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Room/AcrossRoomPK/anchor_pk_invite_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_pk_invite_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_pk_invite_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
22
xplan-ios/Assets.xcassets/Room/AcrossRoomPK/anchor_pk_random_icon.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Room/AcrossRoomPK/anchor_pk_random_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_pk_random_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_pk_random_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// XPAnchorSelectTypeViewController.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/11/17.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPAnchorPKSelectTypeController : MvpViewController
|
||||
|
||||
- (instancetype)initWithRoomUid:(NSString *)roomUid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,193 @@
|
||||
//
|
||||
// XPAnchorSelectTypeViewController.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/11/17.
|
||||
//
|
||||
|
||||
#import "XPAnchorPKSelectTypeController.h"
|
||||
#import "ThemeColor.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "XPMacro.h"
|
||||
#import "TTPopup.h"
|
||||
#import "XPAnchorPKRuleView.h"
|
||||
#import "XPAnchorPKViewController.h"
|
||||
#import "StatisticsServiceHelper.h"
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "Api+Room.h"
|
||||
|
||||
@interface XPAnchorPKSelectTypeController ()
|
||||
|
||||
@property (nonatomic, copy) NSString *roomUid;
|
||||
|
||||
@property (nonatomic, strong) UIView *gesView;
|
||||
@property (nonatomic, strong) UIView *bgView;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UIButton *ruleButton;
|
||||
@property (nonatomic, strong) UIView *lineView;
|
||||
@property (nonatomic, strong) UIButton *randomPKButton;
|
||||
@property (nonatomic, strong) UIButton *invitePKButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPAnchorPKSelectTypeController
|
||||
|
||||
- (instancetype)initWithRoomUid:(NSString *)roomUid {
|
||||
if (self = [super init]) {
|
||||
self.roomUid = roomUid;
|
||||
self.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self addSubView];
|
||||
[self setupContraints];
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
- (void)addSubView {
|
||||
[self.view addSubview:self.gesView];
|
||||
[self.view addSubview:self.bgView];
|
||||
[self.bgView addSubview:self.titleLabel];
|
||||
[self.bgView addSubview:self.ruleButton];
|
||||
[self.bgView addSubview:self.lineView];
|
||||
[self.bgView addSubview:self.randomPKButton];
|
||||
[self.bgView addSubview:self.invitePKButton];
|
||||
}
|
||||
|
||||
- (void)setupContraints {
|
||||
[self.gesView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(0);
|
||||
make.bottom.mas_equalTo(self.bgView.mas_top);
|
||||
}];
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.mas_equalTo(0);
|
||||
make.height.mas_equalTo(250);
|
||||
}];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(16);
|
||||
make.centerX.mas_equalTo(self.bgView);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
[self.ruleButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-16);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
make.width.height.mas_equalTo(21);
|
||||
}];
|
||||
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(8);
|
||||
make.left.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(0.5);
|
||||
}];
|
||||
[self.randomPKButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.bgView.mas_centerX).mas_offset(-22);
|
||||
make.size.mas_equalTo(CGSizeMake(100, 135));
|
||||
make.top.mas_equalTo(self.lineView.mas_bottom).mas_offset(16);
|
||||
}];
|
||||
[self.invitePKButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.randomPKButton.mas_right).mas_offset(44);
|
||||
make.size.mas_equalTo(CGSizeMake(100, 135));
|
||||
make.top.mas_equalTo(self.randomPKButton);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)ruleButtonAction:(UIButton *)sender {
|
||||
// XPAnchorPKRuleView *view = [[XPAnchorPKRuleView alloc] init];
|
||||
// [TTPopup popupView:view style:TTPopupStyleAlert];
|
||||
|
||||
[Api requestAnchorPkRule:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
XPAnchorPKRuleView *view = [[XPAnchorPKRuleView alloc] init];
|
||||
view.ruleString = data.data;
|
||||
[TTPopup popupView:view style:TTPopupStyleAlert];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)randomButtonAction:(UIButton *)sender {
|
||||
|
||||
}
|
||||
|
||||
- (void)inviteButtonAction:(UIButton *)sender {
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
XPAnchorPKViewController * acrossRoomPKVC = [[XPAnchorPKViewController alloc] initWithRoomUid:self.roomUid];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:acrossRoomPKVC animated:YES completion:nil];
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_more_tool_click eventAttributes:@{@"roomMoreMenuType" : @"openAnchorPk"}];
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)dismiss:(UITapGestureRecognizer *)ges {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - getter
|
||||
- (UIView *)gesView {
|
||||
if (!_gesView) {
|
||||
_gesView = [[UIView alloc] init];
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismiss:)];
|
||||
[_gesView addGestureRecognizer:tap];
|
||||
}
|
||||
return _gesView;
|
||||
}
|
||||
|
||||
- (UIView *)bgView {
|
||||
if (!_bgView) {
|
||||
_bgView = [[UIView alloc] init];
|
||||
_bgView.backgroundColor = UIColorFromRGB(0x0D0E2C);
|
||||
CAShapeLayer * layer = [CAShapeLayer layer];
|
||||
layer.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, KScreenWidth, 250) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(8, 8)].CGPath;
|
||||
_bgView.layer.mask = layer;
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = @"选择PK方式";
|
||||
_titleLabel.textColor = [UIColor whiteColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)ruleButton {
|
||||
if (!_ruleButton) {
|
||||
_ruleButton = [[UIButton alloc] init];
|
||||
[_ruleButton setImage:[UIImage imageNamed:@"room_across_pk_help"] forState:UIControlStateNormal];
|
||||
[_ruleButton addTarget:self action:@selector(ruleButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _ruleButton;
|
||||
}
|
||||
|
||||
- (UIView *)lineView {
|
||||
if (!_lineView) {
|
||||
_lineView = [[UIView alloc] init];
|
||||
_lineView.backgroundColor = UIColorRGBAlpha(0xffffff, 0.1);
|
||||
}
|
||||
return _lineView;
|
||||
}
|
||||
|
||||
- (UIButton *)randomPKButton {
|
||||
if (!_randomPKButton) {
|
||||
_randomPKButton = [[UIButton alloc] init];
|
||||
[_randomPKButton setImage:[UIImage imageNamed:@"anchor_pk_random_icon"] forState:UIControlStateNormal];
|
||||
[_randomPKButton addTarget:self action:@selector(randomButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _randomPKButton;
|
||||
}
|
||||
|
||||
- (UIButton *)invitePKButton {
|
||||
if (!_invitePKButton) {
|
||||
_invitePKButton = [[UIButton alloc] init];
|
||||
[_invitePKButton setImage:[UIImage imageNamed:@"anchor_pk_invite_icon"] forState:UIControlStateNormal];
|
||||
[_invitePKButton addTarget:self action:@selector(inviteButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _invitePKButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -19,7 +19,6 @@
|
||||
#import "AcrossRoomPKInfoModel.h"
|
||||
///View
|
||||
#import "XPAnchorPKSelectRoomView.h"
|
||||
#import "XPAnchorPKRuleView.h"
|
||||
///P
|
||||
#import "XPAnchorPKPresenter.h"
|
||||
#import "XPAnchorPKProtocol.h"
|
||||
@@ -33,8 +32,6 @@
|
||||
@property (nonatomic, strong) UIView *contentView;
|
||||
///标题
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
///帮助
|
||||
@property (nonatomic, strong) UIButton *helpButton;
|
||||
///PK对象的容器
|
||||
@property (nonatomic,strong) UIStackView *userStackView;
|
||||
///选择PK对象title
|
||||
@@ -117,7 +114,6 @@
|
||||
[self.view addSubview:self.contentView];
|
||||
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
[self.contentView addSubview:self.helpButton];
|
||||
[self.contentView addSubview:self.userStackView];
|
||||
[self.contentView addSubview:self.timeStackView];
|
||||
[self.contentView addSubview:self.playStackView];
|
||||
@@ -160,13 +156,6 @@
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(18);
|
||||
}];
|
||||
|
||||
[self.helpButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-12);
|
||||
make.width.height.mas_equalTo(22);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
|
||||
[self.userStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(32);
|
||||
make.left.mas_equalTo(self.contentView).offset(22);
|
||||
@@ -321,13 +310,6 @@
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)helpButtonAction:(UIButton *)sender {
|
||||
[self.customTimeTextField resignFirstResponder];
|
||||
[self.pkPlayModeTextField resignFirstResponder];
|
||||
XPAnchorPKRuleView *view = [[XPAnchorPKRuleView alloc] init];
|
||||
[TTPopup popupView:view style:TTPopupStyleAlert];
|
||||
}
|
||||
|
||||
- (void)selectPKButtonAction:(UIButton *)sender {
|
||||
[self.customTimeTextField resignFirstResponder];
|
||||
[self.pkPlayModeTextField resignFirstResponder];
|
||||
@@ -399,15 +381,6 @@
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)helpButton {
|
||||
if (!_helpButton) {
|
||||
_helpButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_helpButton setImage:[UIImage imageNamed:@"room_across_pk_help"] forState:UIControlStateNormal];
|
||||
[_helpButton addTarget:self action:@selector(helpButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _helpButton;
|
||||
}
|
||||
|
||||
- (UIStackView *)userStackView {
|
||||
if (!_userStackView) {
|
||||
_userStackView = [[UIStackView alloc] init];
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#import "XPRoomSendRedPacketViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "XPWishGiftCreateViewController.h"
|
||||
#import "XPAnchorPKSelectTypeController.h"
|
||||
///P
|
||||
#import "XPMoreMenuPresenter.h"
|
||||
#import "XPMoreMenuProtocol.h"
|
||||
@@ -372,9 +373,8 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
|
||||
case RoomMoreMenuType_Room_Anchor_PK_Open:
|
||||
{
|
||||
[self dismissViewControllerAnimated:NO completion:nil];
|
||||
XPAnchorPKViewController * acrossRoomPKVC = [[XPAnchorPKViewController alloc] initWithRoomUid:roomUid];
|
||||
[self.hostDelegate.getCurrentNav presentViewController:acrossRoomPKVC animated:YES completion:nil];
|
||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_more_tool_click eventAttributes:@{@"roomMoreMenuType" : @"openAnchorPk"}];
|
||||
XPAnchorPKSelectTypeController *selectVc = [[XPAnchorPKSelectTypeController alloc] initWithRoomUid:roomUid];
|
||||
[self.hostDelegate.getCurrentNav presentViewController:selectVc animated:YES completion:nil];
|
||||
}
|
||||
break;
|
||||
case RoomMoreMenuType_Room_Anchor_PK_Close:
|
||||
|
Reference in New Issue
Block a user