Browse Source

1、添加淘宝打开url

tags/0.0.15+7
“yanghuaxuan” 3 years ago
parent
commit
eb6b22b4c1
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      lib/util/router_util.dart

+ 14
- 0
lib/util/router_util.dart View File

@@ -2,9 +2,11 @@ import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_alibc/flutter_alibc.dart';
import 'package:provider/provider.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';
import 'package:zhiying_comm/util/event_util/event_util.dart';
import 'package:zhiying_comm/util/event_util/login_success_event.dart';
import 'package:zhiying_comm/util/shared_prefe_util.dart';
@@ -49,6 +51,18 @@ class RouterUtil {
return;
}

if (skipModel?.skipIdentifier == 'pub.flutter.taobao_url') {
print("淘宝链接"+skipModel.url);
Loading.show(context);
Dio dio = Dio();
var responds = await dio.get(skipModel.url);
var detailUrl = responds?.realUri?.toString();
Logger.debug(detailUrl??"");
Loading.dismiss();
FlutterAlibc.openByUrl(url: detailUrl);
return;
}

Widget page = EmptyPage();
if (PageFactory.hasRegisted(skipModel.skipIdentifier)) {
page = PageFactory.create(skipModel.skipIdentifier, data);


Loading…
Cancel
Save