提交
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
// If one sendTypingBaseCondation is satisfied, sendTypingBaseCondationInVC is used until the current session exits
|
||||
|
||||
@property(nonatomic, assign) BOOL sendTypingBaseCondationInVC;
|
||||
@property(nonatomic, strong) UIButton *bottomToolBtn;
|
||||
|
||||
@end
|
||||
|
||||
@@ -35,7 +36,9 @@
|
||||
// Do any additional setup after loading the view.
|
||||
self.sendTypingBaseCondationInVC = NO;
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
|
||||
self.bottomToolBtn = [[UIButton alloc] init];
|
||||
[self.bottomToolBtn addTarget:self action:@selector(alertChat) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:self.bottomToolBtn];
|
||||
// notify
|
||||
NSDictionary *param = @{TUICore_TUIChatNotify_ChatVC_ViewDidLoadSubKey_UserID: self.conversationData.userID ? : @""};
|
||||
[TUICore notifyEvent:TUICore_TUIChatNotify
|
||||
@@ -43,6 +46,43 @@
|
||||
object:nil
|
||||
param:param];
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
if (isCanChat != 1) {
|
||||
self.bottomToolBtn.hidden = NO;
|
||||
}else{
|
||||
self.bottomToolBtn.hidden = YES;
|
||||
}
|
||||
}
|
||||
-(void)viewDidLayoutSubviews{
|
||||
[super viewDidLayoutSubviews];
|
||||
self.bottomToolBtn.frame = CGRectMake(0, self.view.bounds.size.height - TabBar_Height , Screen_Width, TabBar_Height);
|
||||
}
|
||||
-(void)alertChat{
|
||||
NSString* canChatMoney = [[NSUserDefaults standardUserDefaults] objectForKey:@"kIsCanChatMoney"];
|
||||
UIWindow*keyWindow = nil;
|
||||
NSArray *windows = [UIApplication sharedApplication].windows;
|
||||
for (UIWindow *window in windows){
|
||||
if(window.isKeyWindow){
|
||||
keyWindow = window;
|
||||
break;
|
||||
}
|
||||
}
|
||||
UINavigationController*na = (UINavigationController*)keyWindow.rootViewController;
|
||||
NSString *title = [NSString stringWithFormat:@"充值不足%@元,您无法发送消息",canChatMoney];
|
||||
UIAlertController *al = [UIAlertController alertControllerWithTitle:title message:@"" preferredStyle:(UIAlertControllerStyleAlert)];
|
||||
[al addAction:[UIAlertAction actionWithTitle:@"去充值" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
|
||||
UIViewController *vc = [[NSClassFromString(@"QXRechargeViewcController") alloc] init];
|
||||
UINavigationController *naV = [[UINavigationController alloc] initWithRootViewController:vc];
|
||||
naV.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[na presentViewController:naV animated:YES completion:nil];
|
||||
}]];
|
||||
[al addAction:[UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
|
||||
|
||||
}]];
|
||||
[na presentViewController:al animated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Override Methods
|
||||
|
||||
|
||||
@@ -213,14 +213,14 @@
|
||||
|
||||
#pragma mark - Event response
|
||||
- (void)onMicButtonClicked:(UIButton *)sender {
|
||||
NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
#if DEBUG
|
||||
isCanChat = 1;
|
||||
#endif
|
||||
if (isCanChat != 1) {
|
||||
[self alertChat];
|
||||
return;
|
||||
}
|
||||
// NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
//#if DEBUG
|
||||
// isCanChat = 1;
|
||||
//#endif
|
||||
// if (isCanChat != 1) {
|
||||
// [self alertChat];
|
||||
// return;
|
||||
// }
|
||||
_recordButton.hidden = NO;
|
||||
_inputTextView.hidden = YES;
|
||||
_micButton.hidden = YES;
|
||||
@@ -237,14 +237,14 @@
|
||||
}
|
||||
|
||||
- (void)onKeyboardButtonClicked:(UIButton *)sender {
|
||||
NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
#if DEBUG
|
||||
isCanChat = 1;
|
||||
#endif
|
||||
if (isCanChat != 1) {
|
||||
[self alertChat];
|
||||
return;
|
||||
}
|
||||
// NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
//#if DEBUG
|
||||
// isCanChat = 1;
|
||||
//#endif
|
||||
// if (isCanChat != 1) {
|
||||
// [self alertChat];
|
||||
// return;
|
||||
// }
|
||||
_micButton.hidden = NO;
|
||||
_keyboardButton.hidden = YES;
|
||||
_recordButton.hidden = YES;
|
||||
@@ -257,14 +257,14 @@
|
||||
}
|
||||
|
||||
- (void)onFaceEmojiButtonClicked:(UIButton *)sender {
|
||||
NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
#if DEBUG
|
||||
isCanChat = 1;
|
||||
#endif
|
||||
if (isCanChat != 1) {
|
||||
[self alertChat];
|
||||
return;
|
||||
}
|
||||
// NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
//#if DEBUG
|
||||
// isCanChat = 1;
|
||||
//#endif
|
||||
// if (isCanChat != 1) {
|
||||
// [self alertChat];
|
||||
// return;
|
||||
// }
|
||||
_micButton.hidden = NO;
|
||||
_faceButton.hidden = YES;
|
||||
_keyboardButton.hidden = NO;
|
||||
@@ -279,14 +279,14 @@
|
||||
}
|
||||
|
||||
- (void)onMoreButtonClicked:(UIButton *)sender {
|
||||
NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
#if DEBUG
|
||||
isCanChat = 1;
|
||||
#endif
|
||||
if (isCanChat != 1) {
|
||||
[self alertChat];
|
||||
return;
|
||||
}
|
||||
// NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
//#if DEBUG
|
||||
// isCanChat = 1;
|
||||
//#endif
|
||||
// if (isCanChat != 1) {
|
||||
// [self alertChat];
|
||||
// return;
|
||||
// }
|
||||
if (_delegate && [_delegate respondsToSelector:@selector(inputBarDidTouchMore:)]) {
|
||||
[_delegate inputBarDidTouchMore:self];
|
||||
}
|
||||
@@ -371,45 +371,45 @@
|
||||
}
|
||||
}
|
||||
|
||||
-(void)alertChat{
|
||||
NSString* canChatMoney = [[NSUserDefaults standardUserDefaults] objectForKey:@"kIsCanChatMoney"];
|
||||
UIWindow*keyWindow = nil;
|
||||
NSArray *windows = [UIApplication sharedApplication].windows;
|
||||
for (UIWindow *window in windows){
|
||||
if(window.isKeyWindow){
|
||||
keyWindow = window;
|
||||
break;
|
||||
}
|
||||
}
|
||||
UINavigationController*na = (UINavigationController*)keyWindow.rootViewController;
|
||||
NSString *title = [NSString stringWithFormat:@"充值不足%@元,您无法发送消息",canChatMoney];
|
||||
UIAlertController *al = [UIAlertController alertControllerWithTitle:title message:@"" preferredStyle:(UIAlertControllerStyleAlert)];
|
||||
[al addAction:[UIAlertAction actionWithTitle:@"去充值" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
|
||||
UIViewController *vc = [[NSClassFromString(@"QXRechargeViewcController") alloc] init];
|
||||
UINavigationController *naV = [[UINavigationController alloc] initWithRootViewController:vc];
|
||||
naV.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
[na presentViewController:naV animated:YES completion:nil];
|
||||
}]];
|
||||
[al addAction:[UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
|
||||
|
||||
}]];
|
||||
[na presentViewController:al animated:YES completion:nil];
|
||||
}
|
||||
//-(void)alertChat{
|
||||
// NSString* canChatMoney = [[NSUserDefaults standardUserDefaults] objectForKey:@"kIsCanChatMoney"];
|
||||
// UIWindow*keyWindow = nil;
|
||||
// NSArray *windows = [UIApplication sharedApplication].windows;
|
||||
// for (UIWindow *window in windows){
|
||||
// if(window.isKeyWindow){
|
||||
// keyWindow = window;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// UINavigationController*na = (UINavigationController*)keyWindow.rootViewController;
|
||||
// NSString *title = [NSString stringWithFormat:@"充值不足%@元,您无法发送消息",canChatMoney];
|
||||
// UIAlertController *al = [UIAlertController alertControllerWithTitle:title message:@"" preferredStyle:(UIAlertControllerStyleAlert)];
|
||||
// [al addAction:[UIAlertAction actionWithTitle:@"去充值" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
|
||||
// UIViewController *vc = [[NSClassFromString(@"QXRechargeViewcController") alloc] init];
|
||||
// UINavigationController *naV = [[UINavigationController alloc] initWithRootViewController:vc];
|
||||
// naV.modalPresentationStyle = UIModalPresentationFullScreen;
|
||||
// [na presentViewController:naV animated:YES completion:nil];
|
||||
// }]];
|
||||
// [al addAction:[UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
|
||||
//
|
||||
// }]];
|
||||
// [na presentViewController:al animated:YES completion:nil];
|
||||
//}
|
||||
#pragma mark - Text input
|
||||
#pragma mark-- UITextViewDelegate
|
||||
- (void)textViewDidBeginEditing:(UITextView *)textView {
|
||||
NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
// NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
|
||||
//#if DEBUG
|
||||
// isCanChat = 1;
|
||||
//#endif
|
||||
if (TUIChatConfig.defaultConfig.isAppStore) {
|
||||
isCanChat = 1;
|
||||
}
|
||||
if (isCanChat != 1) {
|
||||
[self.inputTextView resignFirstResponder];
|
||||
[self alertChat];
|
||||
return;
|
||||
}
|
||||
// if (TUIChatConfig.defaultConfig.isAppStore) {
|
||||
// isCanChat = 1;
|
||||
// }
|
||||
// if (isCanChat != 1) {
|
||||
// [self.inputTextView resignFirstResponder];
|
||||
// [self alertChat];
|
||||
// return;
|
||||
// }
|
||||
self.keyboardButton.hidden = YES;
|
||||
self.micButton.hidden = NO;
|
||||
self.faceButton.hidden = NO;
|
||||
|
||||
@@ -56,6 +56,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic) BOOL isShowConversationGroup;
|
||||
|
||||
- (void)startConversation:(V2TIMConversationType)type;
|
||||
|
||||
-(void)reloadConversationList;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -63,7 +63,13 @@
|
||||
- (TUIConversationListBaseDataProvider *)dataProvider {
|
||||
return self.settingDataProvider;
|
||||
}
|
||||
|
||||
-(void)reloadConversationList{
|
||||
self.settingDataProvider.delegate = nil;
|
||||
self.settingDataProvider = nil;
|
||||
TUIConversationListDataProvider *dataProvider = [[TUIConversationListDataProvider alloc] init];
|
||||
self.settingDataProvider = dataProvider;
|
||||
[_tableViewForAll setDataProvider:dataProvider];
|
||||
}
|
||||
#pragma mark - Life Cycle
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
Reference in New Issue
Block a user