diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index ef78f21d..f78acfc2 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -113,8 +113,6 @@ 9B0086C627BA392B0032BD2B /* AnchorStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C527BA392B0032BD2B /* AnchorStageView.m */; }; 9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C927BA4F570032BD2B /* AnchorMicroView.m */; }; 9B060B5827BCAEE20001B767 /* AnchorGiftValueView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B060B5727BCAEE20001B767 /* AnchorGiftValueView.m */; }; - 9B0C6BAD27D0C9B600D64296 /* anchor_room_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9B0C6BAB27D0C9B600D64296 /* anchor_room_bg.svga */; }; - 9B0C6BAE27D0C9B600D64296 /* anchor_room_speak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9B0C6BAC27D0C9B600D64296 /* anchor_room_speak.svga */; }; 9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0E1C5826E77022005D4442 /* BaseNavigationController.m */; }; 9B17F71827BD150600440843 /* SVGAParserManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B17F71727BD150600440843 /* SVGAParserManager.m */; }; 9B7B605B27BB53060070BB72 /* XPAnchorAudienceUpMicView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B605A27BB53060070BB72 /* XPAnchorAudienceUpMicView.m */; }; @@ -126,6 +124,8 @@ 9B7D80562753C595003DAC0C /* SendMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D80552753C595003DAC0C /* SendMessageView.m */; }; 9BAA5FED277A1BBE007453F3 /* XPPrivacyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEC277A1BBE007453F3 /* XPPrivacyViewController.m */; }; 9BAA5FF0277A23F4007453F3 /* XPPermissionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEF277A23F4007453F3 /* XPPermissionsViewController.m */; }; + 9BE29A6A27D1BFF700446AB5 /* anchor_room_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6827D1BFF700446AB5 /* anchor_room_bg.svga */; }; + 9BE29A6B27D1BFF700446AB5 /* anchor_room_speak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */; }; E80487652717DDD9008595F2 /* XPRoomMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = E80487642717DDD9008595F2 /* XPRoomMenuItem.m */; }; E80DE4072775665000BE5BCB /* XPFirstRechargeCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E80DE4062775665000BE5BCB /* XPFirstRechargeCollectionViewCell.m */; }; E80DE40A277568D300BE5BCB /* ThemeColor+FirstRecharge.m in Sources */ = {isa = PBXBuildFile; fileRef = E80DE409277568D300BE5BCB /* ThemeColor+FirstRecharge.m */; }; @@ -644,8 +644,6 @@ 9B0086C927BA4F570032BD2B /* AnchorMicroView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorMicroView.m; sourceTree = ""; }; 9B060B5627BCAEE20001B767 /* AnchorGiftValueView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorGiftValueView.h; sourceTree = ""; }; 9B060B5727BCAEE20001B767 /* AnchorGiftValueView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorGiftValueView.m; sourceTree = ""; }; - 9B0C6BAB27D0C9B600D64296 /* anchor_room_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_bg.svga; sourceTree = ""; }; - 9B0C6BAC27D0C9B600D64296 /* anchor_room_speak.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_speak.svga; sourceTree = ""; }; 9B0E1C5726E77022005D4442 /* BaseNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseNavigationController.h; sourceTree = ""; }; 9B0E1C5826E77022005D4442 /* BaseNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseNavigationController.m; sourceTree = ""; }; 9B17F71627BD150600440843 /* SVGAParserManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAParserManager.h; sourceTree = ""; }; @@ -669,6 +667,8 @@ 9BAA5FEE277A23F4007453F3 /* XPPermissionsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPermissionsViewController.h; sourceTree = ""; }; 9BAA5FEF277A23F4007453F3 /* XPPermissionsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPermissionsViewController.m; sourceTree = ""; }; 9BB865B4272076140029CDE0 /* RtcImplDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtcImplDelegate.h; sourceTree = ""; }; + 9BE29A6827D1BFF700446AB5 /* anchor_room_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_bg.svga; sourceTree = ""; }; + 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_speak.svga; sourceTree = ""; }; B66633E061B1B34177CD011C /* Pods-xplan-ios.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-xplan-ios.release.xcconfig"; path = "Target Support Files/Pods-xplan-ios/Pods-xplan-ios.release.xcconfig"; sourceTree = ""; }; CACF623970097D653132D69A /* Pods_xplan_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_xplan_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E80487632717DDD9008595F2 /* XPRoomMenuItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMenuItem.h; sourceTree = ""; }; @@ -3012,8 +3012,8 @@ E8A1E45D276220DA00B294CA /* candyTree_banner.svga */, E8A1E45F276220DA00B294CA /* candyTree_light.svga */, E8A1E45E276220DA00B294CA /* candyTree.svga */, - 9B0C6BAB27D0C9B600D64296 /* anchor_room_bg.svga */, - 9B0C6BAC27D0C9B600D64296 /* anchor_room_speak.svga */, + 9BE29A6827D1BFF700446AB5 /* anchor_room_bg.svga */, + 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */, ); path = Sources; sourceTree = ""; @@ -3655,12 +3655,12 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9B0C6BAD27D0C9B600D64296 /* anchor_room_bg.svga in Resources */, + 9BE29A6A27D1BFF700446AB5 /* anchor_room_bg.svga in Resources */, E8937AC7276C3EDE00B2C7E1 /* svga_member_in_lv40.svga in Resources */, E8A1E461276220DA00B294CA /* candyTree.svga in Resources */, E8937AC9276C3EDE00B2C7E1 /* svga_member_in_lv90.svga in Resources */, E8937ACC276C3EDE00B2C7E1 /* svga_member_in_lv80.svga in Resources */, - 9B0C6BAE27D0C9B600D64296 /* anchor_room_speak.svga in Resources */, + 9BE29A6B27D1BFF700446AB5 /* anchor_room_speak.svga in Resources */, E8937AC8276C3EDE00B2C7E1 /* svga_member_in_lv70.svga in Resources */, E8DEC98B27637EA50078CB70 /* candyTree_open.svga in Resources */, E8A1E460276220DA00B294CA /* candyTree_banner.svga in Resources */, diff --git a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomBackContainerView.m b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomBackContainerView.m index 3e52a956..5a3b69a5 100644 --- a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomBackContainerView.m +++ b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomBackContainerView.m @@ -73,10 +73,24 @@ //@"https://img.erbanyy.com/Noble_OpenEffect_5.svga" [self.parserManager loadSvgaWithURL:[NSURL URLWithString:roomInfo.backPic] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) { @strongify(self); - self.svgDisplayView.loops = INT_MAX; - self.svgDisplayView.clearsAfterStop = NO; - self.svgDisplayView.videoItem = videoItem; - [self.svgDisplayView startAnimation]; + if (videoItem != nil) { + CGFloat width = videoItem.videoSize.width; + CGFloat height = videoItem.videoSize.height; + if (width > height) { + self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFit; + } else {//高大于宽 + CGFloat resizeH = KScreenWidth * height / width;//按照屏幕的宽度去缩放,获得高度 + if (resizeH > KScreenHeight) {//如果大于屏幕高度,填充 + self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFill; + } else {//小于屏幕高度, + self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFit; + } + } + self.svgDisplayView.loops = INT_MAX; + self.svgDisplayView.clearsAfterStop = NO; + self.svgDisplayView.videoItem = videoItem; + [self.svgDisplayView startAnimation]; + } } failureBlock:^(NSError * _Nullable error) { [XCHUDTool showErrorWithMessage:@"贵族专属背景图加载失败"]; }]; @@ -95,10 +109,24 @@ NSURL *bgUrl = [NSURL fileURLWithPath:bgString]; [self.parserManager loadSvgaWithURL:bgUrl completionBlock:^(SVGAVideoEntity * _Nullable videoItem) { @strongify(self); - self.svgDisplayView.loops = INT_MAX; - self.svgDisplayView.clearsAfterStop = NO; - self.svgDisplayView.videoItem = videoItem; - [self.svgDisplayView startAnimation]; + if (videoItem != nil) { + CGFloat width = videoItem.videoSize.width; + CGFloat height = videoItem.videoSize.height; + if (width > height) { + self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFit; + } else {//高大于宽 + CGFloat resizeH = KScreenWidth * height / width;//按照屏幕的宽度去缩放,获得高度 + if (resizeH > KScreenHeight) {//如果大于屏幕高度,填充 + self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFill; + } else {//小于屏幕高度, + self.svgDisplayView.contentMode = UIViewContentModeScaleAspectFit; + } + } + self.svgDisplayView.loops = INT_MAX; + self.svgDisplayView.clearsAfterStop = NO; + self.svgDisplayView.videoItem = videoItem; + [self.svgDisplayView startAnimation]; + } } failureBlock:^(NSError * _Nullable error) { [XCHUDTool showErrorWithMessage:@"个播背景图加载失败"]; }]; diff --git a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m index b5b90d67..057bbee7 100644 --- a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -114,6 +114,9 @@ if (roomInfo.type == RoomType_Anchor) { [self.contributionButton setTitle:@"主播榜" forState:UIControlStateNormal]; self.anchorGiftValueView.hidden = !roomInfo.showGiftValue; + if (!roomInfo.showGiftValue) { + self.anchorGiftValueView.giftValue = 0; + } } else { [self.contributionButton setTitle:@"房间榜" forState:UIControlStateNormal]; self.anchorGiftValueView.hidden = YES; diff --git a/xplan-ios/Main/Room/View/StageView/AnchorStageView.m b/xplan-ios/Main/Room/View/StageView/AnchorStageView.m index 9ffb4060..5a42a3b0 100644 --- a/xplan-ios/Main/Room/View/StageView/AnchorStageView.m +++ b/xplan-ios/Main/Room/View/StageView/AnchorStageView.m @@ -26,16 +26,16 @@ #import "XPRoomInviteUserViewController.h" // 房主头像宽 150 + 光圈 5 -#define ownerWidth (150 + 5) -// 昵称高12,距离头像间距 6 -#define ownerHeight (ownerWidth + 6 + 12) +#define ownerWidth (120 + 5) +// 昵称高21,距离头像间距 6 +#define ownerHeight (ownerWidth + 6 + 20) ///房主头像距上边距离 -#define topMargin 60 +#define topMargin 40 // 底部 3 个坑位宽40 + 光圈 5 #define mcWidth (40 + 5) #define mcHeight (mcWidth + 6 + 12) // 底部3 个坑位顶部距房主坑位距离 padding 30 -#define paddingH 30 +#define paddingH 28 // 下边坑位的左右间距 #define marginW 50 @@ -65,14 +65,14 @@ return CGRectMake((KScreenWidth - ownerWidth) * 0.5, topMargin, ownerWidth, ownerHeight); } if (index >= 1 && index <= 3) { - return CGRectMake((KScreenWidth - mcWidth) * 0.5 - (marginW+mcWidth*1.5) + (marginW+mcWidth*1.5) * (index-1), topMargin+ownerHeight + paddingH, mcWidth, mcHeight); + return CGRectMake((KScreenWidth - mcWidth) * 0.5 - marginW - mcWidth + (marginW+mcWidth) * (index-1), topMargin+ownerHeight + paddingH, mcWidth, mcHeight); } return [super rectForViewAtIndex:index]; } - (CGFloat)hightForStageView { - return 360; + return 286; } - (CGPoint)animationPointAtStageViewByUid:(NSString *)uid { diff --git a/xplan-ios/Main/Room/View/StageView/MicroView/Anchor/AnchorMicroView.m b/xplan-ios/Main/Room/View/StageView/MicroView/Anchor/AnchorMicroView.m index 52a60655..1d832b80 100644 --- a/xplan-ios/Main/Room/View/StageView/MicroView/Anchor/AnchorMicroView.m +++ b/xplan-ios/Main/Room/View/StageView/MicroView/Anchor/AnchorMicroView.m @@ -35,7 +35,7 @@ - (void)initSubViewConstraints { [super initSubViewConstraints]; [self.svgDisplayView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(225); + make.width.height.mas_equalTo(180); make.center.equalTo(self.avatarImageView); }]; } @@ -55,10 +55,12 @@ int position = model.microState.position; self.position = position; if (position != -1 && userInfo == nil) { - self.nickLabel.text = @"号嘉宾"; + self.nickLabel.text = @""; } + self.postionLabel.hidden = YES; ///更新离开模式蒙层 if (position == -1) { + self.nickLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold]; if (userInfo) { if ([self.subviews containsObject:self.leaveLabel]) { [self.leaveLabel removeFromSuperview]; @@ -76,9 +78,14 @@ self.micStateImageView.image = [UIImage imageNamed:@"room_position_mute_Anchor"]; [self.micStateImageView mas_remakeConstraints:^(MASConstraintMaker *make) { make.bottom.mas_equalTo(self.avatarImageView).mas_offset(-2); - make.right.mas_equalTo(self.avatarImageView).mas_offset(-(150 / 4) +11); + make.right.mas_equalTo(self.avatarImageView).mas_offset(-(120 / 4) +11); make.width.height.mas_equalTo(22); }]; + [self.nickLabel mas_updateConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.avatarImageView.mas_bottom).mas_offset(12); + make.height.mas_equalTo(20); + make.width.mas_equalTo(self.avatarImageView); + }]; ///主播添加光圈动画 self.svgDisplayView.hidden = NO; @weakify(self); @@ -94,6 +101,11 @@ }]; } else { self.svgDisplayView.hidden = YES; + + [self.nickLabel mas_updateConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.avatarImageView.mas_bottom).mas_offset(4); + make.height.mas_equalTo(14); + }]; } } diff --git a/xplan-ios/Sources/anchor_room_bg.svga b/xplan-ios/Sources/anchor_room_bg.svga index d95ee4f1..8e7a96a6 100644 Binary files a/xplan-ios/Sources/anchor_room_bg.svga and b/xplan-ios/Sources/anchor_room_bg.svga differ diff --git a/xplan-ios/Sources/anchor_room_speak.svga b/xplan-ios/Sources/anchor_room_speak.svga index f3c8caaa..5c495ea6 100644 Binary files a/xplan-ios/Sources/anchor_room_speak.svga and b/xplan-ios/Sources/anchor_room_speak.svga differ