api声明修改
parent
35998a8490
commit
48c8f1c708
|
@ -1 +1 @@
|
||||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/wangtao/Documents/fantai/code/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"mop","path":"/Users/wangtao/Documents/fantai/code/finclip-flutter-sdk/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"mop","dependencies":[]}],"date_created":"2021-12-20 16:48:35.113009","version":"2.2.1"}
|
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mop","path":"/Users/kangxuyao/StudioProjects/finclip-flutter-sdk/","dependencies":[]}],"android":[{"name":"flutter_plugin_android_lifecycle","path":"/Users/kangxuyao/.pub-cache/hosted/pub.flutter-io.cn/flutter_plugin_android_lifecycle-2.0.5/","dependencies":[]},{"name":"mop","path":"/Users/kangxuyao/StudioProjects/finclip-flutter-sdk/","dependencies":["flutter_plugin_android_lifecycle"]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"mop","dependencies":["flutter_plugin_android_lifecycle"]}],"date_created":"2021-12-22 09:19:50.961703","version":"2.6.0-12.0.pre.553"}
|
|
@ -7,7 +7,7 @@ packages:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.6.1"
|
version: "2.8.2"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -21,14 +21,14 @@ packages:
|
||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.3.1"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -49,7 +49,7 @@ packages:
|
||||||
name: cupertino_icons
|
name: cupertino_icons
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.3"
|
version: "1.0.4"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -62,32 +62,53 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_lints:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: flutter_lints
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.4"
|
||||||
|
flutter_plugin_android_lifecycle:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_plugin_android_lifecycle
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.5"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
lints:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: lints
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.10"
|
version: "0.12.11"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.7.0"
|
||||||
mop:
|
mop:
|
||||||
dependency: "direct dev"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "2.34.9"
|
version: "2.34.12"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -141,7 +162,7 @@ packages:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.0"
|
version: "0.4.3"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -155,7 +176,7 @@ packages:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0 <3.0.0"
|
dart: ">=2.14.0 <3.0.0"
|
||||||
flutter: ">=1.10.0"
|
flutter: ">=2.2.3"
|
||||||
|
|
292
lib/mop.dart
292
lib/mop.dart
|
@ -16,16 +16,189 @@ class FinStoreConfig {
|
||||||
String apiServer; //服务器地址,客户部署的后台地址
|
String apiServer; //服务器地址,客户部署的后台地址
|
||||||
|
|
||||||
String apmServer; //apm统计服务器的地址,如果不填,则默认与apiServer一致
|
String apmServer; //apm统计服务器的地址,如果不填,则默认与apiServer一致
|
||||||
int cryptType; //网络接口加密类型,默认为MD5 0:MD5 1:国密MD5
|
String cryptType; //网络接口加密类型,默认为MD5 国密SM
|
||||||
String fingerprint; //SDK指纹 证联环境(https://open.fdep.cn/) 时必填,其他环境的不用填
|
String? fingerprint; //SDK指纹 证联环境(https://open.fdep.cn/) 时必填,其他环境的不用填
|
||||||
String
|
bool encryptServerData; //是否需要接口加密验证(初始化多服务器时使用)默认为不开启,当设置为YES时开启,接口返回加密数据并处理
|
||||||
encryptServerData; //是否需要接口加密验证(初始化多服务器时使用)默认为不开启,当设置为YES时开启,接口返回加密数据并处理
|
|
||||||
|
|
||||||
|
FinStoreConfig(this.sdkKey, this.sdkSecret, this.apiServer, this.apmServer,
|
||||||
|
{this.cryptType = "MD5",
|
||||||
|
this.fingerprint,
|
||||||
|
this.encryptServerData = false});
|
||||||
|
|
||||||
|
Map<String, dynamic> toMap() {
|
||||||
|
return {
|
||||||
|
"sdkkey": sdkKey,
|
||||||
|
"sdkSecret": sdkSecret,
|
||||||
|
"apiServer": apiServer,
|
||||||
|
"apmServer": apmServer,
|
||||||
|
"cryptType": cryptType,
|
||||||
|
"fingerprint": fingerprint,
|
||||||
|
"encryptServerData": encryptServerData
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class FinAppletUIConfig {
|
class UIConfig {
|
||||||
Map<String, dynamic> navigationTitleTextAttributes; //导航栏的标题样式,目前支持了font
|
Map<String, dynamic>? navigationTitleTextAttributes; //导航栏的标题样式,目前支持了font
|
||||||
|
|
||||||
|
///当导航栏为默认导航栏时,是否始终显示返回按钮
|
||||||
|
bool isAlwaysShowBackInDefaultNavigationBar = false;
|
||||||
|
|
||||||
|
///是否清除导航栏导航按钮的背景
|
||||||
|
bool isClearNavigationBarNavButtonBackground = false;
|
||||||
|
|
||||||
|
///是否隐藏"更多"菜单中的"反馈与投诉"菜单入口
|
||||||
|
bool isHideFeedbackAndComplaints = false;
|
||||||
|
|
||||||
|
///是否隐藏"更多"菜单中的"返回首页"菜单入口
|
||||||
|
bool isHideBackHome = false;
|
||||||
|
|
||||||
|
///是否隐藏"更多"菜单中的"转发"按钮
|
||||||
|
bool isHideForwardMenu = false;
|
||||||
|
|
||||||
|
/// 加载小程序过程中(小程序Service层还未加载成功,基础库还没有向SDK传递小程序配置信息),是否隐藏导航栏的关闭按钮
|
||||||
|
bool hideTransitionCloseButton = false;
|
||||||
|
|
||||||
|
/// 禁用侧滑关闭小程序手势
|
||||||
|
bool disableSlideCloseAppletGesture = false;
|
||||||
|
|
||||||
|
/// 胶囊按钮配置
|
||||||
|
CapsuleConfig? capsuleConfig;
|
||||||
|
|
||||||
|
FloatWindowConfig? floatWindowConfig;
|
||||||
|
|
||||||
|
Map<String, dynamic> toMap() {
|
||||||
|
return {
|
||||||
|
"navigationTitleTextAttributes": navigationTitleTextAttributes,
|
||||||
|
"isAlwaysShowBackInDefaultNavigationBar":
|
||||||
|
isAlwaysShowBackInDefaultNavigationBar,
|
||||||
|
"isClearNavigationBarNavButtonBackground":
|
||||||
|
isClearNavigationBarNavButtonBackground,
|
||||||
|
"isHideFeedbackAndComplaints": isHideFeedbackAndComplaints,
|
||||||
|
"isHideBackHome": isHideBackHome,
|
||||||
|
"isHideForwardMenu": isHideForwardMenu,
|
||||||
|
"hideTransitionCloseButton": hideTransitionCloseButton,
|
||||||
|
"disableSlideCloseAppletGesture": disableSlideCloseAppletGesture,
|
||||||
|
"capsuleConfig": capsuleConfig?.toMap(),
|
||||||
|
"floatWindowConfig": floatWindowConfig?.toMap(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 胶囊按钮配置
|
||||||
|
class CapsuleConfig {
|
||||||
|
/// 上角胶囊视图的宽度,默认值为88
|
||||||
|
double capsuleWidth = 88;
|
||||||
|
|
||||||
|
///上角胶囊视图的高度,默认值为32
|
||||||
|
double capsuleHeight = 32;
|
||||||
|
|
||||||
|
///右上角胶囊视图的右边距
|
||||||
|
double capsuleRightMargin = 7;
|
||||||
|
|
||||||
|
///右上角胶囊视图的圆角半径,默认值为5
|
||||||
|
double capsuleCornerRadius = 5;
|
||||||
|
|
||||||
|
///右上角胶囊视图的边框宽度,默认值为0.8
|
||||||
|
double capsuleBorderWidth = 1;
|
||||||
|
|
||||||
|
///胶囊背景颜色浅色
|
||||||
|
int capsuleBgLightColor = 0x33000000;
|
||||||
|
|
||||||
|
///胶囊背景颜色深色
|
||||||
|
int capsuleBgDarkColor = 0x80ffffff;
|
||||||
|
|
||||||
|
/// 右上角胶囊视图的边框浅色颜色
|
||||||
|
|
||||||
|
int capsuleBorderLightColor = 0x80ffffff;
|
||||||
|
|
||||||
|
///右上角胶囊视图的边框深色颜色
|
||||||
|
|
||||||
|
int capsuleBorderDarkColor = 0x26000000;
|
||||||
|
|
||||||
|
///胶囊分割线浅色颜色
|
||||||
|
int capsuleDividerLightColor = 0x80ffffff;
|
||||||
|
|
||||||
|
///胶囊分割线深色颜色
|
||||||
|
int capsuleDividerDarkColor = 0x26000000;
|
||||||
|
|
||||||
|
///胶囊里的浅色更多按钮的图片对象,如果不传,会使用默认图标
|
||||||
|
int? moreLightImage;
|
||||||
|
|
||||||
|
///胶囊里的深色更多按钮的图片对象,如果不传,会使用默认图标
|
||||||
|
int? moreDarkImage;
|
||||||
|
|
||||||
|
///胶囊里的更多按钮的宽度,高度与宽度相等
|
||||||
|
double moreBtnWidth = 32;
|
||||||
|
|
||||||
|
///胶囊里的更多按钮的左边距
|
||||||
|
double moreBtnLeftMargin = 6;
|
||||||
|
|
||||||
|
///胶囊里的浅色更多按钮的图片对象,如果不传,会使用默认图标
|
||||||
|
|
||||||
|
int? closeLightImage;
|
||||||
|
|
||||||
|
///胶囊里的深色更多按钮的图片对象,如果不传,会使用默认图标
|
||||||
|
int? closeDarkImage;
|
||||||
|
|
||||||
|
///胶囊里的关闭按钮的宽度,高度与宽度相等
|
||||||
|
double closeBtnWidth = 32;
|
||||||
|
|
||||||
|
///胶囊里的关闭按钮的左边距
|
||||||
|
double closeBtnLeftMargin = 6;
|
||||||
|
|
||||||
|
Map<String, dynamic> toMap() {
|
||||||
|
return {
|
||||||
|
"capsuleWidth": capsuleWidth,
|
||||||
|
"capsuleHeight": capsuleHeight,
|
||||||
|
"capsuleRightMargin": capsuleRightMargin,
|
||||||
|
"capsuleCornerRadius": capsuleCornerRadius,
|
||||||
|
"capsuleBorderWidth": capsuleBorderWidth,
|
||||||
|
"capsuleBgLightColor": capsuleBgLightColor,
|
||||||
|
"capsuleBgDarkColor": capsuleBgDarkColor,
|
||||||
|
"capsuleBorderLightColor": capsuleBorderLightColor,
|
||||||
|
"capsuleBorderDarkColor": capsuleBorderDarkColor,
|
||||||
|
"capsuleDividerLightColor": capsuleDividerLightColor,
|
||||||
|
"capsuleDividerDarkColor": capsuleDividerDarkColor,
|
||||||
|
"moreLightImage": moreLightImage,
|
||||||
|
"moreDarkImage": moreDarkImage,
|
||||||
|
"moreBtnWidth": moreBtnWidth,
|
||||||
|
"moreBtnLeftMargin": moreBtnLeftMargin,
|
||||||
|
"closeLightImage": closeLightImage,
|
||||||
|
"closeDarkImage": closeDarkImage,
|
||||||
|
"closeBtnWidth": closeBtnWidth,
|
||||||
|
"closeBtnLeftMargin": closeBtnLeftMargin,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FloatWindowConfig {
|
||||||
|
bool floatMode = false;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
|
||||||
|
FloatWindowConfig(this.floatMode, this.x, this.y, this.width, this.height);
|
||||||
|
|
||||||
|
Map<String, dynamic> toMap() {
|
||||||
|
return {
|
||||||
|
"floatMode": floatMode,
|
||||||
|
"x": x,
|
||||||
|
"y": y,
|
||||||
|
"width": width,
|
||||||
|
"height": height
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Anim {
|
||||||
|
SlideFromLeftToRightAnim,
|
||||||
|
SlideFromRightToLeftAnim,
|
||||||
|
SlideFromTopToBottomAnim,
|
||||||
|
SlideFromBottomToTopAnim,
|
||||||
|
FadeInAnim,
|
||||||
|
NoneAnim
|
||||||
}
|
}
|
||||||
|
|
||||||
class Mop {
|
class Mop {
|
||||||
|
@ -48,7 +221,8 @@ class Mop {
|
||||||
// init
|
// init
|
||||||
_channel = const MethodChannel('mop');
|
_channel = const MethodChannel('mop');
|
||||||
_channel.setMethodCallHandler(_handlePlatformMethodCall);
|
_channel.setMethodCallHandler(_handlePlatformMethodCall);
|
||||||
_mopEventChannel = const EventChannel('plugins.mop.finogeeks.com/mop_event');
|
_mopEventChannel =
|
||||||
|
const EventChannel('plugins.mop.finogeeks.com/mop_event');
|
||||||
_mopEventChannel.receiveBroadcastStream().listen((dynamic value) {
|
_mopEventChannel.receiveBroadcastStream().listen((dynamic value) {
|
||||||
debugPrint('matrix: receiveBroadcastStream $value');
|
debugPrint('matrix: receiveBroadcastStream $value');
|
||||||
for (Map m in _mopEventQueye) {
|
for (Map m in _mopEventQueye) {
|
||||||
|
@ -89,33 +263,54 @@ class Mop {
|
||||||
///
|
///
|
||||||
/// initialize mop miniprogram engine.
|
/// initialize mop miniprogram engine.
|
||||||
/// 初始化小程序
|
/// 初始化小程序
|
||||||
/// [appkey] is required. it can be getted from api.finclip.com
|
/// [sdkkey] is required. it can be getted from api.finclip.com
|
||||||
/// [secret] is required. it can be getted from api.finclip.com
|
/// [secret] is required. it can be getted from api.finclip.com
|
||||||
/// [apiServer] is optional. the mop server address. default is https://mp.finogeek.com
|
/// [apiServer] is optional. the mop server address. default is https://mp.finogeek.com
|
||||||
/// [apiPrefix] is optional. the mop server prefix. default is /api/v1/mop
|
/// [apiPrefix] is optional. the mop server prefix. default is /api/v1/mop
|
||||||
/// [cryptType] is optional. cryptType, should be MD5/SM
|
/// [cryptType] is optional. cryptType, should be MD5/SM
|
||||||
/// [disablePermission] is optional.
|
/// [disablePermission] is optional.
|
||||||
|
/// [encryptServerData] 是否对服务器数据进行加密,需要服务器支持
|
||||||
|
/// [userId] 用户id
|
||||||
|
/// [finStoreConfigs] 多服务配置
|
||||||
|
/// [uiConfig] UI配置
|
||||||
|
/// [debug] 设置debug模式,影响调试和日志
|
||||||
|
/// [customWebViewUserAgent] 设置自定义webview ua
|
||||||
|
/// [appletIntervalUpdateLimit] 设置小程序批量更新周期
|
||||||
|
/// [maxRunningApplet] 设置最大同时运行小程序个数
|
||||||
///
|
///
|
||||||
Future<Map> initialize(String appkey, String secret,
|
Future<Map> initialize(
|
||||||
{ String? apiServer,
|
String sdkkey,
|
||||||
String? apiPrefix,
|
String secret, {
|
||||||
String? cryptType,
|
String? apiServer,
|
||||||
bool? disablePermission,
|
String? apiPrefix,
|
||||||
String? userId,
|
String? cryptType,
|
||||||
bool encryptServerData = false,
|
bool encryptServerData = false,
|
||||||
bool debug = false,
|
bool disablePermission = false,
|
||||||
bool bindAppletWithMainProcess = false}) async {
|
String? userId,
|
||||||
|
bool debug = false,
|
||||||
|
bool bindAppletWithMainProcess = false,
|
||||||
|
List<FinStoreConfig>? finStoreConfigs,
|
||||||
|
UIConfig? uiConfig,
|
||||||
|
String? customWebViewUserAgent,
|
||||||
|
int appletIntervalUpdateLimit = 0,
|
||||||
|
int maxRunningApplet = 5,
|
||||||
|
}) async {
|
||||||
final Map ret = await _channel.invokeMethod('initialize', {
|
final Map ret = await _channel.invokeMethod('initialize', {
|
||||||
'appkey': appkey,
|
'appkey': sdkkey,
|
||||||
'secret': secret,
|
'secret': secret,
|
||||||
'apiServer': apiServer,
|
'apiServer': apiServer,
|
||||||
'apiPrefix': apiPrefix,
|
'apiPrefix': apiPrefix,
|
||||||
'cryptType': cryptType,
|
'cryptType': cryptType,
|
||||||
|
"encryptServerData": encryptServerData,
|
||||||
'disablePermission': disablePermission,
|
'disablePermission': disablePermission,
|
||||||
'userId': userId,
|
'userId': userId,
|
||||||
"encryptServerData": encryptServerData,
|
|
||||||
"debug": debug,
|
"debug": debug,
|
||||||
"bindAppletWithMainProcess": bindAppletWithMainProcess
|
"bindAppletWithMainProcess": bindAppletWithMainProcess,
|
||||||
|
"finStoreConfigs": finStoreConfigs?.map((e) => e.toMap()),
|
||||||
|
"uiConfig": uiConfig?.toMap(),
|
||||||
|
"customWebViewUserAgent": customWebViewUserAgent,
|
||||||
|
"appletIntervalUpdateLimit": appletIntervalUpdateLimit,
|
||||||
|
"maxRunningApplet": maxRunningApplet
|
||||||
});
|
});
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -132,14 +327,11 @@ class Mop {
|
||||||
/// [cryptType] is optional. cryptType, should be MD5/SM
|
/// [cryptType] is optional. cryptType, should be MD5/SM
|
||||||
Future<Map> openApplet(
|
Future<Map> openApplet(
|
||||||
final String appId, {
|
final String appId, {
|
||||||
final String? path,
|
final String? path,
|
||||||
final String? query,
|
final String? query,
|
||||||
final int? sequence,
|
final int? sequence,
|
||||||
final String? apiServer,
|
final String? apiServer,
|
||||||
final String? apiPrefix,
|
final String? scene,
|
||||||
final String? fingerprint,
|
|
||||||
final String? cryptType,
|
|
||||||
final String? scene,
|
|
||||||
}) async {
|
}) async {
|
||||||
Map<String, Object> params = {'appId': appId};
|
Map<String, Object> params = {'appId': appId};
|
||||||
Map param = {};
|
Map param = {};
|
||||||
|
@ -148,9 +340,6 @@ class Mop {
|
||||||
if (param.length > 0) params["params"] = param;
|
if (param.length > 0) params["params"] = param;
|
||||||
if (sequence != null) params["sequence"] = sequence;
|
if (sequence != null) params["sequence"] = sequence;
|
||||||
if (apiServer != null) params["apiServer"] = apiServer;
|
if (apiServer != null) params["apiServer"] = apiServer;
|
||||||
if (apiPrefix != null) params["apiPrefix"] = apiPrefix;
|
|
||||||
if (fingerprint != null) params["fingerprint"] = fingerprint;
|
|
||||||
if (cryptType != null) params["cryptType"] = cryptType;
|
|
||||||
if (scene != null) param["scene"] = scene;
|
if (scene != null) param["scene"] = scene;
|
||||||
final Map ret = await _channel.invokeMethod('openApplet', params);
|
final Map ret = await _channel.invokeMethod('openApplet', params);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -228,7 +417,7 @@ class Mop {
|
||||||
return handler.getUserInfo();
|
return handler.getUserInfo();
|
||||||
};
|
};
|
||||||
_extensionApis["getCustomMenus"] = (params) async {
|
_extensionApis["getCustomMenus"] = (params) async {
|
||||||
final res = await handler.getCustomMenus(params["appId"]);
|
final res = await handler.getCustomMenus(params["appId"]);
|
||||||
List<Map<String, dynamic>> list = [];
|
List<Map<String, dynamic>> list = [];
|
||||||
res.forEach((element) {
|
res.forEach((element) {
|
||||||
Map<String, dynamic> map = Map();
|
Map<String, dynamic> map = Map();
|
||||||
|
@ -242,7 +431,8 @@ class Mop {
|
||||||
return list;
|
return list;
|
||||||
};
|
};
|
||||||
_extensionApis["onCustomMenuClick"] = (params) async {
|
_extensionApis["onCustomMenuClick"] = (params) async {
|
||||||
return handler.onCustomMenuClick(params["appId"], params["path"], params["menuId"], params["appInfo"]);
|
return handler.onCustomMenuClick(
|
||||||
|
params["appId"], params["path"], params["menuId"], params["appInfo"]);
|
||||||
};
|
};
|
||||||
_extensionApis["appletDidOpen"] = (params) async {
|
_extensionApis["appletDidOpen"] = (params) async {
|
||||||
return handler.appletDidOpen(params["appId"]);
|
return handler.appletDidOpen(params["appId"]);
|
||||||
|
@ -274,23 +464,6 @@ class Mop {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//20211220新增Api
|
|
||||||
|
|
||||||
//配置多个服务器
|
|
||||||
Future<void> setFinStoreConfigs(List<FinStoreConfig> configs) async {}
|
|
||||||
|
|
||||||
//定制ui样式
|
|
||||||
Future<void> setUiConfig() async {}
|
|
||||||
|
|
||||||
//自定义ua setUiConfig包含设置ua
|
|
||||||
Future<void> setCustomWebViewUserAgent(String ua) async {}
|
|
||||||
|
|
||||||
//支持指定服务器,启动参数,支持扫码打开小程序参数 之前已实现 启动参数 扫码打开小程序
|
|
||||||
Future<void> startApplet() async {}
|
|
||||||
|
|
||||||
//定时批量更新小程序的数量
|
|
||||||
Future<void> setAppletIntervalUpdateLimit(int count) async {}
|
|
||||||
|
|
||||||
//关闭小程序
|
//关闭小程序
|
||||||
Future<void> closeApplet(String appletId, bool animated) async {
|
Future<void> closeApplet(String appletId, bool animated) async {
|
||||||
await _channel.invokeMethod(
|
await _channel.invokeMethod(
|
||||||
|
@ -305,25 +478,26 @@ class Mop {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//删除小程序 removeUsedApplet? 删掉缓存小程序包
|
//设置小程序切换动画 安卓
|
||||||
Future<void> removeApplet(String appletId) async {
|
Future setActivityTransitionAnim(Anim anim) async {
|
||||||
await _channel.invokeMethod("removeApplet", {"appletId": appletId});
|
await _channel
|
||||||
|
.invokeMethod("setActivityTransitionAnim", {"anim": anim.name});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置小程序切换动画 安卓
|
|
||||||
Future<void> setActivityTransitionAnim() async {}
|
|
||||||
|
|
||||||
//发送事件给小程序
|
//发送事件给小程序
|
||||||
Future<void> sendCustomEvent(Map<String, dynamic> eventData) async {
|
Future<void> sendCustomEvent(
|
||||||
await _channel.invokeMethod("sendCustomEvent", {"eventData": eventData});
|
String appId, Map<String, dynamic> eventData) async {
|
||||||
|
await _channel.invokeMethod(
|
||||||
|
"sendCustomEvent", {"appId": appId, "eventData": eventData});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//原生调用js
|
//原生调用js
|
||||||
Future<void> callJS(String eventName, String nativeViewId,
|
Future<void> callJS(String appId, String eventName, String nativeViewId,
|
||||||
Map<String, dynamic> eventData) async {
|
Map<String, dynamic> eventData) async {
|
||||||
await _channel.invokeMethod("callJS", {
|
await _channel.invokeMethod("callJS", {
|
||||||
|
"appId": appId,
|
||||||
"eventName": eventName,
|
"eventName": eventName,
|
||||||
"nativeViewId": nativeViewId,
|
"nativeViewId": nativeViewId,
|
||||||
"eventData": eventData
|
"eventData": eventData
|
||||||
|
|
Loading…
Reference in New Issue