添加邀请链接

This commit is contained in:
2025-12-26 14:07:21 +08:00
parent 8e934dd83a
commit 510a2f4d66

View File

@@ -15,6 +15,7 @@
#import "KBFeedBackVC.h"
#import "KBMyVM.h"
#import "KBConsumptionRecordVC.h"
#import "KBHUD.h"
@interface MyVC () <UITableViewDelegate, UITableViewDataSource>
@@ -123,6 +124,29 @@
[self.navigationController pushViewController:[KBNoticeVC new] animated:true];
}else if ([itemID isEqualToString:@"2"]){
//
if (!self.viewModel) {
self.viewModel = [[KBMyVM alloc] init];
}
[KBHUD show];
[self.viewModel fetchInviteCodeWithCompletion:^(KBInviteCodeModel * _Nullable inviteCode, NSError * _Nullable error) {
dispatch_async(dispatch_get_main_queue(), ^{
[KBHUD dismiss];
if (error) {
[KBHUD showInfo:error.localizedDescription ?: KBLocalized(@"Network error")];
return;
}
NSString *textToCopy = [NSString stringWithFormat:@"%@?code=%@",inviteCode.h5Link,inviteCode.inviteCode];
if (textToCopy.length == 0) {
[KBHUD showInfo:KBLocalized(@"Failed")];
return;
}
UIPasteboard.generalPasteboard.string = textToCopy;
[KBHUD showInfo:KBLocalized(@"Copy Success")];
});
}];
}else if ([itemID isEqualToString:@"3"]){
[self.navigationController pushViewController:[KBFeedBackVC new] animated:true];