| 类名 | 类描述 |
|---|---|
| VHallGiftObject | 礼物类 |
| VHWebinarBaseInfo | 活动基础信息 |
| 属性 | 属性描述 |
|---|---|
| delegate | 代理 |
| 方法 | 方法描述 |
|---|---|
| webinarUsingGiftListWithRoomId | 观看端_获取活动使用的礼物列表 |
| sendGiftWithRoomId | 观看端_发送礼物给主持人 |
| permissionsCheckWithWebinarId | 获取礼物配置开关 |
| 方法 | 方法描述 |
|---|---|
| vhGifttoModel | 收到礼物 |
+ (void)webinarUsingGiftListWithRoomId:(NSString *)roomId
complete:(void(^)(NSArray <VHallGiftListItem *> *giftList, NSError *error))complete;| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| roomId | 是 | lss_xxxxxx | 房间 id |
| giftItem | 接口请求成功的返回参数 | 礼物列表 |
| 参数名称 | 备注 |
|---|---|
| giftId | 礼物 id |
| image_url | 礼物图片 |
| name | 礼物名称 |
| price | 礼物价格 |
| source_status | 来源类型:0 web 1 app |
| source_type | 0 系统礼物 1 自定义礼物 |
[VHallGiftObject webinarUsingGiftListWithRoomId:self.webinarInfo.webinarInfoData.interact.room_id complete:^(NSArray<VHallGiftListItem *> * _Nonnull giftList, NSError * _Nonnull error) {
@strongify(self);
if (giftList) {
}
if (error) {
}
}];+ (void)sendGiftWithRoomId:(NSString *)roomId
channel:(NSString *)channel
service_code:(NSString *)service_code
giftItem:(VHallGiftListItem *)giftItem
complete:(void(^)(VHallSendGiftModel *sendGiftModel, NSError *error))complete;| 参数名称 | 是否必须 | 示例 | 备注 |
|---|---|---|---|
| roomId | 是 | lss_xxxxxx | 房间 id |
| channel | 是 | lss_xxxxxx | 支付渠道 "ALIPAY":支付宝相关的 "WEIXIN":微信相关的 |
| service_code | 是 | lss_xxxxxx | 支付方式 "QR_PAY":支付宝二维码支付 "H5_PAY":支付宝移动支付 "CASHIER":支付宝收银台支付 "QR_PAY":微信二维码支付 "QR_PAY":微信移动浏览器支付 "JSAPI":微信内置支付 |
| giftItem | 是 | giftItem | 礼物数据模型(礼物列表获取) |
| sendGiftModel | 接口请求成功的返回参数 | 发送成功返回的数据详情 |
| 参数名称 | 备注 |
|---|---|
| source_type | 0 系统礼物 1 自定义礼物 |
| gift_user_id | 赠送礼物者用户 ID |
| gift_user_avatar | 赠送礼物者用户头像 |
| gift_id | 礼物 ID |
| gift_user_name | 赠送礼物者用户名 |
| name | 礼物名称 |
| source_id | 房间 ID |
| gift_user_nickname | 赠送礼物者昵称 |
| gift_user_phone | 赠送礼物者用户手机号 |
| source_status | 来源类型:0 web 1 app |
| pay_status | 礼物支付状态:0 等待支付 1 支付成功 2 支付失败 |
| trade_no | 礼物订单号 |
| creator_id | 礼物创建者 ID |
| receiver_id | 礼物接收者 ID |
| image_url | 礼物图片地址 |
| price | 礼物价格 |
VHallGiftListItem * giftItem = self.dataSource[indexPath.row];
[VHallGiftObject sendGiftWithRoomId:self.webinarInfo.webinarInfoData.interact.room_id channel:@"WEIXIN" service_code:@"QR_PAY" giftItem:giftItem complete:^(VHallSendGiftModel * _Nonnull sendGiftModel, NSError * _Nonnull error) {
if (sendGiftModel) {
}
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.hide_gifts"] boolValue];
} failure:^(NSError * _Nonnull error) {
}];- (void)vhGifttoModel:(VHallGiftModel *)model;