team_card_page.dart 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. }, onError: (code, msg) {
  36. toasts(msg);
  37. });
  38. }
  39. @override
  40. Widget build(BuildContext context) {
  41. return Scaffold(
  42. appBar: MyAppBar(
  43. centerTitle: "我的团队",
  44. actions: <Widget>[
  45. Offstage(
  46. offstage: !item.managerFlag,
  47. child: FlatButton(
  48. child: Text("认证信息"),
  49. textColor: Colours.tip_text_black,
  50. highlightColor: Colors.transparent,
  51. onPressed: () {
  52. if (item.isCertificated == 0) {
  53. NavigatorUtils.push(
  54. context, TeamRouter.teamAuthUploadPage);
  55. } else {
  56. NavigatorUtils.push(context, TeamRouter.teamAuthPage);
  57. }
  58. },
  59. ))
  60. ],
  61. ),
  62. body: ListView(padding: EdgeInsets.all(0.0), children: <Widget>[
  63. Container(
  64. padding: EdgeInsets.only(top: 10, bottom: 20),
  65. color: ThemeUtils.getTabsBg(context),
  66. child: Center(
  67. child: CircleAvatar(
  68. radius: 30.0,
  69. backgroundColor: Colors.transparent,
  70. backgroundImage: ImageUtils.getImageProvider(item.logoImg)),
  71. ),
  72. ),
  73. Container(
  74. padding: EdgeInsets.only(bottom: 20),
  75. color: ThemeUtils.getTabsBg(context),
  76. child: Center(
  77. child: Container(
  78. padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
  79. decoration: BoxDecoration(
  80. color: Colours.app_main,
  81. borderRadius: BorderRadius.circular(12)),
  82. child: Text(
  83. item.isCertificated == 1
  84. ? "已认证"
  85. : item.isCertificated == 2
  86. ? "审核中"
  87. : "未认证",
  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. }