Merge branch 'master' into X5

master
zhongweiguang 2023-03-30 13:20:48 +08:00
commit eff2f43007
2 changed files with 87 additions and 87 deletions

View File

@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
s.dependency 'Flutter'
s.ios.deployment_target = '9.0'
s.dependency 'FinApplet' , '2.40.0-dev20230322v02'
s.dependency 'FinAppletExt' , '2.40.0-dev20230322v02'
s.dependency 'FinApplet' , '2.40.1'
s.dependency 'FinAppletExt' , '2.40.1'
end

View File

@ -1046,18 +1046,30 @@ class Mop {
return ret;
}
/// get current using applet
/// 使
/// {appId,name,icon,description,version,thumbnail}
Future<Map<String, dynamic>> currentApplet() async {
final ret = await _channel.invokeMapMethod("currentApplet");
return Map<String, dynamic>.from(ret!);
///
/// [qrcode]
Future qrcodeOpenApplet(String qrcode, {bool isSingleProcess = false}) async {
Map<String, Object> params = {
'qrcode': qrcode,
'isSingleProcess': isSingleProcess,
};
return await _channel.invokeMapMethod("qrcodeOpenApplet", params);
}
Future<Map<String, dynamic>> changeUserId(String userId) async {
Map<String, Object> params = {'userId': userId};
final ret = await _channel.invokeMapMethod("changeUserId", params);
return Map<String, dynamic>.from(ret!);
/// --
Future scanOpenApplet(String info, {bool isSingleProcess = false}) async {
Map<String, Object> params = {
'info': info,
'isSingleProcess': isSingleProcess,
};
return await _channel.invokeMapMethod("scanOpenApplet", params);
}
///
Future<void> closeApplet(String appletId, bool animated) async {
await _channel.invokeMethod(
"closeApplet", {"appletId": appletId, "animated": animated});
return;
}
/// close all running applets
@ -1066,10 +1078,11 @@ class Mop {
return await _channel.invokeMethod("closeAllApplets");
}
/// clear applets cache
///
Future clearApplets() async {
return await _channel.invokeMethod("clearApplets");
///
Future<void> finishRunningApplet(String appletId, bool animated) async {
await _channel.invokeMethod(
"finishRunningApplet", {"appletId": appletId, "animated": animated});
return;
}
///
@ -1084,30 +1097,18 @@ class Mop {
return await _channel.invokeMethod("removeAllUsedApplets", params);
}
///
Future<String> sdkVersion() async {
return await _channel
.invokeMapMethod("sdkVersion")
.then((value) => value?["data"]);
/// clear applets cache
///
Future clearApplets() async {
return await _channel.invokeMethod("clearApplets");
}
/// --
Future scanOpenApplet(String info, {bool isSingleProcess = false}) async {
Map<String, Object> params = {
'info': info,
'isSingleProcess': isSingleProcess,
};
return await _channel.invokeMapMethod("scanOpenApplet", params);
}
///
/// [qrcode]
Future qrcodeOpenApplet(String qrcode, {bool isSingleProcess = false}) async {
Map<String, Object> params = {
'qrcode': qrcode,
'isSingleProcess': isSingleProcess,
};
return await _channel.invokeMapMethod("qrcodeOpenApplet", params);
/// get current using applet
/// 使
/// {appId,name,icon,description,version,thumbnail}
Future<Map<String, dynamic>> currentApplet() async {
final ret = await _channel.invokeMapMethod("currentApplet");
return Map<String, dynamic>.from(ret!);
}
/// QrCode
@ -1166,49 +1167,11 @@ class Mop {
_channel.invokeMethod("registerExtensionApi", {"name": name});
}
///
Future<String> getSMSign(String plainText) async {
var result =
await _channel.invokeMapMethod("smsign", {'plainText': plainText});
var data = result?['data']['data'];
debugPrint(data);
return data;
}
/// WKWebView
void webViewBounces(bool bounces) async {
await _channel.invokeMapMethod("webViewBounces", {'bounces': bounces});
return;
}
///
Future<void> closeApplet(String appletId, bool animated) async {
await _channel.invokeMethod(
"closeApplet", {"appletId": appletId, "animated": animated});
return;
}
///
Future<void> finishRunningApplet(String appletId, bool animated) async {
await _channel.invokeMethod(
"finishRunningApplet", {"appletId": appletId, "animated": animated});
return;
}
///
Future setActivityTransitionAnim(Anim anim) async {
await _channel.invokeMethod("setActivityTransitionAnim", {"anim": ""});
return;
}
///
/// [appId] id
/// [eventData]
Future<void> sendCustomEvent(
String appId, Map<String, dynamic> eventData) async {
await _channel.invokeMethod(
"sendCustomEvent", {"appId": appId, "eventData": eventData});
return;
/// register webview extension api
/// webviewapi
void addWebExtentionApi(String name, ExtensionApiHandler handler) {
_webExtensionApis[name] = handler;
_channel.invokeMethod("addWebExtentionApi", {"name": name});
}
/// webviewjs
@ -1227,14 +1190,51 @@ class Mop {
return;
}
/// register webview extension api
/// webviewapi
void addWebExtentionApi(String name, ExtensionApiHandler handler) {
_webExtensionApis[name] = handler;
_channel.invokeMethod("addWebExtentionApi", {"name": name});
///
/// [appId] id
/// [eventData]
Future<void> sendCustomEvent(
String appId, Map<String, dynamic> eventData) async {
await _channel.invokeMethod(
"sendCustomEvent", {"appId": appId, "eventData": eventData});
return;
}
///
Future<Map<String, dynamic>> changeUserId(String userId) async {
Map<String, Object> params = {'userId': userId};
final ret = await _channel.invokeMapMethod("changeUserId", params);
return Map<String, dynamic>.from(ret!);
}
///
Future<String> sdkVersion() async {
return await _channel
.invokeMapMethod("sdkVersion")
.then((value) => value?["data"]);
}
///
Future<String> getSMSign(String plainText) async {
var result =
await _channel.invokeMapMethod("smsign", {'plainText': plainText});
var data = result?['data']['data'];
debugPrint(data);
return data;
}
/// WKWebViewiOS
void webViewBounces(bool bounces) async {
await _channel.invokeMapMethod("webViewBounces", {'bounces': bounces});
return;
}
/// Android
Future setActivityTransitionAnim(Anim anim) async {
await _channel.invokeMethod("setActivityTransitionAnim", {"anim": ""});
return;
}
/// Android
void moveCurrentAppletToFront() async {
return await _channel.invokeMethod("moveCurrentAppletToFront");
}