添加邀请链接
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
#import "KBFeedBackVC.h"
|
#import "KBFeedBackVC.h"
|
||||||
#import "KBMyVM.h"
|
#import "KBMyVM.h"
|
||||||
#import "KBConsumptionRecordVC.h"
|
#import "KBConsumptionRecordVC.h"
|
||||||
|
#import "KBHUD.h"
|
||||||
|
|
||||||
|
|
||||||
@interface MyVC () <UITableViewDelegate, UITableViewDataSource>
|
@interface MyVC () <UITableViewDelegate, UITableViewDataSource>
|
||||||
@@ -123,6 +124,29 @@
|
|||||||
[self.navigationController pushViewController:[KBNoticeVC new] animated:true];
|
[self.navigationController pushViewController:[KBNoticeVC new] animated:true];
|
||||||
|
|
||||||
}else if ([itemID isEqualToString:@"2"]){
|
}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"]){
|
}else if ([itemID isEqualToString:@"3"]){
|
||||||
[self.navigationController pushViewController:[KBFeedBackVC new] animated:true];
|
[self.navigationController pushViewController:[KBFeedBackVC new] animated:true];
|
||||||
|
|||||||
Reference in New Issue
Block a user