diff --git a/lib/models/base/base_change_notifier.dart b/lib/models/base/base_change_notifier.dart index 05cbf5c..b32638d 100644 --- a/lib/models/base/base_change_notifier.dart +++ b/lib/models/base/base_change_notifier.dart @@ -6,12 +6,15 @@ import 'package:provider/provider.dart'; class BaseChangeNotifier extends ChangeNotifier { StreamController pageController = StreamController.broadcast(); + static Map hasKeys = Map(); + ///刷新通知方法 void refresh() { pageController.add("refresh"); notifyListeners(); } + void close() { pageController.close(); } @@ -29,8 +32,8 @@ enum EventType { ///页面刷新辅助类 class RefreshListener { bool isListen = false; - StreamSubscription streamSubscription; - + Map hasKeys = Map(); + StreamSubscription streamSubscription; ///监听方法 ///已废弃 void _listen(BuildContext context, Function(String) refresh) { @@ -54,19 +57,18 @@ class RefreshListener { } ///监听构造 - RefreshListener.listen(BuildContext context, Function(String) refresh) { + void listen(BuildContext context, Function(String) refresh) { + BaseChangeNotifier baseChangeNotifier; try { baseChangeNotifier = Provider.of(context); } catch (e, s) { print(e); print(s); - throw Exception( - "父页面或父控件必须添加 BaseChangeNotifier 的 Provide值才能使用RefreshListener对象"); } if (!isListen && baseChangeNotifier != null) { isListen = true; - baseChangeNotifier.stream.listen((event) { + streamSubscription= baseChangeNotifier.stream.listen((event) { if (refresh != null) { refresh(event); } @@ -77,7 +79,7 @@ class RefreshListener { ///关闭监听 void close() { if (streamSubscription != null) { - streamSubscription.cancel(); + streamSubscription?.cancel(); } } } \ No newline at end of file diff --git a/lib/models/base/skip_model.dart b/lib/models/base/skip_model.dart index b914142..14bb590 100644 --- a/lib/models/base/skip_model.dart +++ b/lib/models/base/skip_model.dart @@ -4,6 +4,7 @@ class SkipModel { String requiredTaobaoAuth; String skipIdentifier; String isJump; + String skipName; Map data; SkipModel({ @@ -26,6 +27,7 @@ class SkipModel { requiredTaobaoAuth = json['required_taobao_auth']?.toString(); skipIdentifier = json['skip_identifier']; isJump = json['is_jump']?.toString(); + skipName=json['skip_name']; } Map toJson() { @@ -36,6 +38,7 @@ class SkipModel { data['skip_identifier'] = this.skipIdentifier; data['is_jump'] = this.isJump; data['data'] = this.data; + data['skip_name']=this.skipName; return data; } } diff --git a/lib/util/turn_chain/turn_chain_util.dart b/lib/util/turn_chain/turn_chain_util.dart index 6414b58..99ddc23 100644 --- a/lib/util/turn_chain/turn_chain_util.dart +++ b/lib/util/turn_chain/turn_chain_util.dart @@ -231,10 +231,8 @@ class TurnChainUtil { RouterUtil.openWebview(webUrl, context); rlt = true; } else { - tradeResult = await FlutterAlibc.openByUrl( - url: openAppUrl, - schemeType: provider == GlobalConfig.PROVIDER_TM ? AlibcSchemeType.AlibcSchemeTmall : AlibcSchemeType.AlibcSchemeTaoBao, - ); + + tradeResult = await FlutterAlibc.openByUrl(url: openAppUrl,schemeType: provider==GlobalConfig.PROVIDER_TB?AlibcSchemeType.AlibcSchemeTaoBao:AlibcSchemeType.AlibcSchemeTmall,); rlt = true; } }