diff --git a/ios/Classes/Api/MOPAppletDelegate.m b/ios/Classes/Api/MOPAppletDelegate.m index b0ab388..fdffc36 100644 --- a/ios/Classes/Api/MOPAppletDelegate.m +++ b/ios/Classes/Api/MOPAppletDelegate.m @@ -7,6 +7,7 @@ #import "MOPAppletDelegate.h" #import "MopPlugin.h" +#import "MopCustomMenuModel.h" @implementation MOPAppletDelegate @@ -46,13 +47,35 @@ return userInfo; } -- (NSArray> *)customMenusInMoreItemAtPath:(NSString *)path -{ - return nil; +- (NSArray> *)customMenusInApplet:(FATAppletInfo *)appletInfo atPath:(NSString *)path { + MopCustomMenuModel *favModel1 = [[MopCustomMenuModel alloc] init]; + favModel1.menuId = @"WXShareAPPFriends"; + favModel1.menuTitle = @"微信好友"; + favModel1.menuIconImage = [UIImage imageNamed:@"mini_menu_chat"]; + favModel1.menuType = FATAppletMenuStyleOnMiniProgram; + + MopCustomMenuModel *favModel2 = [[MopCustomMenuModel alloc] init]; + favModel2.menuId = @"ShareSinaWeibo"; + favModel2.menuTitle = @"新浪微博"; + favModel2.menuIconImage = [UIImage imageNamed:@"mini_menu_chat"]; + favModel2.menuType = FATAppletMenuStyleOnMiniProgram; + + MopCustomMenuModel *favModel3 = [[MopCustomMenuModel alloc] init]; + favModel3.menuId = @"Restart"; + favModel3.menuTitle = @"重启"; + favModel3.menuIconImage = [UIImage imageNamed:@"minipro_list_setting"]; + favModel3.menuType = FATAppletMenuStyleCommon; + + MopCustomMenuModel *favModel4 = [[MopCustomMenuModel alloc] init]; + favModel4.menuId = @"ShareQQFriends"; + favModel4.menuTitle = @"QQ好友"; + favModel4.menuIconImage = [UIImage imageNamed:@"minipro_list_setting"]; + favModel4.menuType = FATAppletMenuStyleOnMiniProgram; + + return @[favModel1, favModel2, favModel3, favModel4]; } -- (void)customMenu:(id)customMenu didClickAtPath:(NSString *)path -{ +- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion { } diff --git a/ios/Classes/Model/MopCustomMenuModel.h b/ios/Classes/Model/MopCustomMenuModel.h new file mode 100644 index 0000000..416aea9 --- /dev/null +++ b/ios/Classes/Model/MopCustomMenuModel.h @@ -0,0 +1,17 @@ +// +// MopCustomMenuModel.h +// mop +// +// Created by Lin on 2021/2/26. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MopCustomMenuModel : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/ios/Classes/Model/MopCustomMenuModel.m b/ios/Classes/Model/MopCustomMenuModel.m new file mode 100644 index 0000000..bfea6fc --- /dev/null +++ b/ios/Classes/Model/MopCustomMenuModel.m @@ -0,0 +1,24 @@ +// +// MopCustomMenuModel.m +// mop +// +// Created by Lin on 2021/2/26. +// + +#import "MopCustomMenuModel.h" + +@implementation MopCustomMenuModel + +@synthesize menuId, menuIconImage, menuTitle, menuType; + +- (id)copyWithZone:(NSZone *)zone +{ + MopCustomMenuModel *model = [[MopCustomMenuModel allocWithZone:zone] init]; + model.menuId = self.menuId; + model.menuIconImage = self.menuIconImage; + model.menuTitle = self.menuTitle; + model.menuType = self.menuType; + return model; +} + +@end diff --git a/ios/mop.podspec b/ios/mop.podspec index 5d59262..c8be1c2 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' , '' - s.dependency 'FinAppletExt' , '' + s.dependency 'FinApplet' , '2.21.0-alpha20210226v03' + s.dependency 'FinAppletExt' , '2.21.0-alpha20210226v03' end