Compare commits
3 Commits
hotfix/Sen
...
feature/1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f078f926e9 | ||
![]() |
16a17b82ff | ||
![]() |
ca7051f34e |
Binary file not shown.
Before Width: | Height: | Size: 74 KiB |
@@ -5,12 +5,12 @@
|
|||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "room_gift_panel_arrow@2x.png",
|
"filename" : "gift_bag_icon@2x.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "room_gift_panel_arrow@3x.png",
|
"filename" : "gift_bag_icon@3x.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
}
|
}
|
BIN
YuMi/Assets.xcassets/main/gift_bag_icon.imageset/gift_bag_icon@2x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/main/gift_bag_icon.imageset/gift_bag_icon@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 979 B |
BIN
YuMi/Assets.xcassets/main/gift_bag_icon.imageset/gift_bag_icon@3x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/main/gift_bag_icon.imageset/gift_bag_icon@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 214 B |
Binary file not shown.
Before Width: | Height: | Size: 293 B |
@@ -8,8 +8,6 @@
|
|||||||
#import "UILabel+MSRTL.h"
|
#import "UILabel+MSRTL.h"
|
||||||
#import "NSMutableAttributedString+MSRTL.h"
|
#import "NSMutableAttributedString+MSRTL.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOL isMSRTLString(NSString *string) {
|
BOOL isMSRTLString(NSString *string) {
|
||||||
if ([string hasPrefix:@"\u202B"] || [string hasPrefix:@"\u202A"]) {
|
if ([string hasPrefix:@"\u202B"] || [string hasPrefix:@"\u202A"]) {
|
||||||
return YES;
|
return YES;
|
||||||
@@ -45,10 +43,6 @@ NSString * MSRTLString(NSString *string) {
|
|||||||
Method oldTextMethod1 = class_getInstanceMethod(self,@selector(setAttributedText:));
|
Method oldTextMethod1 = class_getInstanceMethod(self,@selector(setAttributedText:));
|
||||||
Method newTextMethod1 = class_getInstanceMethod(self, @selector(msrtl_setAttributedText:));
|
Method newTextMethod1 = class_getInstanceMethod(self, @selector(msrtl_setAttributedText:));
|
||||||
method_exchangeImplementations(oldTextMethod1, newTextMethod1);
|
method_exchangeImplementations(oldTextMethod1, newTextMethod1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)msrtl_setAttributedText:(NSAttributedString *)attributedText{
|
-(void)msrtl_setAttributedText:(NSAttributedString *)attributedText{
|
||||||
|
@@ -48,20 +48,14 @@
|
|||||||
language = @"ar";
|
language = @"ar";
|
||||||
}
|
}
|
||||||
if ([language isEqualToString:@"ar"]) {
|
if ([language isEqualToString:@"ar"]) {
|
||||||
|
|
||||||
[UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
|
[UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
|
||||||
[UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
|
[UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
[UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
|
[UIView appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
|
||||||
[UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
|
[UISearchBar appearance].semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
[NSBundle setLanguageText:language];
|
[NSBundle setLanguageText:language];
|
||||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kSwitchLanguage" object:language];
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"kSwitchLanguage" object:language];
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5* NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5* NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"kChanecNavView" object:language];
|
[[NSNotificationCenter defaultCenter]postNotificationName:@"kChanecNavView" object:language];
|
||||||
|
@@ -75,8 +75,8 @@
|
|||||||
make.height.mas_equalTo(18);
|
make.height.mas_equalTo(18);
|
||||||
}];
|
}];
|
||||||
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.trailing.mas_equalTo(-22);
|
make.trailing.mas_equalTo(-12);
|
||||||
make.top.mas_equalTo(22);
|
make.top.mas_equalTo(12);
|
||||||
make.width.height.mas_equalTo(33);
|
make.width.height.mas_equalTo(33);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
[self.redRoomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.redRoomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.mas_equalTo(self.redHeadImageView.mas_bottom).mas_offset(8);
|
make.top.mas_equalTo(self.redHeadImageView.mas_bottom).mas_offset(8);
|
||||||
make.left.mas_equalTo(self);
|
make.left.mas_equalTo(self);
|
||||||
make.right.mas_equalTo(self.redHeadImageView.mas_right);
|
make.width.mas_equalTo(70);
|
||||||
make.height.mas_equalTo(14);
|
make.height.mas_equalTo(14);
|
||||||
}];
|
}];
|
||||||
[self.redValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.redValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
@@ -106,7 +106,6 @@
|
|||||||
make.height.mas_equalTo(14);
|
make.height.mas_equalTo(14);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|
||||||
[self.blueHeadImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.blueHeadImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.mas_equalTo(70);
|
make.top.mas_equalTo(70);
|
||||||
make.trailing.mas_equalTo(-12.5);
|
make.trailing.mas_equalTo(-12.5);
|
||||||
@@ -114,9 +113,9 @@
|
|||||||
}];
|
}];
|
||||||
[self.blueRoomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.blueRoomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.mas_equalTo(self.blueHeadImageView.mas_bottom).mas_offset(8);
|
make.top.mas_equalTo(self.blueHeadImageView.mas_bottom).mas_offset(8);
|
||||||
make.right.mas_equalTo(self);
|
make.width.mas_equalTo(70);
|
||||||
make.height.mas_equalTo(14);
|
make.height.mas_equalTo(14);
|
||||||
make.left.mas_equalTo(self.blueHeadImageView.mas_left);
|
make.right.mas_equalTo(self);
|
||||||
}];
|
}];
|
||||||
[self.blueValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.blueValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.centerX.mas_equalTo(self.blueRoomTitleLabel);
|
make.centerX.mas_equalTo(self.blueRoomTitleLabel);
|
||||||
|
@@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
@interface XPAcrossRoomPKPanelView : UIView
|
@interface XPAcrossRoomPKPanelView : UIView
|
||||||
|
- (void)startInitUI;
|
||||||
///开启pk
|
///开启pk
|
||||||
- (void)openCountdownWithTime:(long)time;
|
- (void)openCountdownWithTime:(long)time;
|
||||||
///pk 信息
|
///pk 信息
|
||||||
|
@@ -29,6 +29,7 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
@interface XPAcrossRoomPKPanelView ()
|
@interface XPAcrossRoomPKPanelView ()
|
||||||
///背景
|
///背景
|
||||||
@property (nonatomic, strong) UIImageView *backgroundImageView;
|
@property (nonatomic, strong) UIImageView *backgroundImageView;
|
||||||
|
@property (nonatomic, strong) UIImageView *backgroundImageView_small;
|
||||||
#pragma mark - 规则的view
|
#pragma mark - 规则的view
|
||||||
///帮助按钮
|
///帮助按钮
|
||||||
@property (nonatomic, strong) UIButton *helpButton;
|
@property (nonatomic, strong) UIButton *helpButton;
|
||||||
@@ -54,7 +55,7 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
/// 蓝队头像
|
/// 蓝队头像
|
||||||
@property (nonatomic, strong) NetImageView *blueAvatarImageView;
|
@property (nonatomic, strong) NetImageView *blueAvatarImageView;
|
||||||
/// 去围观
|
/// 去围观
|
||||||
@property (nonatomic, strong) UIButton *onlookButton;
|
@property (nonatomic, strong) UIButton *onLookButton;
|
||||||
#pragma mark -进度条内容
|
#pragma mark -进度条内容
|
||||||
///PK最外面的容器
|
///PK最外面的容器
|
||||||
@property (nonatomic, strong) UIView *progressView;
|
@property (nonatomic, strong) UIView *progressView;
|
||||||
@@ -95,7 +96,7 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
///倒计时
|
///倒计时
|
||||||
@property (strong, nonatomic) dispatch_source_t timer;
|
@property (strong, nonatomic) dispatch_source_t timer;
|
||||||
|
|
||||||
@property (nonatomic, strong) MASConstraint *centerXConstraint;
|
@property (nonatomic, assign) CGPoint centerCenter;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation XPAcrossRoomPKPanelView
|
@implementation XPAcrossRoomPKPanelView
|
||||||
@@ -107,28 +108,33 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
if (self = [super initWithFrame:frame]) {
|
if (self = [super initWithFrame:CGRectMake(0, 0, kGetScaleWidth(310), kGetScaleWidth(MaxHeight))]) {
|
||||||
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(changeLocation:)];
|
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(changeLocation:)];
|
||||||
// 这里的delaysTouchesBegan属性很明显就是对touchBegin方法是否进行延迟,
|
// 这里的delaysTouchesBegan属性很明显就是对touchBegin方法是否进行延迟,
|
||||||
// YES表示延迟,即在系统未识别出来手势为什么手势时先不要调用touchesBegan 方法;
|
// YES表示延迟,即在系统未识别出来手势为什么手势时先不要调用touchesBegan 方法;
|
||||||
// NO表示不延迟,即在系统未识别出来手势为什么手势时会先调用touchesBegan 方法;
|
// NO表示不延迟,即在系统未识别出来手势为什么手势时会先调用touchesBegan 方法;
|
||||||
pan.delaysTouchesBegan = YES;
|
pan.delaysTouchesBegan = YES;
|
||||||
[self addGestureRecognizer:pan];
|
[self addGestureRecognizer:pan];
|
||||||
|
|
||||||
[self initSubViews];
|
|
||||||
[self initSubViewConstraints];
|
|
||||||
|
|
||||||
for (id view in self.ruleTextView.subviews) {
|
|
||||||
if ([view isKindOfClass:[UITextView class]]){
|
|
||||||
UITextView *textView = view;
|
|
||||||
textView.textAlignment = NSTextAlignmentLeft;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)startInitUI {
|
||||||
|
if (self.backgroundImageView.superview) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
[self initSubViews];
|
||||||
|
[self initSubViewConstraints];
|
||||||
|
|
||||||
|
for (id view in self.ruleTextView.subviews) {
|
||||||
|
if ([view isKindOfClass:[UITextView class]]){
|
||||||
|
UITextView *textView = view;
|
||||||
|
textView.textAlignment = NSTextAlignmentLeft;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Public Method
|
#pragma mark - Public Method
|
||||||
- (void)resetAcrossPKViewData {
|
- (void)resetAcrossPKViewData {
|
||||||
if (self.timer) {
|
if (self.timer) {
|
||||||
@@ -140,12 +146,8 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
|
|
||||||
#pragma mark - Private Method
|
#pragma mark - Private Method
|
||||||
- (void)setupBackground {
|
- (void)setupBackground {
|
||||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.width.mas_equalTo(kGetScaleWidth(310));
|
|
||||||
make.height.mas_equalTo(kGetScaleWidth(MaxHeight));
|
|
||||||
}];
|
|
||||||
|
|
||||||
[self addSubview:self.backgroundImageView];
|
[self addSubview:self.backgroundImageView];
|
||||||
|
[self addSubview:self.backgroundImageView_small];
|
||||||
|
|
||||||
UIImageView *topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pk_background_top"]];
|
UIImageView *topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pk_background_top"]];
|
||||||
topImageView.contentMode = UIViewContentModeScaleAspectFill;
|
topImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
@@ -155,6 +157,11 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
make.edges.equalTo(self);
|
make.edges.equalTo(self);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
[self.backgroundImageView_small mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.left.right.mas_equalTo(self);
|
||||||
|
make.height.mas_equalTo(kGetScaleWidth(MiniHeight));
|
||||||
|
}];
|
||||||
|
|
||||||
[topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.centerX.mas_equalTo(self);
|
make.centerX.mas_equalTo(self);
|
||||||
make.centerY.mas_equalTo(self.mas_top).offset(7);
|
make.centerY.mas_equalTo(self.mas_top).offset(7);
|
||||||
@@ -245,7 +252,7 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
[self.teamContainerView insertSubview:self.assistButton belowSubview:self.redAvatarImageView];
|
[self.teamContainerView insertSubview:self.assistButton belowSubview:self.redAvatarImageView];
|
||||||
[self.teamContainerView insertSubview:self.onlookButton belowSubview:self.blueAvatarImageView];
|
[self.teamContainerView insertSubview:self.onLookButton belowSubview:self.blueAvatarImageView];
|
||||||
[self.assistButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.assistButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.leading.mas_equalTo(self.redAvatarImageView.mas_trailing).offset(-16);
|
make.leading.mas_equalTo(self.redAvatarImageView.mas_trailing).offset(-16);
|
||||||
make.bottom.mas_equalTo(self.progressView.mas_top);
|
make.bottom.mas_equalTo(self.progressView.mas_top);
|
||||||
@@ -253,7 +260,7 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
make.height.mas_equalTo(14);
|
make.height.mas_equalTo(14);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.onlookButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.onLookButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.trailing.mas_equalTo(self.blueAvatarImageView.mas_leading).offset(16);
|
make.trailing.mas_equalTo(self.blueAvatarImageView.mas_leading).offset(16);
|
||||||
make.bottom.mas_equalTo(self.progressView.mas_top);
|
make.bottom.mas_equalTo(self.progressView.mas_top);
|
||||||
make.width.mas_equalTo(70);
|
make.width.mas_equalTo(70);
|
||||||
@@ -283,12 +290,12 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
[self.redCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.redCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.leading.mas_equalTo(self.redAvatarImageView.mas_trailing);
|
make.left.mas_equalTo(self.progressView).offset(2);
|
||||||
make.bottom.mas_equalTo(self.redAvatarImageView);
|
make.bottom.mas_equalTo(self.redAvatarImageView);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.blueCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.blueCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.right.mas_equalTo(self.blueAvatarImageView.mas_left);
|
make.right.mas_equalTo(self.progressView).offset(-2);
|
||||||
make.bottom.mas_equalTo(self.blueAvatarImageView);
|
make.bottom.mas_equalTo(self.blueAvatarImageView);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@@ -361,7 +368,6 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
make.width.equalTo(self.ruleTextView.mas_width).offset(20).priorityLow();
|
make.width.equalTo(self.ruleTextView.mas_width).offset(20).priorityLow();
|
||||||
make.height.equalTo(self.ruleTextView.mas_height).offset(20);
|
make.height.equalTo(self.ruleTextView.mas_height).offset(20);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initSubViews {
|
- (void)initSubViews {
|
||||||
@@ -475,25 +481,23 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
#pragma mark - Event Response
|
#pragma mark - Event Response
|
||||||
- (void)foldButtonAction:(UIButton *)sender {
|
- (void)foldButtonAction:(UIButton *)sender {
|
||||||
sender.selected = !sender.selected;
|
sender.selected = !sender.selected;
|
||||||
|
CGRect newFrame = self.frame;
|
||||||
|
|
||||||
if (sender.isSelected) {
|
if (sender.isSelected) {
|
||||||
self.userStackView.hidden = NO;
|
self.userStackView.hidden = NO;
|
||||||
[self mas_updateConstraints:^(MASConstraintMaker *make) {
|
self.backgroundImageView.hidden = NO;
|
||||||
make.height.mas_equalTo(kGetScaleWidth(MaxHeight));
|
self.backgroundImageView_small.hidden = YES;
|
||||||
}];
|
newFrame.size.height = kGetScaleWidth(MaxHeight);
|
||||||
self.backgroundImageView.image = [UIImage imageNamed:@"room_across_pk_panel_bg"];
|
self.foldButton.transform = CGAffineTransformIdentity;
|
||||||
[UIView animateWithDuration:0.5 animations:^{
|
|
||||||
self.foldButton.transform = CGAffineTransformIdentity;
|
|
||||||
}];
|
|
||||||
} else {
|
} else {
|
||||||
self.userStackView.hidden = YES;
|
self.userStackView.hidden = YES;
|
||||||
self.backgroundImageView.image = [UIImage imageNamed:@"room_across_pk_panel_small_bg"];
|
self.backgroundImageView.hidden = YES;
|
||||||
[self mas_updateConstraints:^(MASConstraintMaker *make) {
|
self.backgroundImageView_small.hidden = NO;
|
||||||
make.height.mas_equalTo(kGetScaleWidth(MiniHeight));
|
newFrame.size.height = kGetScaleWidth(MiniHeight);
|
||||||
}];
|
self.foldButton.transform = CGAffineTransformMakeRotation(M_PI);
|
||||||
[UIView animateWithDuration:0.5 animations:^{
|
|
||||||
self.foldButton.transform = CGAffineTransformMakeRotation(M_PI);
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
self.frame = newFrame;
|
||||||
|
[self layoutIfNeeded];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)helpButtonAction:(UIButton *)sender {
|
- (void)helpButtonAction:(UIButton *)sender {
|
||||||
@@ -503,25 +507,29 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
|
|
||||||
- (void)tapRedAvatarRecognizer:(UITapGestureRecognizer *)ges {
|
- (void)tapRedAvatarRecognizer:(UITapGestureRecognizer *)ges {
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:showUserCard:)]) {
|
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:showUserCard:)]) {
|
||||||
[self.delegate XPAcrossRoomPKPanelView:self showUserCard:self.pkPanelInfo.cUid];
|
[self.delegate XPAcrossRoomPKPanelView:self
|
||||||
|
showUserCard:self.pkPanelInfo.cUid];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tapBlueAvatarRecognizer:(UITapGestureRecognizer *)ges {
|
- (void)tapBlueAvatarRecognizer:(UITapGestureRecognizer *)ges {
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:showUserCard:)]) {
|
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:showUserCard:)]) {
|
||||||
[self.delegate XPAcrossRoomPKPanelView:self showUserCard:self.pkPanelInfo.aUid];
|
[self.delegate XPAcrossRoomPKPanelView:self
|
||||||
|
showUserCard:self.pkPanelInfo.aUid];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)assistButtonAction:(UIButton *)sender {
|
- (void)assistButtonAction:(UIButton *)sender {
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:sendGiftToUser:)]) {
|
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:sendGiftToUser:)]) {
|
||||||
[self.delegate XPAcrossRoomPKPanelView:self sendGiftToUser:self.pkPanelInfo.cUid];
|
[self.delegate XPAcrossRoomPKPanelView:self
|
||||||
|
sendGiftToUser:self.pkPanelInfo.cUid];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)onlookButtonAction:(UIButton *)sender {
|
- (void)onlookButtonAction:(UIButton *)sender {
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:onLookRoomonLookRoom:)]) {
|
if (self.delegate && [self.delegate respondsToSelector:@selector(XPAcrossRoomPKPanelView:onLookRoom:)]) {
|
||||||
[self.delegate XPAcrossRoomPKPanelView:self onLookRoom:self.pkPanelInfo.aUid];
|
[self.delegate XPAcrossRoomPKPanelView:self
|
||||||
|
onLookRoom:self.pkPanelInfo.aUid];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -539,12 +547,12 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
|
|
||||||
CGPoint panPoint = [p locationInView:appWindow];
|
CGPoint panPoint = [p locationInView:appWindow];
|
||||||
if (p.state == UIGestureRecognizerStateBegan) {
|
if (p.state == UIGestureRecognizerStateBegan) {
|
||||||
self.alpha = 1;
|
// self.alpha = 1;
|
||||||
} else if(p.state == UIGestureRecognizerStateChanged) {
|
} else if(p.state == UIGestureRecognizerStateChanged) {
|
||||||
self.center = CGPointMake(panPoint.x, panPoint.y);
|
self.center = CGPointMake(panPoint.x, panPoint.y);
|
||||||
} else if(p.state == UIGestureRecognizerStateEnded
|
} else if(p.state == UIGestureRecognizerStateEnded
|
||||||
|| p.state == UIGestureRecognizerStateCancelled) {
|
|| p.state == UIGestureRecognizerStateCancelled) {
|
||||||
self.alpha = 1;
|
// self.alpha = 1;
|
||||||
CGFloat touchWidth = self.frame.size.width;
|
CGFloat touchWidth = self.frame.size.width;
|
||||||
CGFloat touchHeight = self.frame.size.height;
|
CGFloat touchHeight = self.frame.size.height;
|
||||||
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
|
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
|
||||||
@@ -576,6 +584,7 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
}else {
|
}else {
|
||||||
newCenter = CGPointMake(panPoint.x, screenHeight - touchWidth / 3);
|
newCenter = CGPointMake(panPoint.x, screenHeight - touchWidth / 3);
|
||||||
}
|
}
|
||||||
|
self.centerCenter = newCenter;
|
||||||
[UIView animateWithDuration:0.25 animations:^{
|
[UIView animateWithDuration:0.25 animations:^{
|
||||||
if ((newCenter.y + self.frame.size.height / 2) > (KScreenHeight - kSafeAreaBottomHeight - 44)) {
|
if ((newCenter.y + self.frame.size.height / 2) > (KScreenHeight - kSafeAreaBottomHeight - 44)) {
|
||||||
self.center = CGPointMake(newCenter.x, KScreenHeight - self.frame.size.height / 2 - kSafeAreaBottomHeight - 44);
|
self.center = CGPointMake(newCenter.x, KScreenHeight - self.frame.size.height / 2 - kSafeAreaBottomHeight - 44);
|
||||||
@@ -703,11 +712,22 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
_backgroundImageView = [[UIImageView alloc] init];
|
_backgroundImageView = [[UIImageView alloc] init];
|
||||||
_backgroundImageView.image = [UIImage imageNamed:@"room_across_pk_panel_bg"];
|
_backgroundImageView.image = [UIImage imageNamed:@"room_across_pk_panel_bg"];
|
||||||
_backgroundImageView.userInteractionEnabled = YES;
|
_backgroundImageView.userInteractionEnabled = YES;
|
||||||
_backgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
|
_backgroundImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
}
|
}
|
||||||
return _backgroundImageView;
|
return _backgroundImageView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (UIImageView *)backgroundImageView_small {
|
||||||
|
if (!_backgroundImageView_small) {
|
||||||
|
_backgroundImageView_small = [[UIImageView alloc] init];
|
||||||
|
_backgroundImageView_small.image = [UIImage imageNamed:@"room_across_pk_panel_small_bg"];
|
||||||
|
_backgroundImageView_small.userInteractionEnabled = YES;
|
||||||
|
_backgroundImageView_small.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
|
_backgroundImageView_small.hidden = YES;
|
||||||
|
}
|
||||||
|
return _backgroundImageView_small;
|
||||||
|
}
|
||||||
|
|
||||||
- (UIButton *)helpButton {
|
- (UIButton *)helpButton {
|
||||||
if (!_helpButton) {
|
if (!_helpButton) {
|
||||||
_helpButton = [[UIButton alloc] init];
|
_helpButton = [[UIButton alloc] init];
|
||||||
@@ -889,16 +909,16 @@ static CGFloat MiniHeight = 130.5;
|
|||||||
return _assistButton;
|
return _assistButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIButton *)onlookButton {
|
- (UIButton *)onLookButton {
|
||||||
if (!_onlookButton) {
|
if (!_onLookButton) {
|
||||||
_onlookButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
_onLookButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
[_onlookButton setBackgroundImage:kImage(@"pk_name_bg_blue") forState:UIControlStateNormal];
|
[_onLookButton setBackgroundImage:kImage(@"pk_name_bg_blue") forState:UIControlStateNormal];
|
||||||
[_onlookButton setTitle:YMLocalizedString(@"XPAcrossRoomPKPanelView3") forState:UIControlStateNormal];
|
[_onLookButton setTitle:YMLocalizedString(@"XPAcrossRoomPKPanelView3") forState:UIControlStateNormal];
|
||||||
_onlookButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
_onLookButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
||||||
[_onlookButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
[_onLookButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||||
[_onlookButton addTarget:self action:@selector(onlookButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_onLookButton addTarget:self action:@selector(onlookButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
return _onlookButton;
|
return _onLookButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIButton *)foldButton {
|
- (UIButton *)foldButton {
|
||||||
|
@@ -253,7 +253,6 @@
|
|||||||
///房间内PK是否正在进行
|
///房间内PK是否正在进行
|
||||||
- (BOOL)isRoomPKPlaying {
|
- (BOOL)isRoomPKPlaying {
|
||||||
return [self.pkPanelView isRoomPKPlaying];
|
return [self.pkPanelView isRoomPKPlaying];
|
||||||
// return [self.roompkPanelView isRoomPKPlaying];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Private Method
|
#pragma mark - Private Method
|
||||||
@@ -460,12 +459,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// MARK: ----- 修改结束
|
// MARK: ----- 修改结束
|
||||||
- (void)configRoomPKPanelView:(BOOL)isEnter {
|
- (void)configRoomPKPanelView:(BOOL)isEnter{
|
||||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||||
if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
|
if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
|
||||||
|
|
||||||
self.pkPanelView.roomInfo = roomInfo;
|
self.pkPanelView.roomInfo = roomInfo;
|
||||||
[self showPKPanel_];
|
if (self.pkPanelView.isPanelMinion == NO) {
|
||||||
|
[self showPKPanel_];
|
||||||
|
}
|
||||||
|
|
||||||
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
|
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
|
||||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||||
@@ -643,10 +644,8 @@
|
|||||||
if (acrossPKPanelInfo.aUid.integerValue > 0) {
|
if (acrossPKPanelInfo.aUid.integerValue > 0) {
|
||||||
if (!self.acrossPKPanelView.superview) {
|
if (!self.acrossPKPanelView.superview) {
|
||||||
[self addSubview:self.acrossPKPanelView];
|
[self addSubview:self.acrossPKPanelView];
|
||||||
[self.acrossPKPanelView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.acrossPKPanelView startInitUI];
|
||||||
make.centerX.mas_equalTo(self);
|
self.acrossPKPanelView.center = self.center;
|
||||||
make.top.mas_equalTo(self).offset(354 + kSafeAreaTopHeight);
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
self.acrossPKPanelView.pkPanelInfo = acrossPKPanelInfo;
|
self.acrossPKPanelView.pkPanelInfo = acrossPKPanelInfo;
|
||||||
}
|
}
|
||||||
@@ -744,16 +743,16 @@
|
|||||||
if (error == nil) {
|
if (error == nil) {
|
||||||
NIMChatroomMember * member = [members firstObject];
|
NIMChatroomMember * member = [members firstObject];
|
||||||
if (member.type == NIMChatroomMemberTypeCreator || meIsSuperAdmin) {
|
if (member.type == NIMChatroomMemberTypeCreator || meIsSuperAdmin) {
|
||||||
XPAcrossRoomPKInviteResultView * inviteResutView = [[XPAcrossRoomPKInviteResultView alloc] init];
|
XPAcrossRoomPKInviteResultView * inviteResultView = [[XPAcrossRoomPKInviteResultView alloc] init];
|
||||||
inviteResutView.is_XP_Accept = YES;
|
inviteResultView.is_XP_Accept = YES;
|
||||||
[self addSubview:inviteResutView];
|
[self addSubview:inviteResultView];
|
||||||
[inviteResutView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[inviteResultView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.mas_equalTo(self).offset(114 + kSafeAreaTopHeight);
|
make.top.mas_equalTo(self).offset(114 + kSafeAreaTopHeight);
|
||||||
make.centerX.mas_equalTo(self);
|
make.centerX.mas_equalTo(self);
|
||||||
make.size.mas_equalTo(CGSizeMake(281, 42));
|
make.size.mas_equalTo(CGSizeMake(KScreenWidth - 40, 42));
|
||||||
}];
|
}];
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
[inviteResutView removeFromSuperview];
|
[inviteResultView removeFromSuperview];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -793,10 +792,8 @@
|
|||||||
self.acrossPKCountView = nil;
|
self.acrossPKCountView = nil;
|
||||||
if (!self.acrossPKPanelView.superview) {
|
if (!self.acrossPKPanelView.superview) {
|
||||||
[self addSubview:self.acrossPKPanelView];
|
[self addSubview:self.acrossPKPanelView];
|
||||||
[self.acrossPKPanelView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.acrossPKPanelView startInitUI];
|
||||||
make.top.mas_equalTo(self).offset(354 + kSafeAreaTopHeight);
|
self.acrossPKPanelView.center = self.center;
|
||||||
make.centerX.mas_equalTo(self);
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
|
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
|
||||||
if (attachment.data[@"amicStatus"] != nil){
|
if (attachment.data[@"amicStatus"] != nil){
|
||||||
|
@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@class MicroQueueModel, AttachmentModel, RoomInfoModel, RoomPKChooseUserModel;
|
@class MicroQueueModel, AttachmentModel, RoomInfoModel, RoomPKChooseUserModel;
|
||||||
@interface XPRoomPKPanelView : UIView
|
@interface XPRoomPKPanelView : UIView
|
||||||
|
|
||||||
|
@property (nonatomic, strong) UIView *pkPanelContentView;
|
||||||
|
|
||||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MicroQueueModel *> *micQueue;
|
@property (nonatomic, strong) NSMutableDictionary<NSString *, MicroQueueModel *> *micQueue;
|
||||||
///房间信息
|
///房间信息
|
||||||
@property (nonatomic, strong) RoomInfoModel *roomInfo;
|
@property (nonatomic, strong) RoomInfoModel *roomInfo;
|
||||||
@@ -29,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
- (BOOL)isRoomPKPlaying;
|
- (BOOL)isRoomPKPlaying;
|
||||||
|
|
||||||
|
- (BOOL)isPanelMinion;
|
||||||
|
|
||||||
///收到礼物
|
///收到礼物
|
||||||
- (void)roomPKReceiveGift:(AttachmentModel *)attachment;
|
- (void)roomPKReceiveGift:(AttachmentModel *)attachment;
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@
|
|||||||
///蓝队收到礼物个数(按照收礼个数)
|
///蓝队收到礼物个数(按照收礼个数)
|
||||||
@property (nonatomic, strong) NSMutableDictionary * blueTeamGiftPersonDic;
|
@property (nonatomic, strong) NSMutableDictionary * blueTeamGiftPersonDic;
|
||||||
|
|
||||||
@property (nonatomic, strong) UIView *pkPanelContentView;
|
|
||||||
|
|
||||||
@property (nonatomic, strong) UIImageView *backgroundImageView;
|
@property (nonatomic, strong) UIImageView *backgroundImageView;
|
||||||
@property (nonatomic, strong) UIImageView *topImageView;
|
@property (nonatomic, strong) UIImageView *topImageView;
|
||||||
@@ -88,6 +88,8 @@
|
|||||||
@property (nonatomic, strong) UILabel *blueCountLabel;
|
@property (nonatomic, strong) UILabel *blueCountLabel;
|
||||||
@property (nonatomic, strong) UIImageView *fireImageView;
|
@property (nonatomic, strong) UIImageView *fireImageView;
|
||||||
|
|
||||||
|
@property (nonatomic, assign) BOOL isMinion;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation XPRoomPKPanelView
|
@implementation XPRoomPKPanelView
|
||||||
@@ -106,7 +108,7 @@
|
|||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
if (self = [super initWithFrame:frame]) {
|
if (self = [super initWithFrame:frame]) {
|
||||||
[self setupUI];
|
// [self setupUI];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -306,8 +308,9 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Custom_Message_Sub_Room_PK_Result:{
|
case Custom_Message_Sub_Room_PK_Result:{
|
||||||
[TTPopup dismiss];
|
// [TTPopup dismiss];
|
||||||
[self didTapMinion];
|
[self didTapMinion];
|
||||||
|
|
||||||
RoomPKInfoModel * pkInfo = [RoomPKInfoModel modelWithDictionary:attachment.data];
|
RoomPKInfoModel * pkInfo = [RoomPKInfoModel modelWithDictionary:attachment.data];
|
||||||
self.isReceivePKResult = YES;
|
self.isReceivePKResult = YES;
|
||||||
[self stopRoomPKCountDown];
|
[self stopRoomPKCountDown];
|
||||||
@@ -528,6 +531,10 @@
|
|||||||
return self.isPlaying;
|
return self.isPlaying;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isPanelMinion {
|
||||||
|
return self.isMinion;
|
||||||
|
}
|
||||||
|
|
||||||
///收到礼物
|
///收到礼物
|
||||||
- (void)roomPKReceiveGift:(AttachmentModel *)attachment {
|
- (void)roomPKReceiveGift:(AttachmentModel *)attachment {
|
||||||
if (self.pkInfo.pkStatus != RoomPKStatusType_Playing) {
|
if (self.pkInfo.pkStatus != RoomPKStatusType_Playing) {
|
||||||
@@ -849,7 +856,7 @@
|
|||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
- (void)didTapMinion {
|
- (void)didTapMinion {
|
||||||
// TODO: 最小化
|
self.isMinion = true;
|
||||||
[self removeFromSuperview];
|
[self removeFromSuperview];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1251,7 +1258,6 @@
|
|||||||
[transparentRoundedCornersBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[transparentRoundedCornersBackgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.centerX.mas_equalTo(self.pkPanelContentView);
|
make.centerX.mas_equalTo(self.pkPanelContentView);
|
||||||
make.top.mas_equalTo(self.redTeamStackView.mas_bottom).offset(8);
|
make.top.mas_equalTo(self.redTeamStackView.mas_bottom).offset(8);
|
||||||
// make.size.mas_equalTo(CGSizeMake(122, 30));
|
|
||||||
make.width.mas_greaterThanOrEqualTo(120);
|
make.width.mas_greaterThanOrEqualTo(120);
|
||||||
make.height.mas_equalTo(30);
|
make.height.mas_equalTo(30);
|
||||||
}];
|
}];
|
||||||
@@ -1264,6 +1270,13 @@
|
|||||||
make.size.mas_equalTo(CGSizeMake(13, 13));
|
make.size.mas_equalTo(CGSizeMake(13, 13));
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
[transparentRoundedCornersBackgroundView addSubview:self.countDownLabel];
|
||||||
|
[self.countDownLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.mas_equalTo(transparentRoundedCornersBackgroundView);
|
||||||
|
make.right.mas_equalTo(transparentRoundedCornersBackgroundView.mas_right).offset(-6);
|
||||||
|
make.width.mas_greaterThanOrEqualTo(40);
|
||||||
|
}];
|
||||||
|
|
||||||
UILabel *titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPRoomPKProgressView11")
|
UILabel *titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPRoomPKProgressView11")
|
||||||
font:[UIFont systemFontOfSize:11 weight:UIFontWeightMedium]
|
font:[UIFont systemFontOfSize:11 weight:UIFontWeightMedium]
|
||||||
textColor:[UIColor colorWithWhite:1 alpha:0.7]];
|
textColor:[UIColor colorWithWhite:1 alpha:0.7]];
|
||||||
@@ -1271,14 +1284,7 @@
|
|||||||
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.centerY.mas_equalTo(transparentRoundedCornersBackgroundView);
|
make.centerY.mas_equalTo(transparentRoundedCornersBackgroundView);
|
||||||
make.left.mas_equalTo(clockImageView.mas_right).offset(6);
|
make.left.mas_equalTo(clockImageView.mas_right).offset(6);
|
||||||
}];
|
make.right.mas_equalTo(self.countDownLabel.mas_left).offset(-6);
|
||||||
|
|
||||||
[transparentRoundedCornersBackgroundView addSubview:self.countDownLabel];
|
|
||||||
[self.countDownLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.centerY.mas_equalTo(transparentRoundedCornersBackgroundView);
|
|
||||||
make.left.mas_equalTo(titleLabel.mas_right).offset(6);
|
|
||||||
make.right.mas_equalTo(titleLabel.mas_right).offset(-6);
|
|
||||||
make.width.mas_equalTo(50);
|
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1333,7 +1339,7 @@
|
|||||||
|
|
||||||
[self.progressArea addSubview:self.fireImageView];
|
[self.progressArea addSubview:self.fireImageView];
|
||||||
[self.fireImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.fireImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.centerX.mas_equalTo(self.progressArea).offset(0);
|
make.centerX.mas_equalTo(self.progressArea);
|
||||||
make.centerY.mas_equalTo(self.progressArea).mas_offset(2);
|
make.centerY.mas_equalTo(self.progressArea).mas_offset(2);
|
||||||
make.height.mas_equalTo(35);
|
make.height.mas_equalTo(35);
|
||||||
make.width.mas_equalTo(24);
|
make.width.mas_equalTo(24);
|
||||||
@@ -1341,9 +1347,8 @@
|
|||||||
|
|
||||||
[self.progressArea insertSubview:self.blueCountImageView aboveSubview:self.redCountImageView];
|
[self.progressArea insertSubview:self.blueCountImageView aboveSubview:self.redCountImageView];
|
||||||
[self.blueCountImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.blueCountImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.right.mas_equalTo(self.progressArea).offset(-47.5);
|
make.right.top.mas_equalTo(self.redCountImageView);
|
||||||
make.centerY.mas_equalTo(self.progressArea).mas_offset(4);
|
make.left.mas_equalTo(self.fireImageView.mas_centerX);
|
||||||
make.leading.mas_equalTo(self.fireImageView.mas_centerX);
|
|
||||||
make.height.mas_equalTo(14);
|
make.height.mas_equalTo(14);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
@@ -447,7 +447,7 @@
|
|||||||
[self topImageFail];
|
[self topImageFail];
|
||||||
} else { // 平局
|
} else { // 平局
|
||||||
resultType = 2;
|
resultType = 2;
|
||||||
[self topImageFail];
|
[self topImageDraw];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self descAreaGroupType:GroupType_Red];
|
[self descAreaGroupType:GroupType_Red];
|
||||||
|
@@ -20,8 +20,8 @@
|
|||||||
@property (nonatomic, strong) JXCategoryTitleView *titleView;
|
@property (nonatomic, strong) JXCategoryTitleView *titleView;
|
||||||
///分页lineView
|
///分页lineView
|
||||||
@property (nonatomic, strong) JXCategoryListContainerView *pi_containerView;
|
@property (nonatomic, strong) JXCategoryListContainerView *pi_containerView;
|
||||||
///背包总价值
|
/////背包总价值
|
||||||
@property (nonatomic,strong) UILabel *totalValueLabel;
|
//@property (nonatomic,strong) UILabel *totalValueLabel;
|
||||||
///背包礼物
|
///背包礼物
|
||||||
@property (nonatomic,strong) UIButton *packGiftButton;
|
@property (nonatomic,strong) UIButton *packGiftButton;
|
||||||
///背包礼物面板
|
///背包礼物面板
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
[self addSubview:self.titleView];
|
[self addSubview:self.titleView];
|
||||||
[self addSubview:self.pi_containerView];
|
[self addSubview:self.pi_containerView];
|
||||||
[self addSubview:self.packGiftButton];
|
[self addSubview:self.packGiftButton];
|
||||||
[self addSubview:self.totalValueLabel];
|
// [self addSubview:self.totalValueLabel];
|
||||||
[self addSubview:self.packGiftView];
|
[self addSubview:self.packGiftView];
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -74,20 +74,25 @@
|
|||||||
}];
|
}];
|
||||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.leading.equalTo(self);
|
make.top.leading.equalTo(self);
|
||||||
make.height.mas_equalTo(44);
|
// make.leading.equalTo(self).offset(8);
|
||||||
|
// make.trailing.mas_equalTo(self.packGiftButton.mas_leading).offset(-16);
|
||||||
|
make.height.mas_equalTo(34);
|
||||||
make.width.mas_equalTo(kGetScaleWidth(200));
|
make.width.mas_equalTo(kGetScaleWidth(200));
|
||||||
|
|
||||||
}];
|
}];
|
||||||
[self.packGiftButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.packGiftButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.trailing.mas_equalTo(-15);
|
make.trailing.mas_equalTo(-15);
|
||||||
make.centerY.height.mas_equalTo(self.titleView);
|
// make.top.mas_equalTo(2);
|
||||||
make.width.mas_equalTo(isMSRTL() ? 70:40);
|
make.centerY.mas_equalTo(self.titleView);
|
||||||
}];
|
// make.height.mas_equalTo(self.titleView);
|
||||||
[self.totalValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
// make.width.mas_equalTo(isMSRTL() ? 70:40);
|
||||||
make.trailing.mas_equalTo(self.packGiftButton.mas_leading).mas_offset(-3);
|
make.size.mas_equalTo(CGSizeMake(20, 20));
|
||||||
make.leading.equalTo(self.titleView.mas_trailing).mas_offset(5);
|
|
||||||
make.centerY.mas_equalTo(self.packGiftButton);
|
|
||||||
}];
|
}];
|
||||||
|
// [self.totalValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
// make.trailing.mas_equalTo(self.packGiftButton.mas_leading).mas_offset(-3);
|
||||||
|
// make.leading.equalTo(self.titleView.mas_trailing).mas_offset(5);
|
||||||
|
// make.centerY.mas_equalTo(self.packGiftButton);
|
||||||
|
// }];
|
||||||
[self.pi_containerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.pi_containerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.leading.trailing.bottom.equalTo(self);
|
make.leading.trailing.bottom.equalTo(self);
|
||||||
make.top.equalTo(self.titleView.mas_bottom).mas_offset(kGetScaleWidth(0));
|
make.top.equalTo(self.titleView.mas_bottom).mas_offset(kGetScaleWidth(0));
|
||||||
@@ -125,7 +130,7 @@
|
|||||||
[self.titleView reloadData];
|
[self.titleView reloadData];
|
||||||
self.pi_containerView.hidden = NO;
|
self.pi_containerView.hidden = NO;
|
||||||
self.packGiftView.hidden = YES;
|
self.packGiftView.hidden = YES;
|
||||||
self.totalValueLabel.hidden = YES;
|
// self.totalValueLabel.hidden = YES;
|
||||||
XPGiftInfoView *vc = [self getListVC:index];
|
XPGiftInfoView *vc = [self getListVC:index];
|
||||||
self.segmentType = vc.segmentType;
|
self.segmentType = vc.segmentType;
|
||||||
if(self.delegate && [self.delegate respondsToSelector:@selector(pIGiftInfoSegmentedView:didClickSegment:)]){
|
if(self.delegate && [self.delegate respondsToSelector:@selector(pIGiftInfoSegmentedView:didClickSegment:)]){
|
||||||
@@ -179,30 +184,30 @@
|
|||||||
[self.titleView reloadData];
|
[self.titleView reloadData];
|
||||||
self.packGiftView.hidden = NO;
|
self.packGiftView.hidden = NO;
|
||||||
self.pi_containerView.hidden = YES;
|
self.pi_containerView.hidden = YES;
|
||||||
self.totalValueLabel.hidden = NO;
|
// self.totalValueLabel.hidden = NO;
|
||||||
self.segmentType = GiftSegmentType_Pack;
|
self.segmentType = GiftSegmentType_Pack;
|
||||||
if(self.delegate && [self.delegate respondsToSelector:@selector(pIGiftInfoSegmentedView:didClickSegment:)]){
|
if(self.delegate && [self.delegate respondsToSelector:@selector(pIGiftInfoSegmentedView:didClickSegment:)]){
|
||||||
[self.delegate pIGiftInfoSegmentedView:self didClickSegment:self.segmentType];
|
[self.delegate pIGiftInfoSegmentedView:self didClickSegment:self.segmentType];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- (void)createPackTotalValueAttribute {
|
//- (void)createPackTotalValueAttribute {
|
||||||
__block NSInteger giftTotal = 0;
|
// __block NSInteger giftTotal = 0;
|
||||||
[self.packOriginArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
// [self.packOriginArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
if ([obj isKindOfClass:GiftInfoModel.class]) {
|
// if ([obj isKindOfClass:GiftInfoModel.class]) {
|
||||||
GiftInfoModel *gift = (GiftInfoModel *)obj;
|
// GiftInfoModel *gift = (GiftInfoModel *)obj;
|
||||||
if(gift.giftId != self.freeModel.giftId.integerValue){
|
// if(gift.giftId != self.freeModel.giftId.integerValue){
|
||||||
giftTotal += gift.count * gift.goldPrice;
|
// giftTotal += gift.count * gift.goldPrice;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}];
|
// }];
|
||||||
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPGiftInfoView0" ) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:[DJDKMIMOMColor textThirdColor]}];
|
// NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPGiftInfoView0" ) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:[DJDKMIMOMColor textThirdColor]}];
|
||||||
[str appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",[self countFormatCoinStr:giftTotal]] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}]];
|
// [str appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",[self countFormatCoinStr:giftTotal]] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}]];
|
||||||
NSTextAttachment *attachImage = [[NSTextAttachment alloc] init];
|
// NSTextAttachment *attachImage = [[NSTextAttachment alloc] init];
|
||||||
attachImage.image = [UIImage imageNamed:@"exchange_gold_icon"];
|
// attachImage.image = [UIImage imageNamed:@"exchange_gold_icon"];
|
||||||
attachImage.bounds = CGRectMake(0, 0, 9, 9);
|
// attachImage.bounds = CGRectMake(0, 0, 9, 9);
|
||||||
[str appendAttributedString:[[NSMutableAttributedString alloc] initWithAttributedString:[NSAttributedString attributedStringWithAttachment:attachImage]]];
|
// [str appendAttributedString:[[NSMutableAttributedString alloc] initWithAttributedString:[NSAttributedString attributedStringWithAttachment:attachImage]]];
|
||||||
self.totalValueLabel.attributedText = str;
|
// self.totalValueLabel.attributedText = str;
|
||||||
}
|
//}
|
||||||
/**
|
/**
|
||||||
将数量格式化为字符串 万之后用xx.xxW显示并保留小数点2位,最多显示9999W+;
|
将数量格式化为字符串 万之后用xx.xxW显示并保留小数点2位,最多显示9999W+;
|
||||||
@param number 数值
|
@param number 数值
|
||||||
@@ -255,7 +260,7 @@
|
|||||||
-(void)setPackOriginArray:(NSArray *)packOriginArray{
|
-(void)setPackOriginArray:(NSArray *)packOriginArray{
|
||||||
_packOriginArray = packOriginArray;
|
_packOriginArray = packOriginArray;
|
||||||
self.packGiftView.packOriginArray = packOriginArray;
|
self.packGiftView.packOriginArray = packOriginArray;
|
||||||
[self createPackTotalValueAttribute];
|
// [self createPackTotalValueAttribute];
|
||||||
}
|
}
|
||||||
-(void)setFreeModel:(XPFreeGiftModel *)freeModel{
|
-(void)setFreeModel:(XPFreeGiftModel *)freeModel{
|
||||||
_freeModel = freeModel;
|
_freeModel = freeModel;
|
||||||
@@ -268,8 +273,12 @@
|
|||||||
-(void)setRoomType:(RoomType)roomType{
|
-(void)setRoomType:(RoomType)roomType{
|
||||||
_roomType = roomType;
|
_roomType = roomType;
|
||||||
if(_roomType == RoomType_Anchor){
|
if(_roomType == RoomType_Anchor){
|
||||||
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),YMLocalizedString(@"XPGiftInfoView3"),YMLocalizedString(@"XPGiftInfoView4"),YMLocalizedString(@"XPGiftInfoView9"),YMLocalizedString(@"XPGiftInfoView8")];
|
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),
|
||||||
|
YMLocalizedString(@"XPGiftInfoView3"),
|
||||||
|
YMLocalizedString(@"XPGiftInfoView4"),
|
||||||
|
YMLocalizedString(@"XPGiftInfoView9"),
|
||||||
|
YMLocalizedString(@"XPGiftInfoView8")];
|
||||||
|
|
||||||
self.titleView.titles = self.pi_titles;
|
self.titleView.titles = self.pi_titles;
|
||||||
|
|
||||||
[self.titleView reloadData];
|
[self.titleView reloadData];
|
||||||
@@ -279,7 +288,9 @@
|
|||||||
_usingplaceType = usingplaceType;
|
_usingplaceType = usingplaceType;
|
||||||
self.packGiftView.usingplaceType = _usingplaceType;
|
self.packGiftView.usingplaceType = _usingplaceType;
|
||||||
if (_usingplaceType == SendGiftType_User) {
|
if (_usingplaceType == SendGiftType_User) {
|
||||||
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),YMLocalizedString(@"XPGiftInfoView4"),YMLocalizedString(@"XPGiftInfoView9")];
|
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),
|
||||||
|
YMLocalizedString(@"XPGiftInfoView4"),
|
||||||
|
YMLocalizedString(@"XPGiftInfoView9")];
|
||||||
self.titleView.titles = self.pi_titles;
|
self.titleView.titles = self.pi_titles;
|
||||||
[self.titleView reloadData];
|
[self.titleView reloadData];
|
||||||
self.titleView.titleColor = [DJDKMIMOMColor secondTextColor];
|
self.titleView.titleColor = [DJDKMIMOMColor secondTextColor];
|
||||||
@@ -347,20 +358,21 @@
|
|||||||
}
|
}
|
||||||
return _pi_containerView;
|
return _pi_containerView;
|
||||||
}
|
}
|
||||||
- (UILabel *)totalValueLabel {
|
//- (UILabel *)totalValueLabel {
|
||||||
if (!_totalValueLabel) {
|
// if (!_totalValueLabel) {
|
||||||
_totalValueLabel = [[UILabel alloc] init];
|
// _totalValueLabel = [[UILabel alloc] init];
|
||||||
_totalValueLabel.hidden = YES;
|
// _totalValueLabel.hidden = YES;
|
||||||
_totalValueLabel.textAlignment = NSTextAlignmentRight;
|
// _totalValueLabel.textAlignment = NSTextAlignmentRight;
|
||||||
}
|
// }
|
||||||
return _totalValueLabel;
|
// return _totalValueLabel;
|
||||||
}
|
//}
|
||||||
- (UIButton *)packGiftButton {
|
- (UIButton *)packGiftButton {
|
||||||
if (!_packGiftButton) {
|
if (!_packGiftButton) {
|
||||||
_packGiftButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
_packGiftButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
[_packGiftButton setTitle:YMLocalizedString(@"XPGiftInfoView5") forState:UIControlStateNormal];
|
// [_packGiftButton setTitle:YMLocalizedString(@"XPGiftInfoView5") forState:UIControlStateNormal];
|
||||||
[_packGiftButton setTitleColor:[DJDKMIMOMColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
|
// [_packGiftButton setTitleColor:[DJDKMIMOMColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
|
||||||
_packGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
|
// _packGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
|
||||||
|
[_packGiftButton setBackgroundImage:[UIImage imageNamed:@"gift_bag_icon"] forState:UIControlStateNormal];
|
||||||
_packGiftButton.tag = GiftSegmentType_Pack;
|
_packGiftButton.tag = GiftSegmentType_Pack;
|
||||||
[_packGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside];
|
[_packGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
|||||||
///分割线
|
///分割线
|
||||||
@property (nonatomic, strong) UIView *bottomDevideView;
|
@property (nonatomic, strong) UIView *bottomDevideView;
|
||||||
///箭头
|
///箭头
|
||||||
@property (nonatomic, strong) UIImageView *arrowImageView;
|
//@property (nonatomic, strong) UIImageView *arrowImageView;
|
||||||
|
|
||||||
|
|
||||||
///轮播图
|
///轮播图
|
||||||
@@ -53,7 +53,7 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
|||||||
// [self addSubview:self.devideView];
|
// [self addSubview:self.devideView];
|
||||||
// [self addSubview:self.interactButton];
|
// [self addSubview:self.interactButton];
|
||||||
|
|
||||||
[self addSubview:self.arrowImageView];
|
// [self addSubview:self.arrowImageView];
|
||||||
[self addSubview:self.pi_BannerView];
|
[self addSubview:self.pi_BannerView];
|
||||||
[self addSubview:self.bottomDevideView];
|
[self addSubview:self.bottomDevideView];
|
||||||
|
|
||||||
@@ -69,11 +69,11 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
|||||||
make.centerY.mas_equalTo(self);
|
make.centerY.mas_equalTo(self);
|
||||||
make.width.mas_equalTo(40);
|
make.width.mas_equalTo(40);
|
||||||
}];
|
}];
|
||||||
[self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
// [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
// make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
||||||
make.centerX.mas_equalTo(self.giftButton);
|
// make.centerX.mas_equalTo(self.giftButton);
|
||||||
make.size.mas_equalTo(CGSizeMake(9, 7));
|
// make.size.mas_equalTo(CGSizeMake(9, 7));
|
||||||
}];
|
// }];
|
||||||
// [self.interactButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
// [self.interactButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
// make.centerY.mas_equalTo(self);
|
// make.centerY.mas_equalTo(self);
|
||||||
// make.leading.mas_equalTo(self.devideView.mas_trailing).mas_offset(8);
|
// make.leading.mas_equalTo(self.devideView.mas_trailing).mas_offset(8);
|
||||||
@@ -129,11 +129,11 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
|||||||
sender.selected = YES;
|
sender.selected = YES;
|
||||||
|
|
||||||
sender.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
sender.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||||
[self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
// [self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
// make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
||||||
make.centerX.mas_equalTo(self.giftButton);
|
// make.centerX.mas_equalTo(self.giftButton);
|
||||||
make.size.mas_equalTo(CGSizeMake(9, 7));
|
// make.size.mas_equalTo(CGSizeMake(9, 7));
|
||||||
}];
|
// }];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)interactButtonAction:(UIButton *)sender {
|
- (void)interactButtonAction:(UIButton *)sender {
|
||||||
@@ -149,11 +149,11 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
|||||||
sender.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
sender.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||||
self.giftButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
self.giftButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||||
|
|
||||||
[self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
// [self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
// make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
||||||
make.centerX.mas_equalTo(self.giftButton);
|
// make.centerX.mas_equalTo(self.giftButton);
|
||||||
make.size.mas_equalTo(CGSizeMake(9, 7));
|
// make.size.mas_equalTo(CGSizeMake(9, 7));
|
||||||
}];
|
// }];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - setter
|
#pragma mark - setter
|
||||||
@@ -220,14 +220,14 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
|||||||
return _titleArray;
|
return _titleArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIImageView *)arrowImageView {
|
//- (UIImageView *)arrowImageView {
|
||||||
if (!_arrowImageView) {
|
// if (!_arrowImageView) {
|
||||||
UIImageView *imageView = [[UIImageView alloc] init];
|
// UIImageView *imageView = [[UIImageView alloc] init];
|
||||||
imageView.image = [UIImage imageNamed:@"room_gift_panel_arrow"];
|
// imageView.image = [UIImage imageNamed:@"room_gift_panel_arrow"];
|
||||||
|
//
|
||||||
_arrowImageView = imageView;
|
// _arrowImageView = imageView;
|
||||||
}
|
// }
|
||||||
return _arrowImageView;
|
// return _arrowImageView;
|
||||||
}
|
//}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Reference in New Issue
Block a user