2.4.0版本发版 此commit置顶
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>9</string>
|
||||
<string>1</string>
|
||||
<key>FacebookAppID</key>
|
||||
<string>1266232494209868</string>
|
||||
<key>FacebookClientToken</key>
|
||||
|
@@ -273,18 +273,24 @@
|
||||
self.nameLabel.text = self.model.anchorNick;
|
||||
self.countLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPAnchorFansTeamViewController0"), self.model.teamNum];
|
||||
|
||||
XPAnchorFansPrivilegeModel *nameplateModel = self.model.privilegeConfigVos[0];
|
||||
for (XPAnchorFansPrivilegeModel *obj in self.model.privilegeConfigVos) {
|
||||
if(obj.type == 1){
|
||||
XPAnchorFansPrivilegeModel *nameplateModel = obj;
|
||||
self.nameplateImageView.imageUrl = nameplateModel.icon;
|
||||
self.nameplateLabel.text = nameplateModel.name;
|
||||
self.nameplateDescLabel.text = nameplateModel.desc;
|
||||
XPAnchorFansPrivilegeModel *giftModel = self.model.privilegeConfigVos[1];
|
||||
}else if(obj.type == 2){
|
||||
XPAnchorFansPrivilegeModel *giftModel = obj;
|
||||
self.giftImageView.imageUrl = giftModel.icon;
|
||||
self.giftLabel.text = giftModel.name;
|
||||
self.giftDescLabel.text = giftModel.desc;
|
||||
|
||||
XPAnchorFansPrivilegeModel *joinModel = self.model.privilegeConfigVos[2];
|
||||
}else if(obj.type == 3){
|
||||
XPAnchorFansPrivilegeModel *joinModel = obj;
|
||||
self.joinLabel.text = joinModel.name;
|
||||
self.iconImageView.imageUrl = joinModel.icon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CGFloat margin = 8;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
@@ -323,7 +329,14 @@
|
||||
|
||||
- (void)joinButtonAction:(UIButton *)button {
|
||||
button.userInteractionEnabled = NO;
|
||||
XPAnchorFansPrivilegeModel *joinModel = self.model.privilegeConfigVos[2];
|
||||
XPAnchorFansPrivilegeModel *joinModel;
|
||||
for (XPAnchorFansPrivilegeModel *obj in self.model.privilegeConfigVos) {
|
||||
if(obj.type == 3){
|
||||
joinModel = obj;
|
||||
}
|
||||
}
|
||||
if(joinModel == nil)return;
|
||||
|
||||
[Api requestSendAnchorFansGift:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
[self showSuccessToast:YMLocalizedString(@"XPAnchorFansTeamViewController1")];
|
||||
|
@@ -196,7 +196,44 @@
|
||||
[[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) {
|
||||
}];
|
||||
}
|
||||
-(void)updateNIMMicroQueues{
|
||||
RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo;
|
||||
// 获取麦位的状态,并初始化 self.micQueue 。
|
||||
[[NIMSDK sharedSDK].chatroomManager fetchChatroomInfo:[NSString stringWithFormat:@"%ld", (long)roomInfo.roomId] completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom) {
|
||||
if (error) {
|
||||
return;
|
||||
}
|
||||
NSDictionary *info = (NSDictionary *)[chatroom.ext toJSONObject];
|
||||
NSDictionary *micState = [info[@"micQueue"] toJSONObject];
|
||||
for (NSString *position in micState.allKeys) {
|
||||
MicroStateModel *state = [MicroStateModel modelWithJSON:micState[position]];
|
||||
MicroQueueModel *sequence = [self.micQueue objectForKey:position];
|
||||
sequence.microState = state;
|
||||
}
|
||||
[self microQueueUpdated: NO];
|
||||
}];
|
||||
self.hadGetQueueInfoSuccess = NO;
|
||||
// 获取麦位的用户,并初始化 self.micQueue 。
|
||||
[[NIMSDK sharedSDK].chatroomManager fetchChatroomQueue:[NSString stringWithFormat:@"%ld", (long)roomInfo.roomId] completion:^(NSError * _Nullable error, NSArray<NSDictionary<NSString *,NSString *> *> * _Nullable info) {
|
||||
if (error) return;
|
||||
BOOL ownerRTCChange = NO;
|
||||
|
||||
for (NSDictionary *item in info) {
|
||||
UserInfoModel *userInfo = [UserInfoModel modelWithJSON:item.allValues.firstObject];
|
||||
NSString *position = item.allKeys.firstObject;
|
||||
MicroQueueModel *sequence = [self.micQueue objectForKey:position];
|
||||
sequence.userInfo = userInfo;
|
||||
if (userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
ownerRTCChange = YES;
|
||||
}
|
||||
}
|
||||
[self microQueueUpdated:ownerRTCChange];
|
||||
[self.hostDelegate onMicroQueueUpdate:self.micQueue];
|
||||
self.hadGetQueueInfoSuccess = YES;
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
- (void)initGiftValue{
|
||||
RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo;
|
||||
// 获取礼物值
|
||||
@@ -502,8 +539,10 @@
|
||||
for (MicroQueueModel *sequence in self.micQueue.allValues) {
|
||||
if ([AccountInfoStorage instance].getUid.integerValue == sequence.userInfo.uid) {
|
||||
NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init];
|
||||
NSMutableDictionary *userInfo = [[NSMutableDictionary alloc]initWithDictionary:[sequence.userInfo toJSONObject]];
|
||||
[userInfo setValue:@(YES) forKey:@"isNoProhibitMic"];
|
||||
request.key = @(sequence.microState.position).stringValue;
|
||||
request.value = [sequence.userInfo toJSONString];
|
||||
request.value = [userInfo toJSONString];
|
||||
request.roomId = roomId;
|
||||
request.transient = YES;
|
||||
[[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) {
|
||||
@@ -513,7 +552,7 @@
|
||||
}
|
||||
}
|
||||
if (content.source.userId.integerValue == [AccountInfoStorage instance].getUid.integerValue){
|
||||
[self initNIMMicroQueues];
|
||||
[self updateNIMMicroQueues];
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user