相亲模式坑位的显示 目前还有问题 需要解决

This commit is contained in:
fengshuo
2022-01-05 18:01:50 +08:00
parent 1c509f4d0d
commit 167b4934ce
20 changed files with 506 additions and 122 deletions

View File

@@ -259,6 +259,7 @@
E884C36C2743951B00E1EBED /* GiftReceiveInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C36B2743951B00E1EBED /* GiftReceiveInfoModel.m */; };
E884C36F2743AAC800E1EBED /* AttachmentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C36E2743AAC800E1EBED /* AttachmentModel.m */; };
E884C3722743AEDE00E1EBED /* CustomAttachmentDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = E884C3712743AEDE00E1EBED /* CustomAttachmentDecoder.m */; };
E8899C7F27853B6A007944BE /* DatingMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8899C7E27853B6A007944BE /* DatingMicroView.m */; };
E88B5CA526FB088600DA9178 /* XPMineTeenagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */; };
E88B5CA826FB089C00DA9178 /* XPMineTeenagePwdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA726FB089C00DA9178 /* XPMineTeenagePwdViewController.m */; };
E88B5CAD26FB16A800DA9178 /* XPMineTeenagerDesView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CAC26FB16A800DA9178 /* XPMineTeenagerDesView.m */; };
@@ -930,6 +931,8 @@
E884C36E2743AAC800E1EBED /* AttachmentModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AttachmentModel.m; sourceTree = "<group>"; };
E884C3702743AEDE00E1EBED /* CustomAttachmentDecoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomAttachmentDecoder.h; sourceTree = "<group>"; };
E884C3712743AEDE00E1EBED /* CustomAttachmentDecoder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomAttachmentDecoder.m; sourceTree = "<group>"; };
E8899C7D27853B6A007944BE /* DatingMicroView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DatingMicroView.h; sourceTree = "<group>"; };
E8899C7E27853B6A007944BE /* DatingMicroView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DatingMicroView.m; sourceTree = "<group>"; };
E88B5CA326FB088600DA9178 /* XPMineTeenagerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagerViewController.h; sourceTree = "<group>"; };
E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineTeenagerViewController.m; sourceTree = "<group>"; };
E88B5CA626FB089C00DA9178 /* XPMineTeenagePwdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagePwdViewController.h; sourceTree = "<group>"; };
@@ -2518,6 +2521,7 @@
E8680707271959090024F48F /* MicroView */ = {
isa = PBXGroup;
children = (
E8899C7C27853B46007944BE /* Dating */,
180806DA27297269001FD836 /* MicroViewProtocol.h */,
E8680716271967B00024F48F /* MicroView.h */,
E8680717271967B00024F48F /* MicroView.m */,
@@ -2525,8 +2529,6 @@
E81D58812720082A003063FE /* MicroWaveView.m */,
E8DACCF92766EDC60052092C /* MicroGiftValueView.h */,
E8DACCFA2766EDC60052092C /* MicroGiftValueView.m */,
E877A7EC278428FB00EFACED /* MicroDatingProgressView.h */,
E877A7ED278428FB00EFACED /* MicroDatingProgressView.m */,
);
path = MicroView;
sourceTree = "<group>";
@@ -2681,6 +2683,17 @@
path = Tool;
sourceTree = "<group>";
};
E8899C7C27853B46007944BE /* Dating */ = {
isa = PBXGroup;
children = (
E877A7EC278428FB00EFACED /* MicroDatingProgressView.h */,
E877A7ED278428FB00EFACED /* MicroDatingProgressView.m */,
E8899C7D27853B6A007944BE /* DatingMicroView.h */,
E8899C7E27853B6A007944BE /* DatingMicroView.m */,
);
path = Dating;
sourceTree = "<group>";
};
E88B5CA926FB15B900DA9178 /* Teenager */ = {
isa = PBXGroup;
children = (
@@ -3938,6 +3951,7 @@
E8AEAEED27141AE20017FCE0 /* XPRoomBackContainerView.m in Sources */,
E88B5CC126FB407B00DA9178 /* XPMineUserInfoViewController.m in Sources */,
18F4043A275E20D900A6C548 /* TRTCRtcImpl.m in Sources */,
E8899C7F27853B6A007944BE /* DatingMicroView.m in Sources */,
E824545926F5E65900BE8163 /* XPMineVerifIdentityView.m in Sources */,
189DD74026E21C3F00AB55B1 /* YYUtility+App.m in Sources */,
189DD74526E21CCC00AB55B1 /* YYReachability.m in Sources */,

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -69,7 +69,16 @@ NS_ASSUME_NONNULL_BEGIN
///用户信息中的 头饰的动画 如果没有的话 就用这个 并不需要HeadwearModel 映射一下吧
@property (nonatomic,copy) NSString *headwearPic;
///头饰(新字段) 上麦的时候 在扩展字段中的 只用在坑位上
@property (nonatomic, copy) NSString *headWearUrl;
@property (nonatomic,copy) NSString *headWearUrl;
#pragma mark - 相亲房的字段
///是否为相亲模式VIP坑位
@property (nonatomic,assign) BOOL vipMic;
///帽子 相亲中收到礼物值最高的那个人 男神 女神都有
@property (nonatomic,copy) NSString *capUrl;
///是不是选择了人
@property (nonatomic,assign) BOOL hasSelectUser;
///所选择的麦序
@property (nonatomic,assign) int selectMicPosition;
@end
NS_ASSUME_NONNULL_END

View File

@@ -41,7 +41,9 @@ typedef NS_ENUM(NSUInteger, URLType) {
///平台榜单入口
kHomeRankURL,
///房间礼物值 跳转
kRoomCharmRankUrl
kRoomCharmRankUrl,
///相亲规则介绍
kRoomDatingRule
};
NSString * const URLWithType(URLType type);

View File

@@ -33,6 +33,7 @@ NSString * const URLWithType(URLType type) {
@(kUserLevelURL) : @"modules/level/index.html",//
@(kHomeRankURL) : @"modules/rank/index.html#/rank", //
@(kRoomCharmRankUrl) : @"modules/charm/index.html",//
@(kRoomDatingRule) : @"modules/rule/dating.html",//
};
NSString * url = [dic objectForKey:@(type)];

View File

@@ -61,7 +61,7 @@ static CGFloat const kContentAspectRatio = 2/3.f;
[self.webVC.view mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.backImageView).inset(30);
make.bottom.mas_equalTo(self.backImageView).offset(-20);
make.top.mas_equalTo(self.backImageView);
make.top.mas_equalTo(self.backImageView).offset(45);
}];

