diff --git a/xplan-ios/Assets.xcassets/Room/AcrossRoomPK/acrossPK_countDown_left_bg.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/AcrossRoomPK/acrossPK_countDown_left_bg.imageset/Contents.json new file mode 100644 index 00000000..2aeee433 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/AcrossRoomPK/acrossPK_countDown_left_bg.imageset/Contents.json @@ -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 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/AcrossRoomPK/acrossPK_countDown_left_bg.imageset/acrossPK_countDown_left_bg@2x.png b/xplan-ios/Assets.xcassets/Room/AcrossRoomPK/acrossPK_countDown_left_bg.imageset/acrossPK_countDown_left_bg@2x.png new file mode 100644 index 00000000..641eae4b Binary files /dev/null and b/xplan-ios/Assets.xcassets/Room/AcrossRoomPK/acrossPK_countDown_left_bg.imageset/acrossPK_countDown_left_bg@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Room/AcrossRoomPK/acrossPK_countDown_left_bg.imageset/acrossPK_countDown_left_bg@3x.png b/xplan-ios/Assets.xcassets/Room/AcrossRoomPK/acrossPK_countDown_left_bg.imageset/acrossPK_countDown_left_bg@3x.png new file mode 100644 index 00000000..732641ed Binary files /dev/null and b/xplan-ios/Assets.xcassets/Room/AcrossRoomPK/acrossPK_countDown_left_bg.imageset/acrossPK_countDown_left_bg@3x.png differ diff --git a/xplan-ios/Main/Room/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKCountDownView.h b/xplan-ios/Main/Room/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKCountDownView.h index 05c0ed46..9a06cb00 100644 --- a/xplan-ios/Main/Room/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKCountDownView.h +++ b/xplan-ios/Main/Room/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKCountDownView.h @@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN @interface XPAcrossRoomPKCountDownView : UIView @property (nonatomic, assign) long long startTime; +///背景 +@property (nonatomic, strong) UIImageView *backImageView; @end diff --git a/xplan-ios/Main/Room/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKCountDownView.m b/xplan-ios/Main/Room/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKCountDownView.m index 9210faca..4bbbaefd 100644 --- a/xplan-ios/Main/Room/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKCountDownView.m +++ b/xplan-ios/Main/Room/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKCountDownView.m @@ -14,8 +14,6 @@ @interface XPAcrossRoomPKCountDownView() -///背景 -@property (nonatomic, strong) UIImageView *backImageView; ///标题 @property (nonatomic, strong) UILabel *titleLabel; ///显示倒计时 diff --git a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m index c24e87bb..caa6e084 100644 --- a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -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; }