From 659743398096195e4551923bdc06a02573678be7 Mon Sep 17 00:00:00 2001 From: wanghualei Date: Sat, 25 Mar 2023 07:56:11 +0800 Subject: [PATCH 1/2] update ios version --- ios/mop.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/mop.podspec b/ios/mop.podspec index c0169b5..c24d121 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -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 From 462ef3382e74bd8cdb01427aac10e775c6ac89fe Mon Sep 17 00:00:00 2001 From: wanghualei Date: Mon, 27 Mar 2023 18:10:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E5=92=8C=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mop.dart | 170 +++++++++++++++++++++++++-------------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/lib/mop.dart b/lib/mop.dart index 167bcf6..2258100 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -1032,18 +1032,30 @@ class Mop { return ret; } - /// get current using applet - /// 获取当前正在使用的小程序信息 - /// {appId,name,icon,description,version,thumbnail} - Future> currentApplet() async { - final ret = await _channel.invokeMapMethod("currentApplet"); - return Map.from(ret!); + /// 通过二维码打开小程序 + /// [qrcode] 二维码内容 + Future qrcodeOpenApplet(String qrcode, {bool isSingleProcess = false}) async { + Map params = { + 'qrcode': qrcode, + 'isSingleProcess': isSingleProcess, + }; + return await _channel.invokeMapMethod("qrcodeOpenApplet", params); } - Future> changeUserId(String userId) async { - Map params = {'userId': userId}; - final ret = await _channel.invokeMapMethod("changeUserId", params); - return Map.from(ret!); + /// (扫码后)解密-鉴权-打开小程序 + Future scanOpenApplet(String info, {bool isSingleProcess = false}) async { + Map params = { + 'info': info, + 'isSingleProcess': isSingleProcess, + }; + return await _channel.invokeMapMethod("scanOpenApplet", params); + } + + /// 关闭小程序 小程序会在内存中存在 + Future closeApplet(String appletId, bool animated) async { + await _channel.invokeMethod( + "closeApplet", {"appletId": appletId, "animated": animated}); + return; } /// close all running applets @@ -1052,10 +1064,11 @@ class Mop { return await _channel.invokeMethod("closeAllApplets"); } - /// clear applets cache - /// 清除缓存的小程序 - Future clearApplets() async { - return await _channel.invokeMethod("clearApplets"); + /// 结束小程序 小程序会从内存中清除 + Future finishRunningApplet(String appletId, bool animated) async { + await _channel.invokeMethod( + "finishRunningApplet", {"appletId": appletId, "animated": animated}); + return; } /// 清除指定的小程序本体缓存 @@ -1070,30 +1083,18 @@ class Mop { return await _channel.invokeMethod("removeAllUsedApplets", params); } - /// 获取运行时版本号 - Future 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 params = { - 'info': info, - 'isSingleProcess': isSingleProcess, - }; - return await _channel.invokeMapMethod("scanOpenApplet", params); - } - - /// 通过二维码打开小程序 - /// [qrcode] 二维码内容 - Future qrcodeOpenApplet(String qrcode, {bool isSingleProcess = false}) async { - Map params = { - 'qrcode': qrcode, - 'isSingleProcess': isSingleProcess, - }; - return await _channel.invokeMapMethod("qrcodeOpenApplet", params); + /// get current using applet + /// 获取当前正在使用的小程序信息 + /// {appId,name,icon,description,version,thumbnail} + Future> currentApplet() async { + final ret = await _channel.invokeMapMethod("currentApplet"); + return Map.from(ret!); } /// 根据微信QrCode信息解析小程序信息 @@ -1152,49 +1153,11 @@ class Mop { _channel.invokeMethod("registerExtensionApi", {"name": name}); } - /// 获取国密加密 - Future 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 closeApplet(String appletId, bool animated) async { - await _channel.invokeMethod( - "closeApplet", {"appletId": appletId, "animated": animated}); - return; - } - - /// 结束小程序 小程序会从内存中清除 - Future 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 sendCustomEvent( - String appId, Map eventData) async { - await _channel.invokeMethod( - "sendCustomEvent", {"appId": appId, "eventData": eventData}); - return; + /// register webview extension api + /// 注册webview拓展api + void addWebExtentionApi(String name, ExtensionApiHandler handler) { + _webExtensionApis[name] = handler; + _channel.invokeMethod("addWebExtentionApi", {"name": name}); } /// 原生调用webview中的js方法 @@ -1213,14 +1176,51 @@ class Mop { return; } - /// register webview extension api - /// 注册webview拓展api - void addWebExtentionApi(String name, ExtensionApiHandler handler) { - _webExtensionApis[name] = handler; - _channel.invokeMethod("addWebExtentionApi", {"name": name}); + /// 原生发送事件给小程序 + /// [appId] 小程序id + /// [eventData] 事件对象 + Future sendCustomEvent( + String appId, Map eventData) async { + await _channel.invokeMethod( + "sendCustomEvent", {"appId": appId, "eventData": eventData}); + return; } - /// 将当前正在运行的最后一个打开的小程序移至任务栈前台 + Future> changeUserId(String userId) async { + Map params = {'userId': userId}; + final ret = await _channel.invokeMapMethod("changeUserId", params); + return Map.from(ret!); + } + + /// 获取运行时版本号 + Future sdkVersion() async { + return await _channel + .invokeMapMethod("sdkVersion") + .then((value) => value?["data"]); + } + + /// 获取国密加密 + Future getSMSign(String plainText) async { + var result = + await _channel.invokeMapMethod("smsign", {'plainText': plainText}); + var data = result?['data']['data']; + debugPrint(data); + return data; + } + + /// WKWebView的弹性设置,仅iOS生效 + 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"); }