View File

@@ -6,10 +6,13 @@
//
#import "DatingStageView.h"
#import "MicroView.h"
#import "MicroGiftValueView.h"
///Third
#import <Masonry/Masonry.h>
#import <NIMSDK/NIMSDK.h>
#import "DatingMicroView.h"
#import "XPMacro.h"
#import "RoomInfoModel.h"
#import "MicroDatingProgressView.h"
// 58 + 5
#define ownerWidth (58 + 5)
// 12 6
@@ -32,8 +35,27 @@
//
#define secondRowTop (firstRowTop + mcHeight + 27)
@interface DatingStageView()
///
@property (nonatomic,strong) MicroDatingProgressView *datingProgressView;
@end
@implementation DatingStageView
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
if (self = [super initWithDelegate:delegate]) {
[self addSubview:self.datingProgressView];
[self.datingProgressView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(dateingWidth);
make.bottom.mas_equalTo(self);
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(firstRowTop);
}];
}
return self;
}
- (NSInteger)countOfMircoView {
return 10;
}
@@ -43,7 +65,7 @@
if (microView) {
return microView;
}
return [[MicroView alloc]init];
return [[DatingMicroView alloc]init];
}
/**
@@ -106,8 +128,23 @@
* index
*/
- (void)didSelectAtIndex:(NSInteger)index {
NSLog(@"%d", index);
[super didSelectAtIndex:index];
}
- (void)onRoomUpdate {
[super onRoomUpdate];
if (self.hostDelegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) {
self.datingProgressView.blindDateState = self.hostDelegate.getRoomInfo.blindDateState;
}
}
- (MicroDatingProgressView *)datingProgressView {
if (!_datingProgressView) {
_datingProgressView = [[MicroDatingProgressView alloc] init];
}
return _datingProgressView;
}
@end

View File

@@ -0,0 +1,16 @@
//
// DatingMicroView.h
// xplan-ios
//
// Created by 冯硕 on 2022/1/5.
//
#import "MicroView.h"
NS_ASSUME_NONNULL_BEGIN
@interface DatingMicroView : MicroView
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,231 @@
//
// DatingMicroView.m
// xplan-ios
//
// Created by on 2022/1/5.
//
#import "DatingMicroView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "NetImageView.h"
#import "AccountInfoStorage.h"
@interface DatingMicroView ()
///
@property (nonatomic,strong) NetImageView *capImageView;
///
@property (nonatomic,strong) UIButton *pickButton;
///
@property (nonatomic,strong) UIImageView *datingTypeView;
///
@property (nonatomic,assign) BOOL isEmcee;
@end
@implementation DatingMicroView
- (void)initSubViews {
[super initSubViews];
[self insertSubview:self.datingTypeView aboveSubview:self.getAvatarView];
[self addSubview:self.capImageView];
[self addSubview:self.pickButton];
}
- (void)initSubViewConstraints {
[super initSubViewConstraints];
[self.capImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.getAvatarView);
}];
[self.pickButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(37, 14));
make.centerX.mas_equalTo(self.getAvatarView);
make.centerY.mas_equalTo(self.getAvatarView.mas_bottom).mas_offset(-2);
}];
[self.datingTypeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.getAvatarView);
}];
}
- (void)configMicroView:(MicroQueueModel *)model {
[super configMicroView:model];
RoomInfoModel * roomInfo = self.getRoomInfo;
UserInfoModel * userInfo = model.userInfo;
NSMutableDictionary * micQueue = [self getMicroQueue];
NSString * typeImageName = @"";
int position = model.microState.position;
if (position == 0 || position == 1 || position == 4 || position == 5) {
typeImageName = @"room_position_dating_male_bg";
} else if(position == 2 || position == 3 || position == 6 || position == 7){
typeImageName = @"room_position_dating_female_bg";
}
self.datingTypeView.image = [UIImage imageNamed:typeImageName];
///
if (userInfo && userInfo.capUrl.length > 0) {
self.datingTypeView.image = [UIImage imageNamed:typeImageName];
self.datingTypeView.hidden = NO;
} else {
self.capImageView.hidden = YES;
}
///
if (position == -1) {
self.pickButton.hidden = YES;
} else {
if (roomInfo.blindDateState == RoomPlayDateingType_Pick) {
///
if (self.isEmcee) {
if (userInfo) {
self.pickButton.hidden = NO;
if (userInfo.vipMic || position == 999) {
///
if (userInfo.hasSelectUser) {
[self.pickButton setTitle:[NSString stringWithFormat:@"选%d号", (userInfo.selectMicPosition + 1)] forState:UIControlStateNormal];
[self.pickButton setBackgroundImage:nil forState:UIControlStateNormal];
} else {
[self.pickButton setTitle:@"未选择" forState:UIControlStateNormal];
[self.pickButton setBackgroundImage:nil forState:UIControlStateNormal];
}
} else {
///
if (userInfo.hasSelectUser) {
MicroQueueModel *sequence = [micQueue objectForKey:[NSString stringWithFormat:@"%d", userInfo.selectMicPosition]];
NSString *selectNum;
if (sequence.userInfo.vipMic) {
selectNum = @"选VIP";
} else {
selectNum = [NSString stringWithFormat:@"选%d号", (userInfo.selectMicPosition + 1)];
}
if (model.microState.datingMicType == DatingMicType_Male) {
[self configPickTitle:selectNum backmImageName:@"room_mode_dating_male_select"];
} else {
[self configPickTitle:selectNum backmImageName:@"room_mode_dating_female_select"];
}
} else {
[self configPickTitle:@"未选择" backmImageName:@"room_mode_dating_not_select"];
}
}
}
} else {
///
if (userInfo) {
self.pickButton.hidden = NO;
if (userInfo.vipMic || position ==999) {
///
if (userInfo.hasSelectUser) {
///
if (userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
[self.pickButton setTitle:[NSString stringWithFormat:@"选%d号", (userInfo.selectMicPosition + 1)] forState:UIControlStateNormal];
[self.pickButton setBackgroundImage:nil forState:UIControlStateNormal];
} else {
[self.pickButton setTitle:@"已选择" forState:UIControlStateNormal];
[self.pickButton setBackgroundImage:nil forState:UIControlStateNormal];
}
} else {
[self.pickButton setTitle:@"未选择" forState:UIControlStateNormal];
[self.pickButton setBackgroundImage:nil forState:UIControlStateNormal];
}
} else {
///
if (userInfo.hasSelectUser) {
///
if (userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
MicroQueueModel *sequence = [micQueue objectForKey:[NSString stringWithFormat:@"%d", userInfo.selectMicPosition]];
NSString *selectNum;
if (sequence.userInfo.vipMic) {
selectNum = @"选VIP";
} else {
selectNum = [NSString stringWithFormat:@"选%d号", (userInfo.selectMicPosition + 1)];
}
if (model.microState.datingMicType == DatingMicType_Male) {
[self configPickTitle:selectNum backmImageName:@"room_mode_dating_male_select"];
} else {
[self configPickTitle:selectNum backmImageName:@"room_mode_dating_female_select"];
}
} else {
if (model.microState.datingMicType == DatingMicType_Male) {
[self configPickTitle:@"已选择" backmImageName:@"room_mode_dating_male_select"];
} else {
[self configPickTitle:@"已选择" backmImageName:@"room_mode_dating_female_select"];
}
}
} else {
[self configPickTitle:@"未选择" backmImageName:@"room_mode_dating_not_select"];
}
}
}
}
} else if(roomInfo.blindDateState == RoomPlayDateingType_Result || roomInfo.blindDateState == RoomPlayDateingType_Finish) {
///
if (userInfo) {
self.pickButton.hidden = NO;
if (userInfo.vipMic || position == 999) {
///
if (userInfo.hasSelectUser) {
[self.pickButton setTitle:[NSString stringWithFormat:@"选%d号", (userInfo.selectMicPosition + 1)] forState:UIControlStateNormal];
[self.pickButton setBackgroundImage:nil forState:UIControlStateNormal];
} else {
[self.pickButton setTitle:@"未选择" forState:UIControlStateNormal];
[self.pickButton setBackgroundImage:nil forState:UIControlStateNormal];
}
} else {
///
if (userInfo.hasSelectUser) {
MicroQueueModel *sequence = [micQueue objectForKey:[NSString stringWithFormat:@"%d", userInfo.selectMicPosition]];
NSString *selectNum;
if (sequence.userInfo.vipMic) {
selectNum = @"选VIP";
} else {
selectNum = [NSString stringWithFormat:@"选%d号", (userInfo.selectMicPosition + 1)];
}
if (model.microState.datingMicType == DatingMicType_Male) {
[self configPickTitle:selectNum backmImageName:@"room_mode_dating_male_select"];
} else {
[self configPickTitle:selectNum backmImageName:@"room_mode_dating_female_select"];
}
} else {
[self configPickTitle:@"未选择" backmImageName:@"room_mode_dating_not_select"];
}
}
}
}
}
}
- (void)configPickTitle:(NSString *)title backmImageName:(NSString *)backImageName {
[self.pickButton setTitle:title forState:UIControlStateNormal];
[self.pickButton setBackgroundImage:[UIImage imageNamed:backImageName] forState:UIControlStateNormal];
}
- (UIImageView *)datingTypeView {
if (!_datingTypeView) {
_datingTypeView = [[UIImageView alloc] init];
_datingTypeView.userInteractionEnabled = YES;
}
return _datingTypeView;
}
- (NetImageView *)capImageView {
if (!_capImageView) {
_capImageView = [[NetImageView alloc] init];
}
return _capImageView;
}
- (UIButton *)pickButton {
if (!_pickButton) {
_pickButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_pickButton setTitle:@"未选择" forState:UIControlStateNormal];
_pickButton.titleLabel.font = [UIFont systemFontOfSize:9];
_pickButton.userInteractionEnabled = NO;
_pickButton.hidden = YES;
}
return _pickButton;
}
@end

