From 510a2f4d663f308eff1ad4f9ca502e9524757fa1 Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Fri, 26 Dec 2025 14:07:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=82=80=E8=AF=B7=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyBoard/Class/Me/VC/MyVC.m | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/keyBoard/Class/Me/VC/MyVC.m b/keyBoard/Class/Me/VC/MyVC.m index 2984a11..02c4519 100644 --- a/keyBoard/Class/Me/VC/MyVC.m +++ b/keyBoard/Class/Me/VC/MyVC.m @@ -15,6 +15,7 @@ #import "KBFeedBackVC.h" #import "KBMyVM.h" #import "KBConsumptionRecordVC.h" +#import "KBHUD.h" @interface MyVC () @@ -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];