Commit 95d8a6b4 by suolong

添加socket 通知刷新付费屋的弹窗信息

parent 91513c4b
......@@ -93,6 +93,11 @@
/// 用户截图开关变化通知
#define ROOM_CID_RECEIVE_SCREENSHOT_STATE 11035
/// 切换付费房
#define ROOM_CID_PAYROOM_SWITCH 11036
/// 付费房实时变化的业务数据推送
#define ROOM_CID_PAYROOM_REALTIME_DATA 11037
// 更新直播间互动游戏开关状态socket
#define ROOM_CID_liveInteractionGameStateDidChanged 20204
......@@ -129,4 +134,3 @@
......@@ -108,9 +108,8 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_recieveGiftChangeNotification:) name:STR(ROOM_CID_GIFT_CHANGE) object:nil];
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_recieveSomeoneEnterRoomNotification:) name:STR(ROOM_CID_SOMEBODY_JOIN) object:nil];
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_recieveSomeoneExitRoomNotification:) name:STR(ROOM_CID_EXIT) object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_receivePayRoomRealtimeDataNotification:) name:STR(ROOM_CID_PAYROOM_REALTIME_DATA) object:nil];
self.backgroundColor = UIColor.clearColor;
self.clipsToBounds = NO;
......@@ -398,6 +397,46 @@
self.incomeLabel.attributedText = [self fus_incomeLineWithValue:incomeValue];
}
- (void)fus_receivePayRoomRealtimeDataNotification:(NSNotification *)notification {
FUSSocketMessageModel *messageModel = notification.object;
if (!messageModel) {
return;
}
if (![[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] isEqualToString:[NSString stringWithFormat:@"%d", messageModel.extend1]]) {
return;
}
NSDictionary *dict = [messageModel fus_getJsonDict];
NSInteger dataType = [dict[@"dataType"] integerValue];
if (dataType <= 0) {
return;
}
if (!self.payRoomDataModel) {
self.payRoomDataModel = [[FUSPayRoomGetPayRoomDataModel alloc] init];
}
if (dataType == 1) {
NSDictionary *data = dict[@"payViewingData"];
if ([data isKindOfClass:NSDictionary.class]) {
self.payRoomDataModel.payViewingData = [FUSPayRoomPayViewingData fus_modelWithDict:data];
}
} else if (dataType == 2) {
NSDictionary *data = dict[@"previewData"];
if ([data isKindOfClass:NSDictionary.class]) {
self.payRoomDataModel.previewData = [FUSPayRoomPreviewData fus_modelWithDict:data];
}
} else if (dataType == 3) {
NSDictionary *data = dict[@"incomeData"];
if ([data isKindOfClass:NSDictionary.class]) {
self.payRoomDataModel.incomeData = [FUSPayRoomIncomeData fus_modelWithDict:data];
}
}
[self fus_refreshContentTexts];
}
//- (void)fus_recieveGiftChangeNotification:(NSNotification *)notification {
// FUSSocketMessageModel *messageModel = notification.object;
// if (![[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] isEqualToString:[NSString stringWithFormat:@"%d", messageModel.extend1]]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment