panhui 6 лет назад
Родитель
Сommit
fe1ab0cb32
2 измененных файлов с 25 добавлено и 6 удалено
  1. 0 1
      lib/pages/LoginSecond.dart
  2. 25 5
      lib/pages/UserPage.dart

+ 0 - 1
lib/pages/LoginSecond.dart

@@ -114,7 +114,6 @@ class LoginSecondState extends State<LoginSecond> {
                                 ? Container(
                                 ? Container(
                                     margin: EdgeInsets.only(top: 10),
                                     margin: EdgeInsets.only(top: 10),
                                     child: ITextField(
                                     child: ITextField(
-                                      maxLength: 6,
                                       keyboardType: ITextInputType.password,
                                       keyboardType: ITextInputType.password,
                                       prefixIcon: Container(
                                       prefixIcon: Container(
                                         padding: EdgeInsets.all(10),
                                         padding: EdgeInsets.all(10),

+ 25 - 5
lib/pages/UserPage.dart

@@ -26,12 +26,30 @@ class UserPage extends StatefulWidget {
 
 
 class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
 class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
   CustomerService customerService;
   CustomerService customerService;
+  bool isManage=false;
 
 
   Future<void> getUserInfo() async {
   Future<void> getUserInfo() async {
     Result res = await HttpManager.get('userInfo/getUserInfo');
     Result res = await HttpManager.get('userInfo/getUserInfo');
     if (res.success) {
     if (res.success) {
       print(res.data);
       print(res.data);
       StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(UserInfo.fromJson(res.data)));
       StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(UserInfo.fromJson(res.data)));
+
+      if (res.data['channel'] != null) {
+        Result res2 = await HttpManager.get('channelInfo/getChannelInfo', data: {"id": res.data['channel']});
+        print(res2.data);
+        if (res2.success) {
+          if (res2.data['channelManager'] != null && res2.data['channelManager'] == res.data['id']) {
+            setState(() {
+              isManage=true;
+            });
+          }
+          else{
+              setState(() {
+              isManage=false;
+            });
+          }
+        }
+      }
     } else {}
     } else {}
 
 
     Result res2 = await HttpManager.get('customerService/random');
     Result res2 = await HttpManager.get('customerService/random');
@@ -84,7 +102,7 @@ class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
                               height: 2,
                               height: 2,
                             ),
                             ),
                             Text(
                             Text(
-                              userInfo.nickname,
+                              userInfo.nickname+(isManage?'(代理)':''),
                               style: TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w700),
                               style: TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w700),
                             ),
                             ),
                             Container(
                             Container(
@@ -108,10 +126,12 @@ class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
                                 Container(
                                 Container(
                                   width: 10,
                                   width: 10,
                                 ),
                                 ),
-                                customerService!=null?Text(
-                                  '客服QQ:${customerService.qq}',
-                                  style: TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.w600),
-                                ):Container(),
+                                customerService != null
+                                    ? Text(
+                                        '客服QQ:${customerService.qq}',
+                                        style: TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.w600),
+                                      )
+                                    : Container(),
                               ],
                               ],
                             ),
                             ),
                             Container(
                             Container(