Commit bf1e61e0 by suolong

Merge branch 'feature/7840付费房' of http://git.yabolive.net:88/pidan/FuSiLive into feature/7840付费房

parents 96373ac8 131a2c3a
...@@ -380,11 +380,18 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) { ...@@ -380,11 +380,18 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
// 准备上报的材料 // 准备上报的材料
NSMutableDictionary *reqDataJSON = [[NSMutableDictionary alloc] initWithDictionary:[transmissionContent copy]]; NSMutableDictionary *reqDataJSON = [[NSMutableDictionary alloc] initWithDictionary:[transmissionContent copy]];
reqDataJSON[@"data"][@"title"] = notificontent.title ?: @""; id dataValue = reqDataJSON[@"data"];
NSMutableDictionary *dataDict = nil;
if ([reqDataJSON[@"data"][@"text"] stringValue].length <= 0) { if (dataValue != nil && [dataValue isKindOfClass:[NSDictionary class]]) {
reqDataJSON[@"data"][@"text"] = notificontent.body; dataDict = [[NSMutableDictionary alloc] initWithDictionary:(NSDictionary *)dataValue];
} else {
dataDict = [[NSMutableDictionary alloc] init];
} }
reqDataJSON[@"data"] = dataDict;
dataDict[@"title"] = notificontent.title ?: @"";
dataDict[@"text"] = notificontent.body ?: @"";
if (isChatNotification == NO) { if (isChatNotification == NO) {
// 个推打开的,增加一个media // 个推打开的,增加一个media
...@@ -393,7 +400,9 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) { ...@@ -393,7 +400,9 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
if (grinfo != nil && [grinfo isKindOfClass:[NSArray class]] && [grinfo count] > 0) { if (grinfo != nil && [grinfo isKindOfClass:[NSArray class]] && [grinfo count] > 0) {
NSDictionary *grinfoFirst = [grinfo firstObject]; NSDictionary *grinfoFirst = [grinfo firstObject];
NSString *grinfoUrl = [grinfoFirst[@"url"] stringValue]; NSString *grinfoUrl = [grinfoFirst[@"url"] stringValue];
reqDataJSON[@"data"][@"media"] = grinfoUrl; if (grinfoUrl.length > 0) {
dataDict[@"media"] = grinfoUrl;
}
} }
} }
// 2. 转换为 JSON Data // 2. 转换为 JSON Data
......
...@@ -35,8 +35,9 @@ ...@@ -35,8 +35,9 @@
- (void)fus_loadDataSucceed:(void(^)(FUSContributeListModel *listModel, NSArray *ranklist))succeed - (void)fus_loadDataSucceed:(void(^)(FUSContributeListModel *listModel, NSArray *ranklist))succeed
failedHandle:(void(^)(NSString *msg, NSInteger code))failedHandler { failedHandle:(void(^)(NSString *msg, NSInteger code))failedHandler {
NSString *roomId = FUSLiveHelper.shareInstance.roomInfoModel.roomId ?: @"";
NSDictionary *params = @{ NSDictionary *params = @{
@"roomId":FUSLiveHelper.shareInstance.roomInfoModel.roomId, @"roomId": roomId,
@"type":@(self.type), @"type":@(self.type),
@"page":@(self.page) @"page":@(self.page)
}; };
...@@ -44,10 +45,15 @@ ...@@ -44,10 +45,15 @@
self.page = [dataDict[@"page"] integerValue]; self.page = [dataDict[@"page"] integerValue];
NSMutableArray *rankList = [NSMutableArray array]; NSMutableArray *rankList = [NSMutableArray array];
for (NSDictionary *user in dataDict[@"ranklist"]) { NSArray *ranklistArray = [dataDict[@"ranklist"] isKindOfClass:NSArray.class] ? dataDict[@"ranklist"] : @[];
for (NSDictionary *user in ranklistArray) {
if ([user isKindOfClass:NSDictionary.class]) {
FUSContributeModel *model = [FUSContributeModel fus_modelWithDict:user]; FUSContributeModel *model = [FUSContributeModel fus_modelWithDict:user];
if (model) {
[rankList addObject:model]; [rankList addObject:model];
} }
}
}
if (self.page == 1) { if (self.page == 1) {
[self.ranklist removeAllObjects]; [self.ranklist removeAllObjects];
......
...@@ -193,7 +193,7 @@ import RxCocoa ...@@ -193,7 +193,7 @@ import RxCocoa
// 或者数据等于0之外的,都是true // 或者数据等于0之外的,都是true
if type == .chatScreenButton { if type == .chatScreenButton {
// 公屏按钮有次数 // 公屏按钮有次数
let speechGuidance = FUSCacheDataShare.shareStore().settingInitDataModel.fus_speechGuidance if let speechGuidance = FUSCacheDataShare.shareStore().settingInitDataModel?.fus_speechGuidance {
if speechGuidance != -1 { if speechGuidance != -1 {
let showTime = fus_getShowTimes(type: type) let showTime = fus_getShowTimes(type: type)
if showTime >= speechGuidance{ if showTime >= speechGuidance{
...@@ -201,6 +201,10 @@ import RxCocoa ...@@ -201,6 +201,10 @@ import RxCocoa
} }
} }
} }
else {
return false
}
}
return true return true
} }
......
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