View File

@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface MicroDatingProgressView : UIView
///
///相亲的阶段
@property (nonatomic,assign) RoomPlayDateingType blindDateState;
@end

View File

@@ -11,6 +11,9 @@
///Tool
#import "ThemeColor.h"
#import "TTPopup.h"
#import "XPHtmlUrl.h"
///View
#import "XPRoomDatingWebAlertView.h"
@interface MicroDatingProgressView ()
///
@@ -34,30 +37,28 @@
- (void)initSubViews {
[self addSubview:self.heartSceneImageView];
[self addSubview:self.talkButton];
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapRecognizer)];
[self addGestureRecognizer:tap];
}
- (void)initSubViewConstraints {
[self.heartSceneImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(95, 84));
make.top.centerX.mas_equalTo(self);
make.centerX.mas_equalTo(self);
make.top.mas_equalTo(self).offset(12);
}];
[self.talkButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.heartSceneImageView.mas_bottom).offset(7);
make.top.mas_equalTo(self.heartSceneImageView.mas_bottom).offset(8);
make.size.mas_equalTo(CGSizeMake(65, 21));
make.centerX.mas_equalTo(self.heartSceneImageView);
}];
}
#pragma mark - Event Response
- (void)didTapRecognizer {
- (void)tapDatingRuleRecognizer {
[TTPopup dismiss];
// RoomDatingWebView * webView = [[RoomDatingWebView alloc] init];
// webView.url = HtmlUrlKey(kRoomDatingRule);
// [TTPopup popupView:webView style:TTPopupStyleAlert];
XPRoomDatingWebAlertView * webView = [[XPRoomDatingWebAlertView alloc] init];
webView.url = URLWithType(kRoomDatingRule);
[TTPopup popupView:webView style:TTPopupStyleAlert];
}
#pragma mark - Getters And Setters
@@ -72,7 +73,7 @@
talkTitle = @"心动选人";
break;
case RoomPlayDateingType_Result:
talkTitle = @"心动公布";
talkTitle = @"公布心动";
break;
default:
break;
@@ -84,6 +85,9 @@
if (!_heartSceneImageView) {
_heartSceneImageView = [[UIImageView alloc] init];
_heartSceneImageView.userInteractionEnabled = YES;
_heartSceneImageView.image = [UIImage imageNamed:@"room_mode_dating_heart_icon"];
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapDatingRuleRecognizer)];
[_heartSceneImageView addGestureRecognizer:tap];
}
return _heartSceneImageView;
}
@@ -95,8 +99,7 @@
[_talkButton setTitleColor:UIColorFromRGB(0xFFE1E8) forState:UIControlStateNormal];
_talkButton.titleLabel.font = [UIFont boldSystemFontOfSize:13];
_talkButton.titleLabel.textAlignment = NSTextAlignmentCenter;
[_talkButton setBackgroundImage:[UIImage imageNamed:@"room_dating_progress_bg"] forState:UIControlStateNormal];
[_talkButton addTarget:self action:@selector(roomdatingRuleAction:) forControlEvents:UIControlEventTouchUpInside];
[_talkButton setBackgroundImage:[UIImage imageNamed:@"room_mode_dating_progress_bg"] forState:UIControlStateNormal];
}
return _talkButton;
}

