Browse Source

1.优化公共跳转

tags/0.0.7+4
“yanghuaxuan” 3 years ago
parent
commit
d2f24c874e
2 changed files with 21 additions and 0 deletions
  1. +20
    -0
      lib/util/turn_chain/turn_chain_util.dart
  2. +1
    -0
      lib/zhiying_comm.dart

+ 20
- 0
lib/util/turn_chain/turn_chain_util.dart View File

@@ -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) {


+ 1
- 0
lib/zhiying_comm.dart View File

@@ -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';

Loading…
Cancel
Save