房间头部,排行傍修改

This commit is contained in:
chenshuanglin
2023-03-15 17:51:28 +08:00
parent e0c6d71105
commit 50f6c93b28
20 changed files with 588 additions and 56 deletions

View File

@@ -13,6 +13,8 @@
146567E229B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 146567E129B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m */; };
146567E529B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 146567E429B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m */; };
14973CA729C16816008E93E0 /* XPHomeGiftRecordModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 14973CA629C16816008E93E0 /* XPHomeGiftRecordModel.m */; };
14973CAA29C1B41F008E93E0 /* XPRoomTopRankView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14973CA929C1B41F008E93E0 /* XPRoomTopRankView.m */; };
14973CAE29C1BD9E008E93E0 /* XPRoomRankListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 14973CAD29C1BD9E008E93E0 /* XPRoomRankListModel.m */; };
14A0CF3B29C014B400B2375A /* moment_living.svga in Resources */ = {isa = PBXBuildFile; fileRef = 14A0CF3A29C014B400B2375A /* moment_living.svga */; };
14A0CF3E29C01E8500B2375A /* XPMineNewRechargeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14A0CF3D29C01E8500B2375A /* XPMineNewRechargeViewController.m */; };
14A0CF4129C01F0400B2375A /* XPMineRechargeCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14A0CF4029C01F0400B2375A /* XPMineRechargeCollectionViewCell.m */; };
@@ -1296,6 +1298,10 @@
146567E429B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFindNewFriendTableViewCell.m; sourceTree = "<group>"; };
14973CA529C16816008E93E0 /* XPHomeGiftRecordModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeGiftRecordModel.h; sourceTree = "<group>"; };
14973CA629C16816008E93E0 /* XPHomeGiftRecordModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeGiftRecordModel.m; sourceTree = "<group>"; };
14973CA829C1B41F008E93E0 /* XPRoomTopRankView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopRankView.h; sourceTree = "<group>"; };
14973CA929C1B41F008E93E0 /* XPRoomTopRankView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTopRankView.m; sourceTree = "<group>"; };
14973CAC29C1BD9E008E93E0 /* XPRoomRankListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomRankListModel.h; sourceTree = "<group>"; };
14973CAD29C1BD9E008E93E0 /* XPRoomRankListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomRankListModel.m; sourceTree = "<group>"; };
14A0CF3A29C014B400B2375A /* moment_living.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = moment_living.svga; sourceTree = "<group>"; };
14A0CF3C29C01E8500B2375A /* XPMineNewRechargeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineNewRechargeViewController.h; sourceTree = "<group>"; };
14A0CF3D29C01E8500B2375A /* XPMineNewRechargeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineNewRechargeViewController.m; sourceTree = "<group>"; };
@@ -3686,6 +3692,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
14973CAB29C1BD55008E93E0 /* Model */ = {
isa = PBXGroup;
children = (
14973CAC29C1BD9E008E93E0 /* XPRoomRankListModel.h */,
14973CAD29C1BD9E008E93E0 /* XPRoomRankListModel.m */,
);
path = Model;
sourceTree = "<group>";
};
14A0CF5429C0679D00B2375A /* Model */ = {
isa = PBXGroup;
children = (
@@ -7909,6 +7924,7 @@
E8AEAEE727141ACC0017FCE0 /* BaseUIContainerView */ = {
isa = PBXGroup;
children = (
14973CAB29C1BD55008E93E0 /* Model */,
E8AEAEEB27141AE20017FCE0 /* XPRoomBackContainerView.h */,
E8AEAEEC27141AE20017FCE0 /* XPRoomBackContainerView.m */,
E83953202769F33B00CF2F24 /* XPRoomFunctionContainerView.h */,
@@ -7921,6 +7937,8 @@
9B86D88228192DC000494FCD /* XPRoomRankEntranceView.m */,
9B044D9B282D2A6400DE4859 /* XPRoomAnchorRankEnterView.h */,
9B044D9C282D2A6400DE4859 /* XPRoomAnchorRankEnterView.m */,
14973CA829C1B41F008E93E0 /* XPRoomTopRankView.h */,
14973CA929C1B41F008E93E0 /* XPRoomTopRankView.m */,
);
path = BaseUIContainerView;
sourceTree = "<group>";
@@ -10319,6 +10337,7 @@
E89DA67527009ACD008483C1 /* XPMineRechargeNavView.m in Sources */,
E81A6546283519CA00F55894 /* MonentsTopicModel.m in Sources */,
E8C1672A2806B1E500ECB15C /* XPGuildSuperAdminSetTableViewCell.m in Sources */,
14973CAE29C1BD9E008E93E0 /* XPRoomRankListModel.m in Sources */,
E8834E4528003A8F0029CCC1 /* XPMineMangerListViewController.m in Sources */,
E86E79D028A4E0B2006DAF48 /* ContentRistAlertModel.m in Sources */,
9BFE0D922899042600F53C24 /* XPTaskCompleteTipView.m in Sources */,
@@ -10475,6 +10494,7 @@
9BAD41AC28C6EB13005E47B3 /* XPInRoomRecordPresenter.m in Sources */,
E8AC721626F46B06007D6E91 /* XPMineSettingTableViewCell.m in Sources */,
18EE3FDF2750C1F700A452BF /* SessionListCell.m in Sources */,
14973CAA29C1B41F008E93E0 /* XPRoomTopRankView.m in Sources */,
9BD798B72926362F003E03E6 /* XPSessionListHeadItem.m in Sources */,
9BB549622782EA1D0090CD26 /* NobleInfo.m in Sources */,
E80487652717DDD9008595F2 /* XPRoomMenuItem.m in Sources */,

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 939 B

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 305 B

View File

@@ -0,0 +1,29 @@
//
// XPRoomRankListModel.h
// xplan-ios
//
// Created by XY on 2023/3/15.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPRoomRankListModel : NSObject
@property (nonatomic, copy) NSString *avatar;
@property (nonatomic, assign) NSInteger charmSeq;
@property (nonatomic, copy) NSString *charmUrl;
@property (nonatomic, assign) NSInteger erbanNo;
@property (nonatomic, assign) NSInteger experSeq;
@property (nonatomic, copy) NSString *experUrl;
@property (nonatomic, assign) NSInteger gender;
@property (nonatomic, assign) NSInteger goldAmount;
@property (nonatomic, assign) BOOL hide;
@property (nonatomic, copy) NSString *nick;
@property (nonatomic, assign) NSInteger ranking;
@property (nonatomic, assign) NSInteger uid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// XPRoomRankListModel.m
// xplan-ios
//
// Created by XY on 2023/3/15.
//
#import "XPRoomRankListModel.h"
@implementation XPRoomRankListModel
@end

View File

@@ -54,6 +54,7 @@
#import "RoomNewUserGreetModel.h"
#import "WishGiftInfoModel.h"
#import "WishGiftInfoUpdateModel.h"
#import "XPRoomRankListModel.h"
///View
#import "XPRoomHalfWebView.h"
#import "XPAnchorAudienceUpMicView.h"
@@ -85,6 +86,8 @@
#import "XPNewUserRoomGiftView.h"
#import "XPWishGiftViewController.h"
#import "XPWishGiftEnterView.h"
#import "XPRoomTopRankView.h"
#import "XPNobleCenterViewController.h"
///PK
#import "XPAnchorFansTeamEntranceView.h"
#import "XPAnchorFansTeamViewController.h"
@@ -99,6 +102,10 @@
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
///
@property (nonatomic,strong) XPRoomRankEntranceView *contributeEnterView;
///
@property (nonatomic, strong) XPRoomTopRankView *topRankView;
///
@property (nonatomic,strong) UIButton *nobleButton;
///
@property (nonatomic,strong) UIButton *datingProgresButton;
///
@@ -246,13 +253,28 @@
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.topRankView];
[self addSubview:self.contributeEnterView];
[self addSubview:self.topicStackView];
[self addSubview:self.nobleButton];
[self.topicStackView addArrangedSubview:self.topicLabel];
[self.topicStackView addArrangedSubview:self.editButton];
}
- (void)initSubViewConstraints {
[self.topRankView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-46);
make.top.mas_equalTo(kStatusBarHeight+3);
make.width.mas_equalTo(29*3);
make.height.mas_equalTo(37);
}];
[self.nobleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(30, 30));
make.right.mas_equalTo(self.topRankView.mas_left).offset(-3);
make.top.mas_equalTo(kStatusBarHeight+7);
}];
[self.contributeEnterView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(12);
make.top.mas_equalTo(kNavigationHeight+4);
@@ -291,13 +313,13 @@
- (void)configLittleGameState {
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
if (roomInfo.isPermitRoom != PermitRoomType_Licnese && roomInfo.roomModeType != RoomModeType_Open_Blind && roomInfo.roomModeType != RoomModeType_Open_PK_Mode && roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode && roomInfo.roomModeType != RoomModeType_Open_Micro_Mode && !roomInfo.leaveMode && roomInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
if (!self.gameListView.superview) {
[self addSubview:self.gameListView];
[self.gameListView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self).offset(-85);
make.top.mas_equalTo(self).offset(kNavigationHeight - 14 - 11 - 19.0 / 2.0);
}];
}
// if (!self.gameListView.superview) {
// [self addSubview:self.gameListView];
// [self.gameListView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.right.mas_equalTo(self).offset(-85);
// make.top.mas_equalTo(self).offset(kNavigationHeight - 14 - 11 - 19.0 / 2.0);
// }];
// }
self.gameListView.mgId = roomInfo.mgId > 0 ? [NSString stringWithFormat:@"%lld", roomInfo.mgId] : @"0";
} else {
if (self.gameListView.superview) {
@@ -1127,6 +1149,15 @@
}
#pragma mark - Event Response
///
- (void)nobleButtonAction {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceRoomClick];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_noble_click];
XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid];
[self.delegate.getCurrentNav pushViewController:nobleVC animated:YES];
}
- (void)contributionButtonAction:(UITapGestureRecognizer *)tap {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
@@ -1527,13 +1558,19 @@
[Api requestRoomRankings:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {//
if (code == 200) {
NSMutableArray *array = [NSMutableArray array];
for (NSDictionary *dict in data.data[@"rankings"]) {
NSArray *rankings = data.data[@"rankings"];
for (NSDictionary *dict in rankings) {
NSString *str = dict[@"avatar"];
if (str) {
[array addObject:str];
}
}
self.contributeEnterView.array = array;
///
NSArray *rankArray = [XPRoomRankListModel modelsWithArray:rankings];
self.topRankView.rankList = rankArray;
}
} roomUid:roomUid type:type page:@"1" pageSize:@"20"];
}
@@ -1822,6 +1859,24 @@
return _contributeEnterView;
}
- (XPRoomTopRankView *)topRankView {
if (!_topRankView) {
_topRankView = [[XPRoomTopRankView alloc] init];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(contributionButtonAction:)];
[_topRankView addGestureRecognizer:tap];
}
return _topRankView;
}
- (UIButton *)nobleButton {
if (!_nobleButton) {
_nobleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_nobleButton setImage:[UIImage imageNamed:@"room_menu_noble"] forState:UIControlStateNormal];
[_nobleButton addTarget:self action:@selector(nobleButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
return _nobleButton;
}
- (XPRoomAnchorRankEnterView *)hourRankEntranceView {
if (!_hourRankEntranceView) {
_hourRankEntranceView = [[XPRoomAnchorRankEnterView alloc] init];

View File

@@ -0,0 +1,18 @@
//
// XPRoomTopRankView.h
// xplan-ios
//
// Created by XY on 2023/3/15.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPRoomTopRankView : UIView
@property (nonatomic, strong) NSArray *rankList;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,270 @@
//
// XPRoomTopRankView.m
// xplan-ios
//
// Created by XY on 2023/3/15.
//
#import "XPRoomTopRankView.h"
///Third
#import <Masonry/Masonry.h>
#import "ThemeColor.h"
#import "NSArray+Safe.h"
///Tool
#import "NetImageView.h"
///Model
#import "XPRoomRankListModel.h"
@interface XPRoomTopRankView ()
///
@property (nonatomic, strong) UIView *bgView;
///
@property (nonatomic, strong) UIImageView *headwear1;
@property (nonatomic, strong) UIImageView *headwear2;
@property (nonatomic, strong) UIImageView *headwear3;
///
@property (nonatomic, strong) NetImageView *avatar1;
@property (nonatomic, strong) NetImageView *avatar2;
@property (nonatomic, strong) NetImageView *avatar3;
///
@property (nonatomic, strong) UILabel *value1;
@property (nonatomic, strong) UILabel *value2;
@property (nonatomic, strong) UILabel *value3;
@end
@implementation XPRoomTopRankView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.bgView];
[self.bgView addSubview:self.headwear1];
[self.bgView addSubview:self.headwear2];
[self.bgView addSubview:self.headwear3];
[self.headwear1 addSubview:self.avatar1];
[self.headwear1 addSubview:self.value1];
[self.headwear2 addSubview:self.avatar2];
[self.headwear2 addSubview:self.value2];
[self.headwear3 addSubview:self.avatar3];
[self.headwear3 addSubview:self.value3];
}
- (void)initSubViewConstraints {
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.right.left.mas_equalTo(0);
}];
[self.headwear1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(0);
make.left.mas_equalTo(0);
make.size.mas_equalTo(CGSizeMake(29, 33));
}];
[self.avatar1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(22, 22));
make.centerX.mas_equalTo(2.5);
make.centerY.mas_equalTo(4.5);
}];
[self.value1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.headwear1.mas_bottom);
make.centerX.mas_equalTo(3);
make.size.mas_equalTo(CGSizeMake(22, 8));
}];
[self.headwear2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.headwear1);
make.left.mas_equalTo(self.headwear1.mas_right);
make.size.mas_equalTo(self.headwear1);
}];
[self.avatar2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(self.avatar1);
make.centerX.mas_equalTo(2.5);
make.centerY.mas_equalTo(4.5);
}];
[self.value2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.headwear2.mas_bottom);
make.centerX.mas_equalTo(3);
make.size.mas_equalTo(self.value1);
}];
[self.headwear3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.headwear1);
make.left.mas_equalTo(self.headwear2.mas_right);
make.size.mas_equalTo(self.headwear1);
}];
[self.avatar3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(self.avatar1);
make.centerX.mas_equalTo(2.5);
make.centerY.mas_equalTo(4.5);
}];
[self.value3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.headwear2.mas_bottom);
make.centerX.mas_equalTo(3);
make.size.mas_equalTo(self.value1);
}];
}
///
- (NSString *)getAmountText:(NSInteger)amount {
if (amount >= 10000) {
return [NSString stringWithFormat:@"%.1fw",amount/10000.0];
}
return [NSString stringWithFormat:@"%ld",amount];
}
#pragma mark - Getters And Setters
- (void)setRankList:(NSArray *)rankList {
_rankList = rankList;
XPRoomRankListModel *model1 = [rankList safeObjectAtIndex1:0];
if (model1) {
self.avatar1.imageUrl = model1.avatar;
self.value1.text = [self getAmountText:model1.goldAmount];
}else{
self.avatar1.imageUrl = @"";
self.value1.text = @"0";
}
XPRoomRankListModel *model2 = [rankList safeObjectAtIndex1:1];
if (model2) {
self.avatar2.imageUrl = model2.avatar;
self.value2.text = [self getAmountText:model2.goldAmount];
}else{
self.avatar2.imageUrl = @"";
self.value2.text = @"0";
}
XPRoomRankListModel *model3 = [rankList safeObjectAtIndex1:2];
if (model3) {
self.avatar3.imageUrl = model3.avatar;
self.value3.text = [self getAmountText:model3.goldAmount];
}else{
self.avatar3.imageUrl = @"";
self.value3.text = @"0";
}
}
- (UIView *)bgView {
if (_bgView == nil) {
_bgView = [[UIView alloc] init];
}
return _bgView;
}
- (UIImageView *)headwear1 {
if (!_headwear1) {
_headwear1 = [[UIImageView alloc] init];
_headwear1.image = [UIImage imageNamed:@"room_rank_headwear_first"];
}
return _headwear1;
}
- (UIImageView *)headwear2 {
if (!_headwear2) {
_headwear2 = [[UIImageView alloc] init];
_headwear2.image = [UIImage imageNamed:@"room_rank_headwear_second"];
}
return _headwear2;
}
- (UIImageView *)headwear3 {
if (!_headwear3) {
_headwear3 = [[UIImageView alloc] init];
_headwear3.image = [UIImage imageNamed:@"room_rank_headwear_third"];
}
return _headwear3;
}
- (NetImageView *)avatar1 {
if (!_avatar1) {
NetImageConfig *config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultEmptyAvatarPlaceholder];
_avatar1 = [[NetImageView alloc] initWithConfig:config];
_avatar1.layer.cornerRadius = 11;
_avatar1.layer.masksToBounds = YES;
}
return _avatar1;
}
- (NetImageView *)avatar2 {
if (!_avatar2) {
NetImageConfig *config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultEmptyAvatarPlaceholder];
_avatar2 = [[NetImageView alloc] initWithConfig:config];
_avatar2.layer.cornerRadius = 11;
_avatar2.layer.masksToBounds = YES;
}
return _avatar2;
}
- (NetImageView *)avatar3 {
if (!_avatar3) {
NetImageConfig *config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultEmptyAvatarPlaceholder];
_avatar3 = [[NetImageView alloc] initWithConfig:config];
_avatar3.layer.cornerRadius = 11;
_avatar3.layer.masksToBounds = YES;
}
return _avatar3;
}
- (UILabel *)value1 {
if (!_value1) {
_value1 = [[UILabel alloc] init];
_value1.textColor = [ThemeColor colorWithHexString:@"#8E461A"];
_value1.textAlignment = NSTextAlignmentCenter;
_value1.text = @"0";
_value1.font = [UIFont systemFontOfSize:7 weight:UIFontWeightMedium];
_value1.backgroundColor = [ThemeColor colorWithHexString:@"#F5CD57"];
_value1.layer.cornerRadius = 4;
_value1.clipsToBounds = YES;
}
return _value1;
}
- (UILabel *)value2 {
if (!_value2) {
_value2 = [[UILabel alloc] init];
_value2.textColor = [ThemeColor colorWithHexString:@"#2E527A"];
_value2.textAlignment = NSTextAlignmentCenter;
_value2.text = @"0";
_value2.font = [UIFont systemFontOfSize:7 weight:UIFontWeightMedium];
_value2.backgroundColor = [ThemeColor colorWithHexString:@"#91C8FA"];
_value2.layer.cornerRadius = 4;
_value2.clipsToBounds = YES;
}
return _value2;
}
- (UILabel *)value3 {
if (!_value3) {
_value3 = [[UILabel alloc] init];
_value3.textColor = [ThemeColor colorWithHexString:@"#824B2C"];
_value3.textAlignment = NSTextAlignmentCenter;
_value3.text = @"0";
_value3.font = [UIFont systemFontOfSize:7 weight:UIFontWeightMedium];
_value3.backgroundColor = [ThemeColor colorWithHexString:@"#F0A47B"];
_value3.layer.cornerRadius = 4;
_value3.clipsToBounds = YES;
}
return _value3;
}
@end