View File

@@ -7,8 +7,8 @@
#import <UIKit/UIKit.h>
#import "MicroViewProtocol.h"
#import "NetImageView.h"
NS_ASSUME_NONNULL_BEGIN
@interface MicroView : UIView<MicroViewProtocol>
@end

View File

@@ -21,10 +21,6 @@
#import "SpriteSheetImageManager.h"
#import "XPMacro.h"
#import "MicroQueueModel.h"
#import "MicroStateModel.h"
#import "UserInfoModel.h"
@interface MicroView ()<CAAnimationDelegate>
///
@property (nonatomic,strong) NetImageView *avatarImageView;
@@ -44,16 +40,17 @@
@property (nonatomic,strong) MicroGiftValueView *giftValueView;
///
@property (nonatomic,strong) MicroQueueModel *microModel;
///Uid
@property (nonatomic,copy) NSString *roomUid;
///
@property (nonatomic,strong) UserInfoModel *userInfo;
///
@property (nonatomic,strong) RoomInfoModel *roomInfo;
///
@property (nonatomic,strong) YYAnimatedImageView *headWearImageView;
///
@property (nonatomic, strong) SpriteSheetImageManager *manager;
///
@property (nonatomic,strong) UIImageView *datingTypeView;
///
@property (nonatomic,strong) NSMutableDictionary<NSString *,MicroQueueModel *> *micQueue;
@end
@@ -135,6 +132,10 @@
}];
}
- (UIView *)getAvatarView {
return self.avatarImageView;
}
#pragma mark - MicroViewProtocol
- (void)showLeaveMode:(BOOL)isLeaveMode {
if (isLeaveMode) {
@@ -175,8 +176,7 @@
[image drawInRect:CGRectMake(1, 1, scaledToSize.width - 2, scaledToSize.height - 2)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIColor * image1 = [UIColor colorWithPatternImage:newImage];
self.avatarImageView.image = newImage;
self.avatarImageView.backgroundColor = [UIColor colorWithPatternImage:newImage];
self.postionLabel.text = [NSString stringWithFormat:@"%d", micState.position + 1];
}
@@ -195,10 +195,11 @@
}
self.nickLabel.text = userInfo.nick.length > 0 ? userInfo.nick : @"";
} else {
// self.avatarImageView.image = nil;
self.avatarImageView.image = nil;
[self.postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]];
}
if (userInfo.headWearUrl.length > 0) {
NSString * headWearUrl = userInfo.headwearEffect.length ? userInfo.headwearEffect : userInfo.headWearUrl.length ? userInfo.headWearUrl : userInfo.headwearPic;
if (headWearUrl.length > 0 && !userInfo.vipMic) {
self.headWearImageView.hidden = NO;
NSURL *url = [NSURL URLWithString:userInfo.headWearUrl];
@kWeakify(self);
@@ -210,6 +211,29 @@
} else {
self.headWearImageView.hidden = YES;
}
if (self.roomInfo.roomModeType == RoomModeType_Open_Blind) {
if (self.microModel && self.microModel.microState.position == 999) {///VIP
self.headWearImageView.hidden = NO;
if (self.roomInfo.blindDateState == RoomPlayDateingType_Talk || self.roomInfo.blindDateState == RoomPlayDateingType_Finish) {
self.headWearImageView.image = [UIImage imageNamed:@"room_mode_dating_vip_title"];
} else {
if (userInfo) {
self.headWearImageView.image = [UIImage imageNamed:@"room_mode_dating_vip"];
} else {
self.headWearImageView.image = [UIImage imageNamed:@"room_mode_dating_vip_title"];
}
}
} else {
if (userInfo && userInfo.vipMic) {
self.headWearImageView.hidden = NO;
if (self.roomInfo.blindDateState == RoomPlayDateingType_Talk || self.roomInfo.blindDateState == RoomPlayDateingType_Finish) {
self.headWearImageView.image = [UIImage imageNamed:@"room_mode_dating_vip_title"];
} else {
self.headWearImageView.image = [UIImage imageNamed:@"room_mode_dating_vip"];
}
}
}
}
}
- (void)configGiftValue:(long long)giftValue {
@@ -224,39 +248,31 @@
self.giftValueView.giftValue = 0;
}
- (void)configRoomUid:(NSString *)roomUid {
self.roomUid = roomUid;
- (void)configRoomInfo:(RoomInfoModel *)roomInfo {
self.roomInfo = roomInfo;
}
- (void)configDatingMode:(BOOL)isDating position:(int)position {
if (isDating) {
NSString * typeImageName = @"";
if (position == 0 || position == 1 || position == 4 || position == 5) {
typeImageName = @"room_position_dating_male_bg";
} else if(position == 2 || position == 3 || position == 6 || position == 7){
typeImageName = @"room_position_dating_female_bg";
}
if (!self.datingTypeView.superview) {
[self insertSubview:self.datingTypeView aboveSubview:self.avatarImageView];
[self.datingTypeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.avatarImageView);
}];
}
self.datingTypeView.image = [UIImage imageNamed:typeImageName];
self.datingTypeView.hidden = NO;
} else {
self.datingTypeView.hidden = YES;
[self.datingTypeView removeFromSuperview];
}
- (RoomInfoModel *)getRoomInfo {
return self.roomInfo;
}
- (void)configMicQueue:(NSMutableDictionary<NSString *,MicroQueueModel *> *)micQueue {
self.micQueue = micQueue;
}
- (NSMutableDictionary<NSString *, MicroQueueModel *>*)getMicroQueue {
return self.micQueue;
}
#pragma mark - Event Response
- (void)tapGiftValueRecognizer {
if (self.giftValueView.hidden) return;
if (self.userInfo && self.userInfo.uid > 0) {
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.roomUid = self.roomUid;
webVC.url = [NSString stringWithFormat:@"%@?uid=%ld", URLWithType(kRoomCharmRankURL), self.userInfo.uid];
webVC.roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
webVC.url = [NSString stringWithFormat:@"%@?uid=%ld", URLWithType(kRoomCharmRankUrl), self.microModel.userInfo.uid];
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
}
}
@@ -288,37 +304,37 @@
}
- (UILabel *)nickLabel {
if (!_nickLabel) {
_nickLabel = [[UILabel alloc] init];
_nickLabel.font = [UIFont systemFontOfSize:11];
_nickLabel.textColor = [ThemeColor positionNickColor];
_nickLabel.textAlignment = NSTextAlignmentCenter;
}
return _nickLabel;
if (!_nickLabel) {
_nickLabel = [[UILabel alloc] init];
_nickLabel.font = [UIFont systemFontOfSize:11];
_nickLabel.textColor = [ThemeColor positionNickColor];
_nickLabel.textAlignment = NSTextAlignmentCenter;
}
return _nickLabel;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 2;
}
return _stackView;
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 2;
}
return _stackView;
}
- (UILabel *)postionLabel {
if (!_postionLabel) {
_postionLabel = [[UILabel alloc] init];
_postionLabel.font = [UIFont systemFontOfSize:10];
_postionLabel.textAlignment = NSTextAlignmentCenter;
_postionLabel.textColor = [UIColor colorWithWhite:1 alpha:0.6];
_postionLabel.layer.masksToBounds = YES;
_postionLabel.layer.cornerRadius = 7;
[_postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]];
}
return _postionLabel;
if (!_postionLabel) {
_postionLabel = [[UILabel alloc] init];
_postionLabel.font = [UIFont systemFontOfSize:10];
_postionLabel.textAlignment = NSTextAlignmentCenter;
_postionLabel.textColor = [UIColor colorWithWhite:1 alpha:0.6];
_postionLabel.layer.masksToBounds = YES;
_postionLabel.layer.cornerRadius = 7;
[_postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]];
}
return _postionLabel;
}
- (UILabel *)leaveLabel {
@@ -362,12 +378,5 @@
return _headWearImageView;
}
- (UIImageView *)datingTypeView {
if (!_datingTypeView) {
_datingTypeView = [[UIImageView alloc] init];
_datingTypeView.userInteractionEnabled = YES;
}
return _datingTypeView;
}
@end

