team_card_page.dart 4.1 KB

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