选中的那个人在坑位上的时候展示用户卡片
This commit is contained in:
@@ -159,7 +159,6 @@
|
||||
E824546426F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E824546326F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.m */; };
|
||||
E824546626F5FF6000BE8163 /* XPMineResetPayPasswordProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E824546526F5FF5100BE8163 /* XPMineResetPayPasswordProtocol.h */; };
|
||||
E82EE0F8272FDDFA00D15DC1 /* UserPrivacyView.m in Sources */ = {isa = PBXBuildFile; fileRef = E82EE0F7272FDDFA00D15DC1 /* UserPrivacyView.m */; };
|
||||
E833ED0A274F375100A2463B /* XPUserCardBaseView.m in Sources */ = {isa = PBXBuildFile; fileRef = E833ED09274F375100A2463B /* XPUserCardBaseView.m */; };
|
||||
E833ED0D274FAD1C00A2463B /* XPKickUserModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E833ED0C274FAD1C00A2463B /* XPKickUserModel.m */; };
|
||||
E83DB47A27462C4500D8CBD1 /* XPGiftBigPrizeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47927462C4500D8CBD1 /* XPGiftBigPrizeModel.m */; };
|
||||
E83DB47D2746372300D8CBD1 /* XPRoomGiftBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E83DB47C2746372300D8CBD1 /* XPRoomGiftBannerView.m */; };
|
||||
@@ -209,6 +208,8 @@
|
||||
E890BC07273CF1800007C46B /* XPGiftCountCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E890BC06273CF1800007C46B /* XPGiftCountCollectionViewCell.m */; };
|
||||
E890BC0D273D09A50007C46B /* XPGiftCountView.m in Sources */ = {isa = PBXBuildFile; fileRef = E890BC0C273D09A50007C46B /* XPGiftCountView.m */; };
|
||||
E890BC10273D23F00007C46B /* GiftInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E890BC0F273D23F00007C46B /* GiftInfoModel.m */; };
|
||||
E899C68927508F4E00E189E5 /* XPUserCardInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E899C68827508F4E00E189E5 /* XPUserCardInfoModel.m */; };
|
||||
E899C68C275093B800E189E5 /* XPUserCardMicroItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E899C68B275093B800E189E5 /* XPUserCardMicroItemModel.m */; };
|
||||
E89D60BA271D643A001F8895 /* Api+Room.m in Sources */ = {isa = PBXBuildFile; fileRef = E89D60B9271D643A001F8895 /* Api+Room.m */; };
|
||||
E89D60BD271D647A001F8895 /* XPRoomPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E89D60BC271D647A001F8895 /* XPRoomPresenter.m */; };
|
||||
E89D60C1271D64B9001F8895 /* RoomInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E89D60C0271D64B9001F8895 /* RoomInfoModel.m */; };
|
||||
@@ -588,8 +589,6 @@
|
||||
E824546526F5FF5100BE8163 /* XPMineResetPayPasswordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineResetPayPasswordProtocol.h; sourceTree = "<group>"; };
|
||||
E82EE0F6272FDDFA00D15DC1 /* UserPrivacyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserPrivacyView.h; sourceTree = "<group>"; };
|
||||
E82EE0F7272FDDFA00D15DC1 /* UserPrivacyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserPrivacyView.m; sourceTree = "<group>"; };
|
||||
E833ED08274F375100A2463B /* XPUserCardBaseView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPUserCardBaseView.h; sourceTree = "<group>"; };
|
||||
E833ED09274F375100A2463B /* XPUserCardBaseView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPUserCardBaseView.m; sourceTree = "<group>"; };
|
||||
E833ED0B274FAD1C00A2463B /* XPKickUserModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPKickUserModel.h; sourceTree = "<group>"; };
|
||||
E833ED0C274FAD1C00A2463B /* XPKickUserModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPKickUserModel.m; sourceTree = "<group>"; };
|
||||
E83DB47827462C4500D8CBD1 /* XPGiftBigPrizeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftBigPrizeModel.h; sourceTree = "<group>"; };
|
||||
@@ -689,6 +688,10 @@
|
||||
E890BC0C273D09A50007C46B /* XPGiftCountView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftCountView.m; sourceTree = "<group>"; };
|
||||
E890BC0E273D23F00007C46B /* GiftInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftInfoModel.h; sourceTree = "<group>"; };
|
||||
E890BC0F273D23F00007C46B /* GiftInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftInfoModel.m; sourceTree = "<group>"; };
|
||||
E899C68727508F4E00E189E5 /* XPUserCardInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPUserCardInfoModel.h; sourceTree = "<group>"; };
|
||||
E899C68827508F4E00E189E5 /* XPUserCardInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPUserCardInfoModel.m; sourceTree = "<group>"; };
|
||||
E899C68A275093B700E189E5 /* XPUserCardMicroItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPUserCardMicroItemModel.h; sourceTree = "<group>"; };
|
||||
E899C68B275093B800E189E5 /* XPUserCardMicroItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPUserCardMicroItemModel.m; sourceTree = "<group>"; };
|
||||
E89D60B8271D643A001F8895 /* Api+Room.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+Room.h"; sourceTree = "<group>"; };
|
||||
E89D60B9271D643A001F8895 /* Api+Room.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+Room.m"; sourceTree = "<group>"; };
|
||||
E89D60BB271D647A001F8895 /* XPRoomPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPresenter.h; sourceTree = "<group>"; };
|
||||
@@ -1595,8 +1598,12 @@
|
||||
children = (
|
||||
E82325FA274E4735003A3332 /* XPUserCardItemModel.h */,
|
||||
E82325FB274E4735003A3332 /* XPUserCardItemModel.m */,
|
||||
E899C68A275093B700E189E5 /* XPUserCardMicroItemModel.h */,
|
||||
E899C68B275093B800E189E5 /* XPUserCardMicroItemModel.m */,
|
||||
E833ED0B274FAD1C00A2463B /* XPKickUserModel.h */,
|
||||
E833ED0C274FAD1C00A2463B /* XPKickUserModel.m */,
|
||||
E899C68727508F4E00E189E5 /* XPUserCardInfoModel.h */,
|
||||
E899C68827508F4E00E189E5 /* XPUserCardInfoModel.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -1616,8 +1623,6 @@
|
||||
E82325FD274E48D0003A3332 /* Cell */,
|
||||
E82325F0274E2DE6003A3332 /* XPUserCardViewController.h */,
|
||||
E82325F1274E2DE6003A3332 /* XPUserCardViewController.m */,
|
||||
E833ED08274F375100A2463B /* XPUserCardBaseView.h */,
|
||||
E833ED09274F375100A2463B /* XPUserCardBaseView.m */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -2506,6 +2511,7 @@
|
||||
E86596512701A1C000846EBD /* StatisticsService.m in Sources */,
|
||||
E824544026F58F9400BE8163 /* XPMinePayPwdViewController.m in Sources */,
|
||||
E890BC04273CF0500007C46B /* XPGiftCountModel.m in Sources */,
|
||||
E899C68C275093B800E189E5 /* XPUserCardMicroItemModel.m in Sources */,
|
||||
E82325F5274E2E09003A3332 /* XPUserCardPresenter.m in Sources */,
|
||||
E8AC723D26F4B6AA007D6E91 /* XPLoginBindPhoneResultViewController.m in Sources */,
|
||||
189DD73E26E21C3F00AB55B1 /* YYUtility.m in Sources */,
|
||||
@@ -2554,7 +2560,6 @@
|
||||
186A534E26FC6ED900D67B2C /* TTPopupService.m in Sources */,
|
||||
18A61BD7274F7F6900A09A54 /* NetImageConfig.m in Sources */,
|
||||
E8C21501274B76F60079E6BF /* XPRoomAnimationHitView.m in Sources */,
|
||||
E833ED0A274F375100A2463B /* XPUserCardBaseView.m in Sources */,
|
||||
E8AC722426F47E5E007D6E91 /* XPMineFeedbackViewController.m in Sources */,
|
||||
9B7D804D27537950003DAC0C /* MessageCell.m in Sources */,
|
||||
E81366E326F0A1FC0076364C /* LoginBindPhoneViewController.m in Sources */,
|
||||
@@ -2584,6 +2589,7 @@
|
||||
E81D58822720082A003063FE /* MicroWaveView.m in Sources */,
|
||||
E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */,
|
||||
E88B5CB026FB1C6500DA9178 /* XPMineTeenagerPresenter.m in Sources */,
|
||||
E899C68927508F4E00E189E5 /* XPUserCardInfoModel.m in Sources */,
|
||||
186A534B26FC6ED900D67B2C /* TTPopupManagerService.m in Sources */,
|
||||
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,
|
||||
E81366F626F0C0DF0076364C /* LoginFullInfoPresenter.m in Sources */,
|
||||
|
@@ -23,8 +23,6 @@
|
||||
|
||||
#import "RtcManager.h"
|
||||
|
||||
#import "XPUserCardViewController.h"
|
||||
|
||||
@interface XPRoomMenuContainerView ()
|
||||
///
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
@@ -82,14 +80,13 @@
|
||||
break;
|
||||
case XPRoomMenuItemType_Gift: {
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid];
|
||||
|
||||
XPSendGiftView * giftView = [[XPSendGiftView alloc] initWithType:SendGiftType_Room uid:roomUid];
|
||||
giftView.delegate = self.delegate;
|
||||
NSArray * giftUses = [self configGiftUsers:[self.delegate getMicroQueue]];
|
||||
[giftView configGiftUsers:giftUses];
|
||||
[TTPopup popupView:giftView style:TTPopupStyleActionSheet];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
///View
|
||||
#import "NetImageView.h"
|
||||
#import "XPUserCardViewController.h"
|
||||
|
||||
@interface StageView()<RtcDelegate, NIMChatManagerDelegate>
|
||||
|
||||
@@ -334,8 +335,15 @@
|
||||
[TTPopup actionSheetWithItems:@[upMic]];
|
||||
} else if (self.hostDelegate.getUserInfo.uid == micModel.userInfo.uid) {
|
||||
[TTPopup actionSheetWithItems:@[downMic]];
|
||||
} else {
|
||||
// TODO: 用户资料卡片弹窗
|
||||
} else {
|
||||
NSString * targetUid = [NSString stringWithFormat:@"%ld", micModel.userInfo.uid];
|
||||
XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init];
|
||||
model.uid = targetUid;
|
||||
model.position = position;
|
||||
model.posState = (UserCardMicroPosStateType)micModel.microState.posState;
|
||||
model.micState = (UserCardMicroMicStateType)micModel.microState.micState;
|
||||
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model delegate:self.hostDelegate];
|
||||
[self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param complection 完成
|
||||
/// @param uid 自己的uid
|
||||
/// @param isLikeUid 要查询的那个人的uid
|
||||
+ (void)attentionStatusComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid isLikeUid:(NSString *)isLikeUid;
|
||||
+ (void)attentionStatusComplection:(HttpRequestHelperCompletion)complection
|
||||
uid:(NSString *)uid
|
||||
isLikeUid:(NSString *)isLikeUid;
|
||||
|
||||
/// 关注某人
|
||||
/// @param complection 完成
|
||||
@@ -22,7 +24,39 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param likedUid 被关注的人
|
||||
/// @param ticket ticket
|
||||
/// @param type l类型默认1
|
||||
+ (void)attentionComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid likedUid:(NSString *)likedUid ticket:(NSString *)ticket type:(NSString *)type;
|
||||
+ (void)attentionComplection:(HttpRequestHelperCompletion)complection
|
||||
uid:(NSString *)uid
|
||||
likedUid:(NSString *)likedUid
|
||||
ticket:(NSString *)ticket
|
||||
type:(NSString *)type;
|
||||
|
||||
/// 锁麦/开麦
|
||||
/// @param complection 完成
|
||||
/// @param roomUid 房主的uid
|
||||
/// @param state 0 开麦 1 锁麦
|
||||
/// @param position 坑位
|
||||
/// @param ticket 用户的ticket
|
||||
/// @param uid uid
|
||||
+ (void)microMuteCompletion:(HttpRequestHelperCompletion)complection
|
||||
roomUid:(NSString *)roomUid
|
||||
state:(NSString *)state
|
||||
position:(NSString *)position
|
||||
ticket:(NSString *)ticket
|
||||
uid:(NSString *)uid;
|
||||
|
||||
/// 锁坑/开锁
|
||||
/// @param complection 完成
|
||||
/// @param roomUid 房主的uid
|
||||
/// @param state 1锁坑位,0取消锁(即取消锁坑位)
|
||||
/// @param position 坑位
|
||||
/// @param ticket 用户的ticket
|
||||
/// @param uid uid
|
||||
+ (void)microLockCompletion:(HttpRequestHelperCompletion)complection
|
||||
roomUid:(NSString *)roomUid
|
||||
state:(NSString *)state
|
||||
position:(NSString *)position
|
||||
ticket:(NSString *)ticket
|
||||
uid:(NSString *)uid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -20,7 +20,6 @@
|
||||
[self makeRequest:@"fans/islike" method:HttpRequestHelperMethodGET completion:complection,__FUNCTION__, uid, isLikeUid, nil];
|
||||
}
|
||||
|
||||
|
||||
/// 关注某人
|
||||
/// @param complection 完成
|
||||
/// @param uid 发起关注的人
|
||||
@@ -31,4 +30,26 @@
|
||||
[self makeRequest:@"fans/like" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, uid, likedUid, ticket, type, nil];
|
||||
}
|
||||
|
||||
/// 锁麦/开麦
|
||||
/// @param complection 完成
|
||||
/// @param roomUid 房主的uid
|
||||
/// @param state 0 开麦 1 锁麦
|
||||
/// @param position 坑位
|
||||
/// @param ticket 用户的ticket
|
||||
/// @param uid uid
|
||||
+ (void)microMuteCompletion:(HttpRequestHelperCompletion)complection roomUid:(NSString *)roomUid state:(NSString *)state position:(NSString *)position ticket:(NSString *)ticket uid:(NSString *)uid {
|
||||
[self makeRequest:@"room/mic/lockmic" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, roomUid, state, position, ticket, uid, nil];
|
||||
}
|
||||
|
||||
/// 锁坑/开锁
|
||||
/// @param complection 完成
|
||||
/// @param roomUid 房主的uid
|
||||
/// @param state 1锁坑位,0取消锁(即取消锁坑位)
|
||||
/// @param position 坑位
|
||||
/// @param ticket 用户的ticket
|
||||
/// @param uid uid
|
||||
+ (void)microLockCompletion:(HttpRequestHelperCompletion)complection roomUid:(NSString *)roomUid state:(NSString *)state position:(NSString *)position ticket:(NSString *)ticket uid:(NSString *)uid {
|
||||
[self makeRequest:@"room/mic/lockpos" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__, roomUid, state, position, ticket, uid, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// XPUserCardInfoModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/11/26.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
typedef NS_ENUM(NSInteger, UserCardMicroPosStateType) {
|
||||
UserCard_MicroPosStateType_Free = 0,///空闲
|
||||
UserCard_MicroPosStateType_Lock = 1,///上锁
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, UserCardMicroMicStateType) {
|
||||
UserCard_MicroMicStateType_Open = 0,///开麦
|
||||
UserCard_MicroMicStateType_Close = 1,///锁麦
|
||||
};
|
||||
|
||||
|
||||
@interface XPUserCardInfoModel : NSObject
|
||||
///用户的UID
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
///如果在坑位上的话 就传入 如果在坑位上的话 就传 如果不再的话 就传nil
|
||||
@property (nonatomic,copy) NSString *position;
|
||||
///坑位状态 锁坑/开坑
|
||||
@property (nonatomic,assign) UserCardMicroPosStateType posState;
|
||||
///麦序的状态 闭麦/开麦
|
||||
@property (nonatomic,assign) UserCardMicroMicStateType micState;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// XPUserCardInfoModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/11/26.
|
||||
//
|
||||
|
||||
#import "XPUserCardInfoModel.h"
|
||||
|
||||
@implementation XPUserCardInfoModel
|
||||
|
||||
@end
|
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// XPUserCardMicroItemModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/11/26.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger, UserCardMicroType) {
|
||||
///开麦 闭麦
|
||||
UserCardMicroType_Mute = 1,
|
||||
///上麦 下麦
|
||||
UserCardMicroType_UpDown,
|
||||
///锁麦 解锁
|
||||
UserCardMicroType_Lock
|
||||
};
|
||||
|
||||
@interface XPUserCardMicroItemModel : NSObject
|
||||
///显示标题
|
||||
@property (nonatomic,copy) NSString *title;
|
||||
///选中的标题
|
||||
@property (nonatomic,copy) NSString *selectTitle;
|
||||
///是否选中
|
||||
@property (nonatomic,assign) BOOL isSelect;
|
||||
///类型
|
||||
@property (nonatomic,assign) UserCardMicroType type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// XPUserCardMicroItemModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/11/26.
|
||||
//
|
||||
|
||||
#import "XPUserCardMicroItemModel.h"
|
||||
|
||||
@implementation XPUserCardMicroItemModel
|
||||
|
||||
@end
|
@@ -8,7 +8,7 @@
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class XPUserCardInfoModel;
|
||||
@interface XPUserCardPresenter : BaseMvpPresenter
|
||||
/// 获取用户信息
|
||||
/// @param uid 查询的用户的uid
|
||||
@@ -19,6 +19,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param roomId 房间的id
|
||||
- (void)getFunctionItems:(NSString *)targetUid roomid:(NSString *)roomId;
|
||||
|
||||
/// 用户卡片底部的操作按钮
|
||||
/// @param userInfo 目标用户的信息
|
||||
/// @param roomId 房间的ID
|
||||
- (void)getMicroFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo roomid:(NSString *)roomId;
|
||||
|
||||
///抱她上麦的 数据
|
||||
/// @param micCount 当前麦序的个数
|
||||
- (void)getRoomMicroItems:(int)micCount;
|
||||
@@ -43,6 +48,24 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param targetUid 用户的uid
|
||||
/// @param roomId 房间的uid
|
||||
- (void)makeKickUser:(NSString *)targetUid roomId:(NSString *)roomId;
|
||||
|
||||
// 锁麦 开锁
|
||||
/// @param roomUid 房间的uid
|
||||
/// @param state YES 锁坑位,NO取消锁
|
||||
/// @param position 操作的坑位
|
||||
- (void)microLock:(NSString *)roomUid state:(BOOL)state position:(NSString *)position;
|
||||
|
||||
/// 闭麦 开麦
|
||||
/// @param roomUid 房间的uid
|
||||
/// @param state NO 开麦 YES 锁麦
|
||||
/// @param position 操作的坑位
|
||||
- (void)microMute:(NSString *)roomUid state:(BOOL)state position:(NSString *)position;
|
||||
|
||||
/// 抱下麦
|
||||
/// @param position 坑位信息
|
||||
/// @param roomId 房间id
|
||||
- (void)kickDownMicro:(NSString *)position roomId:(NSString *)roomId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -15,6 +15,8 @@
|
||||
///Model
|
||||
#import "UserInfoModel.h"
|
||||
#import "XPUserCardItemModel.h"
|
||||
#import "XPUserCardInfoModel.h"
|
||||
#import "XPUserCardMicroItemModel.h"
|
||||
///P
|
||||
#import "XPUserCardProtocol.h"
|
||||
|
||||
@@ -80,7 +82,7 @@
|
||||
[[self rac_queryChatRoomMember:uid roomId:roomId] subscribeNext:^(id _Nullable x) {
|
||||
@strongify(self);
|
||||
NIMChatroomMember * member = x;
|
||||
if (x == nil) {return;}
|
||||
if (member == nil) {return;}
|
||||
if (member.type == NIMChatroomMemberTypeCreator) {///房主 踢出房间 设置管理员 拉黑
|
||||
[self.functionArray addObject:self.kikoutItem];
|
||||
[self.functionArray addObject:self.managerItem];
|
||||
@@ -98,7 +100,7 @@
|
||||
//////查看 目标用户是否是管理员
|
||||
[[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) {
|
||||
NIMChatroomMember * targetMember = x;
|
||||
if (x == nil) {return;}
|
||||
if (targetMember == nil) {return;}
|
||||
if (targetMember.type != NIMChatroomMemberTypeManager || targetMember.type != NIMChatroomMemberTypeCreator) { ///目标是管理员
|
||||
[self.functionArray addObject:self.kikoutItem];
|
||||
[self.functionArray addObject:self.blackItem];
|
||||
@@ -132,6 +134,87 @@
|
||||
}
|
||||
|
||||
|
||||
/// 用户卡片底部的操作按钮
|
||||
/// @param userInfo 目标用户的信息
|
||||
/// @param roomId 房间的ID
|
||||
- (void)getMicroFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo roomid:(NSString *)roomId {
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString * targetUid = userInfo.uid;
|
||||
NSMutableArray * array = [NSMutableArray array];
|
||||
XPUserCardMicroItemModel * muteItem = [[XPUserCardMicroItemModel alloc] init];
|
||||
muteItem.title = @"开麦";
|
||||
muteItem.selectTitle = @"闭麦";
|
||||
muteItem.isSelect = userInfo.micState == UserCard_MicroMicStateType_Open;
|
||||
muteItem.type = UserCardMicroType_Mute;
|
||||
|
||||
XPUserCardMicroItemModel * upDownItem = [[XPUserCardMicroItemModel alloc] init];
|
||||
upDownItem.title = @"抱Ta上麦";
|
||||
upDownItem.selectTitle = [uid isEqualToString:targetUid] ? @"下麦旁听" : @"抱Ta下麦";
|
||||
upDownItem.isSelect = userInfo.position.length > 0;
|
||||
upDownItem.type = UserCardMicroType_UpDown;
|
||||
|
||||
XPUserCardMicroItemModel * lockItem = [[XPUserCardMicroItemModel alloc] init];
|
||||
lockItem.title = @"开锁";
|
||||
lockItem.selectTitle = @"锁麦";
|
||||
lockItem.isSelect = userInfo.posState == UserCard_MicroPosStateType_Free;
|
||||
lockItem.type = UserCardMicroType_Lock;
|
||||
|
||||
if ([targetUid isEqualToString:uid]) {///自己看自己
|
||||
@weakify(self);
|
||||
[[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) {
|
||||
@strongify(self);
|
||||
NIMChatroomMember * member = x;
|
||||
if (member == nil) {return;}
|
||||
if (member.type == NIMTeamMemberTypeOwner || member.type == NIMChatroomMemberTypeManager) {
|
||||
if (userInfo.position.length > 0) {
|
||||
[array addObject:muteItem];
|
||||
[array addObject:upDownItem];
|
||||
[array addObject:lockItem];
|
||||
[[self getView] onGetMicroFunctionArraySccess:array];
|
||||
}
|
||||
}
|
||||
}];
|
||||
} else {///不是自己看自己
|
||||
@weakify(self);
|
||||
[[self rac_queryChatRoomMember:uid roomId:roomId] subscribeNext:^(id _Nullable x) {
|
||||
@strongify(self);
|
||||
NIMChatroomMember * member = x;
|
||||
if (member == nil) {return;}
|
||||
if (member.type == NIMTeamMemberTypeOwner) {
|
||||
if (userInfo.position.length > 0) {
|
||||
[array addObject:muteItem];
|
||||
[array addObject:upDownItem];
|
||||
[array addObject:lockItem];
|
||||
} else {
|
||||
[array addObject:upDownItem];
|
||||
}
|
||||
[[self getView] onGetMicroFunctionArraySccess:array];
|
||||
} else if(member.type == NIMChatroomMemberTypeManager) {/// 管理员
|
||||
[[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) {
|
||||
NIMChatroomMember * targetMember = x;
|
||||
if (targetMember == nil) {return;}
|
||||
if (targetMember.type == NIMTeamMemberTypeOwner || targetMember.type == NIMChatroomMemberTypeManager) {
|
||||
if (userInfo.position.length > 0) {
|
||||
[array addObject:lockItem];
|
||||
} else {
|
||||
[array addObject:upDownItem];
|
||||
}
|
||||
} else {///目标者是普通用户
|
||||
if (userInfo.position.length > 0) {
|
||||
[array addObject:muteItem];
|
||||
[array addObject:upDownItem];
|
||||
[array addObject:lockItem];
|
||||
} else {
|
||||
[array addObject:upDownItem];
|
||||
}
|
||||
}
|
||||
[[self getView] onGetMicroFunctionArraySccess:array];
|
||||
}];
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
/// 关注用户 /取消该关注
|
||||
/// @param targetUid 目标用户的uid
|
||||
/// @param status 是否关注 yes 关注 NO 取消关注
|
||||
@@ -192,6 +275,47 @@
|
||||
}];
|
||||
}
|
||||
|
||||
/// 闭麦 开麦
|
||||
/// @param roomUid 房间的uid
|
||||
/// @param state NO 开麦 YES 锁麦
|
||||
/// @param position 操作的坑位
|
||||
- (void)microMute:(NSString *)roomUid state:(BOOL)state position:(NSString *)position {
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * stateStr = state ? @"1" : @"0";
|
||||
[Api microMuteCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] muteMicroSusccess];
|
||||
}] roomUid:roomUid state:stateStr position:position ticket:ticket uid:uid];
|
||||
}
|
||||
|
||||
// 锁麦 开锁
|
||||
/// @param roomUid 房间的uid
|
||||
/// @param state YES 锁坑位,NO取消锁
|
||||
/// @param position 操作的坑位
|
||||
- (void)microLock:(NSString *)roomUid state:(BOOL)state position:(NSString *)position {
|
||||
NSString * uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString * ticket = [[AccountInfoStorage instance] getTicket];
|
||||
NSString * stateStr = state ? @"1" : @"0";
|
||||
[Api microLockCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] lockMicroSusccess];
|
||||
}] roomUid:roomUid state:stateStr position:position ticket:ticket uid:uid];
|
||||
}
|
||||
|
||||
/// 抱下麦
|
||||
/// @param position 坑位信息
|
||||
/// @param roomId 房间id
|
||||
- (void)kickDownMicro:(NSString *)position roomId:(NSString *)roomId {
|
||||
NIMChatroomQueueRemoveRequest *request = [[NIMChatroomQueueRemoveRequest alloc]init];
|
||||
request.key = position;
|
||||
request.roomId = roomId;
|
||||
[[NIMSDK sharedSDK].chatroomManager removeChatroomQueueObject:request completion:^(NSError * _Nullable error, NSDictionary<NSString *,NSString *> * _Nullable element) {
|
||||
if (error == nil ) {
|
||||
[[self getView] kickDownMicroSuccess];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Private Method
|
||||
///获取房间角色
|
||||
- (RACSignal *)rac_queryChatRoomMember:(NSString *)uid roomId:(NSString *)roomId{
|
||||
|
@@ -8,13 +8,15 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class UserInfoModel, XPUserCardItemModel;
|
||||
@class UserInfoModel, XPUserCardItemModel, XPUserCardMicroItemModel;
|
||||
@protocol XPUserCardProtocol <NSObject>
|
||||
|
||||
///获取用户信息成功
|
||||
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo;
|
||||
///获取用户卡片中 functioin的数据源
|
||||
- (void)onGetFunctionArraySccess:(NSArray<XPUserCardItemModel *> *)array;
|
||||
///获取用户卡片中 操作麦的 functioin的数据源
|
||||
- (void)onGetMicroFunctionArraySccess:(NSArray<XPUserCardMicroItemModel *> *)array;
|
||||
///关注成功
|
||||
- (void)attentionUserSuccess:(XPUserCardItemModel *)item;
|
||||
///加入黑名单
|
||||
@@ -23,6 +25,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)markUserManagerFinish:(XPUserCardItemModel *)item error:(NSError *)error;
|
||||
/// 踢出房间
|
||||
- (void)makeKickUserFinish:(NSError *)error;
|
||||
///抱下麦成功
|
||||
- (void)kickDownMicroSuccess;
|
||||
///操作静音成功
|
||||
- (void)muteMicroSusccess;
|
||||
///操作锁坑成功
|
||||
- (void)lockMicroSusccess;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// XPUserCardBaseView.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/11/25.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPUserCardBaseView : UIView
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// XPUserCardBaseView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/11/25.
|
||||
//
|
||||
|
||||
#import "XPUserCardBaseView.h"
|
||||
|
||||
@implementation XPUserCardBaseView
|
||||
//- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
|
||||
// for (int i = 0; i < self.subviews.count; i++) {
|
||||
// UIView * subView = [self.subviews objectAtIndex:i];
|
||||
// CGPoint convertPoint = [subView convertPoint:point fromView:self];
|
||||
// if (CGRectContainsPoint(subView.bounds, convertPoint)) {
|
||||
// UIView * view = [subView hitTest:convertPoint withEvent:event];
|
||||
// return view;
|
||||
// }
|
||||
// }
|
||||
// return self;
|
||||
//}
|
||||
|
||||
@end
|
@@ -7,10 +7,11 @@
|
||||
|
||||
#import "MvpViewController.h"
|
||||
#import "RoomhostDelegate.h"
|
||||
#import "XPUserCardInfoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPUserCardViewController : MvpViewController
|
||||
- (instancetype)initWithUid:(NSString *)uid delegate:(id<RoomHostDelegate>)delegate;
|
||||
- (instancetype)initWithUser:(XPUserCardInfoModel *)cardInfo delegate:(id<RoomHostDelegate>)delegate;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -20,10 +20,10 @@
|
||||
#import "RoomInfoModel.h"
|
||||
#import "AttachmentModel.h"
|
||||
#import "XPKickUserModel.h"
|
||||
#import "XPUserCardMicroItemModel.h"
|
||||
///View
|
||||
#import "NetImageView.h"
|
||||
#import "XPUserCardItemCollectionViewCell.h"
|
||||
#import "XPUserCardBaseView.h"
|
||||
///P
|
||||
#import "XPUserCardPresenter.h"
|
||||
#import "XPUserCardProtocol.h"
|
||||
@@ -32,8 +32,10 @@
|
||||
|
||||
|
||||
@interface XPUserCardViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,XPUserCardProtocol>
|
||||
///点击的view
|
||||
@property (nonatomic,strong) XPUserCardBaseView *tapView;
|
||||
///上面点击的view
|
||||
@property (nonatomic,strong) UIView *topTapView;
|
||||
///下面点击的view
|
||||
@property (nonatomic,strong) UIView *bottomTapView;
|
||||
///背景
|
||||
@property (nonatomic,strong) UIView *backView;
|
||||
///最外层的容器
|
||||
@@ -78,16 +80,12 @@
|
||||
@property (nonatomic,strong) UIView * sepLineView;
|
||||
///操作的容器
|
||||
@property (nonatomic,strong) UIStackView *operaStackView;
|
||||
///开启关闭
|
||||
@property (nonatomic,strong) UIButton *lockMicroButton;
|
||||
///闭麦/开麦
|
||||
@property (nonatomic,strong) UIButton *muteMicroButton;
|
||||
///上/下麦
|
||||
@property (nonatomic,strong) UIButton *upMicroButton;
|
||||
///展示用户的uid
|
||||
@property (nonatomic,copy) NSString *uid;
|
||||
@property (nonatomic,strong) XPUserCardInfoModel *cardInfo;
|
||||
///数据源
|
||||
@property (nonatomic,strong) NSArray<XPUserCardItemModel *> *datasource;
|
||||
@property (nonatomic,copy) NSArray<XPUserCardItemModel *> *datasource;
|
||||
///操作麦序的数据
|
||||
@property (nonatomic,copy) NSArray<XPUserCardMicroItemModel *> * microItems;
|
||||
///host代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate>hostDelegate;
|
||||
///目标用户的信息
|
||||
@@ -96,10 +94,10 @@
|
||||
|
||||
@implementation XPUserCardViewController
|
||||
|
||||
- (instancetype)initWithUid:(NSString *)uid delegate:(id<RoomHostDelegate>)delegate {
|
||||
- (instancetype)initWithUser:(XPUserCardInfoModel *)cardInfo delegate:(id<RoomHostDelegate>)delegate {
|
||||
if (self = [super init]) {
|
||||
self.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
self.uid = uid;
|
||||
self.cardInfo = cardInfo;
|
||||
self.hostDelegate = delegate;
|
||||
}
|
||||
return self;
|
||||
@@ -125,9 +123,10 @@
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.tapView];
|
||||
///设置颜色 stackView 设置背景色 会失败
|
||||
[self.tapView addSubview:self.backView];
|
||||
[self.view addSubview:self.topTapView];
|
||||
[self.view addSubview:self.backView];
|
||||
[self.view addSubview:self.bottomTapView];
|
||||
|
||||
[self.backView addSubview:self.stackView];
|
||||
|
||||
@@ -154,23 +153,25 @@
|
||||
///铭牌
|
||||
[self.namePlateView addSubview:self.nameplateImageView];
|
||||
[self.namePlateView addSubview:self.nameplateLabel];
|
||||
///底部的操作按钮
|
||||
[self.operaStackView addArrangedSubview:self.muteMicroButton];
|
||||
[self.operaStackView addArrangedSubview:self.upMicroButton];
|
||||
[self.operaStackView addArrangedSubview:self.lockMicroButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.tapView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.view);
|
||||
[self.topTapView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.left.right.mas_equalTo(self.view);
|
||||
make.bottom.mas_equalTo(self.backView.mas_top);
|
||||
}];
|
||||
|
||||
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.tapView).inset(45);
|
||||
make.centerY.mas_equalTo(self.tapView);
|
||||
make.left.right.mas_equalTo(self.view).inset(45);
|
||||
make.centerY.mas_equalTo(self.view);
|
||||
make.bottom.mas_equalTo(self.stackView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.bottomTapView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.left.right.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.backView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(KScreenWidth - 90);
|
||||
make.top.centerX.mas_equalTo(self.backView);
|
||||
@@ -275,17 +276,20 @@
|
||||
}
|
||||
|
||||
- (void)initEvent {
|
||||
// UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMisssVc:)];
|
||||
// [self.tapView addGestureRecognizer:tap];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMisssVc:)];
|
||||
[self.topTapView addGestureRecognizer:tap];
|
||||
UITapGestureRecognizer * bottomTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMisssVc:)];
|
||||
[self.bottomTapView addGestureRecognizer:bottomTap];
|
||||
|
||||
// UITapGestureRecognizer * userInfoTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoUserInfoVC:)];
|
||||
// [self.userInfoView addGestureRecognizer:userInfoTap];
|
||||
UITapGestureRecognizer * userInfoTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoUserInfoVC:)];
|
||||
[self.avatarImageView addGestureRecognizer:userInfoTap];
|
||||
}
|
||||
|
||||
- (void)initHttp {
|
||||
[self.presenter getUserInfo:self.uid];
|
||||
[self.presenter getUserInfo:self.cardInfo.uid];
|
||||
NSString * roomId = [NSString stringWithFormat:@"%ld", [self.hostDelegate getRoomInfo].roomId];
|
||||
[self.presenter getFunctionItems:self.uid roomid:roomId];
|
||||
[self.presenter getFunctionItems:self.cardInfo.uid roomid:roomId];
|
||||
[self.presenter getMicroFunctionItemsByUserInfo:self.cardInfo roomid:roomId];
|
||||
}
|
||||
|
||||
- (void)updateCollectionHeight:(NSArray *)array {
|
||||
@@ -313,9 +317,9 @@
|
||||
XPKickUserModel *notifyModel = [[XPKickUserModel alloc] init];
|
||||
notifyModel.handleNick = userInfo.nick;
|
||||
notifyModel.handleUid = userInfo.uid;
|
||||
notifyModel.targetUid = self.uid.integerValue;
|
||||
notifyModel.targetUid = self.cardInfo.uid.integerValue;
|
||||
notifyModel.targetNick = self.targetUserInfo.nick;
|
||||
notifyModel.uid = self.uid.integerValue;
|
||||
notifyModel.uid = self.cardInfo.uid.integerValue;
|
||||
AttachmentModel *attachment = [[AttachmentModel alloc] init];
|
||||
attachment.first = CustomMessageType_Kick_User;
|
||||
if (isKick) {
|
||||
@@ -392,6 +396,22 @@
|
||||
[self updateCollectionHeight:self.datasource];
|
||||
}
|
||||
|
||||
- (void)onGetMicroFunctionArraySccess:(NSArray<XPUserCardMicroItemModel *> *)array {
|
||||
if (array.count <= 0) {return;}
|
||||
self.microItems = array;
|
||||
for (XPUserCardMicroItemModel * model in array) {
|
||||
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[button setTitle:model.title forState:UIControlStateNormal];
|
||||
[button setTitle:model.selectTitle forState:UIControlStateSelected];
|
||||
button.selected = model.isSelect;
|
||||
button.titleLabel.font = [UIFont systemFontOfSize:13];
|
||||
button.tag = model.type;
|
||||
[button setTitleColor:[ThemeColor userMicroTitleColor] forState:UIControlStateNormal];
|
||||
[button addTarget:self action:@selector(microButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.operaStackView addArrangedSubview:button];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)attentionUserSuccess:(XPUserCardItemModel *)item {
|
||||
///其实这个遍历 有没有都行 只是为了预防 在vc中修改了数据源中的item 还是判断一下吧
|
||||
[self.datasource enumerateObjectsUsingBlock:^(XPUserCardItemModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
@@ -433,6 +453,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)lockMicroSusccess {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)muteMicroSusccess {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)kickDownMicroSuccess {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDelegate
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return self.datasource.count;
|
||||
@@ -451,7 +483,7 @@
|
||||
///TODO : 去送礼物
|
||||
break;
|
||||
case UserCardItemType_Attention:
|
||||
[self.presenter attentionUser:self.uid status:!model.isSelect];
|
||||
[self.presenter attentionUser:self.cardInfo.uid status:!model.isSelect];
|
||||
break;
|
||||
case UserCardItemType_KickOut:
|
||||
{
|
||||
@@ -460,7 +492,7 @@
|
||||
config.title = @"操作提醒";
|
||||
config.message = message;
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
[self.presenter makeKickUser:self.uid roomId:roomId];
|
||||
[self.presenter makeKickUser:self.cardInfo.uid roomId:roomId];
|
||||
} cancelHandler:^{
|
||||
}];
|
||||
}
|
||||
@@ -472,13 +504,13 @@
|
||||
config.title = title;
|
||||
config.message = @"拉黑后他将无法加入此房间";
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
[self.presenter makeUserBlack:self.uid roomId:roomId];
|
||||
[self.presenter makeUserBlack:self.cardInfo.uid roomId:roomId];
|
||||
} cancelHandler:^{
|
||||
}];
|
||||
}
|
||||
break;
|
||||
case UserCardItemType_Manager:
|
||||
[self.presenter makeUserManager:self.uid roomId:roomId enable:!model.isSelect];
|
||||
[self.presenter makeUserManager:self.cardInfo.uid roomId:roomId enable:!model.isSelect];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -494,22 +526,38 @@
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)muteMicroButtonAction:(UIButton *)sender {
|
||||
|
||||
}
|
||||
|
||||
- (void)upMicroButtonAction:(UIButton *)sender {
|
||||
|
||||
}
|
||||
|
||||
- (void)lockMicroButtonAction:(UIButton *)sender {
|
||||
NSLog(@"锁麦");
|
||||
- (void)microButtonAction:(UIButton *)sender {
|
||||
if (self.microItems.count < (sender.tag - 1)) {return;}
|
||||
XPUserCardMicroItemModel * model= [self.microItems objectAtIndex:sender.tag - 1];
|
||||
if (model == nil) {return;}
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
|
||||
NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
|
||||
switch (sender.tag) {
|
||||
case UserCardMicroType_UpDown:
|
||||
{
|
||||
if (sender.selected) {
|
||||
[self.presenter kickDownMicro:self.cardInfo.position roomId:roomId];
|
||||
} else {
|
||||
///TODO : 抱她上麦
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case UserCardMicroType_Lock:
|
||||
[self.presenter microLock:roomUid state:sender.selected position:self.cardInfo.position];
|
||||
break;
|
||||
case UserCardMicroType_Mute:
|
||||
[self.presenter microMute:roomUid state:sender.selected position:self.cardInfo.position];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)reportButtonAction:(UIButton *)sender {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
XPWebViewController *vc = [[XPWebViewController alloc]init];
|
||||
NSString *urlstr = [NSString stringWithFormat:@"%@?reportUid=%@&source=USERCARD",URLWithType(kReportRoomURL),self.uid];
|
||||
NSString *urlstr = [NSString stringWithFormat:@"%@?reportUid=%@&source=USERCARD",URLWithType(kReportRoomURL),self.cardInfo.uid];
|
||||
vc.url = urlstr;
|
||||
[(UINavigationController *)self.presentingViewController pushViewController:vc animated:YES];
|
||||
}
|
||||
@@ -527,14 +575,21 @@
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (XPUserCardBaseView *)tapView {
|
||||
if (!_tapView) {
|
||||
_tapView = [[XPUserCardBaseView alloc] init];
|
||||
_tapView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _tapView;
|
||||
}
|
||||
|
||||
- (UIView *)topTapView {
|
||||
if (!_topTapView) {
|
||||
_topTapView = [[UIView alloc] init];
|
||||
_topTapView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _topTapView;
|
||||
}
|
||||
- (UIView *)bottomTapView {
|
||||
if (!_bottomTapView) {
|
||||
_bottomTapView = [[UIView alloc] init];
|
||||
_bottomTapView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _bottomTapView;
|
||||
}
|
||||
|
||||
- (UIView *)backView {
|
||||
if (!_backView) {
|
||||
@@ -756,42 +811,5 @@
|
||||
return _operaStackView;
|
||||
}
|
||||
|
||||
- (UIButton *)muteMicroButton {
|
||||
if (!_muteMicroButton) {
|
||||
_muteMicroButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_muteMicroButton setTitle:@"闭麦" forState:UIControlStateNormal];
|
||||
[_muteMicroButton setTitle:@"开麦" forState:UIControlStateSelected];
|
||||
[_muteMicroButton setTitleColor:[ThemeColor userMicroTitleColor] forState:UIControlStateNormal];
|
||||
_muteMicroButton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[_muteMicroButton addTarget:self action:@selector(muteMicroButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _muteMicroButton;
|
||||
}
|
||||
|
||||
- (UIButton *)upMicroButton {
|
||||
if (!_upMicroButton) {
|
||||
_upMicroButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_upMicroButton setTitle:@"抱TA上麦" forState:UIControlStateNormal];
|
||||
[_upMicroButton setTitle:@"下麦旁听" forState:UIControlStateSelected];
|
||||
[_upMicroButton setTitleColor:[ThemeColor userMicroTitleColor] forState:UIControlStateNormal];
|
||||
_upMicroButton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[_upMicroButton addTarget:self action:@selector(upMicroButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _upMicroButton;
|
||||
}
|
||||
|
||||
- (UIButton *)lockMicroButton {
|
||||
if (!_lockMicroButton) {
|
||||
_lockMicroButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_lockMicroButton setTitle:@"锁麦" forState:UIControlStateNormal];
|
||||
[_lockMicroButton setTitle:@"解锁" forState:UIControlStateSelected];
|
||||
[_lockMicroButton setTitleColor:[ThemeColor userMicroTitleColor] forState:UIControlStateNormal];
|
||||
_lockMicroButton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[_lockMicroButton addTarget:self action:@selector(lockMicroButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _lockMicroButton;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user