增加sequence参数

master
kangxuyao 2020-04-01 14:44:01 +08:00
parent c6527d9df2
commit 5920734584
12 changed files with 102 additions and 59 deletions

View File

@ -1,3 +1,4 @@
## 0.5.0
## 0.4.0
## 0.3.0

View File

@ -1,6 +1,7 @@
package com.finogeeks.mop.api.mop;
import android.content.Context;
import android.util.Log;
import com.finogeeks.lib.applet.client.FinAppClient;
import com.finogeeks.mop.api.BaseApi;
@ -12,6 +13,7 @@ import java.util.Map;
public class AppletModule extends BaseApi {
private final static String TAG = AppletModule.class.getSimpleName();
private Context mContext;
public AppletModule(Context context) {
super(context);
mContext = context;
@ -22,6 +24,7 @@ public class AppletModule extends BaseApi {
super.onCreate();
}
@Override
public String[] apis() {
return new String[]{"openApplet"};
@ -30,17 +33,22 @@ public class AppletModule extends BaseApi {
@Override
public void invoke(String event, Map param, ICallback callback) {
if (param.get("appId") == null) {
callback.onFail(new HashMap(){
callback.onFail(new HashMap() {
{
put("info","appId不能为空");
put("info", "appId不能为空");
}
});
return;
}
String appId = String.valueOf(param.get("appId"));
Map<String,String> params = (Map)param.get("params");
Integer sequence = (Integer) param.get("sequence");
Map<String, String> params = (Map) param.get("params");
if (params == null) {
if (sequence == null) {
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId);
} else {
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, sequence, null);
}
} else {
FinAppClient.INSTANCE.getAppletApiManager().startApplet(mContext, appId, params);
}

View File

@ -6,7 +6,7 @@ PODS:
- Flutter
DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`)
- Flutter (from `.symlinks/flutter/ios-release`)
- mop (from `.symlinks/plugins/mop/ios`)
SPEC REPOS:
@ -15,7 +15,7 @@ SPEC REPOS:
EXTERNAL SOURCES:
Flutter:
:path: ".symlinks/flutter/ios"
:path: ".symlinks/flutter/ios-release"
mop:
:path: ".symlinks/plugins/mop/ios"

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildSystemType</key>
<string>Original</string>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>

View File

@ -82,7 +82,7 @@ class _MyAppState extends State<MyApp> {
),
child: FlatButton(
onPressed: () {
Mop.instance.openApplet('5e4d123647edd60001055df1');
Mop.instance.openApplet('5e4d123647edd60001055df1',sequence: 1);
},
child: Text(
'打开官方小程序',

View File

@ -5,63 +5,63 @@ packages:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.11"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.11"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
flutter:
@ -78,21 +78,21 @@ packages:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.6"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.8"
mop:
@ -101,33 +101,33 @@ packages:
path: ".."
relative: true
source: path
version: "0.3.0"
version: "0.4.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.4"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.5"
sky_engine:
@ -139,63 +139,63 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.5"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.3"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.11"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.5.0"
sdks:

View File

@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface MOP_openApplet : MOPBaseApi
@property(nonatomic,copy)NSString* appId;
@property(nonatomic,copy)NSNumber* sequence;
@property(nonatomic,copy)NSDictionary* params;
@end

View File

@ -16,6 +16,7 @@
UIViewController *currentVC = [MOPTools topViewController];
//
if (self.sequence == nil) {
[[FATClient sharedClient] startRemoteApplet:self.appId startParams:self.params InParentViewController:currentVC completion:^(BOOL result, NSError *error) {
NSLog(@"result:%d---error:%@", result, error);
if (result){
@ -24,5 +25,15 @@
failure(error.description);
}
}];
}else{
[[FATClient sharedClient] startRemoteApplet:self.appId sequence:self.sequence startParams:self.params InParentViewController:currentVC transitionStyle:FATTranstionStylePush completion:^(BOOL result, NSError *error) {
NSLog(@"result:%d---error:%@", result, error);
if (result){
success(@{});
}else {
failure(error.description);
}
}];
}
}
@end

View File

@ -11,9 +11,11 @@ class Mop {
EventChannel _mopEventChannel;
int eventId = 0;
List<Map<String, dynamic>> _mopEventQueye = <Map<String, dynamic>>[];
factory Mop() {
return _instance;
}
Mop._internal() {
print('mop: _internal');
// init
@ -30,6 +32,7 @@ class Mop {
// failure(value);
});
}
static Mop get instance => _instance;
Future<String> get platformVersion async {
@ -68,7 +71,7 @@ class Mop {
///
///
Future<Map> openApplet(final String appId,
{final String path, final String query}) async {
{final String path, final String query, final int sequence}) async {
Map<String, Object> params;
if (path != '') {
params = {
@ -78,6 +81,7 @@ class Mop {
} else {
params = {'appId': appId};
}
if (sequence != null) params["sequence"] = sequence;
final Map ret = await _channel.invokeMethod('openApplet', params);
return ret;
}

View File

@ -5,56 +5,56 @@ packages:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.11"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.14.11"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
flutter:
@ -71,49 +71,49 @@ packages:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.6"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.8"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.4"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.5"
sky_engine:
@ -125,63 +125,63 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.5"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.3"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.11"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.6"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.5.0"
sdks:

View File

@ -1,6 +1,6 @@
name: mop
description: A Finogeeks MiniProgram Flutter SDK.
version: 0.4.0
version: 0.5.0
authors:
- finogeeks <finogeeks.mop@gmail.com>
homepage: https://github.com/finogeeks/mop-flutter-sdk