最后提交
This commit is contained in:
1
Podfile
1
Podfile
@@ -20,6 +20,7 @@ def taget_pods
|
|||||||
pod 'MQTTClient'
|
pod 'MQTTClient'
|
||||||
#菊花
|
#菊花
|
||||||
pod 'MBProgressHUD'
|
pod 'MBProgressHUD'
|
||||||
|
pod 'SVProgressHUD'
|
||||||
#图片选择
|
#图片选择
|
||||||
pod 'TZImagePickerController'
|
pod 'TZImagePickerController'
|
||||||
# 布局
|
# 布局
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
-(void)didResignFirstResponder;
|
-(void)didResignFirstResponder;
|
||||||
|
|
||||||
|
-(void)didBecomeFirstResponder;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface QXDynamicCommentInputView : UIView
|
@interface QXDynamicCommentInputView : UIView
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
@interface QXDynamicCommentInputView()<UITextFieldDelegate>
|
@interface QXDynamicCommentInputView()<UITextFieldDelegate>
|
||||||
@property (nonatomic,strong)UICollectionView *collectionViwew;
|
@property (nonatomic,strong)UICollectionView *collectionViwew;
|
||||||
|
@property (nonatomic,strong)UIView *bigBgView;
|
||||||
@property (nonatomic,strong)UIView *inputBgView;
|
@property (nonatomic,strong)UIView *inputBgView;
|
||||||
@property (nonatomic,strong)UIView *inputShadowView;
|
@property (nonatomic,strong)UIView *inputShadowView;
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@
|
|||||||
self.textField = [[UITextField alloc] init];
|
self.textField = [[UITextField alloc] init];
|
||||||
self.textField.font = [UIFont systemFontOfSize:14];
|
self.textField.font = [UIFont systemFontOfSize:14];
|
||||||
self.textField.textColor = QXConfig.textColor;
|
self.textField.textColor = QXConfig.textColor;
|
||||||
self.textField.returnKeyType = UIReturnKeyDone;
|
self.textField.returnKeyType = UIReturnKeySend;
|
||||||
self.textField.delegate = self;
|
self.textField.delegate = self;
|
||||||
[self.textField addTarget:self action:@selector(textDidChange:) forControlEvents:UIControlEventEditingChanged];
|
[self.textField addTarget:self action:@selector(textDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||||
[self.inputBgView addSubview:self.textField];
|
[self.inputBgView addSubview:self.textField];
|
||||||
@@ -95,7 +96,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
|
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
|
||||||
|
if (self.textField.text.length == 0) {
|
||||||
|
showToast(@"内容不能为空");
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
[textField resignFirstResponder];
|
[textField resignFirstResponder];
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickSendWithText:model:)]) {
|
||||||
|
[self.delegate didClickSendWithText:self.textField.text model:self.model];
|
||||||
|
}
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
-(void)textFieldDidEndEditing:(UITextField *)textField{
|
-(void)textFieldDidEndEditing:(UITextField *)textField{
|
||||||
@@ -103,6 +111,11 @@
|
|||||||
[self.delegate didResignFirstResponder];
|
[self.delegate didResignFirstResponder];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
-(void)textFieldDidBeginEditing:(UITextField *)textField{
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(didBecomeFirstResponder)]) {
|
||||||
|
[self.delegate didBecomeFirstResponder];
|
||||||
|
}
|
||||||
|
}
|
||||||
-(void)setModel:(QXDynamicCommentListModel *)model{
|
-(void)setModel:(QXDynamicCommentListModel *)model{
|
||||||
_model = model;
|
_model = model;
|
||||||
}
|
}
|
||||||
@@ -111,6 +124,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
-(void)sendAction{
|
-(void)sendAction{
|
||||||
|
if (self.textField.text.length == 0) {
|
||||||
|
showToast(@"内容不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickSendWithText:model:)]) {
|
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickSendWithText:model:)]) {
|
||||||
[self.delegate didClickSendWithText:self.textField.text model:self.model];
|
[self.delegate didClickSendWithText:self.textField.text model:self.model];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
[self.bankAddressTextField addRoundedCornersWithRadius:11];
|
[self.bankAddressTextField addRoundedCornersWithRadius:11];
|
||||||
[self.view addSubview:self.bankAddressTextField];
|
[self.view addSubview:self.bankAddressTextField];
|
||||||
|
|
||||||
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.bankNumberTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
|
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.bankAddressTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
22
QXLive/Other/Assets.xcassets/room/room_day_task.imageset/Contents.json
vendored
Normal file
22
QXLive/Other/Assets.xcassets/room/room_day_task.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "room_day_task@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "room_day_task@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@2x.png
vendored
Normal file
BIN
QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@2x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@3x.png
vendored
Normal file
BIN
QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@3x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
@@ -5,12 +5,12 @@
|
|||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Group 7257@2x.png",
|
"filename" : "room_sound@2x.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Group 7257@3x.png",
|
"filename" : "room_sound@3x.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
BIN
QXLive/Other/Assets.xcassets/room/room_sound.imageset/room_sound@2x.png
vendored
Normal file
BIN
QXLive/Other/Assets.xcassets/room/room_sound.imageset/room_sound@2x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
QXLive/Other/Assets.xcassets/room/room_sound.imageset/room_sound@3x.png
vendored
Normal file
BIN
QXLive/Other/Assets.xcassets/room/room_sound.imageset/room_sound@3x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -37,6 +37,8 @@
|
|||||||
#import "QXRedBagRecordViewController.h"
|
#import "QXRedBagRecordViewController.h"
|
||||||
#import "QXRoomEmojiView.h"
|
#import "QXRoomEmojiView.h"
|
||||||
#import "QXGiftDisplayManager.h"
|
#import "QXGiftDisplayManager.h"
|
||||||
|
#import "QXRoomDayTaskTagView.h"
|
||||||
|
#import "QXTaskViewController.h"
|
||||||
|
|
||||||
@interface QXRoomViewController ()<
|
@interface QXRoomViewController ()<
|
||||||
QXRoomBottomViewDelegate,
|
QXRoomBottomViewDelegate,
|
||||||
@@ -85,6 +87,7 @@ QXRoomUserInfoViewDelegate
|
|||||||
@property (nonatomic,strong)QXAllRoomHourRankTagView *hourRankIconView;
|
@property (nonatomic,strong)QXAllRoomHourRankTagView *hourRankIconView;
|
||||||
|
|
||||||
@property (nonatomic,strong)QXRoomEmojiView *emojiView;
|
@property (nonatomic,strong)QXRoomEmojiView *emojiView;
|
||||||
|
@property (nonatomic,strong)QXRoomDayTaskTagView *dayTaskTagView;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation QXRoomViewController
|
@implementation QXRoomViewController
|
||||||
@@ -177,14 +180,14 @@ QXRoomUserInfoViewDelegate
|
|||||||
[self.upSeatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.upSeatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.right.mas_equalTo(-16);
|
make.right.mas_equalTo(-16);
|
||||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(56), ScaleWidth(27)));
|
make.size.mas_equalTo(CGSizeMake(ScaleWidth(56), ScaleWidth(27)));
|
||||||
make.bottom.equalTo(self.bottomView.mas_top).offset(-34);
|
make.bottom.equalTo(self.bottomView.mas_top).offset(-18);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
self.soundBtn.hidden = YES;
|
self.soundBtn.hidden = YES;
|
||||||
[self.view addSubview:self.soundBtn];
|
[self.view addSubview:self.soundBtn];
|
||||||
[self.soundBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.soundBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.centerX.equalTo(self.upSeatBtn);
|
make.centerX.equalTo(self.upSeatBtn);
|
||||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(52), ScaleWidth(52)));
|
make.size.mas_equalTo(CGSizeMake(ScaleWidth(52), ScaleWidth(25)));
|
||||||
make.bottom.equalTo(self.upSeatBtn.mas_top).offset(-12);
|
make.bottom.equalTo(self.upSeatBtn.mas_top).offset(-12);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@@ -217,6 +220,7 @@ QXRoomUserInfoViewDelegate
|
|||||||
|
|
||||||
[self.view addSubview:self.hourRankIconView];
|
[self.view addSubview:self.hourRankIconView];
|
||||||
[self.view addSubview:self.redBagTagView];
|
[self.view addSubview:self.redBagTagView];
|
||||||
|
[self.view addSubview:self.dayTaskTagView];
|
||||||
[self setupEffectView];
|
[self setupEffectView];
|
||||||
|
|
||||||
// [self.view addSubview:self.headlineView];
|
// [self.view addSubview:self.headlineView];
|
||||||
@@ -812,6 +816,7 @@ QXRoomUserInfoViewDelegate
|
|||||||
if (toPitNumber == 9) {
|
if (toPitNumber == 9) {
|
||||||
self.soundBtn.hidden = NO;
|
self.soundBtn.hidden = NO;
|
||||||
self.titleView.isCompere = YES;
|
self.titleView.isCompere = YES;
|
||||||
|
self.seatContentView.myPitNumber = toPitNumber;
|
||||||
}else{
|
}else{
|
||||||
self.soundBtn.hidden = YES;
|
self.soundBtn.hidden = YES;
|
||||||
self.titleView.isCompere = NO;
|
self.titleView.isCompere = NO;
|
||||||
@@ -2004,5 +2009,16 @@ QXRoomUserInfoViewDelegate
|
|||||||
}
|
}
|
||||||
return _emojiView;
|
return _emojiView;
|
||||||
}
|
}
|
||||||
|
-(QXRoomDayTaskTagView *)dayTaskTagView{
|
||||||
|
if (!_dayTaskTagView) {
|
||||||
|
_dayTaskTagView = [[QXRoomDayTaskTagView alloc] init];
|
||||||
|
MJWeakSelf
|
||||||
|
_dayTaskTagView.startBlock = ^{
|
||||||
|
QXTaskViewController *vc = [[QXTaskViewController alloc] init];
|
||||||
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return _dayTaskTagView;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
#import "QXBadgeButton.h"
|
#import "QXBadgeButton.h"
|
||||||
#import "AppDelegate.h"
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
@interface QXRoomBottomView()<QXDynamicCommentInputViewDelegate>
|
@interface QXRoomBottomView()<QXDynamicCommentInputViewDelegate,UIGestureRecognizerDelegate>
|
||||||
|
@property (nonatomic,strong)UIView *inputBigBgView;
|
||||||
@property (nonatomic,strong)UIView *sayBg;
|
@property (nonatomic,strong)UIView *sayBg;
|
||||||
@property (nonatomic,strong)UIButton *emojiBtn;
|
@property (nonatomic,strong)UIButton *emojiBtn;
|
||||||
@property (nonatomic,strong)UIButton *chatBtn;
|
@property (nonatomic,strong)UIButton *chatBtn;
|
||||||
@@ -405,6 +406,10 @@
|
|||||||
}
|
}
|
||||||
-(void)didResignFirstResponder{
|
-(void)didResignFirstResponder{
|
||||||
self.redpacketModel = nil;
|
self.redpacketModel = nil;
|
||||||
|
[self.inputBigBgView removeFromSuperview];
|
||||||
|
}
|
||||||
|
-(void)didBecomeFirstResponder{
|
||||||
|
[self.vc.view insertSubview:self.inputBigBgView belowSubview:self.commentView];
|
||||||
}
|
}
|
||||||
-(QXDynamicCommentInputView *)commentView{
|
-(QXDynamicCommentInputView *)commentView{
|
||||||
if (!_commentView) {
|
if (!_commentView) {
|
||||||
@@ -413,4 +418,20 @@
|
|||||||
}
|
}
|
||||||
return _commentView;
|
return _commentView;
|
||||||
}
|
}
|
||||||
|
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
|
||||||
|
return touch.view == self.inputBigBgView;
|
||||||
|
}
|
||||||
|
-(void)hideInput{
|
||||||
|
[self.commentView.textField resignFirstResponder];
|
||||||
|
}
|
||||||
|
|
||||||
|
-(UIView *)inputBigBgView{
|
||||||
|
if (!_inputBigBgView) {
|
||||||
|
_inputBigBgView = [[UIView alloc] initWithFrame:UIScreen.mainScreen.bounds];
|
||||||
|
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideInput)];
|
||||||
|
tap.delegate = self;
|
||||||
|
[_inputBigBgView addGestureRecognizer:tap];
|
||||||
|
}
|
||||||
|
return _inputBigBgView;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#define messageNameColor RGB16(0x00C8FF)
|
#define messageNameColor RGB16(0x00C8FF)
|
||||||
#define messageGiftColor RGB16(0xFFE309)
|
#define messageGiftColor RGB16(0xFFE309)
|
||||||
#define messageBubbleColor RGB16A(0x000000, 0.3)
|
#define messageBubbleColor RGB16A(0x000000, 0.3)
|
||||||
#define messageBubbleMargin 4
|
#define messageBubbleMargin 2
|
||||||
NSArray<NSValue *> *findAllOccurrencesOfString(NSString *fullString, NSString *substring) {
|
NSArray<NSValue *> *findAllOccurrencesOfString(NSString *fullString, NSString *substring) {
|
||||||
NSMutableArray<NSValue *> *occurrences = [NSMutableArray array];
|
NSMutableArray<NSValue *> *occurrences = [NSMutableArray array];
|
||||||
NSRange searchRange = NSMakeRange(0, fullString.length);
|
NSRange searchRange = NSMakeRange(0, fullString.length);
|
||||||
@@ -316,13 +316,7 @@ NSInteger maxMessageCount = 20;
|
|||||||
height = 28+19+13+8 + height;
|
height = 28+19+13+8 + height;
|
||||||
}
|
}
|
||||||
}else if (model.messageType == QXRoomChatMessageTypeGift) {
|
}else if (model.messageType == QXRoomChatMessageTypeGift) {
|
||||||
// if ([model.FromUserInfo.chat_bubble isExist]) {
|
height = [model.text heightForFont:[UIFont systemFontOfSize:12] width:ScaleWidth(280)-16-8-8*2] + 12+4+1;
|
||||||
// height = [model.text heightForFont:[UIFont systemFontOfSize:14] width:ScaleWidth(280)-16*2-8];
|
|
||||||
// height = 16*2 + height+1;
|
|
||||||
// }else{
|
|
||||||
height = [model.text heightForFont:[UIFont systemFontOfSize:14] width:ScaleWidth(280)-16*2-8];
|
|
||||||
height = 8*2+messageBubbleMargin*2 + height+1;
|
|
||||||
// }
|
|
||||||
}else if(model.messageType == QXRoomChatMessageTypeEmoji){
|
}else if(model.messageType == QXRoomChatMessageTypeEmoji){
|
||||||
if ([model.FromUserInfo.chat_bubble isExist]) {
|
if ([model.FromUserInfo.chat_bubble isExist]) {
|
||||||
height = 28+19+13+16 + 40;
|
height = 28+19+13+16 + 40;
|
||||||
@@ -330,7 +324,7 @@ NSInteger maxMessageCount = 20;
|
|||||||
height = 28+19+13+8 + 40;
|
height = 28+19+13+8 + 40;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
height = [model.text heightForFont:[UIFont systemFontOfSize:14] width:ScaleWidth(280)-16-8-8*2] + 12+16+1;
|
height = [model.text heightForFont:[UIFont systemFontOfSize:12] width:ScaleWidth(280)-16-8-8*2] + 12+4+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return height;
|
return height;
|
||||||
@@ -487,6 +481,7 @@ NSInteger maxMessageCount = 20;
|
|||||||
-(void)initSubviews{
|
-(void)initSubviews{
|
||||||
self.bgView = [[UIView alloc] init];
|
self.bgView = [[UIView alloc] init];
|
||||||
[self.contentView addSubview:self.bgView];
|
[self.contentView addSubview:self.bgView];
|
||||||
|
[self.bgView addRoundedCornersWithRadius:8];
|
||||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.mas_equalTo(16);
|
make.left.mas_equalTo(16);
|
||||||
make.right.mas_equalTo(0);
|
make.right.mas_equalTo(0);
|
||||||
@@ -501,7 +496,9 @@ NSInteger maxMessageCount = 20;
|
|||||||
self.bubbleImageView.backgroundColor = messageBubbleColor;
|
self.bubbleImageView.backgroundColor = messageBubbleColor;
|
||||||
[self.bgView addSubview:self.bubbleImageView];
|
[self.bgView addSubview:self.bubbleImageView];
|
||||||
[self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.edges.equalTo(self.bgView);
|
make.left.right.equalTo(self.bgView);
|
||||||
|
make.top.mas_equalTo(-4);
|
||||||
|
make.bottom.mas_equalTo(4);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
self.headerImageView = [[UIImageView alloc] init];
|
self.headerImageView = [[UIImageView alloc] init];
|
||||||
@@ -601,7 +598,7 @@ NSInteger maxMessageCount = 20;
|
|||||||
make.top.mas_equalTo(19);
|
make.top.mas_equalTo(19);
|
||||||
}];
|
}];
|
||||||
}else{
|
}else{
|
||||||
self.bgView.backgroundColor = UIColor.clearColor;
|
self.bgView.backgroundColor = messageBubbleColor;
|
||||||
[self.bgView mas_updateConstraints:^(MASConstraintMaker *make) {
|
[self.bgView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.mas_equalTo(16);
|
make.left.mas_equalTo(16);
|
||||||
make.right.mas_equalTo(-8);
|
make.right.mas_equalTo(-8);
|
||||||
@@ -613,7 +610,7 @@ NSInteger maxMessageCount = 20;
|
|||||||
make.top.mas_equalTo(11);
|
make.top.mas_equalTo(11);
|
||||||
}];
|
}];
|
||||||
self.bubbleImageView.image = nil;
|
self.bubbleImageView.image = nil;
|
||||||
self.bubbleImageView.backgroundColor = messageBubbleColor;
|
self.bubbleImageView.backgroundColor = UIColor.clearColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-(NSMutableArray *)iconViewArray{
|
-(NSMutableArray *)iconViewArray{
|
||||||
@@ -758,7 +755,7 @@ NSInteger maxMessageCount = 20;
|
|||||||
|
|
||||||
self.titleLabel = [[UILabel alloc] init];
|
self.titleLabel = [[UILabel alloc] init];
|
||||||
self.titleLabel.textColor = [UIColor whiteColor];
|
self.titleLabel.textColor = [UIColor whiteColor];
|
||||||
self.titleLabel.font = [UIFont systemFontOfSize:14];
|
self.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||||
self.titleLabel.numberOfLines = 0;
|
self.titleLabel.numberOfLines = 0;
|
||||||
[self.bgView addSubview:self.titleLabel];
|
[self.bgView addSubview:self.titleLabel];
|
||||||
// [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
// [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
@@ -768,8 +765,8 @@ NSInteger maxMessageCount = 20;
|
|||||||
// }];
|
// }];
|
||||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.bgView).offset(8);
|
make.left.equalTo(self.bgView).offset(8);
|
||||||
make.top.mas_equalTo(8);
|
make.top.mas_equalTo(2);
|
||||||
make.bottom.mas_equalTo(-8);
|
make.bottom.mas_equalTo(-2);
|
||||||
make.right.mas_equalTo(-8);
|
make.right.mas_equalTo(-8);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@@ -806,6 +803,10 @@ NSInteger maxMessageCount = 20;
|
|||||||
// [self.iconViewArray addObject:iconImageView];
|
// [self.iconViewArray addObject:iconImageView];
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
-(void)layoutSubviews{
|
||||||
|
[super layoutSubviews];
|
||||||
|
[self.bgView addRoundedCornersWithRadius:self.bgView.height/2];
|
||||||
}
|
}
|
||||||
-(void)loadBubble{
|
-(void)loadBubble{
|
||||||
// if ([self.message.FromUserInfo.chat_bubble isExist]) {
|
// if ([self.message.FromUserInfo.chat_bubble isExist]) {
|
||||||
@@ -937,7 +938,9 @@ NSInteger maxMessageCount = 20;
|
|||||||
self.bubbleImageView.backgroundColor = messageBubbleColor;
|
self.bubbleImageView.backgroundColor = messageBubbleColor;
|
||||||
[self.bgView addSubview:self.bubbleImageView];
|
[self.bgView addSubview:self.bubbleImageView];
|
||||||
[self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.edges.equalTo(self.bgView);
|
make.left.right.equalTo(self.bgView);
|
||||||
|
make.top.mas_equalTo(-4);
|
||||||
|
make.bottom.mas_equalTo(4);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
self.headerImageView = [[UIImageView alloc] init];
|
self.headerImageView = [[UIImageView alloc] init];
|
||||||
@@ -1077,7 +1080,14 @@ NSInteger maxMessageCount = 20;
|
|||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
-(void)layoutSubviews{
|
||||||
|
[super layoutSubviews];
|
||||||
|
if (self.message.messageType == QXRoomChatMessageTypeNotice) {
|
||||||
|
[self.bgView addRoundedCornersWithRadius:8];
|
||||||
|
}else{
|
||||||
|
[self.bgView addRoundedCornersWithRadius:self.bgView.height/2];
|
||||||
|
}
|
||||||
|
}
|
||||||
-(void)setMessage:(QXRoomChatListModel *)message{
|
-(void)setMessage:(QXRoomChatListModel *)message{
|
||||||
_message = message;
|
_message = message;
|
||||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
|
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:message.text];
|
||||||
@@ -1115,7 +1125,7 @@ NSInteger maxMessageCount = 20;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.messageType == QXRoomChatMessageTypeNotice) {
|
if (message.messageType == QXRoomChatMessageTypeNotice) {
|
||||||
[attr yy_setColor:messageNameColor range:NSMakeRange(0, attr.length)];
|
[attr yy_setColor:messageNoticeColor range:NSMakeRange(0, attr.length)];
|
||||||
}
|
}
|
||||||
self.titleLabel.attributedText = attr;
|
self.titleLabel.attributedText = attr;
|
||||||
}
|
}
|
||||||
@@ -1136,13 +1146,13 @@ NSInteger maxMessageCount = 20;
|
|||||||
self.titleLabel = [[UILabel alloc] init];
|
self.titleLabel = [[UILabel alloc] init];
|
||||||
// self.titleLabel.textColor = RGB16(0XD1A9FE);
|
// self.titleLabel.textColor = RGB16(0XD1A9FE);
|
||||||
self.titleLabel.textColor = UIColor.whiteColor;
|
self.titleLabel.textColor = UIColor.whiteColor;
|
||||||
self.titleLabel.font = [UIFont systemFontOfSize:14];
|
self.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||||
self.titleLabel.numberOfLines = 0;
|
self.titleLabel.numberOfLines = 0;
|
||||||
[self.bgView addSubview:self.titleLabel];
|
[self.bgView addSubview:self.titleLabel];
|
||||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.bgView).offset(8);
|
make.left.equalTo(self.bgView).offset(8);
|
||||||
make.top.mas_equalTo(8);
|
make.top.mas_equalTo(2);
|
||||||
make.bottom.mas_equalTo(-8);
|
make.bottom.mas_equalTo(-2);
|
||||||
make.right.mas_equalTo(-8);
|
make.right.mas_equalTo(-8);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|||||||
16
QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.h
Normal file
16
QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// QXRoomDayTaskTagView.h
|
||||||
|
// QXLive
|
||||||
|
//
|
||||||
|
// Created by 启星 on 2025/10/27.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface QXRoomDayTaskTagView : UIView
|
||||||
|
@property (nonatomic,copy)void(^startBlock)(void);
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
64
QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.m
Normal file
64
QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.m
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
//
|
||||||
|
// QXRoomDayTaskTagView.m
|
||||||
|
// QXLive
|
||||||
|
//
|
||||||
|
// Created by 启星 on 2025/10/27.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "QXRoomDayTaskTagView.h"
|
||||||
|
@interface QXRoomDayTaskTagView()
|
||||||
|
@property (nonatomic,strong)UIImageView *imageView;
|
||||||
|
@property (nonatomic,strong)UILabel *timeLabel;
|
||||||
|
@property (nonatomic,strong)UIButton *btn;
|
||||||
|
@end
|
||||||
|
@implementation QXRoomDayTaskTagView
|
||||||
|
|
||||||
|
- (instancetype)init
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
if (self) {
|
||||||
|
self.frame = CGRectMake(SCREEN_WIDTH-80, SCREEN_HEIGHT-330, 80, 60);
|
||||||
|
[self initSubviews];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)initSubviews{
|
||||||
|
self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_day_task"]];
|
||||||
|
self.imageView.frame = CGRectMake(0, 0, 80, 60);
|
||||||
|
[self addSubview:self.imageView];
|
||||||
|
|
||||||
|
self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.imageView.bottom, self.width, 20)];
|
||||||
|
self.timeLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
|
self.timeLabel.font = [UIFont systemFontOfSize:12];
|
||||||
|
self.timeLabel.textColor = RGB16(0xFFEBBD);
|
||||||
|
[self addSubview:self.timeLabel];
|
||||||
|
self.btn = [[UIButton alloc] initWithFrame:self.bounds];
|
||||||
|
[self.btn addTarget:self action:@selector(btnClick) forControlEvents:(UIControlEventTouchUpInside)];
|
||||||
|
[self addSubview:self.btn];
|
||||||
|
|
||||||
|
UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
|
||||||
|
[self addGestureRecognizer:panRecognizer];
|
||||||
|
}
|
||||||
|
-(void)btnClick{
|
||||||
|
if (self.startBlock) {
|
||||||
|
self.startBlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-(void)handlePan:(UIPanGestureRecognizer*)recognizer{
|
||||||
|
if (recognizer.state == UIGestureRecognizerStateEnded) {
|
||||||
|
NSLog(@"拖动结束");
|
||||||
|
}
|
||||||
|
CGPoint translation = [recognizer translationInView:self.viewController.view];
|
||||||
|
CGPoint panCenter = CGPointMake(recognizer.view.center.x + translation.x,
|
||||||
|
recognizer.view.center.y + translation.y);
|
||||||
|
if (panCenter.y < kSafeAreaTop || panCenter.y> SCREEN_HEIGHT-kSafeAreaBottom) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
recognizer.view.center = CGPointMake(SCREEN_WIDTH-ScaleWidth(80)/2,
|
||||||
|
recognizer.view.center.y + translation.y);
|
||||||
|
[recognizer setTranslation:CGPointZero inView:self.viewController.view];
|
||||||
|
}
|
||||||
|
@end
|
||||||
@@ -40,10 +40,10 @@
|
|||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="王富贵" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SNA-M2-7Y8">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="王富贵" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SNA-M2-7Y8">
|
||||||
<rect key="frame" x="74" y="85.666666666666671" width="90" height="18"/>
|
<rect key="frame" x="74" y="85.666666666666671" width="200" height="18"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="height" constant="18" id="XKi-Bc-Kyd"/>
|
<constraint firstAttribute="height" constant="18" id="XKi-Bc-Kyd"/>
|
||||||
<constraint firstAttribute="width" constant="90" id="cZF-LW-Eez"/>
|
<constraint firstAttribute="width" constant="200" id="cZF-LW-Eez"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||||
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wAY-Bl-81T">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wAY-Bl-81T">
|
||||||
<rect key="frame" x="174" y="94.666666666666671" width="169" height="0.0"/>
|
<rect key="frame" x="284" y="94.666666666666671" width="59" height="0.0"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||||
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
|
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
self.frame = CGRectMake(SCREEN_WIDTH-80, SCREEN_HEIGHT-250, 80, 100);
|
self.frame = CGRectMake(SCREEN_WIDTH-80, SCREEN_HEIGHT-220, 80, 100);
|
||||||
[self initSubviews];
|
[self initSubviews];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
Reference in New Issue
Block a user