提交
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user