team_card_page.dart 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:liftmanager/internal/team/model/team_info_item.dart';
  4. import 'package:liftmanager/internal/team/team_router.dart';
  5. import 'package:liftmanager/net/api_service.dart';
  6. import 'package:liftmanager/res/colors.dart';
  7. import 'package:liftmanager/res/gaps.dart';
  8. import 'package:liftmanager/routers/fluro_navigator.dart';
  9. import 'package:liftmanager/utils/image_utils.dart';
  10. import 'package:liftmanager/utils/theme_utils.dart';
  11. import 'package:liftmanager/utils/toast.dart';
  12. import 'package:liftmanager/widgets/app_bar.dart';
  13. import 'package:liftmanager/widgets/click_item.dart';
  14. class TeamCardPage extends StatefulWidget {
  15. @override
  16. State<StatefulWidget> createState() {
  17. return TeamCardPageState();
  18. }
  19. }
  20. class TeamCardPageState extends State<TeamCardPage> {
  21. TeamInfoItem item = TeamInfoItem();
  22. @override
  23. void initState() {
  24. super.initState();
  25. getTeamInfo();
  26. }
  27. @override
  28. void dispose() {
  29. super.dispose();
  30. }
  31. getTeamInfo(){
  32. ApiService(context: context).teamDetail(onSuccess: (res){
  33. item = res;
  34. setState(() {
  35. });
  36. },onError: (code,msg){
  37. toasts(msg);
  38. });
  39. }
  40. @override
  41. Widget build(BuildContext context) {
  42. return Scaffold(
  43. appBar: MyAppBar(
  44. centerTitle: "我的团队",
  45. actions: <Widget>[
  46. Offstage(
  47. offstage: !item.managerFlag,
  48. child: FlatButton(
  49. child: Text("认证信息"),
  50. textColor: Colours.dark_text,
  51. highlightColor: Colors.transparent,
  52. onPressed: () {
  53. if(item.isCertificated == 0){
  54. NavigatorUtils.push(context, TeamRouter.teamAuthUploadPage);
  55. }else{
  56. NavigatorUtils.push(context, TeamRouter.teamAuthPage);
  57. }
  58. },
  59. )
  60. )
  61. ],
  62. ),
  63. body: ListView(padding: EdgeInsets.all(0.0), children: <Widget>[
  64. Container(
  65. padding: EdgeInsets.only(top: 10,bottom: 20),
  66. color: ThemeUtils.getTabsBg(context),
  67. child: Center(
  68. child: CircleAvatar(
  69. radius: 30.0,
  70. backgroundColor: Colors.transparent,
  71. backgroundImage: ImageUtils.getImageProvider(
  72. item.logoImg)),
  73. ),
  74. ),
  75. Container(
  76. padding: EdgeInsets.only(bottom: 20),
  77. color: ThemeUtils.getTabsBg(context),
  78. child: Center(
  79. child: Container(
  80. padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
  81. decoration: BoxDecoration(
  82. color: Colours.app_main,
  83. borderRadius: BorderRadius.circular(12)),
  84. child: Text(
  85. item.isCertificated == 1
  86. ? "已认证"
  87. : item.isCertificated == 2 ? "审核中" : "未认证",
  88. style: TextStyle(
  89. fontSize: 10,
  90. color: Colors.white,
  91. fontWeight: FontWeight.bold)),
  92. )),
  93. ),
  94. Gaps.vGap12,
  95. ClickItem(title: "团队名", content: "${item.name}"),
  96. ClickItem(title: "联系人", content: "${item.corporator}"),
  97. ClickItem(title: "联系电话", content: "${item.telephone}"),
  98. Container(
  99. margin: EdgeInsets.only(top: 8, bottom: 8),
  100. child: ClickItem(
  101. title: "团队描述",
  102. content: "${item.remarks}",
  103. ),
  104. ),
  105. // Padding(
  106. // padding: const EdgeInsets.all(16),
  107. // child: MyButton(
  108. // fontSize: 14,
  109. // onPressed: () {
  110. // _joinTeamDialog();
  111. // },
  112. // text: "加入团队",
  113. // ),
  114. // )
  115. ]));
  116. }
  117. }