From 0a5217e652bfdfb6acbbcc1dee5492a8224a0525 Mon Sep 17 00:00:00 2001 From: wangzhaoyao Date: Thu, 25 Aug 2022 00:27:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=E5=AE=9E=E7=8E=B0chooseAvatar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Classes/Api/MOPAppletDelegate.m | 11 +++++++++++ ios/mop.podspec | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ios/Classes/Api/MOPAppletDelegate.m b/ios/Classes/Api/MOPAppletDelegate.m index 7ef44c8..027fa9c 100644 --- a/ios/Classes/Api/MOPAppletDelegate.m +++ b/ios/Classes/Api/MOPAppletDelegate.m @@ -142,6 +142,17 @@ static NSString *scheme = @"fatae55433be2f62915";//App对应的scheme }]; } + +- (void)chooseAvatarWithAppletInfo:(FATAppletInfo *)appletInfo bindChooseAvatar:(void (^)(NSDictionary *result))bindChooseAvatar { + + NSDictionary *params = @{@"name":@"chooseAvatar"}; + + FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; + [channel invokeMethod:@"extensionApi:chooseAvatar" arguments:params result:^(id _Nullable result) { + !bindChooseAvatar?: bindChooseAvatar(result); + }]; +} + @end @implementation NSString (FATEncode) diff --git a/ios/mop.podspec b/ios/mop.podspec index c7bbf2d..19a3a85 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk. s.dependency 'Flutter' s.ios.deployment_target = '9.0' - s.dependency 'FinApplet' , '2.38.0-alpha20220812v07' - s.dependency 'FinAppletExt' , '2.38.0-alpha20220812v07' + s.dependency 'FinApplet' , '2.37.10-alpha20220824v04' + s.dependency 'FinAppletExt' , '2.37.10-alpha20220824v04' end From 17af0c0e8da76510472c25c1858c3bf8e94cab35 Mon Sep 17 00:00:00 2001 From: wangzhaoyao Date: Thu, 25 Aug 2022 21:40:52 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E7=9B=B8=E6=9C=BA?= =?UTF-8?q?=E5=92=8C=E7=9B=B8=E5=86=8C=E7=9A=84=E5=BC=B9=E6=A1=86=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Classes/Api/MOPAppletDelegate.m | 36 +++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/ios/Classes/Api/MOPAppletDelegate.m b/ios/Classes/Api/MOPAppletDelegate.m index 027fa9c..64d15f6 100644 --- a/ios/Classes/Api/MOPAppletDelegate.m +++ b/ios/Classes/Api/MOPAppletDelegate.m @@ -8,6 +8,7 @@ #import "MOPAppletDelegate.h" #import "MopPlugin.h" #import "MopCustomMenuModel.h" +#import @interface NSString (FATEncode) - (NSString *)fat_encodeString; @@ -144,15 +145,40 @@ static NSString *scheme = @"fatae55433be2f62915";//App对应的scheme } - (void)chooseAvatarWithAppletInfo:(FATAppletInfo *)appletInfo bindChooseAvatar:(void (^)(NSDictionary *result))bindChooseAvatar { - - NSDictionary *params = @{@"name":@"chooseAvatar"}; - FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; - [channel invokeMethod:@"extensionApi:chooseAvatar" arguments:params result:^(id _Nullable result) { - !bindChooseAvatar?: bindChooseAvatar(result); + 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 @implementation NSString (FATEncode) From c09a5eb0ccb194deb44f556474a7225305e565b5 Mon Sep 17 00:00:00 2001 From: wangzhaoyao Date: Thu, 25 Aug 2022 21:54:18 +0800 Subject: [PATCH 3/3] 1.update --- ios/mop.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/mop.podspec b/ios/mop.podspec index 19a3a85..c5aa502 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk. s.dependency 'Flutter' s.ios.deployment_target = '9.0' - s.dependency 'FinApplet' , '2.37.10-alpha20220824v04' - s.dependency 'FinAppletExt' , '2.37.10-alpha20220824v04' + s.dependency 'FinApplet' , '2.37.10-alpha20220825v10' + s.dependency 'FinAppletExt' , '2.37.10-alpha20220825v10' end