Bladeren bron

1.优化url唤起京东的流程

tags/0.0.17+3
“yanghuaxuan” 3 jaren geleden
bovenliggende
commit
7b342708a8
1 gewijzigde bestanden met toevoegingen van 6 en 4 verwijderingen
  1. +6
    -4
      lib/util/router_util.dart

+ 6
- 4
lib/util/router_util.dart Bestand weergeven

@@ -6,6 +6,7 @@ import 'package:flutter_alibc/alibc_const_key.dart';
import 'package:flutter_alibc/flutter_alibc.dart';
import 'package:jdsdk/jdsdk.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:zhiying_comm/pages/login_page/account/login_account_page.dart';
import 'package:zhiying_comm/pages/login_page/login_page.dart';
import 'package:zhiying_comm/util/dialog/loading/loading.dart';
@@ -48,7 +49,7 @@ class RouterUtil {
}
}

// TODO webView 临时代码,IOS添加原生WebView需要改动这里
if (skipModel?.skipIdentifier == 'pub.flutter.url') {
if (skipModel?.url?.contains("sourceType=jd") ?? false) {
Loading.show(context);
@@ -57,10 +58,11 @@ class RouterUtil {
var detailUrl = responds?.realUri?.toString();
Logger.debug(detailUrl ?? "");
Loading.dismiss();
Jdsdk.openUrl(url: detailUrl);
return;
if (await canLaunch(detailUrl)) {
Jdsdk.openUrl(url: detailUrl);
return;
}
}

RouterUtil.openWebview(skipModel?.url, context);
return;
}


Laden…
Annuleren
Opslaan