| | |
| | | import 'package:flutter/cupertino.dart'; |
| | | import 'package:flutter/material.dart'; |
| | | import 'package:makemoney/api/extract_api.dart'; |
| | | import 'package:makemoney/api/user_api.dart'; |
| | | import 'package:makemoney/model/user/extract_money_model.dart'; |
| | | import 'package:makemoney/ui/widget/button.dart'; |
| | | import 'package:makemoney/ui/widget/dialog.dart'; |
| | | import 'package:makemoney/utils/ui_constant.dart'; |
| | | import 'package:makemoney/utils/ui_utils.dart'; |
| | | import 'package:makemoney/utils/wx_util.dart'; |
| | | |
| | | import '../../ui/widget/nav.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); |
| | | _getExtractInfo(); |
| | | return; |
| | | } |
| | | ToastUtil.toast(value["msg"], context); |
| | | }); |
| | | }); |
| | | _getExtractInfo(); |
| | | _getExtractDenominationList(); |
| | | } |
| | |
| | | Image.asset( |
| | | "assets/imgs/mine/ic_balance_bg.png"), |
| | | Container( |
| | | margin: EdgeInsets.only( |
| | | margin: const EdgeInsets.only( |
| | | left: 20, top: 14, bottom: 10), |
| | | child: Column( |
| | | crossAxisAlignment: |
| | |
| | | color: Colors.white, |
| | | fontSize: 12), |
| | | ), |
| | | SizedBox( |
| | | const SizedBox( |
| | | height: 5, |
| | | ), |
| | | Text.rich(TextSpan( |
| | |
| | | //绑定微信 |
| | | !_needBindWX |
| | | ? Container() |
| | | : Container( |
| | | padding: const EdgeInsets.fromLTRB(13, 10, 5, 10), |
| | | margin: const EdgeInsets.only(top: 12), |
| | | decoration: BoxDecoration( |
| | | borderRadius: BorderRadius.circular(13), |
| | | color: Colors.white), |
| | | child: Row( |
| | | children: [ |
| | | Image.asset( |
| | | "assets/imgs/mine/icon_balance_wx.png", |
| | | height: 34, |
| | | ), |
| | | const SizedBox( |
| | | width: 12.5, |
| | | ), |
| | | const Text("绑定微信", |
| | | style: TextStyle( |
| | | color: Colors.black, fontSize: 15)), |
| | | Expanded(child: Container()), |
| | | const Text("去绑定", |
| | | style: TextStyle( |
| | | color: Color(0xFF333333), |
| | | fontSize: 11)), |
| | | const Icon( |
| | | Icons.chevron_right, |
| | | size: 30, |
| | | color: Color(0xff2222222), |
| | | ) |
| | | ], |
| | | ), |
| | | ), |
| | | : InkWell( |
| | | onTap: () { |
| | | WXAuthUtil.startAuth(context); |
| | | }, |
| | | child: Container( |
| | | padding: |
| | | const EdgeInsets.fromLTRB(13, 10, 5, 10), |
| | | margin: const EdgeInsets.only(top: 12), |
| | | decoration: BoxDecoration( |
| | | borderRadius: BorderRadius.circular(13), |
| | | color: Colors.white), |
| | | child: Row( |
| | | children: [ |
| | | Image.asset( |
| | | "assets/imgs/mine/icon_balance_wx.png", |
| | | height: 34, |
| | | ), |
| | | const SizedBox( |
| | | width: 12.5, |
| | | ), |
| | | const Text("绑定微信", |
| | | style: TextStyle( |
| | | color: Colors.black, fontSize: 15)), |
| | | Expanded(child: Container()), |
| | | const Text("去绑定", |
| | | style: TextStyle( |
| | | color: Color(0xFF333333), |
| | | fontSize: 11)), |
| | | const Icon( |
| | | Icons.chevron_right, |
| | | size: 30, |
| | | color: Color(0xff2222222), |
| | | ) |
| | | ], |
| | | ), |
| | | )), |
| | | const SizedBox( |
| | | height: 12, |
| | | ), |