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.dependency 'Flutter'
s.ios.deployment_target = '9.0' s.ios.deployment_target = '9.0'
s.dependency 'FinApplet' , '2.40.0-dev20230322v02' s.dependency 'FinApplet' , '2.40.1'
s.dependency 'FinAppletExt' , '2.40.0-dev20230322v02' s.dependency 'FinAppletExt' , '2.40.1'
end end

View File

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