This commit is contained in:
2025-11-11 15:28:22 +08:00
parent e34288ae56
commit d10114572e
4 changed files with 254 additions and 1 deletions

View File

@@ -14,6 +14,8 @@
#import <Masonry/Masonry.h>
#import "KBPersonInfoItemCell.h"
#import <PhotosUI/PhotosUI.h>
#import "LSTPopView.h"
#import "KBChangeNicknamePopView.h"
@interface KBPersonInfoVC () <UITableViewDelegate, UITableViewDataSource, PHPickerViewControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@@ -107,7 +109,37 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// / ID
if (indexPath.row == 0) {
// TODO:
// ->
CGFloat width = MIN(KB_SCREEN_WIDTH - 48, 360);
KBChangeNicknamePopView *content = [[KBChangeNicknamePopView alloc] initWithFrame:CGRectMake(0, 0, width, 230)];
content.prefillNickname = self.items.firstObject[@"value"] ?: @"";
LSTPopView *pop = [LSTPopView initWithCustomView:content
parentView:self.view
popStyle:LSTPopStyleSmoothFromBottom
dismissStyle:LSTDismissStyleScale];
pop.bgColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
pop.hemStyle = LSTHemStyleCenter; //
pop.isClickBgDismiss = YES; //
pop.isAvoidKeyboard = YES; //
pop.avoidKeyboardSpace = 10;
__weak typeof(self) weakSelf = self;
__weak typeof(pop) weakPop = pop;
content.closeHandler = ^{ [weakPop dismiss]; };
content.saveHandler = ^(NSString *nickname) {
if (nickname.length > 0) {
//
NSMutableArray *m = [weakSelf.items mutableCopy];
NSMutableDictionary *d0 = [m.firstObject mutableCopy];
d0[@"value"] = nickname; m[0] = d0; weakSelf.items = m;
[weakSelf.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
}
[weakPop dismiss];
};
[pop pop];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [content focusInput]; });
} else if (indexPath.row == 1) {
// TODO:
}