View File

@@ -6,14 +6,27 @@
//
#import <Foundation/Foundation.h>
#import "MicroQueueModel.h"
#import "MicroStateModel.h"
#import "UserInfoModel.h"
#import "RoomInfoModel.h"
NS_ASSUME_NONNULL_BEGIN
@class MicroQueueModel;
@class MicroStateModel;
@class UserInfoModel;
@protocol MicroViewProtocol <NSObject>
/**
初始化子view
*/
- (void)initSubViews;
/**
给子view 添加约束
*/
- (void)initSubViewConstraints;
/**
获取头像的view
*/
- (UIView *)getAvatarView;
/**
* 离开模式。
@@ -25,11 +38,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)configMicroView:(MicroQueueModel *)model;
/**
* 设置麦位信息。
*/
- (void)configMicroState:(MicroStateModel *)micState;
/**
* 设置用户信息。
*/
@@ -54,16 +62,26 @@ NS_ASSUME_NONNULL_BEGIN
* 礼物值清零
*/
- (void)resetGiftValue;
/**
* 房主的uid
*/
- (void)configRoomUid:(NSString *)roomUid;
/**
* 是否是相亲模式
* 设置房间信息房间的信息
*/
- (void)configDatingMode:(BOOL)isDating position:(int)position;
- (void)configRoomInfo:(RoomInfoModel *)roomInfo;
/**
* 获取当前房间的信息
*/
- (RoomInfoModel *)getRoomInfo;
/**
* 设置当前房间的麦序
*/
- (void)configMicQueue:(NSMutableDictionary <NSString *, MicroQueueModel *> *)micQueue;
/**
* 获取当前的麦序
*/
- (NSMutableDictionary<NSString *, MicroQueueModel *>*)getMicroQueue;
@end
NS_ASSUME_NONNULL_END

