| | |
| | | import 'package:makemoney/ui/widget/images_widget.dart'; |
| | | import 'package:makemoney/utils/pageutils.dart'; |
| | | import 'package:makemoney/utils/string_util.dart'; |
| | | import 'package:makemoney/utils/wx_util.dart'; |
| | | |
| | | import '../../api/user_api.dart'; |
| | | import '../../model/user/user_info.dart'; |
| | |
| | | @override |
| | | void initState() { |
| | | super.initState(); |
| | | WXAuthUtil.init(context, (s) { |
| | | UserApiUtil.bindWX(context, s).then((value) { |
| | | if (value == null) { |
| | | return; |
| | | } |
| | | if (value["code"] == 0) { |
| | | ToastUtil.toast("微信绑定成功", context); |
| | | getUserInfo(); |
| | | return; |
| | | } |
| | | ToastUtil.toast(value["msg"], context); |
| | | }); |
| | | }); |
| | | |
| | | getUserInfo(); |
| | | } |
| | | |
| | |
| | | ? "未添加" |
| | | : _user!.phone!, |
| | | onClick: () { |
| | | if (_user!.phone == null) { |
| | | if (StringUtil.isNullOrEmpty( |
| | | _user!.phone)) { |
| | | //手机号绑定 |
| | | NavigatorUtil.navigateToNextPage( |
| | | context, |
| | |
| | | ? "去授权" |
| | | : _user!.wxNickName!, |
| | | onClick: () { |
| | | //TODO 微信授权 |
| | | if (!StringUtil.isNullOrEmpty( |
| | | _user!.wxNickName)) { |
| | | return; |
| | | } |
| | | WXAuthUtil.startAuth(context); |
| | | }, |
| | | canIn: StringUtil.isNullOrEmpty( |
| | | _user!.wxNickName)) |