From 039917ee11fa2df2c415abb0de0ff535980ad57c Mon Sep 17 00:00:00 2001 From: wanghualei Date: Wed, 24 May 2023 22:06:29 +0800 Subject: [PATCH] =?UTF-8?q?ios=E6=94=AF=E6=8C=81=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=97=B6=E8=AE=BE=E7=BD=AE=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/lib/main.dart | 2 +- ios/Classes/Api/MOP_startApplet.h | 1 + ios/Classes/Api/MOP_startApplet.m | 1 + lib/mop.dart | 5 +++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 32604b4..916050a 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -131,7 +131,7 @@ class _MyAppState extends State { _buildAppletItem(appletId, "打开小程序", () { // Mop.instance.openApplet(appletId, // path: 'pages/index/index', query: ''); - RemoteAppletRequest request = RemoteAppletRequest(apiServer: 'https://api.finclip.com', appletId: appletId); + RemoteAppletRequest request = RemoteAppletRequest(apiServer: 'https://api.finclip.com', appletId: appletId, transitionStyle: TranstionStyle.TranstionStyleUp); Mop.instance.startApplet(request); }), _buildAppletItem(appletId, "finishRunningApplet", () { diff --git a/ios/Classes/Api/MOP_startApplet.h b/ios/Classes/Api/MOP_startApplet.h index d51f4df..27c6b3c 100644 --- a/ios/Classes/Api/MOP_startApplet.h +++ b/ios/Classes/Api/MOP_startApplet.h @@ -18,6 +18,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSString *offlineMiniprogramZipPath; @property (nonatomic, copy) NSString *offlineFrameworkZipPath; @property (nonatomic, strong) NSString *animated; +@property (nonatomic, strong) NSString *transitionStyle; @end diff --git a/ios/Classes/Api/MOP_startApplet.m b/ios/Classes/Api/MOP_startApplet.m index d998603..744db0a 100644 --- a/ios/Classes/Api/MOP_startApplet.m +++ b/ios/Classes/Api/MOP_startApplet.m @@ -25,6 +25,7 @@ request.offlineMiniprogramZipPath = self.offlineMiniprogramZipPath; request.offlineFrameworkZipPath = self.offlineFrameworkZipPath; request.animated = [self.animated boolValue]; + request.transitionStyle = [self.transitionStyle intValue]; // 启动小程序 [[FATClient sharedClient] startAppletWithRequest:request InParentViewController:currentVC completion:^(BOOL result, NSError *error) { diff --git a/lib/mop.dart b/lib/mop.dart index a579ca0..37a27fb 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -788,6 +788,9 @@ class RemoteAppletRequest { // iOS端打开小程序时是否显示动画,默认为true。 bool animated; + // iOS端打开小程序时的动画方式 + TranstionStyle transitionStyle; + // 是否以单进程模式运行,仅限android,默认为false bool isSingleProcess; @@ -799,6 +802,7 @@ class RemoteAppletRequest { this.offlineMiniprogramZipPath, this.offlineFrameworkZipPath, this.animated = true, + this.transitionStyle = TranstionStyle.TranstionStyleUp, this.isSingleProcess = false, }); @@ -809,6 +813,7 @@ class RemoteAppletRequest { "appletId": appletId, "animated": animated, "isSingleProcess": isSingleProcess, + "transitionStyle":transitionStyle.index, }; if (startParams != null) result["startParams"] = startParams; if (offlineMiniprogramZipPath != null)