@@ -225,7 +225,7 @@ class _SecurityBindAlipayContainerState | |||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
}else{ | }else{ | ||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
// Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -197,7 +197,7 @@ class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { | |||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
} else { | } else { | ||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
// Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | } | ||||
} | } | ||||
@@ -164,7 +164,7 @@ class _SecurityMobileUnbindState extends State<SecurityMobileUnbind> { | |||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
} else { | } else { | ||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
// Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | } | ||||
} | } | ||||
@@ -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_base_widget/pages/security_page/security_page_bloc.dart'; | ||||
import 'package:zhiying_comm/util/base_bloc.dart'; | import 'package:zhiying_comm/util/base_bloc.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.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> { | class _SecurityContainerState extends State<_SecurityContainer> { | ||||
SecurityPageBloc _bloc; | SecurityPageBloc _bloc; | ||||
UserInfoModel _user; | |||||
@override | |||||
void didChangeDependencies() { | |||||
_user = Provider.of<UserInfoNotifier>(context).userInfo; | |||||
super.didChangeDependencies(); | |||||
} | |||||
@override | @override | ||||
void initState() { | void initState() { | ||||
@@ -149,6 +158,18 @@ class _SecurityContainerState extends State<_SecurityContainer> { | |||||
), | ), | ||||
), | ), | ||||
onTap: () async { | 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( | await RouterUtil.route( | ||||
item, | item, | ||||
Map<String, dynamic>.from( | Map<String, dynamic>.from( | ||||
@@ -167,7 +167,7 @@ class _SecurityPasswordState extends State<SecurityPassword> { | |||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
}else{ | }else{ | ||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
// Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | } | ||||
// NetUtil.request('/api/v1/settings/account/security/password/sms', | // NetUtil.request('/api/v1/settings/account/security/password/sms', | ||||
@@ -155,7 +155,7 @@ class _SecurityUnbinAlipayState extends State<SecurityUnbinAlipay> { | |||||
setState(() {}); | setState(() {}); | ||||
}); | }); | ||||
} else { | } else { | ||||
Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
// Fluttertoast.showToast(msg: '获取验证码失败'); | |||||
} | } | ||||
} | } | ||||
@@ -44,7 +44,9 @@ class _SettingContainerState extends State<_SettingContainer> { | |||||
@override | @override | ||||
void initState() { | void initState() { | ||||
_bloc = BlocProvider.of<SettingPageBloc>(context); | _bloc = BlocProvider.of<SettingPageBloc>(context); | ||||
_bloc.loadData(widget.data['skip_identifier']); | |||||
// if(!EmptyUtil.isEmpty(widget.data)) { | |||||
_bloc.loadData(widget.data['skip_identifier']); | |||||
// } | |||||
super.initState(); | super.initState(); | ||||
} | } | ||||
@@ -95,7 +95,7 @@ final SkipModel skipModel; | |||||
), | ), | ||||
onTap:() { | onTap:() { | ||||
RouterUtil.route(skipModel, null, context); | |||||
RouterUtil.route(skipModel, skipModel.toJson(), context); | |||||
}); | }); | ||||
} | } | ||||
} | } |