This commit is contained in:
启星
2026-01-14 20:36:58 +08:00
parent 705d891c51
commit 5548f5d6a5
64 changed files with 482 additions and 103 deletions

View File

@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomViewController (Bar)
-(void)createCoinView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -6,8 +6,74 @@
//
#import "QXRoomViewController+Bar.h"
#import "QXRechargeViewcController.h"
#import "QXMineNetwork.h"
@implementation QXRoomViewController (Bar)
-(void)createCoinView{
self.coinView = [[UIView alloc] init];
self.coinView.backgroundColor = RGB16A(0x000000, 0.4);
[self.view addSubview:self.coinView];
[self.coinView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.bottomView.mas_top).offset(-20);
make.right.mas_equalTo(-5);
make.width.mas_equalTo(100);
make.height.mas_equalTo(50);
}];
[self.coinView addRoundedCornersWithRadius:5];
self.coinImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wallet_corn"]];
[self.coinView addSubview:self.coinImageView];
[self.coinImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(5);
make.height.width.mas_equalTo(25);
make.centerY.equalTo(self.coinView);
}];
self.coinLabel = [[UILabel alloc] init];
self.coinLabel.textColor = RGB16(0xffffff);
self.coinLabel.text = @"0";
self.coinLabel.textAlignment = NSTextAlignmentCenter;
self.coinLabel.font = [UIFont systemFontOfSize:10];
[self.coinView addSubview:self.coinLabel];
[self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.coinImageView.mas_right).offset(2);
make.right.equalTo(self.coinView.mas_right).offset(-5);
make.top.equalTo(self.coinView).offset(10);
}];
self.rechargeBtn = [[UIButton alloc] init];
[self.rechargeBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
[self.rechargeBtn setTitle:@"充值" forState:(UIControlStateNormal)];
self.rechargeBtn.titleLabel.font = [UIFont systemFontOfSize:12];
[self.coinView addSubview:self.rechargeBtn];
[self.rechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.coinLabel);
make.right.equalTo(self.coinView).offset(-5);
make.bottom.equalTo(self.coinView).offset(-5);
make.height.mas_equalTo(20);
}];
UIButton *button = [[UIButton alloc] init];
[button addTarget:self action:@selector(rechargeAction) forControlEvents:(UIControlEventTouchUpInside)];;
[self.coinView addSubview:button];
[button mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.coinView);
}];
MJWeakSelf
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
weakSelf.coinLabel.text = coin;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)rechargeAction{
QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
-(void)barRoomSeductionEffectWithModel:(QXRoomChatListModel*)model{
[self.seatContentView barRoomSeductionEffectWithModel:model];
}

View File

@@ -63,6 +63,12 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QXMeetActivityView *meetView;
/// 任务待领取数量
@property (nonatomic,strong)NSString *taskWaitDrawNum;
@property (nonatomic,strong)UIView *coinView;
@property (nonatomic,strong)UIImageView *coinImageView;
@property (nonatomic,strong)UILabel *coinLabel;
@property (nonatomic,strong)UIButton *rechargeBtn;
-(void)configBottomTools;
-(void)stopHWDMP4;
-(void)playHWDMP4;

View File

@@ -41,6 +41,7 @@
#import "QXRoomViewController+Singer.h"
#import "QXRoomViewController+Sign.h"
#import "QXDrifNobilityJoinRoomView.h"
#import "QXRoomViewController+Bar.h"
@interface QXRoomViewController ()<
QXRoomBottomViewDelegate,
@@ -479,6 +480,7 @@ QXUpSeatViewDelegate
make.top.equalTo(self.seatContentView.mas_bottom);
make.width.mas_equalTo(ScaleWidth(280));
}];
[self createCoinView];
}else{
self.bottomView.isCabinRoom = YES;
//

View File

@@ -120,7 +120,7 @@
// [self.eventSwitch setOn:self.isOn animated:YES];
// }];
//
[QXMineNetwork noAgreePKInvite:isOn?@"1":@"2" room_id:self.roomId successBlock:^(NSString * _Nonnull token) {
[QXMineNetwork noAgreePKInvite:isOn?@"2":@"1" room_id:self.roomId successBlock:^(NSString * _Nonnull token) {
if (isOn) {
[sender setOn:YES animated:YES];
}else{

View File

@@ -381,6 +381,7 @@
-(void)cabinAction{
QXRoomBarCabinListView *cabinListView = [[QXRoomBarCabinListView alloc] init];
cabinListView.roomId = self.roomModel.room_info.room_id;
[cabinListView showInView:self.viewController.view];
}

View File

@@ -422,7 +422,7 @@
-(void)setTimeModel:(QXRoomRelationModel *)timeModel{
_timeModel = timeModel;
[self.selectedBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateSelected)];
[self.selectedBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
[self.selectedBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.selectedBtn setTitle:timeModel.name forState:(UIControlStateNormal)];
self.selectedBtn.layer.borderColor = RGB16(0xF1F2F3).CGColor;
self.selectedBtn.layer.borderWidth = 1;

View File

@@ -55,7 +55,7 @@
CGFloat viewHeight = 40;
CGFloat spacing = 10;
CGFloat topMargin = 400;
CGFloat topMargin = 460;
CGFloat width = 290;
for (int i = 0; i < 3; i++) {

View File

@@ -169,7 +169,7 @@
showToast(@"抢头条成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
[weakSelf hide];
// [weakSelf hide];
showToast(msg);
}];
}else{

View File

@@ -89,7 +89,9 @@
}];
}
-(void)setRoomId:(NSString *)roomId{
_roomId = roomId;
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{

View File

@@ -6,15 +6,22 @@
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger) {
/// 撩他
QXSeductionAlertTypeSeduction = 0,
/// 小黑屋送礼物
QXSeductionAlertTypeSendGift = 1,
}QXSeductionAlertType;
NS_ASSUME_NONNULL_BEGIN
@interface QXSeductionAlertView : UIView
@property (nonatomic,copy)void(^commitBlock)(void);
@property (nonatomic,copy)void(^commitBlock)(BOOL isNoAlert);
@property (nonatomic,copy)void(^cancelBlock)(void);
@property (nonatomic,strong)QXRoomPitModel *pitModel;
@property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,strong)NSString *sexy_coin;
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,assign)QXSeductionAlertType alertType;
-(void)showInView:(UIView *)view;
-(void)hide;

View File

@@ -123,13 +123,47 @@
[attr yy_setColor:QXConfig.themeColor range:[str rangeOfString:self.sexy_coin]];
self.messageLabel.attributedText = attr;
}
- (void)setGiftModel:(QXGiftModel *)giftModel{
_giftModel = giftModel;
NSString *str = [NSString stringWithFormat:@"将送出 %@ 需要消费 %@个 金币。",giftModel.gift_name,giftModel.gift_price];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
[attr yy_setColor:QXConfig.themeColor range:[str rangeOfString:giftModel.gift_name]];
[attr yy_setColor:QXConfig.themeColor range:[str rangeOfString:giftModel.gift_price]];
self.messageLabel.attributedText = attr;
}
-(void)noShowAction{
self.noShowBtn.selected = !self.noShowBtn.selected;
[[NSUserDefaults standardUserDefaults] setBool:self.noShowBtn.isSelected forKey:kIsCloseSeductionAlert];
[[NSUserDefaults standardUserDefaults] synchronize];
switch (self.alertType) {
case QXSeductionAlertTypeSeduction:{
[[NSUserDefaults standardUserDefaults] setBool:self.noShowBtn.isSelected forKey:kIsCloseSeductionAlert];
[[NSUserDefaults standardUserDefaults] synchronize];
}
break;
case QXSeductionAlertTypeSendGift:{
}
break;
default:
break;
}
}
-(void)setAlertType:(QXSeductionAlertType)alertType{
_alertType = alertType;
switch (alertType) {
case QXSeductionAlertTypeSeduction:{
[self.noShowBtn setTitle:@" 以后不再提示" forState:(UIControlStateNormal)];
}
break;
case QXSeductionAlertTypeSendGift:{
[self.noShowBtn setTitle:@" 此交友小屋以后不再提示" forState:(UIControlStateNormal)];
}
break;
default:
break;
}
}
-(void)cancelAction{
@@ -140,14 +174,26 @@
}
-(void)commitAction{
if (self.commitBlock) {
self.commitBlock();
self.commitBlock(self.noShowBtn.selected);
}
switch (self.alertType) {
case QXSeductionAlertTypeSeduction:{
[QXMineNetwork roomSeductionWithRoomId:self.roomId to_user_id:self.pitModel.user_id type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
break;
case QXSeductionAlertTypeSendGift:{
}
break;
default:
break;
}
[self hide];
[QXMineNetwork roomSeductionWithRoomId:self.roomId to_user_id:self.pitModel.user_id type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
-(void)showInView:(UIView *)view{

View File

@@ -9,6 +9,7 @@
#import "QXMineNetwork.h"
#import "UIView+FloatingAnimation.h"
#import "QXAgoraEngine.h"
#import "QXSeductionAlertView.h"
@class QXRoomSeatBarCabinGiftView;
@interface QXRoomSeatBarCabinView()<QXRoomSeatBarCabinGiftViewDelegate>
//
@@ -46,6 +47,8 @@
@property (nonatomic,strong)QXTimer *timer;
@property (nonatomic,assign)long startTime;
@property (nonatomic,assign)BOOL isNoAlert;
@end
@implementation QXRoomSeatBarCabinView
@@ -58,6 +61,7 @@
return self;
}
-(void)initSubviews{
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(rechargeSuccess) name:noticeAlipayResult object:nil];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.text = @"房间名称";
self.titleLabel.font = [UIFont systemFontOfSize:14];
@@ -205,6 +209,9 @@
// self.audioBtn.tag = 21;
// [self.audioBtn setImage:[UIImage imageNamed:@"room_event_mute_audio_nor"] forState:(UIControlStateNormal)];
// [self.audioBtn setImage:[UIImage imageNamed:@"room_event_mute_audio_sel"] forState:(UIControlStateSelected)];
}
-(void)setRoomModel:(QXRoomModel *)roomModel{
@@ -243,6 +250,10 @@
[self getGiftList];
}
-(void)rechargeSuccess{
[self getWallet];
}
-(void)getGiftList{
MJWeakSelf
// [QXMineNetwork giftListWithLabel:@"99" roomId:self.roomModel.room_info.room_id successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
@@ -277,14 +288,36 @@
}
-(void)didSendGiftWithGiftModel:(QXGiftModel *)giftModel giftView:(QXRoomSeatBarCabinGiftView *)giftView{
if (self.isNoAlert) {
[self sendGiftNetWorkWithGiftModel:giftModel giftView:giftView];
}else{
QXSeductionAlertView *seductionView = [[QXSeductionAlertView alloc] init];
seductionView.alertType = QXSeductionAlertTypeSendGift;
seductionView.roomId = self.roomModel.room_info.room_id;
seductionView.giftModel = giftModel;
[seductionView showInView:self.viewController.view];
__weak typeof(self) weakSelf = self;
seductionView.commitBlock = ^(BOOL isNoAlert) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) return;
strongSelf.isNoAlert = isNoAlert;
[strongSelf sendGiftNetWorkWithGiftModel:giftModel giftView:giftView];
};
}
}
-(void)sendGiftNetWorkWithGiftModel:(QXGiftModel*)giftModel giftView:(QXRoomSeatBarCabinGiftView *)giftView{
NSString *to_uid = @"";
if ([self.roomModel.cp_user.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
to_uid = self.roomModel.cp_user.user_id1;
}else{
to_uid = self.roomModel.cp_user.user_id;
}
__weak typeof(self) weakSelf = self;
[QXMineNetwork roomSendGiftWithRoomId:self.roomModel.room_info.room_id gift_id:giftModel.gift_id gift_num:@"1" to_uid:to_uid heart_id:@"" type:@"1" pit_number:@"" gift_bag_id:giftModel.gift_bag successBlock:^(NSDictionary * _Nonnull dict) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) return;
[strongSelf getWallet];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
@@ -295,6 +328,17 @@
[self giftViewShow:giftView];
}];
}
-(void)getWallet{
__weak typeof(self) weakSelf = self;
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) return;
QXRoomViewController *vc = (QXRoomViewController *)strongSelf.viewController;
vc.coinLabel.text = coin;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)giftViewShow:(QXRoomSeatBarCabinGiftView*)giftView{
QXGiftModel *gift = [self randomResultGift];
@@ -420,6 +464,7 @@
_rightSeatView = nil;
}
[self stopTimer];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {

View File

@@ -296,18 +296,17 @@
-(void)everyOneFollowMe{
NSInteger count = 0;
for (int i = 0 ; i < self.seatArray.count;i++) {
for (int i = 0 ; i < 6;i++) {
id object = self.seatArray[i];
if ([object isKindOfClass:[QXRoomSeatContentView class] ]) {
QXRoomSeatContentView *contentView = (QXRoomSeatContentView*)object;
if (contentView.pitModel.user_id.longLongValue > 0 && ![contentView.pitModel.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
count++;
}
// QXRoomSeatContentView *contentView = (QXRoomSeatContentView*)object;
// if (contentView.pitModel.user_id.longLongValue > 0 && ![contentView.pitModel.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
// }
continue;
}
if ([object isKindOfClass:[QXRoomSeatBarSeatView class] ]) {
QXRoomSeatBarSeatView *contentView = (QXRoomSeatBarSeatView*)object;
if (contentView.pitModel.user_id.longLongValue > 0 && ![contentView.pitModel.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
if (contentView.contentView.pitModel.user_id.longLongValue > 0 && ![contentView.contentView.pitModel.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
count++;
}
continue;
@@ -368,6 +367,7 @@
}];
}else{
QXSeductionAlertView *seductionView = [[QXSeductionAlertView alloc] init];
seductionView.alertType = QXSeductionAlertTypeSeduction;
seductionView.roomId = self.roomModel.room_info.room_id;
seductionView.sexy_coin = self.roomModel.room_info.sexy_coin;
seductionView.pitModel = pitModel;
@@ -1042,14 +1042,15 @@
-(void)playSeductionEffectWithPlayImage:(NSString *)playImage isMute:(BOOL)isMute{
MJWeakSelf
if ([playImage hasPrefix:@"http"] || [playImage hasPrefix:@"https"]) {
[weakSelf.mp4View stopHWDMP4];
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:playImage completion:^(BOOL result, NSString * _Nonnull fileName) {
NSString *videoPath = [QXFileManager getGiftVideoPath:playImage.lastPathComponent];
weakSelf.mp4View.hidden = NO;
[weakSelf.mp4View setMute:isMute];
[weakSelf.mp4View playHWDMP4:videoPath repeatCount:1 delegate:self];
}];
// self.mp4View.hidden = NO;
// NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"zizi" ofType:@"mp4"];
// [self.mp4View setMute:isMute];
// [self.mp4View playHWDMP4:videoPath repeatCount:1 delegate:self];
}

View File

@@ -81,7 +81,7 @@
make.height.equalTo(self.noUserImageView.mas_width);
}];
[self insertSubview:self.micSvgaView belowSubview:self.headerView];
[self insertSubview:self.micSvgaView aboveSubview:self.headerView];
[self.micSvgaView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self.headerView).offset(-10);
make.right.bottom.equalTo(self.headerView).offset(10);

View File

@@ -643,6 +643,7 @@ QXRoomSeatDelegate
QXRoomPitModel *model = self.dataArray[indexPath.row];
cell.seatContentView.pitModel = model;
cell.seatContentView.delegate = self;
[cell.seatContentView stopAudioAnimation];
return cell;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{