sync
parent
98168c167e
commit
0ac5a988dc
|
@ -75,17 +75,15 @@
|
||||||
|
|
||||||
- (NSArray<id<FATAppletMenuProtocol>> *)customMenusInApplet:(FATAppletInfo *)appletInfo atPath:(NSString *)path {
|
- (NSArray<id<FATAppletMenuProtocol>> *)customMenusInApplet:(FATAppletInfo *)appletInfo atPath:(NSString *)path {
|
||||||
NSLog(@"customMenusInApplet:%@,appletInfo=%@",path,appletInfo);
|
NSLog(@"customMenusInApplet:%@,appletInfo=%@",path,appletInfo);
|
||||||
__block NSArray *list;
|
|
||||||
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
NSDictionary<NSString *, NSString *> *item1 = @{@"menuId": @"shareToChatPicId", @"title": @"Share to friends", @"image": @"miniChat", @"darkImage": @"miniChat", @"type": @"common"};
|
||||||
[channel invokeMethod:@"extensionApi:getCustomMenus" arguments:@{@"appId": appletInfo.appId} result:^(id _Nullable result) {
|
NSDictionary<NSString *, NSString *> *item2 = @{@"menuId": @"shareToOutsidePicId", @"title": @"Share to others", @"image": @"miniSend", @"darkImage": @"miniSend", @"type": @"common"};
|
||||||
CFRunLoopStop(CFRunLoopGetMain());
|
NSDictionary<NSString *, NSString *> *item3 = @{@"menuId": @"shareQrcodePicId", @"title": @"Phiz code", @"image": @"qrCode", @"darkImage": @"qrCode", @"type": @"common"};
|
||||||
if ([result isKindOfClass:[NSArray class]]) {
|
NSDictionary<NSString *, NSString *> *item4 = @{@"menuId": @"555", @"title": @"小程序支付测试4", @"image": @"qrCode", @"darkImage": @"qrCode", @"type": @"common"};
|
||||||
list = result;
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
CFRunLoopRun();
|
|
||||||
|
|
||||||
|
NSArray<NSDictionary<NSString *, NSString *> *> *list = @[item1, item2, item3, item4];
|
||||||
NSLog(@"customMenusInApplet:%@,list=%@",path,list);
|
NSLog(@"customMenusInApplet:%@,list=%@",path,list);
|
||||||
|
|
||||||
NSMutableArray *models = [NSMutableArray array];
|
NSMutableArray *models = [NSMutableArray array];
|
||||||
for (NSDictionary<NSString *, NSString *> *data in list) {
|
for (NSDictionary<NSString *, NSString *> *data in list) {
|
||||||
MopCustomMenuModel *model = [[MopCustomMenuModel alloc] init];
|
MopCustomMenuModel *model = [[MopCustomMenuModel alloc] init];
|
||||||
|
@ -115,6 +113,7 @@
|
||||||
return models;
|
return models;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo inApplet:(FATAppletInfo *)appletInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion {
|
- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo inApplet:(FATAppletInfo *)appletInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion {
|
||||||
NSError *parseError = nil;
|
NSError *parseError = nil;
|
||||||
NSMutableDictionary *shareDic = [[NSMutableDictionary alloc] initWithDictionary:[self dictionaryRepresentation:appletInfo]];
|
NSMutableDictionary *shareDic = [[NSMutableDictionary alloc] initWithDictionary:[self dictionaryRepresentation:appletInfo]];
|
||||||
|
|
Loading…
Reference in New Issue