Merge branch 'feat/chooseAvatar'

master
wangzhaoyao 2022-08-26 10:49:25 +08:00
commit 2e7a37e6d3
2 changed files with 39 additions and 2 deletions

View File

@ -8,6 +8,7 @@
#import "MOPAppletDelegate.h" #import "MOPAppletDelegate.h"
#import "MopPlugin.h" #import "MopPlugin.h"
#import "MopCustomMenuModel.h" #import "MopCustomMenuModel.h"
#import <mop/MOPTools.h>
@interface NSString (FATEncode) @interface NSString (FATEncode)
- (NSString *)fat_encodeString; - (NSString *)fat_encodeString;
@ -142,6 +143,42 @@ static NSString *scheme = @"fatae55433be2f62915";//App对应的scheme
}]; }];
} }
- (void)chooseAvatarWithAppletInfo:(FATAppletInfo *)appletInfo bindChooseAvatar:(void (^)(NSDictionary *result))bindChooseAvatar {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *chooseAlbumAction = [UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
NSDictionary *params = @{@"name":@"chooseAvatarAlbum"};
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
[channel invokeMethod:@"extensionApi:chooseAvatarAlbum" arguments:params result:^(id _Nullable result) {
!bindChooseAvatar?: bindChooseAvatar(result);
}];
}];
UIAlertAction *photoAction = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
NSDictionary *params = @{@"name":@"chooseAvatarPhoto"};
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
[channel invokeMethod:@"extensionApi:chooseAvatarPhoto" arguments:params result:^(id _Nullable result) {
!bindChooseAvatar?: bindChooseAvatar(result);
}];
}];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *_Nonnull action){
bindChooseAvatar(@{});
}];
[alertController addAction:chooseAlbumAction];
[alertController addAction:photoAction];
[alertController addAction:cancelAction];
UIViewController *topVC = [MOPTools topViewController];
[topVC presentViewController:alertController animated:YES completion:nil];
}
@end @end
@implementation NSString (FATEncode) @implementation NSString (FATEncode)

View File

@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
s.dependency 'Flutter' s.dependency 'Flutter'
s.ios.deployment_target = '9.0' s.ios.deployment_target = '9.0'
s.dependency 'FinApplet' , '2.38.0-alpha20220812v07' s.dependency 'FinApplet' , '2.37.10-alpha20220825v10'
s.dependency 'FinAppletExt' , '2.38.0-alpha20220812v07' s.dependency 'FinAppletExt' , '2.37.10-alpha20220825v10'
end end