From 1c68279be35f017c7008d4cd26b7c9591c4a376b Mon Sep 17 00:00:00 2001 From: Weller <1812208341@qq.com> Date: Sat, 14 Nov 2020 13:45:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dios=E6=89=93=E5=BC=80?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9APP=EF=BC=8C=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=83=BD=E5=90=A6=E6=89=93=E5=BC=80bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/util/turn_chain/turn_chain_util.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/util/turn_chain/turn_chain_util.dart b/lib/util/turn_chain/turn_chain_util.dart index d23dee5..0d07730 100644 --- a/lib/util/turn_chain/turn_chain_util.dart +++ b/lib/util/turn_chain/turn_chain_util.dart @@ -104,9 +104,10 @@ class TurnChainUtil { case GlobalConfig.PROVIDER_PDD: case GlobalConfig.PROVIDER_SN: case GlobalConfig.PROVIDER_VIP: - if (!EmptyUtil.isEmpty(appUrl) && await canLaunch(appUrl)) { - Logger.log('打开${provider} app, url = ${appUrl}'); - launch(appUrl); + print(await canLaunch(appUrl)); + bool launchable = await launch(appUrl); + if (launchable) { + // Logger.log('打开${provider} app, url = ${appUrl}'); } else if (!EmptyUtil.isEmpty(webUrl)) { Logger.log('打开${provider} webUrl, url = ${webUrl}'); RouterUtil.openWebview(webUrl, context); From fc391179b13b50d7311010afff51071d02ee0065 Mon Sep 17 00:00:00 2001 From: Weller <1812208341@qq.com> Date: Sat, 14 Nov 2020 17:32:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=B9=B3=E5=8F=B0=E5=B7=AE=E5=BC=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/util/turn_chain/turn_chain_util.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/util/turn_chain/turn_chain_util.dart b/lib/util/turn_chain/turn_chain_util.dart index 0d07730..62ad40d 100644 --- a/lib/util/turn_chain/turn_chain_util.dart +++ b/lib/util/turn_chain/turn_chain_util.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter_alibc/alibc_model.dart'; import 'package:flutter_alibc/flutter_alibc.dart'; +import 'package:fluttertoast/fluttertoast.dart'; import 'package:jdsdk/jdsdk.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:zhiying_comm/models/user/user_info_model.dart'; @@ -12,7 +13,7 @@ import 'package:zhiying_comm/util/global_config.dart'; import 'package:zhiying_comm/util/log/let_log.dart'; import 'package:zhiying_comm/util/net_util.dart'; import 'package:zhiying_comm/util/taobao/taobao_auth.dart'; -import 'package:fluttertoast/fluttertoast.dart'; + import '../router_util.dart'; class TurnChainUtil { @@ -104,10 +105,14 @@ class TurnChainUtil { case GlobalConfig.PROVIDER_PDD: case GlobalConfig.PROVIDER_SN: case GlobalConfig.PROVIDER_VIP: - print(await canLaunch(appUrl)); - bool launchable = await launch(appUrl); + bool launchable = await canLaunch(appUrl); + if (Platform.isIOS) { + launchable = await launch(appUrl); + } if (launchable) { - // Logger.log('打开${provider} app, url = ${appUrl}'); + if (!Platform.isIOS) { + await launch(appUrl); + } } else if (!EmptyUtil.isEmpty(webUrl)) { Logger.log('打开${provider} webUrl, url = ${webUrl}'); RouterUtil.openWebview(webUrl, context);