互动-点赞
核心类
类名 | 类描述 |
---|---|
VHallLikeObject | 点赞类 |
VHWebinarBaseInfo | 活动基础信息 |
VHallLikeObject 基础属性
属性 | 属性描述 |
---|---|
delegate | 代理 |
VHallLikeObject 关键方法
方法 | 方法描述 |
---|---|
createUserLikeWithRoomId | 创建房间的用户点赞 |
getRoomLikeWithRoomId | 获取房间的点赞数量 |
permissionsCheckWithWebinarId | 获取点赞配置开关 |
VHallLikeObjectDelegate 关于文档的代理方法
方法 | 方法描述 |
---|---|
vhPraiseTotalToNum | 更新点赞总数 |
创建房间的用户点赞
+ (void)createUserLikeWithRoomId:(NSString *)roomId
num:(NSInteger)num
complete:(void(^)(NSDictionary *responseObject, NSError *error))complete;
参数名称 | 是否必须 | 示例 | 备注 |
---|---|---|---|
roomId | 是 | lss_xxxxxx | 房间 id |
num | 是 | 99 | 点赞次数,最多 500,超过 500 会强制成为 500 |
complete | 接口请求完成回调 |
[VHallLikeObject createUserLikeWithRoomId:self.moviePlayer.webinarInfo.webinarInfoData.interact.room_id num:self.likeTapCount complete:^(NSDictionary *responseObject, NSError *error) {
}];
获取房间的点赞数量
+ (void)getRoomLikeWithRoomId:(NSString *)roomId
complete:(void(^)(NSInteger total, NSError *error))complete;
参数名称 | 是否必须 | 示例 | 备注 |
---|---|---|---|
roomId | 是 | lss_xxxxxx | 房间 id |
complete | 接口请求完成回调 |
参数名称 | 备注 |
---|---|
total | 点赞数 |
[VHallLikeObject getRoomLikeWithRoomId:self.moviePlayer.webinarInfo.webinarInfoData.interact.room_id complete:^(NSInteger total, NSError *error) {
if (total) {
}
if (error) {
}
}];
获取点赞配置开关
+ (void)permissionsCheckWithWebinarId:(NSString *)webinarId
webinar_user_id:(NSString *)webinar_user_id
scene_id:(NSString *)scene_id
success:(void(^)(NSDictionary *data))success
failure:(void(^)(NSError *error))failure;
参数名 | 是否必须 | 示例 | 备注 |
---|---|---|---|
webinarId | 是 | 123456678 | 活动 id 1、传活动 id 时,返回活动 id+活动创建者相关的配置项信息 2、不传活动 id 时,获取登录用户的配置项信息 |
webinar_user_id | 是 | 123456 | 活动发起者用户 id,有 webinar_id 时,必传 |
scene_id | 是 | 1 | 使用场景:1 权限检测(默认 1) 2 获取配置项选中值 |
[VHWebinarBaseInfo permissionsCheckWithWebinarId:self.moviePlayer.webinarInfo.webinarId webinar_user_id:self.moviePlayer.webinarInfo.author_userId scene_id:@"1" success:^(NSDictionary * _Nonnull data) {
NSString * permissions = data[@"permissions"];
// 字符串转json
NSDictionary * permissionsDic = [UIModelTools objectWithJsonString:permissions];
// 点赞是否显示
self.likeBtn.hidden = ![permissionsDic[@"ui.watch_hide_like"] boolValue];
} failure:^(NSError * _Nonnull error) {
}];
更新点赞总数
- (void)vhPraiseTotalToNum:(NSInteger)num;
参数名称 | 备注 |
---|---|
num | 点赞总数 |
修改于 2025-05-27 11:59:31