Explorar o código

fix:v1.3版本的bug

Primroses %!s(int64=3) %!d(string=hai) anos
pai
achega
1d99ab3373

+ 5 - 3
lib/pages/my/achievement_detail_page.dart

@@ -289,7 +289,8 @@ Future<bool> showSharePopup(
                 ),
                 Center(
                   child: Column(
-                    children: <Widget>[                Container(
+                    children: <Widget>[
+                      Container(
                         padding: EdgeInsets.symmetric(horizontal: 17.0),
                         alignment: Alignment.centerRight,
                         child: InkWell(
@@ -311,6 +312,7 @@ Future<bool> showSharePopup(
                       Container(
                         height: 278,
                         child: new Swiper(
+                          loop: false,
                           index: startIndex,
                           itemBuilder: (BuildContext context, int index) {
                             return Column(
@@ -407,8 +409,8 @@ Future<bool> showSharePopup(
                                     Container(
                                       alignment: Alignment.center,
                                       height: 25.0,
-                                      width:
-                                      MediaQuery.of(context).size.width * 0.7,
+//                                      width:
+//                                      MediaQuery.of(context).size.width * 0.7,
                                       decoration: BoxDecoration(
                                           image: DecorationImage(
                                               image: AssetImage(

+ 2 - 2
lib/pages/my/achievement_page.dart

@@ -343,10 +343,10 @@ ListView getList(data) {
                       ),
                       Row(
                         children: <Widget>[
-                          Text("成就条件:",
+                          Text("距离下一级还需:",
                               style: Theme.of(context).textTheme.subtitle1),
                           Expanded(
-                            child: Text("${item.conditionDetail}",
+                            child: Text("${item.conditionCount - item.conditionProgress}${item.conditionMeasure}",
                                 style: Theme.of(context).textTheme.bodyText2),
                           ),
                         ],

+ 28 - 18
lib/pages/social/new_social_index_page.dart

@@ -506,12 +506,18 @@ class _PageState
                               child: Row(
                                 children: <Widget>[
                                   if (drawOneIndex.value != 0)
-                                    _buildFilterButton('${buttonList[drawOneIndex.value].gameName}',drawOneIndex,"one"),
+                                    _buildFilterButton(
+                                        '${buttonList[drawOneIndex.value].gameName}',
+                                        drawOneIndex,
+                                        "one"),
                                   Space(
                                     width: 10.0,
                                   ),
                                   if (drawTwoIndex.value != 0)
-                                    _buildFilterButton('${buttonData[drawTwoIndex.value].gameName}',drawTwoIndex,"two"),
+                                    _buildFilterButton(
+                                        '${buttonData[drawTwoIndex.value].gameName}',
+                                        drawTwoIndex,
+                                        "two"),
                                 ],
                               ),
                             ),
@@ -550,23 +556,27 @@ class _PageState
               });
         },
       ),
-      floatingActionButton: Container(
-        width: 44.0,
-        height: 44.0,
-        color: Colors.white,
-        alignment: Alignment.center,
-        child: FloatingActionButton(
-          child: Image.asset("lib/assets/img/bbs_icon_edit.png"),
-          onPressed: () {
-//            print('FloatingActionButton');
-            NavigatorUtil.goPage(
-                context,
-                (context) => PostPage(
-                      "",
-                      forums: buttonList,
-                    ));
-          },
+      floatingActionButton: InkWell(
+        child: Container(
+          width: 88.0,
+          height: 88.0,
+          alignment: Alignment.centerRight,
+          decoration: BoxDecoration(
+            image: DecorationImage(
+              image: AssetImage("lib/assets/img/bbs_icon_edit.png",)
+            ),
+//            color: Colors.white,
+          ),
         ),
+        onTap: () {
+//            print('FloatingActionButton');
+          NavigatorUtil.goPage(
+              context,
+              (context) => PostPage(
+                    "",
+                    forums: buttonList,
+                  ));
+        },
       ),
     );
   }

+ 2 - 2
lib/pages/social/post_page.dart

@@ -34,7 +34,7 @@ class PostPage extends StatefulWidget {
   final String url;  // url  转发的情况下
   final String hash; //      转发的情况下
   final String image; //     转发的情况下
-  final List<Forum> forums; // 主要是获取 forums 名字
+  final List<Forum> forums; // 主要是获取 forums 名字 分享好像拿不到这个东西...
   const PostPage(this.id, {this.post, this.forum,this.url,this.hash,this.image,this.forums});
 
   @override
@@ -113,7 +113,7 @@ class _PageState extends State<PostPage> {
                     barrierDismissible: false,
                     builder: (context) => SimpleDialog(
                           children: <Widget>[
-                            PostAction(selectLabel.forumId, postValue, imageList, widget.post?.quoteSubjectId == '0' ? widget.post?.id : widget.post?.quoteSubjectId,widget.url,widget.hash,widget.image)
+                            PostAction(selectLabel?.forumId == null? '':selectLabel.forumId, postValue, imageList, widget.post?.quoteSubjectId == '0' ? widget.post?.id : widget.post?.quoteSubjectId,widget.url,widget.hash,widget.image)
                           ],
                         ));
                 if (result == true) {

+ 9 - 9
lib/pages/social/post_widget.dart

@@ -662,14 +662,14 @@ class _PostWidgetState extends State<PostWidget> with InjectApi {
             padding: const EdgeInsets.only(bottom: 12.0, left: 12.0),
             child: Row(
               children: <Widget>[
-                Container(
-                  child: Text("来自${widget.post.forumName}", style: Theme.of(context).textTheme.bodyText1),
-                  padding: EdgeInsets.fromLTRB(8, 0, 8, 1),
-                  decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(20)), color: Color(0xfff1f1f1)),
-                ),
-                Space(
-                  width: 10,
-                ),
+//                Container(
+//                  child: Text("来自${widget.post.forumName}", style: Theme.of(context).textTheme.bodyText1),
+//                  padding: EdgeInsets.fromLTRB(8, 0, 8, 1),
+//                  decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(20)), color: Color(0xfff1f1f1)),
+//                ),
+//                Space(
+//                  width: 10,
+//                ),
                 if (widget.post.isUserTop == '1')
                   Container(
                     child: Text(
@@ -689,7 +689,7 @@ class _PostWidgetState extends State<PostWidget> with InjectApi {
               ],
             ),
           ),
-        if(post.gameName != null)
+        if(post.gameName != null && post.gameName != "" )
         Container(
             padding: EdgeInsets.fromLTRB(8.0, 0, 8.0, 16.0),
             alignment: Alignment.centerLeft,

+ 2 - 2
lib/pages/social/share_webview.dart

@@ -37,8 +37,8 @@ class _WebViewSharePageState extends State<WebViewSharePage> {
                 height: MediaQuery.of(context).size.height * 1,
                 child: WebView(
                   initialUrl:
-//                      'http://shoes-web.hiyd.com/share?h=${widget.hash}&t=${DateTime.now()}',
-                  "http://172.16.14.23:9090/share?h=${widget.hash}&t=${DateTime.now()}",
+                      'http://shoes-web.hiyd.com/share?h=${widget.hash}&t=${DateTime.now()}',
+//                  "http://172.16.14.23:9090/share?h=${widget.hash}&t=${DateTime.now()}",
                   javascriptMode: JavascriptMode.unrestricted,
                   onWebViewCreated: (WebViewController webViewController) {
                     _controller.complete(webViewController);

+ 1 - 0
lib/pages/social/user_detail_page.dart

@@ -483,6 +483,7 @@ class _PageState extends ViewStateLifecycle<UserDetailPage, UserDetailModel> wit
                                   model?.initData();
                                 },
                               );
+//                            return Text("A");
                             },
                             childCount: model.list.length,
                           ),

+ 186 - 154
lib/pages/social/user_friend_page.dart

@@ -173,7 +173,6 @@ class _PageDetailState
     super.initState();
     _focusNode = FocusNode();
     _controller = new TextEditingController(text: '');
-
   }
 
   @override
@@ -191,121 +190,133 @@ class _PageDetailState
         builder: (_, model, __) {
           return widget.type == 0
               ? Column(
-                children: <Widget>[
-                  _searchWidget(context),
-                  Space(height: 16.0,),
-                  Expanded(
-                    child: AzListView(
-                      data: model.items,
-                      susItemHeight:200,
-                      itemCount: model.items.length,
-                      indexBarData: model.items.map((e) => "${e.getSuspensionTag()}").toList(),
-                      itemBuilder: (BuildContext context, int index) {
-                        return ListTile(
-                          leading: Container(
-                            width: 44,
-                            height: 44,
-                            decoration: BoxDecoration(
-                              shape: BoxShape.rectangle,
-                              borderRadius: BorderRadius.circular(4.0),
-                              image: DecorationImage(
-                                  image: CachedNetworkImageProvider(model.items[index].user.avatar,)
+                  children: <Widget>[
+                    _searchWidget(context),
+                    Space(
+                      height: 16.0,
+                    ),
+                    Expanded(
+                      child: AzListView(
+                        data: model.items,
+                        susItemHeight: 200,
+                        itemCount: model.items.length,
+                        indexBarData: model.items
+                            .map((e) => "${e.getSuspensionTag()}")
+                            .toList(),
+                        itemBuilder: (BuildContext context, int index) {
+                          return ListTile(
+                            leading: Container(
+                              width: 44,
+                              height: 44,
+                              decoration: BoxDecoration(
+                                shape: BoxShape.rectangle,
+                                borderRadius: BorderRadius.circular(4.0),
+                                image: DecorationImage(
+                                    image: CachedNetworkImageProvider(
+                                  model.items[index].user.avatar,
+                                )),
                               ),
                             ),
-                          ),
-                          title: Text("${model.items[index].user.name}"),
-                          onTap: () {
-
-                          },
-                        );
-                      },
-                      physics: BouncingScrollPhysics(),
-                      padding: EdgeInsets.zero,
-                      susItemBuilder: (BuildContext context, int index) {
-                        return Column(
-                          children: <Widget>[
-                            Container(
+                            title: Text("${model.items[index].user.name}"),
+                            onTap: () {},
+                          );
+                        },
+                        physics: BouncingScrollPhysics(),
+                        padding: EdgeInsets.zero,
+                        susItemBuilder: (BuildContext context, int index) {
+                          return Column(
+                            children: <Widget>[
+                              Container(
 //                              height: 40,
-                              width: MediaQuery.of(context).size.width,
-                              padding: EdgeInsets.only(left: 16.0),
+                                width: MediaQuery.of(context).size.width,
+                                padding: EdgeInsets.only(left: 16.0),
 //                              color: Color(0xFFF3F4F5),
-                              alignment: Alignment.centerLeft,
-                              child: Text(
-                                '${model.items[index].getSuspensionTag()}',
-                                softWrap: false,
-                                style: TextStyle(
-                                  fontSize: 14.0,
-                                  color: Color(0xff9999999),
+                                alignment: Alignment.centerLeft,
+                                child: Text(
+                                  '${model.items[index].getSuspensionTag()}',
+                                  softWrap: false,
+                                  style: TextStyle(
+                                    fontSize: 14.0,
+                                    color: Color(0xff9999999),
+                                  ),
                                 ),
                               ),
-                            ),
-                            Divider(indent: 12.0,endIndent: 12.0,),
-                          ],
-                        );
-                      },
-                      indexBarOptions: IndexBarOptions(
-                        needRebuild: true,
-                        ignoreDragCancel: true,
-                        textStyle: TextStyle(color:Color(0xff999999),fontSize: 12.0),
-                        selectTextStyle: TextStyle(fontSize: 20, color: Theme.of(context).accentColor),
+                              Divider(
+                                indent: 12.0,
+                                endIndent: 12.0,
+                              ),
+                            ],
+                          );
+                        },
+                        indexBarOptions: IndexBarOptions(
+                          needRebuild: true,
+                          ignoreDragCancel: true,
+                          textStyle: TextStyle(
+                              color: Color(0xff999999), fontSize: 12.0),
+                          selectTextStyle: TextStyle(
+                              fontSize: 20,
+                              color: Theme.of(context).accentColor),
 //                        downTextStyle: TextStyle(fontSize: 12, color: Theme.of(context).accentColor),
 //                        selectItemDecoration: BoxDecoration(color: Colors.green),
 //                        downItemDecoration:
 //                        BoxDecoration(color: Colors.green),
-                        indexHintWidth: 33,
-                        indexHintHeight: 33,
-                            indexHintDecoration: BoxDecoration(
-                              image: DecorationImage(
-                                image: AssetImage("lib/assets/img/friendlist_bg_letter.png"),
-                                fit: BoxFit.contain,
-                              ),
+                          indexHintWidth: 33,
+                          indexHintHeight: 33,
+                          indexHintDecoration: BoxDecoration(
+                            image: DecorationImage(
+                              image: AssetImage(
+                                  "lib/assets/img/friendlist_bg_letter.png"),
+                              fit: BoxFit.contain,
                             ),
-                        indexHintTextStyle:TextStyle(fontSize: 18.0,color:Colors.white),
-                        indexHintAlignment: Alignment.centerRight,
-                        indexHintChildAlignment: Alignment(-0.25, 0.0),
-                        indexHintOffset: Offset(0, 0),
+                          ),
+                          indexHintTextStyle:
+                              TextStyle(fontSize: 18.0, color: Colors.white),
+                          indexHintAlignment: Alignment.centerRight,
+                          indexHintChildAlignment: Alignment(-0.25, 0.0),
+                          indexHintOffset: Offset(0, 0),
+                        ),
                       ),
                     ),
-                  ),
-                ],
-              ) : EasyRefresh.custom(
-            firstRefresh: false,
-            onRefresh: () => model.refresh(),
-            onLoad: () => model.loadMore(),
-            enableControlFinishRefresh: true,
-            controller: model.refreshController,
-            header: buildClassicalHeader(),
-            footer: buildClassicalFooter(),
-            slivers: <Widget>[
-              SliverToBoxAdapter(
-                child: _searchWidget(context),
-              ),
-              if (model.isBusy)
-                SliverToBoxAdapter(
-                  child: RequestLoadingWidget(),
-                ),
-              SliverList(
-                        delegate: SliverChildBuilderDelegate(
-                          (context, index) {
-                            return _buildItem(model.list[index]);
+                  ],
+                )
+              : EasyRefresh.custom(
+                  firstRefresh: false,
+                  onRefresh: () => model.refresh(),
+                  onLoad: () => model.loadMore(),
+                  enableControlFinishRefresh: true,
+                  controller: model.refreshController,
+                  header: buildClassicalHeader(),
+                  footer: buildClassicalFooter(),
+                  slivers: <Widget>[
+                    SliverToBoxAdapter(
+                      child: _searchWidget(context),
+                    ),
+                    if (model.isBusy)
+                      SliverToBoxAdapter(
+                        child: RequestLoadingWidget(),
+                      ),
+                    SliverList(
+                      delegate: SliverChildBuilderDelegate(
+                        (context, index) {
+                          return _buildItem(model.list[index]);
+                        },
+                        childCount: model.list.length,
+                      ),
+                    ),
+                    if (model.isError)
+                      SliverToBoxAdapter(
+                        child: RequestErrorWidget(
+                          () {
+                            model.initData();
                           },
-                          childCount: model.list.length,
+                          msg: widget.type == 0
+                              ? "暂无好友~"
+                              : widget.type == 1 ? "暂无关注~" : "暂无关注我的~",
+                          assets: "emptypage-image-nomotion.png",
                         ),
                       ),
-              if (model.isError)
-                SliverToBoxAdapter(
-                  child: RequestErrorWidget(
-                    () {
-                      model.initData();
-                    },
-                    msg: widget.type == 0
-                        ? "暂无好友~"
-                        : widget.type == 1 ? "暂无关注~" : "暂无关注我的~",
-                    assets: "emptypage-image-nomotion.png",
-                  ),
-                ),
-            ],
-          );
+                  ],
+                );
         });
   }
 
@@ -374,51 +385,51 @@ class _PageDetailState
               ],
             ),
           ),
-          if (user?.isFriends == "0")
-            user?.isIgnore == 0
-                ? GestureDetector(
-                    child: Container(
-                      width: 64,
-                      height: 30,
-                      alignment: Alignment.center,
-                      margin: _padding,
-                      child: Text(
-                        "关注",
-                        strutStyle: fixedLine,
-                        style: Theme.of(context).textTheme.bodyText2,
-                      ),
-                      decoration: BoxDecoration(
-                        borderRadius: BorderRadius.circular(20),
-                        border: Border.all(
-                          color: Color(0xff999999),
-                          width: .5,
-                        ),
-                      ),
-                    ),
-                    onTap: () async {
-                      await request(context, () async {
-                        var resp = await model.api
-                            .userIgnoreFollow(uid: user?.socialInfo?.id)
-                            .catchError((onError) {});
-                        if (resp?.code == 0) {
-                          setState(() {
-                            user.isIgnore = 1;
-                          });
-                        }
-                      });
-                    },
-                  )
-                : Container(
-                    width: 64,
-                    height: 30,
-                    margin: _padding,
-                    alignment: Alignment.center,
-                    child: Text(
-                      "已忽略",
-                      strutStyle: fixedLine,
-                      style: Theme.of(context).textTheme.bodyText2,
-                    ),
-                  ),
+//          if (user?.isFriends == "0")
+//            user?.isIgnore == 0
+//                ? GestureDetector(
+//                    child: Container(
+//                      width: 64,
+//                      height: 30,
+//                      alignment: Alignment.center,
+//                      margin: _padding,
+//                      child: Text(
+//                        "关注",
+//                        strutStyle: fixedLine,
+//                        style: Theme.of(context).textTheme.bodyText2,
+//                      ),
+//                      decoration: BoxDecoration(
+//                        borderRadius: BorderRadius.circular(20),
+//                        border: Border.all(
+//                          color: Color(0xff999999),
+//                          width: .5,
+//                        ),
+//                      ),
+//                    ),
+//                    onTap: () async {
+//                      await request(context, () async {
+//                        var resp = await model.api
+//                            .userIgnoreFollow(uid: user?.socialInfo?.id)
+//                            .catchError((onError) {});
+//                        if (resp?.code == 0) {
+//                          setState(() {
+//                            user.isIgnore = 1;
+//                          });
+//                        }
+//                      });
+//                    },
+//                  )
+//                : Container(
+//                    width: 64,
+//                    height: 30,
+//                    margin: _padding,
+//                    alignment: Alignment.center,
+//                    child: Text(
+//                      "已忽略",
+//                      strutStyle: fixedLine,
+//                      style: Theme.of(context).textTheme.bodyText2,
+//                    ),
+//                  ),
           if (user?.isIgnore == 0)
             user.isFriends == "1"
                 ? Container(
@@ -502,8 +513,13 @@ class _PageDetailState
                               fontSize: 14.0, color: Color(0xff999999)))
                     ],
                   )
-                : Text("已关注",
-                    style: TextStyle(fontSize: 14.0, color: Color(0xff999999))),
+                : user.isFriends == "0"
+                    ? Text("已关注",
+                        style:
+                            TextStyle(fontSize: 14.0, color: Color(0xff999999)))
+                    : Text("关注",
+                        style: TextStyle(
+                            fontSize: 14.0, color: Color(0xff999999))),
 //            Container(
 //              width: 82,
 //              height: 30,
@@ -528,21 +544,37 @@ class _PageDetailState
                             Navigator.of(context).pop(true);
                           },
                         ));
-              } else {
+              } else if (user.isFriends == "0") {
                 flag = true;
               }
-              if (flag) {
+              if (flag == true) {
                 await request(context, () async {
                   var resp = await model.api
                       .userUnFollow(uid: user?.socialInfo?.id)
                       .catchError((onError) {});
+                  setState(() {
+                    user.isFriends = "2";
+//                    text = "233";
+                  });
+//                  if (resp?.code == 0) {
+//                    ToastUtil.show("取关成功");
+//                    setState(() {
+//                      model.list?.remove(user);
+//                      if (model.list?.isEmpty == true) {
+//                        model.initData();
+//                      }
+//                    });
+//                  }
+                });
+              } else {
+                await request(context, () async {
+                  var resp = await model.api
+                      .userFollow(uid: user?.socialInfo?.id)
+                      .catchError((onError) {});
                   if (resp?.code == 0) {
-                    ToastUtil.show("取关成功");
+                    ToastUtil.show("关成功");
                     setState(() {
-                      model.list?.remove(user);
-                      if (model.list?.isEmpty == true) {
-                        model.initData();
-                      }
+                      user.isFriends = "0";
                     });
                   }
                 });

+ 3 - 5
lib/provider/user_friend_model.dart

@@ -21,18 +21,16 @@ class UserFriendModel extends ViewStateRefreshListModel<UserFriend>
     switch (type) {
       case 2:
         results =
-            (await api.userFansList(kw: kw, page: max(1, pageNum))).results;
+            (await api.userFansList(kw: kw, page: max(1, pageNum))).results.list;
         break;
       case 1:
         results =
-            (await api.userFollowList(kw: kw, page: max(1, pageNum))).results;
+            (await api.userFollowList(kw: kw, page: max(1, pageNum))).results.list;
         break;
       default:
         ResultsTest<UserFriend> data = (await api.userFriendsTest(
                 kw: kw, page: max(1, pageNum), test: "1"))
             .results;
-//        map = data.map;
-//        items = data.map.keys.map((e) => SuspensionBean(e.toString(), data.map[e] as List)).toList();
         items = [];
         data.map.forEach((key, value) {
           value.forEach((element) {
@@ -44,9 +42,9 @@ class UserFriendModel extends ViewStateRefreshListModel<UserFriend>
         });
         SuspensionUtil.setShowSuspensionStatus(items);
         SuspensionUtil.sortListBySuspensionTag(items);
-//        print("$items----------------${items.length}");
         break;
     }
+    print("[RESULTS]${results}------------------------------");
     return results;
   }
 

+ 3 - 3
lib/services/api/rest_client.dart

@@ -113,7 +113,7 @@ abstract class RestClient {
   Future<RespPage<Post>> getPostList({@Query("forumId") String forumId, @Query("p") int page, @Query("isGood") int isGood, @Query("kw") String kw ,@Query("isOfficial") String isOfficial,});
 
   @GET("/forum/listByOfficial")
-  Future<RespPage<Post>> getPostListByOfficial({@Query("forumId") String forumId, @Query("p") int page, @Query("limit") int limit = 3,  @Query("sortBy") String sortBy,@Query("isOfficial") String isOfficial});
+  Future<RespPage<Post>> getPostListByOfficial({@Query("forumId") String forumId, @Query("p") int page, @Query("limit") int limit,  @Query("sortBy") String sortBy,@Query("isOfficial") String isOfficial});
 
   @GET("/forum/listByHot")
   Future<RespPage<Post>> getPostListByHot({@Query("forumId") String forumId,@Query("p") int page,@Query("isOfficial") String isOfficial, @DioOptions() Options options});
@@ -199,10 +199,10 @@ abstract class RestClient {
   Future<RespData<String>> userIgnoreFollow({@Query("uid") int uid});
 
   @GET("/forum/followList")
-  Future<RespList<UserFriend>> userFollowList({@Query("groupId") String groupId, @Query("kw") String kw, @Query("p") int page, @Query("limit") int limit = 50});
+  Future<RespListTest<UserFriend>> userFollowList({@Query("groupId") String groupId, @Query("kw") String kw, @Query("p") int page, @Query("limit") int limit = 50});
 
   @GET("/forum/fansList")
-  Future<RespList<UserFriend>> userFansList({@Query("groupId") String groupId, @Query("kw") String kw, @Query("p") int page, @Query("limit") int limit = 50});
+  Future<RespListTest<UserFriend>> userFansList({@Query("groupId") String groupId, @Query("kw") String kw, @Query("p") int page, @Query("limit") int limit = 50});
 
   @GET("/forum/friends")
   Future<RespList<UserFriend>> userFriends({@Query("groupId") String groupId, @Query("kw") String kw, @Query("p") int page, @Query("limit") int limit = 50 ,@Query("test") String test,});

+ 3 - 3
lib/services/api/rest_client.g.dart

@@ -492,7 +492,7 @@ class _RestClient implements RestClient {
   }
 
   @override
-  getPostListByOfficial({forumId, page, limit = 3, sortBy, isOfficial}) async {
+  getPostListByOfficial({forumId, page, limit, sortBy, isOfficial}) async {
     const _extra = <String, dynamic>{};
     final queryParameters = <String, dynamic>{
       r'forumId': forumId,
@@ -1088,7 +1088,7 @@ class _RestClient implements RestClient {
             extra: _extra,
             baseUrl: baseUrl),
         data: _data);
-    final value = RespList<UserFriend>.fromJson(_result.data);
+    final value = RespListTest<UserFriend>.fromJson(_result.data);
     return value;
   }
 
@@ -1112,7 +1112,7 @@ class _RestClient implements RestClient {
             extra: _extra,
             baseUrl: baseUrl),
         data: _data);
-    final value = RespList<UserFriend>.fromJson(_result.data);
+    final value = RespListTest<UserFriend>.fromJson(_result.data);
     return value;
   }
 

+ 16 - 1
lib/widgets/menu_share_bottom.dart

@@ -6,12 +6,14 @@ import 'package:flutter/rendering.dart';
 import 'package:flutter/services.dart';
 import 'package:image_gallery_saver/image_gallery_saver.dart';
 import 'package:provider/provider.dart';
+import 'package:sport/bean/forum.dart';
 import 'package:sport/bean/post.dart';
 import 'package:sport/pages/social/post_page.dart';
 import 'package:sport/pages/social/post_share_page.dart';
 import 'package:sport/provider/user_model.dart';
 import 'package:sport/router/navigator_util.dart';
 import 'package:sport/services/api/inject_api.dart';
+import 'package:sport/services/api/resp.dart';
 import 'package:sport/utils/toast.dart';
 import 'package:path_provider/path_provider.dart';
 import 'package:sport/sharesdk/tencent.dart';
@@ -103,12 +105,19 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
         "value": "社区",
         "url": "share_icon_community",
         "callBack": () async {
+          List buttonList = [];
+          RespList<Forum> data = await api.getForumIndex();
+          buttonList = data.results;
+          if (data.results.length > 0) {
+            buttonList.insert(0, new Forum(gameName: "全部"));
+          }
           if (widget.shareType == "social") {
             await NavigatorUtil.goPage(
                 context,
                 (contxt) => PostPage(
                       "",
                       post: widget.post,
+                      forums: buttonList,
                     ));
           } else if (widget.shareType == "Link") {
             await NavigatorUtil.goPage(
@@ -118,13 +127,19 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
                       post: widget.post,
                       url: "http://shoes-web.hiyd.com/share",
                       hash: widget.hash,
+                      forums: buttonList,
                     ));
           } else if (widget.shareType == "Img") {
             String path = await initFile();
             print("$path---------------------------------");
             Future.delayed(new Duration(milliseconds: 200));
             await NavigatorUtil.goPage(
-                context, (context) => PostPage("",image: path));
+                context,
+                (context) => PostPage(
+                      "",
+                      image: path,
+                      forums: buttonList,
+                    ));
           }
           Navigator.pop(context, true);
         }