加入粉丝团送礼接口修改,粉丝团入口更新

This commit is contained in:
chenguilong
2022-04-15 14:12:33 +08:00
parent 4a833a4104
commit f81be36d34
6 changed files with 64 additions and 5 deletions

View File

@@ -46,6 +46,28 @@ NS_ASSUME_NONNULL_BEGIN
roomUid:(NSString *)roomUid
msg:(NSString *)msg
uid:(NSString *)uid;
/// 送粉丝团入团礼物的接口
/// @param completion 完成
/// @param targetUids 送给谁的
/// @param giftNum 送的个数
/// @param sendType 送的类型
/// @param giftId 礼物的id
/// @param giftSource 礼物的来源
/// @param giftType 礼物的类型
/// @param roomUid 房间的ID
/// @param msg 喊话的
/// @param uid 用户的id
+ (void)requestSendAnchorFansGift:(HttpRequestHelperCompletion)completion
targetUids:(NSString *)targetUids
giftNum:(NSString *)giftNum
sendType:(NSString *)sendType
giftId:(NSString *)giftId
giftSource:(NSString *)giftSource
giftType:(NSString *)giftType
roomUid:(NSString *)roomUid
msg:(NSString *)msg
uid:(NSString *)uid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -50,4 +50,28 @@
[self makeRequest:method method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, targetUids, giftNum, sendType, giftId, giftSource, giftType, roomUid, msg, uid, nil];
}
///
/// @param completion
/// @param targetUids
/// @param giftNum
/// @param sendType
/// @param giftId id
/// @param giftSource
/// @param giftType
/// @param roomUid ID
/// @param msg
/// @param uid id
+ (void)requestSendAnchorFansGift:(HttpRequestHelperCompletion)completion
targetUids:(NSString *)targetUids
giftNum:(NSString *)giftNum
sendType:(NSString *)sendType
giftId:(NSString *)giftId
giftSource:(NSString *)giftSource
giftType:(NSString *)giftType
roomUid:(NSString *)roomUid
msg:(NSString *)msg
uid:(NSString *)uid {
[self makeRequest:@"anchorFansTeam/sendJoinTeamGift" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, targetUids, giftNum, sendType, giftId, giftSource, giftType, roomUid, msg, uid, nil];
}
@end

View File

@@ -469,7 +469,7 @@
- (UIView *)bottomView {
if (!_bottomView) {
_bottomView = [[UIStackView alloc] init];
_bottomView = [[UIView alloc] init];
_bottomView.backgroundColor = [UIColor whiteColor];
}
return _bottomView;

View File

@@ -99,6 +99,14 @@
}];
} else {
self.titleLabel.text = @"加入我的粉丝团吧~";
self.iconImageView.image = [UIImage imageNamed:@"anchor_fansTeam_entrance_icon"];
[self.iconImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self);
make.width.height.mas_equalTo(37);
}];
[self.bgImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.iconImageView.mas_right).mas_offset(-8);
}];
}
} else {
self.titleLabel.text = @"该主播暂未开通粉丝团";

View File

@@ -307,8 +307,13 @@
- (void)joinButtonAction:(UIButton *)button {
XPAnchorFansPrivilegeModel *joinModel = self.model.privilegeConfigVos[2];
[Api requestSendGift:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
[self dismissViewControllerAnimated:YES completion:nil];
[Api requestSendAnchorFansGift:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
[self showSuccessToast:@"加入粉丝团成功"];
[self dismissViewControllerAnimated:YES completion:nil];
} else {
[self showErrorToast:msg];
}
} targetUids:[NSString stringWithFormat:@"%lld", self.model.teamUid] giftNum:@"1" sendType:@"1" giftId:[NSString stringWithFormat:@"%ld", joinModel.normalId] giftSource:@"1" giftType:@"" roomUid:self.roomUid msg:@"" uid:[[AccountInfoStorage instance] getUid]];
}
@@ -385,7 +390,7 @@
- (UIView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView = [[UIView alloc] init];
_stackView.backgroundColor = [UIColor whiteColor];
_stackView.layer.cornerRadius = 14;
_stackView.layer.masksToBounds = YES;

View File

@@ -835,7 +835,7 @@
} else if ([attachment.data[@"uid"] isKindOfClass:[NSString class]]) {
uid = attachment.data[@"uid"];
}
if ([uid isEqualToString:[AccountInfoStorage instance].getUid] || [uid isEqualToString:roomUid]) {
if ([uid isEqualToString:[AccountInfoStorage instance].getUid] || [[AccountInfoStorage instance].getUid isEqualToString:roomUid]) {
[Api requestInRoomFansTeam:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
XPAnchorFansRelationModel *model = [XPAnchorFansRelationModel modelWithJSON:data.data];
[self updateFansTeamEntranceView:model];