From 93434d0db0ff82259cb688b9bcf50fd4824b057e Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Fri, 25 Dec 2020 10:18:55 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=9F=AD=E4=BF=A1=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=8F=90=E7=A4=BA=202=E3=80=81?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E6=B7=98=E5=AE=9D=E6=8E=88?= =?UTF-8?q?=E6=9D=83=203=E3=80=81=E6=88=91=E7=9A=84=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security_bind_alipay_page.dart | 2 +- .../security_mobile/security_mobile.dart | 2 +- .../security_mobile_unbind.dart | 2 +- lib/pages/security_page/security_page.dart | 21 +++++++++++++++++++ .../security_password/security_password.dart | 2 +- .../security_unbin_alipay.dart | 2 +- lib/pages/setting_page/setting_page.dart | 4 +++- lib/widgets/mine/mine_nav/mine_nav.dart | 2 +- 8 files changed, 30 insertions(+), 7 deletions(-) diff --git a/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart b/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart index 5e3df54..e4c3de1 100644 --- a/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart +++ b/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart @@ -225,7 +225,7 @@ class _SecurityBindAlipayContainerState setState(() {}); }); }else{ - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } } } diff --git a/lib/pages/security_page/security_mobile/security_mobile.dart b/lib/pages/security_page/security_mobile/security_mobile.dart index 0661915..a167a01 100644 --- a/lib/pages/security_page/security_mobile/security_mobile.dart +++ b/lib/pages/security_page/security_mobile/security_mobile.dart @@ -197,7 +197,7 @@ class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { setState(() {}); }); } else { - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } } diff --git a/lib/pages/security_page/security_mobile/security_mobile_unbind.dart b/lib/pages/security_page/security_mobile/security_mobile_unbind.dart index 22269e0..9d44f54 100644 --- a/lib/pages/security_page/security_mobile/security_mobile_unbind.dart +++ b/lib/pages/security_page/security_mobile/security_mobile_unbind.dart @@ -164,7 +164,7 @@ class _SecurityMobileUnbindState extends State { setState(() {}); }); } else { - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } } diff --git a/lib/pages/security_page/security_page.dart b/lib/pages/security_page/security_page.dart index 5bc14b3..c2923eb 100644 --- a/lib/pages/security_page/security_page.dart +++ b/lib/pages/security_page/security_page.dart @@ -4,6 +4,7 @@ import 'package:zhiying_base_widget/pages/security_page/models/security_style_mo import 'package:zhiying_base_widget/pages/security_page/security_page_bloc.dart'; import 'package:zhiying_comm/util/base_bloc.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; +import 'package:provider/provider.dart'; /// /// 账号安全 @@ -41,6 +42,14 @@ class _SecurityContainer extends StatefulWidget { class _SecurityContainerState extends State<_SecurityContainer> { SecurityPageBloc _bloc; + UserInfoModel _user; + + @override + void didChangeDependencies() { + _user = Provider.of(context).userInfo; + super.didChangeDependencies(); + } + @override void initState() { @@ -149,6 +158,18 @@ class _SecurityContainerState extends State<_SecurityContainer> { ), ), onTap: () async { + // 淘宝授权不跳转 + if(item.skipIdentifier == 'pub.flutter.account_security_toabao_auth'){ + if(_user == null || EmptyUtil.isEmpty(_user.token)){ + RouterUtil.goLogin(context); + return; + } + if( !(_user?.isTBAuth ?? false)) { + // 淘宝授权 + await TaobaoAuth.auth(context); + } + return; + } await RouterUtil.route( item, Map.from( diff --git a/lib/pages/security_page/security_password/security_password.dart b/lib/pages/security_page/security_password/security_password.dart index b781178..0fee690 100644 --- a/lib/pages/security_page/security_password/security_password.dart +++ b/lib/pages/security_page/security_password/security_password.dart @@ -167,7 +167,7 @@ class _SecurityPasswordState extends State { setState(() {}); }); }else{ - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } // NetUtil.request('/api/v1/settings/account/security/password/sms', diff --git a/lib/pages/security_page/security_unbind_alipay/security_unbin_alipay.dart b/lib/pages/security_page/security_unbind_alipay/security_unbin_alipay.dart index cd73011..82b5300 100644 --- a/lib/pages/security_page/security_unbind_alipay/security_unbin_alipay.dart +++ b/lib/pages/security_page/security_unbind_alipay/security_unbin_alipay.dart @@ -155,7 +155,7 @@ class _SecurityUnbinAlipayState extends State { setState(() {}); }); } else { - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } } diff --git a/lib/pages/setting_page/setting_page.dart b/lib/pages/setting_page/setting_page.dart index 09f30df..290c52d 100644 --- a/lib/pages/setting_page/setting_page.dart +++ b/lib/pages/setting_page/setting_page.dart @@ -44,7 +44,9 @@ class _SettingContainerState extends State<_SettingContainer> { @override void initState() { _bloc = BlocProvider.of(context); - _bloc.loadData(widget.data['skip_identifier']); + // if(!EmptyUtil.isEmpty(widget.data)) { + _bloc.loadData(widget.data['skip_identifier']); + // } super.initState(); } diff --git a/lib/widgets/mine/mine_nav/mine_nav.dart b/lib/widgets/mine/mine_nav/mine_nav.dart index d8a35b6..0da777d 100644 --- a/lib/widgets/mine/mine_nav/mine_nav.dart +++ b/lib/widgets/mine/mine_nav/mine_nav.dart @@ -95,7 +95,7 @@ final SkipModel skipModel; ), onTap:() { - RouterUtil.route(skipModel, null, context); + RouterUtil.route(skipModel, skipModel.toJson(), context); }); } }