admin
2022-05-07 4c7cde7ae5ed57335405459e47de4bbd2726c4ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import 'dart:io';
import 'dart:ui';
 
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:makemoney/api/team_api.dart';
import 'package:makemoney/model/user/user_info.dart';
import 'package:makemoney/ui/widget/button.dart';
import 'package:makemoney/ui/widget/images_widget.dart';
import 'package:makemoney/ui/widget/verification_box.dart';
import 'package:makemoney/utils/ui_utils.dart';
import '../../utils/ui_constant.dart';
import '../../ui/widget/nav.dart';
import '../../utils/pageutils.dart';
 
import 'advice_submit.dart';
import 'package:launch_review/launch_review.dart';
 
class MyBossPage extends StatefulWidget {
  MyBossPage({Key? key, required this.title}) : super(key: key);
 
  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.
 
  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".
 
  final String title;
 
  @override
  _MyBossPageState createState() => _MyBossPageState();
}
 
class _MyBossPageState extends State<MyBossPage>
    with SingleTickerProviderStateMixin {
  UserInfo? _user;
 
  @override
  void initState() {
    super.initState();
    _getMyBoss();
  }
 
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        resizeToAvoidBottomInset: false,
        backgroundColor: const Color(0xFFFFFFFF),
        body: Flex(
          direction: Axis.vertical,
          children: [
            TopNavBar(title: "邀请人"),
            _user == null
                ? Container()
                : Expanded(
                    child: Container(
                        color: ColorConstant.theme,
                        child: Stack(
                          children: [
                            AspectRatio(
                              aspectRatio: 1.875,
                              child: Image.asset(
                                "assets/imgs/mine/ic_my_boss_top_bg.png",
                                fit: BoxFit.fill,
                              ),
                            ),
                            Container(
                              margin: const EdgeInsets.fromLTRB(10, 118, 10, 0),
                              decoration: const BoxDecoration(
                                  borderRadius: BorderRadius.only(
                                      topRight: Radius.circular(13),
                                      topLeft: Radius.circular(13)),
                                  color: Colors.white),
                            ),
                            Positioned(
                                top: 90,
                                left: 60,
                                right: 60,
                                child: Column(
                                  children: [
                                    //-------头像--------
                                    portraitWidget(),
                                    //昵称
                                    Text(
                                      _user == null ? "" : _user!.nickName!,
                                      style: const TextStyle(
                                          color: Color(0xFF333333),
                                          fontSize: 13,
                                          fontWeight: FontWeight.bold),
                                    ),
                                    //内容
                                    const SizedBox(
                                      height: 15,
                                    ),
                                    const Text(
                                      "恭喜你,你已成功加入好友团队!",
                                      style: TextStyle(
                                          color: ColorConstant.theme,
                                          fontSize: 18,
                                          fontWeight: FontWeight.bold),
                                    ),
                                    const SizedBox(
                                      height: 35,
                                    ),
                                    MyFillButton(
                                      "返    回",
                                      13,
                                      height: 42,
                                      fontSize: 15,
                                      onClick: () {
                                        popPage(context);
                                      },
                                    ),
                                  ],
                                ))
                          ],
                        )))
          ],
        ));
  }
 
  void _getMyBoss() async {
    Map<String, dynamic>? result = await TeamApiUtil.getMyBossInfo(context);
    if (result == null) {
      popPage(context);
      return;
    }
    if (result["code"] != 0) {
      ToastUtil.toast(result["msg"], context);
      popPage(context);
      return;
    }
    UserInfo temp = UserInfo.fromJson(result["data"]);
    setState(() {
      _user = temp;
    });
  }
 
  Widget portraitWidget() {
    return InkWell(
        onTap: () {},
        child: Container(
            width: 90,
            height: 90,
            padding: const EdgeInsets.all(4),
            alignment: Alignment.center,
            decoration: BoxDecoration(
                color: Colors.white, borderRadius: BorderRadius.circular(50)),
            child: ClipRRect(
                borderRadius: BorderRadius.circular(50),
                child: CommonImage(
                    _user != null
                        ? _user!.portrait!
                        : "assets/imgs/ic_portrait_default.png",
                    defaultWidget:
                        Image.asset("assets/imgs/ic_portrait_default.png")))));
  }
}