View File

@@ -18,6 +18,10 @@ typedef NS_ENUM(NSInteger, MicroMicStateType) {
MicroMicStateType_Close = 1,///锁麦
};
typedef NS_ENUM(NSUInteger, DatingMicType) {
DatingMicType_Male = 1, //男神
DatingMicType_Female = 2, //女神
};
@interface MicroStateModel : NSObject
///坑位的序号
@@ -26,6 +30,8 @@ typedef NS_ENUM(NSInteger, MicroMicStateType) {
@property (nonatomic, assign) MicroPosStateType posState;
///麦序的状态 闭麦/开麦
@property (nonatomic, assign) MicroMicStateType micState;
///相亲房的 男神女神位置的 1 男 2 女
@property (nonatomic,assign) DatingMicType datingMicType;
@end
NS_ASSUME_NONNULL_END

View File

@@ -168,8 +168,9 @@
MicroQueueModel * model = [self.micQueue objectForKey:[self indexToPosition:i]];
UIView<MicroViewProtocol> * view = [self findMicroViewByIndex:i];
[view configRoomInfo:roomInfo];
[view configMicQueue:self.micQueue];
[view configMicroView:model];
[view configRoomUid:[NSString stringWithFormat:@"%ld", roomInfo.uid]];
[view showLeaveMode:i == 0 && leaveMode];
if (roomInfo.leaveMode) {
if (i == 0) {
@@ -182,7 +183,6 @@
}
[view showGiftValueMode:roomInfo.showGiftValue];
[view configDatingMode:roomInfo.roomModeType == RoomModeType_Open_Blind position:model.microState.position];
if (self.hostDelegate.getUserInfo.uid && model.userInfo.uid == self.hostDelegate.getUserInfo.uid) {
selfNeedBroadcast = model.microState.micState == MicroMicStateType_Open;
}

View File

@@ -77,7 +77,7 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
@property (nonatomic,strong) UserInfoModel *userInfo;
///
@property (nonatomic,strong) RoomInfoModel *roomInfo;
///
///
@property (nonatomic,assign) BOOL hasAnimationEffect;
@end
@@ -130,12 +130,14 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
- (void)initSubViews {
[self.view addSubview:self.backContainerView];
[self.view addSubview:self.roomHeaderView];
self.stageView = self.socialView;
[self.view addSubview:self.stageView];
[self.view addSubview:self.messageContainerView];
[self.view addSubview:self.menuContainerView];
[self.view addSubview:self.activityContainerView];
[self.view addSubview:self.functionView];
[self.view addSubview:self.animationView];
}
- (void)initSubViewConstraints {
@@ -151,6 +153,7 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
[self.stageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.view);
make.top.mas_equalTo(self.roomHeaderView.mas_bottom);
make.height.mas_equalTo(self.stageView.hightForStageView);
}];
[self.messageContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -381,11 +384,11 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
case 1:
case 3:
{
RoomInfoModel * roomInfo =[RoomInfoModel modelWithJSON:data[@"roomInfo"]];
roomInfo.hasAnimationEffect = self.hasAnimationEffect;
self.roomInfo.leaveMode = roomInfo.leaveMode;
self.roomInfo.showGiftValue = roomInfo.showGiftValue;
self.roomInfo.roomModeType = roomInfo.roomModeType;
NSMutableDictionary *lastRoomInfoDic = [NSMutableDictionary dictionaryWithDictionary:[self.roomInfo model2dictionary]];
[lastRoomInfoDic addEntriesFromDictionary: ((NSString *)data[@"roomInfo"]).toJSONObject];
RoomInfoModel * lastRoomInfo = [RoomInfoModel modelWithJSON:lastRoomInfoDic];
lastRoomInfo.hasAnimationEffect = self.hasAnimationEffect;
self.roomInfo= lastRoomInfo;
[self changeStageViewOnRoomUpdate];
[self.stageView onRoomUpdate];
[self.menuContainerView onRoomUpdate];
@@ -577,13 +580,6 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
return _socialView;
}
- (StageView *)stageView {
if (!_stageView) {
_stageView = [[StageView alloc] initWithDelegate:self];
}
return _stageView;
}
- (DatingStageView *)datingView {
if (!_datingView) {
_datingView = [[DatingStageView alloc] initWithDelegate:self];