修复PK预约和心愿礼物入口重叠问题

This commit is contained in:
chenguilong
2022-11-14 14:03:36 +08:00
parent 53f415a28c
commit 91722f4de2
6 changed files with 56 additions and 30 deletions

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "acrossPK_countDown_left_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "acrossPK_countDown_left_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPAcrossRoomPKCountDownView : UIView
@property (nonatomic, assign) long long startTime;
///背景
@property (nonatomic, strong) UIImageView *backImageView;
@end

View File

@@ -14,8 +14,6 @@
@interface XPAcrossRoomPKCountDownView()
///
@property (nonatomic, strong) UIImageView *backImageView;
///
@property (nonatomic, strong) UILabel *titleLabel;
///

View File

@@ -585,20 +585,7 @@
} roomUid:roomUid];
}
if (roomInfo.showPkBeginTime && roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode) {//PK
if (!self.acrossPKCountView.superview) {
[self addSubview:self.acrossPKCountView];
self.acrossPKCountView.startTime = roomInfo.pkBeginTime;
[self.acrossPKCountView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(0);
make.top.mas_equalTo(self.contributeEnterView.mas_bottom).mas_offset(4);
make.size.mas_equalTo(CGSizeMake(52, 52));
}];
[UIView animateWithDuration:0.5 animations:^{
CGRect frame = self.acrossPKCountView.frame;
frame.origin.x = KScreenWidth-frame.size.width;
self.acrossPKCountView.frame = frame;
}];
}
[self handleAcrollPKCountView];
}
[self updateRoomTopic];
[self showLittleGameMiniView:roomInfo.type micCount:roomInfo.mgMicNum];
@@ -1657,19 +1644,36 @@
if ([self.delegate getRoomInfo].roomModeType == RoomModeType_Open_AcrossRoomPK_mode) {
return;
}
[self addSubview:self.acrossPKCountView];
self.acrossPKCountView.startTime = time;
[self.acrossPKCountView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.height.mas_equalTo(52);
make.width.mas_equalTo(52);
make.top.mas_equalTo(self.contributeEnterView.mas_bottom).mas_offset(4);
}];
[UIView animateWithDuration:0.5 animations:^{
CGRect frame = self.acrossPKCountView.frame;
frame.origin.x = 0;
self.acrossPKCountView.frame = frame;
}];
[self handleAcrollPKCountView];
}
- (void)handleAcrollPKCountView {
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
if (roomInfo.hasOpenWishGift) {
if (!self.acrossPKCountView.superview) {
[self addSubview:self.acrossPKCountView];
[self bringSubviewToFront:self.acrossPKCountView];
self.acrossPKCountView.startTime = roomInfo.pkBeginTime;
self.acrossPKCountView.backImageView.image = [UIImage imageNamed:@"acrossPK_countDown_left_bg"];
[self.acrossPKCountView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kNavigationHeight+4+24+4);
make.left.mas_equalTo(0);
make.width.height.mas_equalTo(52);
}];
}
} else {
if (!self.acrossPKCountView.superview) {
[self addSubview:self.acrossPKCountView];
[self bringSubviewToFront:self.acrossPKCountView];
self.acrossPKCountView.startTime = roomInfo.pkBeginTime;
self.acrossPKCountView.backImageView.image = [UIImage imageNamed:@"acrossPK_countDown_bg"];
[self.acrossPKCountView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kNavigationHeight+4+24+4);
make.left.mas_equalTo(KScreenWidth-52);
make.width.height.mas_equalTo(52);
}];
}
}
}
#pragma mark -
@@ -1930,7 +1934,7 @@
- (XPAcrossRoomPKCountDownView *)acrossPKCountView {
if (!_acrossPKCountView) {
_acrossPKCountView = [[XPAcrossRoomPKCountDownView alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight+4+22+4, 52, 52)];
_acrossPKCountView = [[XPAcrossRoomPKCountDownView alloc] initWithFrame:CGRectMake(-52, kNavigationHeight+4+24+4, 52, 52)];
}
return _acrossPKCountView;
}