diff --git a/lib/util/turn_chain/turn_chain_util.dart b/lib/util/turn_chain/turn_chain_util.dart index 4a253f1..bdba4fa 100644 --- a/lib/util/turn_chain/turn_chain_util.dart +++ b/lib/util/turn_chain/turn_chain_util.dart @@ -119,6 +119,26 @@ class TurnChainUtil { case GlobalConfig.PROVIDER_KL: case GlobalConfig.PROVIDER_PDD: case GlobalConfig.PROVIDER_SN: + bool launchable = await canLaunch(appUrl); + if (Platform.isIOS) { + launchable = await launch(appUrl); + } + if (launchable) { + if (!Platform.isIOS) { + if(appUrl.startsWith("suning")){ + RouterUtil.openWebview(webUrl, context); + }else{ + RouterUtil.openWebview(webUrl, context); + } + } + } else if (!EmptyUtil.isEmpty(webUrl)) { + Logger.log('打开${provider} webUrl, url = ${webUrl}'); + RouterUtil.openWebview(webUrl, context); + } else { + Fluttertoast.cancel(); + Fluttertoast.showToast(msg: '购买链接不存在'); + } + break; case GlobalConfig.PROVIDER_VIP: bool launchable = await canLaunch(appUrl); if (Platform.isIOS) { diff --git a/lib/zhiying_comm.dart b/lib/zhiying_comm.dart index 1e8df24..fd1a100 100644 --- a/lib/zhiying_comm.dart +++ b/lib/zhiying_comm.dart @@ -49,3 +49,4 @@ export 'package:zhiying_comm/util/encode_util.dart'; export 'package:path_provider/path_provider.dart'; export 'package:dio/dio.dart'; export 'package:fluwx/fluwx.dart'; +export 'package:permission_handler/permission_handler.dart';