补充提交

This commit is contained in:
启星
2025-09-23 09:15:02 +08:00
parent ae9be0b58e
commit 33522540a9
18 changed files with 190 additions and 27 deletions

View File

@@ -342,6 +342,30 @@
#pragma mark - Text input
#pragma mark-- UITextViewDelegate
- (void)textViewDidBeginEditing:(UITextView *)textView {
NSInteger isCanChat = [[NSUserDefaults standardUserDefaults] integerForKey:@"kIsCanChat"];
NSString* canChatMoney = [[NSUserDefaults standardUserDefaults] objectForKey:@"kIsCanChatMoney"];
if (isCanChat != 1) {
[self.inputTextView resignFirstResponder];
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) {
[na pushViewController:[[NSClassFromString(@"QXRechargeViewcController") alloc] init] animated:YES];
}]];
[al addAction:[UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
}]];
[na presentViewController:al animated:YES completion:nil];
return;
}
self.keyboardButton.hidden = YES;
self.micButton.hidden = NO;
self.faceButton.hidden = NO;