添加反馈接口

This commit is contained in:
2025-12-17 20:52:23 +08:00
parent 857822c49c
commit 10ba4cd80f
4 changed files with 63 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
#import "KBFeedBackVC.h"
#import <Masonry/Masonry.h>
#import "KBMyVM.h"
#import "KBHUD.h"
@interface KBFeedBackVC () <UITextViewDelegate>
@@ -17,6 +19,8 @@
///
@property (nonatomic, assign) NSInteger maxCount;
@property (nonatomic, strong) KBMyVM *viewModel;
@end
@implementation KBFeedBackVC
@@ -81,8 +85,16 @@
///
- (void)onTapCommit {
NSString *content = self.textView.text ?: @"";
// TODO: +
NSString *content = [self.textView.text ?: @"" stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (content.length == 0) {
[KBHUD showInfo:KBLocalized(@"Please Enter The Content")];
return;
}
__weak typeof(self) weakSelf = self;
[self.viewModel submitFeedbackWithContent:content completion:^(BOOL success, NSError * _Nullable error) {
if (!success) { return; }
[weakSelf.navigationController popViewControllerAnimated:YES];
}];
}
#pragma mark - UITextViewDelegate
@@ -161,4 +173,11 @@
return _commitButton;
}
- (KBMyVM *)viewModel {
if (!_viewModel) {
_viewModel = [[KBMyVM alloc] init];
}
return _viewModel;
}
@end