View File

@@ -57,8 +57,6 @@ NSString * const kRoomPlayEnterKey = @"kRoomPlayEnterKey";
@property (nonatomic,strong) UIButton *giftButton;
///
@property (nonatomic,strong) UIButton *arrangeMicButton;
///
@property (nonatomic,strong) UIButton *nobleButton;
///
@property (nonatomic,strong) XPRoomSendTextView *inputTextView;
@property (nonatomic,strong) XPRoomMessageBubbleView *miniMessageView;
@@ -226,7 +224,7 @@ NSString * const kRoomPlayEnterKey = @"kRoomPlayEnterKey";
[self.stackView addArrangedSubview:self.messageButton];
[self.stackView addArrangedSubview:self.moreButton];
[self.stackView addArrangedSubview:self.playButton];
[self.stackView addArrangedSubview:self.nobleButton];
}
- (void)initSubViewConstraints {
@@ -563,16 +561,6 @@ NSString * const kRoomPlayEnterKey = @"kRoomPlayEnterKey";
return _moreButton;
}
- (UIButton *)nobleButton {
if (!_nobleButton) {
_nobleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_nobleButton setImage:[UIImage imageNamed:@"room_menu_noble"] forState:UIControlStateNormal];
_nobleButton.tag = XPRoomMenuItemType_Noble;
[_nobleButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _nobleButton;
}
- (UIButton *)giftButton {
if (!_giftButton) {
_giftButton = [UIButton buttonWithType:UIButtonTypeCustom];

View File

@@ -28,6 +28,7 @@
#import "XCCurrentVCStackManager.h"
#import "StatisticsServiceHelper.h"
#import "NSMutableDictionary+Saft.h"
#import "NetImageView.h"
///Model
#import "RoomInfoModel.h"
#import "UserInfoModel.h"
@@ -46,8 +47,14 @@
///
@property (nonatomic, strong) UIButton *backButton;
///
@property (nonatomic, strong) UIStackView *nickBgStackView;
///
@property (nonatomic, strong) UIView *spaceView;
///
@property (nonatomic,strong) UIStackView *nickStackView;
///
@property (nonatomic,strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) UIStackView *titleStackView;
///
@@ -60,8 +67,10 @@
@property (nonatomic,strong) UIStackView *onlineStackView;
///绿
@property (nonatomic,strong) UIView * greenDotView;
///id线
///id
@property (nonatomic,strong) YYLabel *idLabel;
///线
@property (nonatomic,strong) UILabel *onLineLabel;
///
@property (nonatomic,strong) UIButton *collectButton;
///
@@ -129,16 +138,21 @@
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.backButton];
[self addSubview:self.nickStackView];
[self addSubview:self.collectButton];
// [self addSubview:self.backButton];
[self addSubview:self.nickBgStackView];
[self addSubview:self.settingButton];
[self.nickBgStackView addArrangedSubview:self.avatarImageView];
[self.nickBgStackView addArrangedSubview:self.nickStackView];
[self.nickBgStackView addArrangedSubview:self.collectButton];
[self.nickBgStackView addArrangedSubview:self.spaceView];
[self.nickStackView addArrangedSubview:self.titleStackView];
[self.nickStackView addArrangedSubview:self.onlineStackView];
[self.onlineStackView addArrangedSubview:self.greenDotView];
[self.onlineStackView addArrangedSubview:self.idLabel];
[self.onlineStackView addArrangedSubview:self.greenDotView];
[self.onlineStackView addArrangedSubview:self.onLineLabel];
[self.titleStackView addArrangedSubview:self.titleLabel];
[self.titleStackView addArrangedSubview:self.giftEffectImageView];
@@ -146,38 +160,46 @@
}
- (void)initSubViewConstraints {
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self).offset(14);
make.height.width.equalTo(@22);
make.centerY.mas_equalTo(self.settingButton);
}];
// [self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self).offset(14);
// make.height.width.equalTo(@22);
// make.centerY.mas_equalTo(self.settingButton);
// }];
//
[self.settingButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-15);
make.bottom.mas_equalTo(-11);
make.width.height.mas_equalTo(22);
make.right.mas_equalTo(-13);
make.centerY.mas_equalTo(self.nickBgStackView);
make.width.height.mas_equalTo(25);
}];
[self.collectButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.settingButton);
make.right.equalTo(self.settingButton.mas_left).offset(-8);
make.width.height.mas_equalTo(22);
}];
[self.nickStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.settingButton);
make.left.mas_equalTo(self.backButton.mas_right).offset(10);
}];
[self.nickBgStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.bottom.mas_equalTo(-5);
make.height.mas_equalTo(34);
}];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(self.nickBgStackView.mas_height);
}];
[self.collectButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
}];
[self.spaceView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(4);
make.height.mas_equalTo(1);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_lessThanOrEqualTo(100);
make.height.mas_equalTo(21);
make.height.mas_equalTo(18);
}];
[self.greenDotView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(3,3));
}];
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(14);
make.height.mas_equalTo(16);
}];
[self.giftEffectImageView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -194,9 +216,9 @@
///
[[[NIMSDK sharedSDK] chatroomManager] fetchChatroomInfo:[NSString stringWithFormat:@"%ld", (long)self.hostDelegate.getRoomInfo.roomId] completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom) {
if (error == nil) {
self.idLabel.text = [NSString stringWithFormat:@"在线:%ld ID:%ld", (long)(chatroom.onlineUserCount > 0 ? chatroom.onlineUserCount : 0), (long)roomInfo.erbanNo];
self.onLineLabel.text = [NSString stringWithFormat:@"%ld", (long)(chatroom.onlineUserCount > 0 ? chatroom.onlineUserCount : 0)];
} else {
self.idLabel.text = [NSString stringWithFormat:@"在线:%ld ID:%ld", (long)(roomInfo.onlineNum > 0 ? roomInfo.onlineNum : 0), (long)roomInfo.erbanNo];
self.onLineLabel.text = [NSString stringWithFormat:@"%ld", (long)(roomInfo.onlineNum > 0 ? roomInfo.onlineNum : 0)];
}
}];
@@ -215,8 +237,10 @@
- (void)onRoomUpdate {
RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo;
self.avatarImageView.imageUrl = roomInfo.avatar;
self.titleLabel.text = roomInfo.title;
self.idLabel.text = [NSString stringWithFormat:@"在线:%ld ID:%ld", (long)(roomInfo.onlineNum > 0 ? roomInfo.onlineNum : 0), (long)roomInfo.erbanNo];
self.idLabel.text = [NSString stringWithFormat:@"ID:%ld",roomInfo.erbanNo];
self.onLineLabel.text = [NSString stringWithFormat:@"%ld", (long)(roomInfo.onlineNum > 0 ? roomInfo.onlineNum : 0)];
self.giftEffectImageView.hidden = roomInfo.hasAnimationEffect;
if (roomInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
self.collectButton.hidden = YES;
@@ -412,11 +436,15 @@
- (UIButton *)collectButton {
if (!_collectButton) {
_collectButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_collectButton setImage:[UIImage imageNamed:@"room_collect_normal"] forState:UIControlStateNormal];
[_collectButton setImage:[UIImage imageNamed:@"room_collect_selected"] forState:UIControlStateSelected];
_collectButton.backgroundColor = [ThemeColor colorWithHexString:@"#67D7D7"];
[_collectButton setTitle:@"收藏" forState:UIControlStateNormal];
[_collectButton setTitle:@"已收藏" forState:UIControlStateSelected];
[_collectButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
_collectButton.titleLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightMedium];
_collectButton.layer.cornerRadius = 10;
_collectButton.clipsToBounds = YES;
[_collectButton addTarget:self action:@selector(collectButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_collectButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8];
_collectButton.adjustsImageWhenHighlighted = NO;
_collectButton.contentEdgeInsets = UIEdgeInsetsMake(0, 7, 0, 7);
_collectButton.hidden = YES;
}
return _collectButton;
@@ -448,7 +476,7 @@
_titleLabel = [[MarqueeLabel alloc] init];
_titleLabel.scrollDuration = 8.0;
_titleLabel.fadeLength = 6.0f;
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:15];
_titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_titleLabel.textColor = [ThemeColor roomOwnerNickColor];
_titleLabel.userInteractionEnabled = YES;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onlineTapRecognizer)];
@@ -508,6 +536,15 @@
return _idLabel;
}
- (UILabel *)onLineLabel {
if (!_onLineLabel) {
_onLineLabel = [[UILabel alloc] init];
_onLineLabel.textColor = [ThemeColor roomOwnerNickColor];
_onLineLabel.font = [UIFont systemFontOfSize:10];
}
return _onLineLabel;
}
- (XPRoomRecommendView *)recommendRoomView {
if (!_recommendRoomView) {
_recommendRoomView = [[XPRoomRecommendView alloc] init];
@@ -516,4 +553,41 @@
return _recommendRoomView;
}
- (NetImageView *)avatarImageView {
if (!_avatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserIcon;
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
_avatarImageView.userInteractionEnabled = YES;
_avatarImageView.layer.masksToBounds = YES;
_avatarImageView.layer.cornerRadius = 17;
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
// UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapAvatarGuest)];
// [_avatarImageView addGestureRecognizer:tap];
}
return _avatarImageView;
}
- (UIStackView *)nickBgStackView {
if (!_nickBgStackView) {
_nickBgStackView = [[UIStackView alloc] init];
_nickBgStackView.axis = UILayoutConstraintAxisHorizontal;
_nickBgStackView.distribution = UIStackViewDistributionFill;
_nickBgStackView.alignment = UIStackViewAlignmentCenter;
_nickBgStackView.spacing = 4;
_nickBgStackView.backgroundColor = [UIColor.whiteColor colorWithAlphaComponent:0.1];
_nickBgStackView.layer.cornerRadius = 17;
}
return _nickBgStackView;
}
- (UIView *)spaceView {
if (!_spaceView) {
_spaceView = [[UIView alloc] init];
}
return _spaceView;
}
@end