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

@@ -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) {