瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

liukai 3 月之前
父節點
當前提交
7b00d04f3a
共有 79 個文件被更改,包括 2753 次插入1026 次删除
  1. 15 4
      packages/cpt_community/lib/components/newsfeed_card_content.dart
  2. 17 5
      packages/cpt_community/lib/components/newsfeed_card_footer.dart
  3. 29 16
      packages/cpt_community/lib/modules/community/following/following_page.dart
  4. 18 18
      packages/cpt_community/lib/modules/community/following/following_state.dart
  5. 135 174
      packages/cpt_community/lib/modules/community/following/following_vm.dart
  6. 1 1
      packages/cpt_community/lib/modules/community/following/following_vm.g.dart
  7. 28 17
      packages/cpt_community/lib/modules/community/foryou/foryou_page.dart
  8. 18 18
      packages/cpt_community/lib/modules/community/foryou/foryou_state.dart
  9. 234 144
      packages/cpt_community/lib/modules/community/foryou/foryou_vm.dart
  10. 1 1
      packages/cpt_community/lib/modules/community/foryou/foryou_vm.g.dart
  11. 27 14
      packages/cpt_community/lib/modules/community/news/news_page.dart
  12. 18 18
      packages/cpt_community/lib/modules/community/news/news_state.dart
  13. 233 120
      packages/cpt_community/lib/modules/community/news/news_vm.dart
  14. 1 1
      packages/cpt_community/lib/modules/community/news/news_vm.g.dart
  15. 18 18
      packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_state.dart
  16. 13 13
      packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_vm.dart
  17. 1 1
      packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_vm.g.dart
  18. 18 18
      packages/cpt_community/lib/modules/garage/for_rent/for_rent_state.dart
  19. 13 13
      packages/cpt_community/lib/modules/garage/for_rent/for_rent_vm.dart
  20. 1 1
      packages/cpt_community/lib/modules/garage/for_rent/for_rent_vm.g.dart
  21. 18 18
      packages/cpt_community/lib/modules/garage/for_sale/for_sale_state.dart
  22. 13 13
      packages/cpt_community/lib/modules/garage/for_sale/for_sale_vm.dart
  23. 1 1
      packages/cpt_community/lib/modules/garage/for_sale/for_sale_vm.g.dart
  24. 3 3
      packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_vm.dart
  25. 1 1
      packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_vm.g.dart
  26. 12 12
      packages/cpt_community/lib/modules/my_following/my_follow/my_follow_state.dart
  27. 13 13
      packages/cpt_community/lib/modules/my_following/my_follow/my_follow_vm.dart
  28. 1 1
      packages/cpt_community/lib/modules/my_following/my_follow/my_follow_vm.g.dart
  29. 12 12
      packages/cpt_community/lib/modules/my_following/my_follower/my_follower_state.dart
  30. 13 13
      packages/cpt_community/lib/modules/my_following/my_follower/my_follower_vm.dart
  31. 1 1
      packages/cpt_community/lib/modules/my_following/my_follower/my_follower_vm.g.dart
  32. 18 18
      packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_state.dart
  33. 13 13
      packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_vm.dart
  34. 1 1
      packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_vm.g.dart
  35. 18 18
      packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_state.dart
  36. 13 13
      packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_vm.dart
  37. 1 1
      packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_vm.g.dart
  38. 2 0
      packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_page.dart
  39. 18 18
      packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_state.dart
  40. 13 13
      packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_vm.dart
  41. 1 1
      packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_vm.g.dart
  42. 1 1
      packages/cpt_community/lib/modules/my_posts/my_posts_vm.dart
  43. 1 1
      packages/cpt_community/lib/modules/my_posts/my_posts_vm.g.dart
  44. 16 22
      packages/cpt_community/lib/modules/community/news/news_respository.dart
  45. 29 0
      packages/cpt_community/lib/respository/newsfeed_comment_repository.g.dart
  46. 99 0
      packages/cpt_community/lib/respository/newsfeed_following_repository.dart
  47. 30 0
      packages/cpt_community/lib/respository/newsfeed_following_repository.g.dart
  48. 99 0
      packages/cpt_community/lib/respository/newsfeed_foryou_repository.dart
  49. 11 9
      packages/cpt_community/lib/modules/community/news/news_respository.g.dart
  50. 98 0
      packages/cpt_community/lib/respository/newsfeed_news_repository.dart
  51. 11 9
      packages/cpt_community/lib/modules/community/foryou/foryou_respository.g.dart
  52. 14 20
      packages/cpt_community/lib/modules/community/foryou/foryou_respository.dart
  53. 29 0
      packages/cpt_community/lib/respository/newsfeed_publish_repository.g.dart
  54. 1 1
      packages/cpt_property/lib/modules/ioan/property_ioan_vm.dart
  55. 1 1
      packages/cpt_property/lib/modules/news/page/property_news_page.dart
  56. 1 1
      packages/cpt_property/lib/modules/news/repository/property_news_repository.dart
  57. 23 21
      packages/cpt_property/lib/modules/news/vm/property_news_vm.dart
  58. 2 2
      packages/cpt_property/lib/modules/rent/page/property_rent_page.dart
  59. 8 6
      packages/cpt_property/lib/modules/rent/vm/property_rent_vm.dart
  60. 1 1
      packages/cpt_property/lib/modules/sale/page/property_sale_page.dart
  61. 4 4
      packages/cpt_property/lib/modules/sale/repository/property_sale_repository.dart
  62. 8 6
      packages/cpt_property/lib/modules/sale/vm/property_sale_vm.dart
  63. 23 0
      packages/cs_domain/lib/entity/newsfeed_comment_publish_entity.dart
  64. 70 0
      packages/cs_domain/lib/entity/newsfeed_following_entity.dart
  65. 70 0
      packages/cs_domain/lib/entity/newsfeed_foryou_entity.dart
  66. 70 0
      packages/cs_domain/lib/entity/newsfeed_news_entity.dart
  67. 26 1
      packages/cs_domain/lib/entity/property_news_entity.dart
  68. 0 25
      packages/cs_domain/lib/entity/property_sale_entity.dart
  69. 49 0
      packages/cs_domain/lib/entity/property_sale_rent_entity.dart
  70. 107 22
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  71. 42 0
      packages/cs_domain/lib/generated/json/newsfeed_comment_publish_entity.g.dart
  72. 184 0
      packages/cs_domain/lib/generated/json/newsfeed_following_entity.g.dart
  73. 180 0
      packages/cs_domain/lib/generated/json/newsfeed_foryou_entity.g.dart
  74. 179 0
      packages/cs_domain/lib/generated/json/newsfeed_news_entity.g.dart
  75. 72 4
      packages/cs_domain/lib/generated/json/property_news_entity.g.dart
  76. 0 55
      packages/cs_domain/lib/generated/json/property_sale_entity.g.dart
  77. 126 0
      packages/cs_domain/lib/generated/json/property_sale_rent_entity.g.dart
  78. 33 15
      packages/cs_domain/lib/generated/json/user_me_entity.g.dart
  79. 10 0
      packages/cs_shared/lib/utils/ext_dart.dart

+ 15 - 4
packages/cpt_community/lib/components/newsfeed_card_content.dart

@@ -60,6 +60,7 @@ class NewsFeedCardContent extends StatelessWidget {
             // color: Colors.red,
             padding: const EdgeInsets.symmetric(horizontal: 15),
             child: Column(
+              crossAxisAlignment: CrossAxisAlignment.start,
                 children: [
                   MyTextView(
                     content,
@@ -70,7 +71,16 @@ class NewsFeedCardContent extends StatelessWidget {
                   ),
                   const SizedBox(height: 12),
                   // 图片
-                  _buildImageSection(context, isPreviewImage!, maxWidth - 15, imageUrlsList, imageUrls, totalImageCount,otherImageCount),
+                  _buildImageSection(
+                      context,
+                      isPreviewImage!,
+                      maxWidth - 15,
+                      imageUrlsList,
+                      imageUrls,
+                      totalImageCount,
+                      otherImageCount,
+                      rowMaxImageNum!
+                  ),
                 ]
             )
           );
@@ -79,7 +89,7 @@ class NewsFeedCardContent extends StatelessWidget {
   }
 
 
-  Widget _buildImageSection(BuildContext context,bool isPreviewImage, double maxWidth, List? imageUrls,List? totalImageUrls, int totalImageCount, int otherImageCount) {
+  Widget _buildImageSection(BuildContext context,bool isPreviewImage, double maxWidth, List? imageUrls,List? totalImageUrls, int totalImageCount, int otherImageCount, int rowMaxImageNum) {
     if (imageUrls != null && imageUrls!.isNotEmpty) {
       final imageCount = imageUrls.length;
       return SizedBox(
@@ -93,13 +103,14 @@ class NewsFeedCardContent extends StatelessWidget {
                 height: 87,
                 width: maxWidth/imageCount - 16,
                 margin: EdgeInsets.only(right: (index!=imageCount-1) ? 16 : 0 ),
-                color: ColorUtils.string2Color("#F2F3F6"),
+                // color: ColorUtils.string2Color("#F2F3F6"),
                 child:Stack(
                     children: [
                       MyLoadImage(
                         imageUrls[index],
                         height: 87,
-                        width: maxWidth/imageCount - 16,
+                        // width: maxWidth/imageCount - 16,
+                        width: (totalImageCount < rowMaxImageNum)? maxWidth/rowMaxImageNum - 16 : maxWidth/imageCount - 16,
                         fit: BoxFit.cover,
                         // fit:BoxFit.fitWidth,
                         cornerRadius: 5,

+ 17 - 5
packages/cpt_community/lib/components/newsfeed_card_footer.dart

@@ -2,6 +2,8 @@ import 'package:cpt_community/components/newfeed_card_header.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
+import 'package:flutter_hooks/flutter_hooks.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:shared/utils/color_utils.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
@@ -21,8 +23,10 @@ import '../modules/community/community_page.dart';
 // 'time': 'June 17,2016 at 7:23 p.m.',
 // 'likeno': 12
 
-class NewsFeedCardFooter extends StatelessWidget {
+class NewsFeedCardFooter extends HookConsumerWidget {
   final bool isLike;
+  int? likes_count = 0;
+  int? comments_count = 0;
   final VoidCallback? onLike;
   final VoidCallback? onComment;
   final VoidCallback? onShare;
@@ -34,6 +38,8 @@ class NewsFeedCardFooter extends StatelessWidget {
      GlobalKey<MyLikeButtonState>? likeButtonKey,
     required this.isLike,
     this.onLike,
+    this.likes_count = 0,
+    this.comments_count = 0,
     this.onComment,
     this.onShare,
     this.showShare = false,
@@ -42,7 +48,11 @@ class NewsFeedCardFooter extends StatelessWidget {
          super(key: key);
 
   @override
-  Widget build(BuildContext context) {
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _isLike =useState(isLike);
+    final _likes_count =useState(likes_count);
+    final _comments_count =useState(comments_count);
+
     return Container(
       height: 40,
       width: double.infinity,
@@ -59,14 +69,16 @@ class NewsFeedCardFooter extends StatelessWidget {
                 children: [
                   MyLikeButton(
                     key: likeButtonKey,
-                    isLiked: false,
+                    isLiked: _isLike.value,
                     isCustomIcon: true,
                     onLike: () {
                       Log.d('点击了like button');
+                      onLike?.call();
                     },
                   ),
+                  // 动态的
                   MyTextView(
-                    'Like',
+                    'Like (${_likes_count.value})',
                     textColor: ColorUtils.string2Color('#767676'),
                     fontSize: 14,
                     isFontRegular: true,
@@ -88,7 +100,7 @@ class NewsFeedCardFooter extends StatelessWidget {
                 children: [
                   const MyAssetImage(Assets.communityComments, width: 16,height: 16,),
                   MyTextView(
-                    'Comments',
+                    'Comments ($comments_count)',
                     textColor: ColorUtils.string2Color('#767676'),
                     fontSize: 14,
                     isFontRegular: true,

+ 29 - 16
packages/cpt_community/lib/modules/community/following/following_page.dart

@@ -5,6 +5,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/my_button.dart';
@@ -77,7 +78,7 @@ class FollowingPage extends HookConsumerWidget {
                     SliverList(
                       delegate: SliverChildBuilderDelegate(
                               (context, index){
-                            return _buildNewsItem(context, ref, state.list![index], vm);
+                            return _buildNewsItem(context, ref, state.list![index], vm, index);
                           },
                           childCount: state.list!.length
                       ),
@@ -91,11 +92,20 @@ class FollowingPage extends HookConsumerWidget {
     );
   }
 
-  Widget _buildNewsItem(BuildContext context, WidgetRef ref, item, vm){
+  Widget _buildNewsItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int itemIdx){
+    String card_title = item.getValue("title", "");
+    String card_created_at = item.getValue("created_at", "");
+    Map<String, dynamic>? card_account = item.getValue<Map<String,dynamic>>("account", {});
+    String card_avator = card_account?['avator']?? "";
+    bool card_followed = card_account?['followed']??false;
+    String card_content = item.getValue("content", "");
+    List? card_resources = item.getValue<List>("resources", [])?? [];
+    bool card_liked = item.getValue("liked", false);
+    int card_likes_count = item.getValue("likes_count", 0);
+    int card_comments_count = item.getValue("comments_count", 0);
     return Container(
       margin: const EdgeInsets.only(left: 15, right: 15,top: 14,bottom: 14),
       padding: const EdgeInsets.only(left: 15, right: 15,top: 17,bottom: 0),
-      // height: 280,
       decoration: BoxDecoration(
           color: context.appColors.textWhite,
           borderRadius: BorderRadius.circular(10),
@@ -118,39 +128,41 @@ class FollowingPage extends HookConsumerWidget {
                 Container(
                   child: NewsFeedCardHeader(
                     key: UniqueKey(),
-                    title: item['title'],
-                    avator: item['avator'],
-                    time: item['time'],
+                    title: card_title,
+                    avator: card_avator,
+                    time: card_created_at,
                   ),
                 ),
                 const SizedBox(height: 15),
                 // 卡片中间 (文字和图片)
                 NewsFeedCardContent(
                   key: UniqueKey(),
-                  content: item['content'],
-                  imageUrls: item['imageUrls'],
+                  content: card_content,
+                  imageUrls: card_resources,
                 ),
                 const SizedBox(height: 16),
                 // // 卡片底部 (点赞 评论 分享)
                 Container(
+                  padding: const EdgeInsets.only(top: 10, bottom: 15),
                   decoration: BoxDecoration(
                     // color: Colors.white,
                       border: Border(
                         top: BorderSide(color: context.appColors.dividerDefault, width: 0.5),
                       )
                   ),
-                  padding: const EdgeInsets.only(top: 10, bottom: 15),
                   child: NewsFeedCardFooter(
                     key: UniqueKey(),
-                    isLike: item['isLike'],
+                    isLike: card_liked,
+                    likes_count: card_likes_count,
+                    comments_count: card_comments_count,
                     onLike: (){
-                      vm.handlerClickActionBtn('like', item);
+                      vm.handlerClickActionBtn('like', item, itemIdx);
                     },
                     onComment: (){
-                      vm.handlerClickActionBtn('comments', item);
+                      vm.handlerClickActionBtn('comments', item, itemIdx);
                     },
                     onShare: (){
-                      vm.handlerClickActionBtn('share', item);
+                      vm.handlerClickActionBtn('share', item, itemIdx);
                     },
                   ),
                 ),
@@ -158,7 +170,7 @@ class FollowingPage extends HookConsumerWidget {
           ),
           // 右上角 关注/取消关注 按钮
           Visibility(
-            visible: !item['isFollow'],
+            visible: card_followed ? false: true,
             child: Positioned(
                 right: 10,
                 top: -5,
@@ -180,7 +192,7 @@ class FollowingPage extends HookConsumerWidget {
                     fontWeight: FontWeight.w400,
                     fontSize: 14,
                     onPressed: (){
-                      // Navigator.pop(context);
+                      vm.handlerFollow(context, card_followed);
                     },
                   ),
                 )
@@ -193,7 +205,8 @@ class FollowingPage extends HookConsumerWidget {
       // height: 580,
       // minHeight: 300,
     ).onTap((){
-      vm.handlerClickActionBtn(null, item);
+      vm.handlerGotoDetail(context, item['id']);
     });
   }
+
 }

+ 18 - 18
packages/cpt_community/lib/modules/community/following/following_state.dart

@@ -4,34 +4,34 @@ class FollowingState {
   //页面 LoadView 状态的展示
   LoadState loadingState;
   String? errorMessage;
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 0;
+  int? page;
+  int? limit = 10;
+  int? count = 0;
   List<Map<String, dynamic>>? list = [];
 
   FollowingState({
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 0,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 0,
     this.list,
   });
 
   FollowingState copyWith({
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
   }) {
     return FollowingState(
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
     );
   }
@@ -40,9 +40,9 @@ class FollowingState {
     return {
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
-      'curPage': this.curPage,
-      'pageSize': this.pageSize,
-      'filterCount': this.filterCount,
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
       'list': this.list,
     };
   }
@@ -51,9 +51,9 @@ class FollowingState {
     return FollowingState(
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
-      curPage: map['curPage'] as int,
-      pageSize: map['pageSize'] as int,
-      filterCount: map['filterCount'] as int,
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
       list: map['list'] as List<Map<String, dynamic>>,
     );
   }

+ 135 - 174
packages/cpt_community/lib/modules/community/following/following_vm.dart

@@ -1,8 +1,11 @@
+import 'package:cpt_community/respository/newsfeed_following_repository.dart';
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/newsfeed_following_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
@@ -16,8 +19,8 @@ part 'following_vm.g.dart';
 
 @riverpod
 class FollowingVm extends _$FollowingVm {
-  bool _needShowPlaceholder = true; //是否展示LoadingView
-
+  late NewsFeedFollowingRepository repositoryInstance;
+  bool _needShowPlaceholder = false; //是否展示LoadingView
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
     controlFinishRefresh: true,  //允许刷新
@@ -26,90 +29,14 @@ class FollowingVm extends _$FollowingVm {
 
   FollowingState initState() {
     return FollowingState(
-      list: [
-          {
-            'id':1,
-            'avator': Assets.communityCamera,
-            'title': 'William Jefferson',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-            'time': 'June 17,2016 at 7:23 p.m.',
-              'isLike': true,
-            'likeno': 12
-          },
-          {
-            'id':2,
-            'avator': Assets.communityCamera,
-            'title': 'William fdsaf的飞洒发生的',
-            'isFollow': true,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': true,
-            'likeno': 12
-          },
-          {
-            'id':3,
-            'avator': Assets.communityCamera,
-            'title': 'Fsjfkds  dfsk',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-          {
-            'id':4,
-            'avator': Assets.communityCamera,
-            'title': 'Fsjfkds  dfsk',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-          {
-            'id':5,
-            'avator': Assets.communityCamera,
-            'title': 'Fsjfkds  dfsk',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-          {
-            'id':6,
-            'avator': Assets.communityCamera,
-            'title': 'Fsjfkds  dfsk',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-          {
-            'id':7,
-            'avator': Assets.communityCamera,
-            'title': '放大发大水',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-      ]
+      list: []
     );
   }
 
   @override
   FollowingState build(){
+    // 引入数据仓库
+    repositoryInstance = ref.read(newsFeedFollowingRepositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -136,16 +63,16 @@ class FollowingVm extends _$FollowingVm {
     if(isShowing){
       Log.d("----following_vm-----loadMore");
       // await Future.delayed(const Duration(seconds: 2));
-      // if(state.list.length >= state.filterCount){
+      // if(state.list.length >= state.count){
       //   return;
       // }else {
-      //   int curPage = state.curPage + 1;
-      //   state = state.copyWith(curPage: curPage,);
+      //   int page = state.page + 1;
+      //   state = state.copyWith(page: page,);
       //   getListData();
       // }
-      // 检查 curPage 是否为 null,并初始化为 1
-      int newCurPage = state.curPage ?? 1;
-      state = state.copyWith(curPage: ++newCurPage);
+      // 检查 page 是否为 null,并初始化为 1
+      int newCurPage = state.page ?? 1;
+      state = state.copyWith(page: ++newCurPage);
       getListData();
     }else {
       refreshController.finishRefresh();
@@ -160,12 +87,10 @@ class FollowingVm extends _$FollowingVm {
       // 当前pageView 页面正处于显示状态
       Log.d("----following_vm-----onRefresh ");
       // await Future.delayed(const Duration(seconds: 2));
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       getListData();
     }else {
       refreshController.finishRefresh();
-      // //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
     }
   }
 
@@ -173,7 +98,7 @@ class FollowingVm extends _$FollowingVm {
   Future retryRequest() async {
     bool isShowing = await ref.read(communityVmProvider.notifier).isCurrentPageViewShowing(CommunityPageViewIdxData.following);
     if(isShowing){
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       _needShowPlaceholder = true;
       getListData();
     }
@@ -185,113 +110,149 @@ class FollowingVm extends _$FollowingVm {
     if (_needShowPlaceholder) {
       changeLoadingState(LoadState.State_Loading, null);
     }
+    Log.d("加载listData数据---------------start--${state.page}---");
 
-    Log.d("for_sale加载listData数据---------------start--${state.curPage}---");
-    //   try {
-    //     //请求网络
-    //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
-    //     };
-    //     Log.d("请求参数------$params");
-    //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
-    //     Log.d("请求完成结果------${result.data}");
-    //     //校验成功失败
-    //     if (result.isSuccess) {
-    //       // state = state.copyWith(serverTime: result.data);
-    //       state = state;
-    //   handleList(listResult.data?.rows);
-    //       ToastEngine.show("获取数据成功");
-    //     } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    //       ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //     }
-    //   } catch (e) {
-    //     ToastEngine.show("Error: $e");
-    //   }
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "page": state.page,
+        "limit": state.limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await repositoryInstance.fetchFollowingList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList((result.data  as NewsfeedFollowingEntity).list);
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+    // // 最后赋值
+    _needShowPlaceholder = false;
+  }
 
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        'id':1,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'William Jefferson',
-        'isFollow': false,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': true,
-        'likeno': 12
-      },
-      {
-        'id':2,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'William fdsaf的飞洒发生的',
-        'isFollow': true,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': [],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': true,
-        'likeno': 12
-      },
-      {
-        'id':3,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'Fsjfkds  dfsk',
-        'isFollow': false,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': [],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': false,
-        'likeno': 12
-      },
-    ];
 
-    if (state.curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(list: listData);
-      refreshController.finishRefresh();
-      // //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
-    } else {
-      //加载更多
-      final allList = state.list;
-      allList?.addAll(listData);
-      state = state.copyWith(list: allList);
-      refreshController.finishLoad();
+  void handlerResultList(List<NewsfeedFollowingList>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (state.page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
 
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      if (state.page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        if(state.list!.length == 0){
+          changeLoadingState(LoadState.State_Empty, null);
+        }else {
+          if(_needShowPlaceholder){
+            changeLoadingState(LoadState.State_Success, null);
+          }
+        }
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
     }
-
-    // 最后赋值
-    _needShowPlaceholder = false;
   }
 
+  // 点赞/取消点赞
+  Future handlerLikeClick(int id, bool isLike, int itemidx) async {
+    try {
+      final result = await repositoryInstance.fetchLikeClick({
+        "id": id,
+      });
+      if (result.isSuccess) {
+        //重新赋值data或list
+        // final json = result.getDataJson();
+        // var data = NewsfeedNewsEntity.fromJson(json!);
+        //重新赋值data或list
+        // state.list![id].liked = data.list![0].liked;
+        // state.list![id].likeno = data.list![0].likeno;
+        final String toastMsg = isLike ? "Cancel successfully": "Liked successfully";
+        ToastEngine.show(toastMsg);
+        // 修改 state.list[itemIdx] 中的 like 状态 和 likes_count
+        state.list![itemidx]['liked'] = !isLike;
+        if(isLike){
+          // 取消点赞
+          if(state.list![itemidx]['likes_count']>0){
+            state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] - 1;
+          }
+        }else {
+          state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] + 1;
+        }
+        //重新赋值data或list
+        changeLoadingState(LoadState.State_Success, null);
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error) {
+      return false;
+    }
+  }
 
   // 点击 like comments  share
-  void handlerClickActionBtn(String? actionStr, item){
+  Future<bool?> handlerClickActionBtn(String? actionStr, Map<String, dynamic> item, int itemidx) async{
     final id = item['id'];
+    final liked = item.getValue('liked', false);
     switch (actionStr) {
       case 'like':
-        Log.d("点击了 点赞");
-        handlerGotoDetail(id);
-        break;
+        return await handlerLikeClick(id, liked, itemidx);
       case 'comments':
         Log.d("点击了 评论");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
       case 'share':
         Log.d("点击了 分享");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
       default:
         Log.d("点击了卡片");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
     }
   }
+  Future handlerFollow(BuildContext context, bool isFollow) async{
+    Log.d("点击了 关注");
+    // try {
+    //   //请求网络
+    //   Map<String, dynamic>  params = {
+    //
+    //   };
+    //   Log.d("请求参数------$params");
+    //   final result = await repositoryInstance.fetchNewsList(params);
+    //   //校验成功失败
+    //   if (result.isSuccess) {
+    //     handlerResultList((result.data  as NewsfeedNewsEntity).list);
+    //   } else {
+    //     String errorMessage = result.errorMsg!;
+    //     changeLoadingState(LoadState.State_Error, errorMessage);
+    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
+    //   }
+    // } catch (e) {
+    //   ToastEngine.show("Error: $e");
+    // }
+  }
   // 去详情页面
-  void handlerGotoDetail(id){
+  void handlerGotoDetail(BuildContext? context, int id){
     Log.d("去详情页面");
     appRouter.push(NewsfeedDetailPageRoute(id: id, type:'following'));
   }

+ 1 - 1
packages/cpt_community/lib/modules/community/following/following_vm.g.dart

@@ -6,7 +6,7 @@ part of 'following_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$followingVmHash() => r'd1095a72d4591c463b6a6ef58602c117149075cb';
+String _$followingVmHash() => r'440282038f9410a19f56dec59438ed8b7e13d10f';
 
 /// See also [FollowingVm].
 @ProviderFor(FollowingVm)

+ 28 - 17
packages/cpt_community/lib/modules/community/foryou/foryou_page.dart

@@ -5,6 +5,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/my_button.dart';
@@ -79,7 +80,7 @@ class ForyouPage extends HookConsumerWidget {
                     SliverList(
                       delegate: SliverChildBuilderDelegate(
                               (context, index){
-                            return _buildNewsItem(context, ref, state.list![index], vm);
+                            return _buildNewsItem(context, ref, state.list![index], vm, index);
                           },
                           childCount: state.list!.length
                       ),
@@ -93,12 +94,20 @@ class ForyouPage extends HookConsumerWidget {
     );
   }
 
-
-  Widget _buildNewsItem(BuildContext context, WidgetRef ref, item, vm){
+  Widget _buildNewsItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int itemIdx){
+    String card_title = item.getValue("title", "");
+    String card_created_at = item.getValue("created_at", "");
+    Map<String, dynamic>? card_account = item.getValue<Map<String,dynamic>>("account", {});
+    String card_avator = card_account?['avator']?? "";
+    bool card_followed = card_account?['followed']??false;
+    String card_content = item.getValue("content", "");
+    List? card_resources = item.getValue<List>("resources", [])?? [];
+    bool card_liked = item.getValue("liked", false);
+    int card_likes_count = item.getValue("likes_count", 0);
+    int card_comments_count = item.getValue("comments_count", 0);
     return Container(
       margin: const EdgeInsets.only(left: 15, right: 15,top: 14,bottom: 14),
       padding: const EdgeInsets.only(left: 15, right: 15,top: 17,bottom: 0),
-      // height: 280,
       decoration: BoxDecoration(
           color: context.appColors.textWhite,
           borderRadius: BorderRadius.circular(10),
@@ -121,39 +130,41 @@ class ForyouPage extends HookConsumerWidget {
                 Container(
                   child: NewsFeedCardHeader(
                     key: UniqueKey(),
-                    title: item['title'],
-                    avator: item['avator'],
-                    time: item['time'],
+                    title: card_title,
+                    avator: card_avator,
+                    time: card_created_at,
                   ),
                 ),
                 const SizedBox(height: 15),
                 // 卡片中间 (文字和图片)
                 NewsFeedCardContent(
                   key: UniqueKey(),
-                  content: item['content'],
-                  imageUrls: item['imageUrls'],
+                  content: card_content,
+                  imageUrls: card_resources,
                 ),
                 const SizedBox(height: 16),
                 // // 卡片底部 (点赞 评论 分享)
                 Container(
+                  padding: const EdgeInsets.only(top: 10, bottom: 15),
                   decoration: BoxDecoration(
                     // color: Colors.white,
                       border: Border(
                         top: BorderSide(color: context.appColors.dividerDefault, width: 0.5),
                       )
                   ),
-                  padding: const EdgeInsets.only(top: 10, bottom: 15),
                   child: NewsFeedCardFooter(
                     key: UniqueKey(),
-                    isLike: item['isLike'],
+                    isLike: card_liked,
+                    likes_count: card_likes_count,
+                    comments_count: card_comments_count,
                     onLike: (){
-                      vm.handlerClickActionBtn('like', item);
+                      vm.handlerClickActionBtn('like', item, itemIdx);
                     },
                     onComment: (){
-                      vm.handlerClickActionBtn('comments', item);
+                      vm.handlerClickActionBtn('comments', item, itemIdx);
                     },
                     onShare: (){
-                      vm.handlerClickActionBtn('share', item);
+                      vm.handlerClickActionBtn('share', item, itemIdx);
                     },
                   ),
                 ),
@@ -161,7 +172,7 @@ class ForyouPage extends HookConsumerWidget {
           ),
           // 右上角 关注/取消关注 按钮
           Visibility(
-            visible: !item['isFollow'],
+            visible: card_followed ? false: true,
             child: Positioned(
                 right: 10,
                 top: -5,
@@ -183,7 +194,7 @@ class ForyouPage extends HookConsumerWidget {
                     fontWeight: FontWeight.w400,
                     fontSize: 14,
                     onPressed: (){
-                      // Navigator.pop(context);
+                      vm.handlerFollow(context, card_followed);
                     },
                   ),
                 )
@@ -196,7 +207,7 @@ class ForyouPage extends HookConsumerWidget {
       // height: 580,
       // minHeight: 300,
     ).onTap((){
-      vm.handlerClickActionBtn(null, item);
+      vm.handlerGotoDetail(context, item['id']);
     });
   }
 

+ 18 - 18
packages/cpt_community/lib/modules/community/foryou/foryou_state.dart

@@ -4,35 +4,35 @@ class ForyouState {
   //页面 LoadView 状态的展示
   LoadState loadingState;
   String? errorMessage;
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 0;
+  int? page;
+  int? limit = 10;
+  int? count = 0;
 
   List<Map<String, dynamic>>? list = [];
 
   ForyouState({
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 0,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 0,
     this.list,
   });
 
   ForyouState copyWith({
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
   }) {
     return ForyouState(
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
     );
   }
@@ -41,9 +41,9 @@ class ForyouState {
     return {
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
-      'curPage': this.curPage,
-      'pageSize': this.pageSize,
-      'filterCount': this.filterCount,
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
       'list': this.list,
     };
   }
@@ -52,9 +52,9 @@ class ForyouState {
     return ForyouState(
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
-      curPage: map['curPage'] as int,
-      pageSize: map['pageSize'] as int,
-      filterCount: map['filterCount'] as int,
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
       list: map['list'] as List<Map<String, dynamic>>,
     );
   }

+ 234 - 144
packages/cpt_community/lib/modules/community/foryou/foryou_vm.dart

@@ -1,25 +1,27 @@
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/newsfeed_foryou_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
+import '../../../respository/newsfeed_foryou_repository.dart';
 import '../../../router/page/community_page_router.dart';
 import '../community_pageview_idx_data.dart';
 import '../community_vm.dart';
 import '../newsfeed_detail/newsfeed_detail_page.dart';
-import 'foryou_respository.dart';
 import 'foryou_state.dart';
 
 part 'foryou_vm.g.dart';
 
 @riverpod
 class ForyouVm extends _$ForyouVm {
-  late ForyouRepository ForyouRepositoryInstance;
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  late NewsFeedForyouRepository repositoryInstance;
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -29,92 +31,14 @@ class ForyouVm extends _$ForyouVm {
 
   ForyouState initState() {
     return ForyouState(
-        list: [
-          {
-            'id':1,
-            'avator': Assets.communityCamera,
-            'title': 'William Jefferson',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': true,
-            'likeno': 12
-          },
-          {
-            'id':2,
-            'avator': Assets.communityCamera,
-            'title': 'William fdsaf的飞洒发生的',
-            'isFollow': true,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': true,
-            'likeno': 12
-          },
-          {
-            'id':3,
-            'avator': Assets.communityCamera,
-            'title': 'Fsjfkds  dfsk',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-          {
-            'id':4,
-            'avator': Assets.communityCamera,
-            'title': 'Fsjfkds  dfsk',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-          {
-            'id':5,
-            'avator': Assets.communityCamera,
-            'title': 'Fsjfkds  dfsk',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-          {
-            'id':6,
-            'avator': Assets.communityCamera,
-            'title': 'Fsjfkds  dfsk',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-          {
-            'id':7,
-            'avator': Assets.communityCamera,
-            'title': '放大发大水',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': [],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': false,
-            'likeno': 12
-          },
-        ]
+        list: []
     );
   }
 
   @override
   ForyouState build(){
     // 引入数据仓库
-    ForyouRepositoryInstance = ref.read(foryouRepositoryProvider);
+    repositoryInstance = ref.read(newsFeedForyouRepositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -141,16 +65,16 @@ class ForyouVm extends _$ForyouVm {
     if(isShowing){
       Log.d("----foryou_vm-----loadMore");
       // await Future.delayed(const Duration(seconds: 2));
-      // if(state.list.length >= state.filterCount){
+      // if(state.list.length >= state.count){
       //   return;
       // }else {
-      //   int curPage = state.curPage + 1;
-      //   state = state.copyWith(curPage: curPage,);
+      //   int page = state.page + 1;
+      //   state = state.copyWith(page: page,);
       //   getListData();
       // }
-      // 检查 curPage 是否为 null,并初始化为 1
-      int newCurPage = state.curPage ?? 1;
-      state = state.copyWith(curPage: ++newCurPage);
+      // 检查 page 是否为 null,并初始化为 1
+      int newCurPage = state.page ?? 1;
+      state = state.copyWith(page: ++newCurPage);
       getListData();
     }else {
       refreshController.finishRefresh();
@@ -165,12 +89,10 @@ class ForyouVm extends _$ForyouVm {
       // 当前pageView 页面正处于显示状态
       Log.d("----forsale_vm-----onRefresh ");
       // await Future.delayed(const Duration(seconds: 2));
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       getListData();
     }else {
       refreshController.finishRefresh();
-      // //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
     }
   }
 
@@ -178,7 +100,7 @@ class ForyouVm extends _$ForyouVm {
   Future retryRequest() async {
     bool isShowing = await ref.read(communityVmProvider.notifier).isCurrentPageViewShowing(CommunityPageViewIdxData.forYou);
     if(isShowing){
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       _needShowPlaceholder = true;
       getListData();
     }
@@ -191,12 +113,12 @@ class ForyouVm extends _$ForyouVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.curPage}---");
+    Log.d("加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -216,76 +138,244 @@ class ForyouVm extends _$ForyouVm {
     //     ToastEngine.show("Error: $e");
     //   }
 
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        'id':1,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'William Jefferson',
-        'isFollow': false,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': true,
-        'likeno': 12
-      },
-      {
-        'id':2,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'William fdsaf的飞洒发生的',
-        'isFollow': true,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': [],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': true,
-        'likeno': 12
-      },
-    ];
-
-    if (state.curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(list: listData);
-      refreshController.finishRefresh();
-      // //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
-    } else {
-      //加载更多
-      final allList = state.list;
-      allList?.addAll(listData);
-      state = state.copyWith(list: allList);
-      refreshController.finishLoad();
+    // await Future.delayed(const Duration(milliseconds: 1500));
+    // final List<Map<String, dynamic>> listData = [
+    //   {
+    //     'id':1,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'William Jefferson',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': true,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':2,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'William fdsaf的飞洒发生的',
+    //     'isFollow': true,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': true,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':3,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'Fsjfkds  dfsk',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':4,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'Fsjfkds  dfsk',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':5,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'Fsjfkds  dfsk',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':6,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'Fsjfkds  dfsk',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':7,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': '放大发大水',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    // ];
+    //
+    // if (state.page == 1) {
+    //   //刷新的方式
+    //   state = state.copyWith(list: listData);
+    //   refreshController.finishRefresh();
+    //   // //更新展示的状态
+    //   changeLoadingState(LoadState.State_Success, null);
+    // } else {
+    //   //加载更多
+    //   final allList = state.list;
+    //   allList?.addAll(listData);
+    //   state = state.copyWith(list: allList);
+    //   refreshController.finishLoad();
+    //
+    // }
+    //
+    // // 最后赋值
+    // _needShowPlaceholder = false;
 
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "page": state.page,
+        "limit": state.limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await repositoryInstance.fetchForyouList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList((result.data  as NewsfeedForyouEntity).list);
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
     }
+  }
 
-    // 最后赋值
-    _needShowPlaceholder = false;
+
+  void handlerResultList(List<NewsfeedForyouList>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (state.page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
+
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      if (state.page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        if(state.list!.length == 0){
+          changeLoadingState(LoadState.State_Empty, null);
+        }else {
+          if(_needShowPlaceholder){
+            changeLoadingState(LoadState.State_Success, null);
+          }
+        }
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
   }
 
+  // 点赞/取消点赞
+  Future handlerLikeClick(int id, bool isLike, int itemidx) async {
+    try {
+      final result = await repositoryInstance.fetchLikeClick({
+        "id": id,
+      });
+      if (result.isSuccess) {
+        //重新赋值data或list
+        // final json = result.getDataJson();
+        // var data = NewsfeedNewsEntity.fromJson(json!);
+        //重新赋值data或list
+        // state.list![id].liked = data.list![0].liked;
+        // state.list![id].likeno = data.list![0].likeno;
+        final String toastMsg = isLike ? "Cancel successfully": "Liked successfully";
+        ToastEngine.show(toastMsg);
+        // 修改 state.list[itemIdx] 中的 like 状态 和 likes_count
+        state.list![itemidx]['liked'] = !isLike;
+        if(isLike){
+          // 取消点赞
+          if(state.list![itemidx]['likes_count']>0){
+            state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] - 1;
+          }
+        }else {
+          state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] + 1;
+        }
+        //重新赋值data或list
+        changeLoadingState(LoadState.State_Success, null);
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error) {
+      return false;
+    }
+  }
 
   // 点击 like comments  share
-  void handlerClickActionBtn(String? actionStr, item){
+  Future<bool?> handlerClickActionBtn(String? actionStr, Map<String, dynamic> item, int itemidx) async{
     final id = item['id'];
+    final liked = item.getValue('liked', false);
     switch (actionStr) {
       case 'like':
-        Log.d("点击了 点赞");
-        handlerGotoDetail(id);
-        break;
+        return await handlerLikeClick(id, liked, itemidx);
       case 'comments':
         Log.d("点击了 评论");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
       case 'share':
         Log.d("点击了 分享");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
       default:
         Log.d("点击了卡片");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
     }
   }
+  Future handlerFollow(BuildContext context, bool isFollow) async{
+    Log.d("点击了 关注");
+    // try {
+    //   //请求网络
+    //   Map<String, dynamic>  params = {
+    //
+    //   };
+    //   Log.d("请求参数------$params");
+    //   final result = await repositoryInstance.fetchNewsList(params);
+    //   //校验成功失败
+    //   if (result.isSuccess) {
+    //     handlerResultList((result.data  as NewsfeedNewsEntity).list);
+    //   } else {
+    //     String errorMessage = result.errorMsg!;
+    //     changeLoadingState(LoadState.State_Error, errorMessage);
+    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
+    //   }
+    // } catch (e) {
+    //   ToastEngine.show("Error: $e");
+    // }
+  }
   // 去详情页面
-  void handlerGotoDetail(id){
+  void handlerGotoDetail(BuildContext? context, int id){
     Log.d("去详情页面");
     appRouter.push(NewsfeedDetailPageRoute(id: id, type:'foryou'));
   }

+ 1 - 1
packages/cpt_community/lib/modules/community/foryou/foryou_vm.g.dart

@@ -6,7 +6,7 @@ part of 'foryou_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$foryouVmHash() => r'af8a4c5962dea938d82be432aa28ec4e704971ad';
+String _$foryouVmHash() => r'3e8bcaf6a2fde125f5957bccdec1076baaca385b';
 
 /// See also [ForyouVm].
 @ProviderFor(ForyouVm)

+ 27 - 14
packages/cpt_community/lib/modules/community/news/news_page.dart

@@ -6,6 +6,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/my_button.dart';
@@ -81,7 +82,7 @@ class NewsPage extends HookConsumerWidget {
                   SliverList(
                     delegate: SliverChildBuilderDelegate(
                         (context, index){
-                          return _buildNewsItem(context, ref, state.list![index], vm);
+                          return _buildNewsItem(context, ref, state.list![index], vm, index);
                         },
                         childCount: state.list!.length
                     ),
@@ -95,7 +96,17 @@ class NewsPage extends HookConsumerWidget {
     );
   }
 
-  Widget _buildNewsItem(BuildContext context, WidgetRef ref, item, vm){
+  Widget _buildNewsItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int itemIdx){
+    String card_title = item.getValue("title", "");
+    String card_created_at = item.getValue("created_at", "");
+    Map<String, dynamic>? card_account = item.getValue<Map<String,dynamic>>("account", {});
+    String card_avator = card_account?['avator']?? "";
+    bool card_followed = card_account?['followed']??false;
+    String card_content = item.getValue("content", "");
+    List? card_resources = item.getValue<List>("resources", [])?? [];
+    bool card_liked = item.getValue("liked", false);
+    int card_likes_count = item.getValue("likes_count", 0);
+    int card_comments_count = item.getValue("comments_count", 0);
     return Container(
         margin: const EdgeInsets.only(left: 15, right: 15,top: 14,bottom: 14),
         padding: const EdgeInsets.only(left: 15, right: 15,top: 17,bottom: 0),
@@ -121,17 +132,17 @@ class NewsPage extends HookConsumerWidget {
                   Container(
                     child: NewsFeedCardHeader(
                       key: UniqueKey(),
-                      title: item['title'],
-                      avator: item['avator'],
-                      time: item['time'],
+                      title: card_title,
+                      avator: card_avator,
+                      time: card_created_at,
                     ),
                   ),
                   const SizedBox(height: 15),
                   // 卡片中间 (文字和图片)
                   NewsFeedCardContent(
                     key: UniqueKey(),
-                    content: item['content'],
-                    imageUrls: item['imageUrls'],
+                    content: card_content,
+                    imageUrls: card_resources,
                   ),
                   const SizedBox(height: 16),
                   // // 卡片底部 (点赞 评论 分享)
@@ -145,15 +156,17 @@ class NewsPage extends HookConsumerWidget {
                     ),
                     child: NewsFeedCardFooter(
                         key: UniqueKey(),
-                        isLike: item['isLike'],
+                        isLike: card_liked,
+                        likes_count: card_likes_count,
+                        comments_count: card_comments_count,
                         onLike: (){
-                          vm.handlerClickActionBtn('like', item);
+                          vm.handlerClickActionBtn('like', item, itemIdx);
                         },
                         onComment: (){
-                          vm.handlerClickActionBtn('comments', item);
+                          vm.handlerClickActionBtn('comments', item, itemIdx);
                         },
                         onShare: (){
-                          vm.handlerClickActionBtn('share', item);
+                          vm.handlerClickActionBtn('share', item, itemIdx);
                         },
                     ),
                   ),
@@ -161,7 +174,7 @@ class NewsPage extends HookConsumerWidget {
             ),
             // 右上角 关注/取消关注 按钮
             Visibility(
-              visible: !item['isFollow'],
+              visible: card_followed ? false: true,
               child: Positioned(
                   right: 10,
                   top: -5,
@@ -183,7 +196,7 @@ class NewsPage extends HookConsumerWidget {
                       fontWeight: FontWeight.w400,
                       fontSize: 14,
                       onPressed: (){
-                        // Navigator.pop(context);
+                        vm.handlerFollow(context, card_followed);
                       },
                     ),
                   )
@@ -196,7 +209,7 @@ class NewsPage extends HookConsumerWidget {
         // height: 580,
         // minHeight: 300,
       ).onTap((){
-      vm.handlerClickActionBtn(null, item);
+      vm.handlerGotoDetail(context, item['id']);
     });
   }
 

+ 18 - 18
packages/cpt_community/lib/modules/community/news/news_state.dart

@@ -4,36 +4,36 @@ class NewsState {
   //页面 LoadView 状态的展示
   LoadState loadingState;
   String? errorMessage;
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 0;
+  int? page;
+  int? limit = 10;
+  int? count = 0;
   List<Map<String, dynamic>>? list = [];
 
 
   NewsState({
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 0,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 0,
     this.list,
   });
 
   NewsState copyWith({
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
     List<String>? tabsList,
   }) {
     return NewsState(
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
     );
   }
@@ -42,9 +42,9 @@ class NewsState {
     return {
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
-      'curPage': this.curPage,
-      'pageSize': this.pageSize,
-      'filterCount': this.filterCount,
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
       'list': this.list,
     };
   }
@@ -53,9 +53,9 @@ class NewsState {
     return NewsState(
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
-      curPage: map['curPage'] as int,
-      pageSize: map['pageSize'] as int,
-      filterCount: map['filterCount'] as int,
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
       list: map['list'] as List<Map<String, dynamic>>,
     );
   }

+ 233 - 120
packages/cpt_community/lib/modules/community/news/news_vm.dart

@@ -1,25 +1,27 @@
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/newsfeed_news_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
+import '../../../respository/newsfeed_news_repository.dart';
 import '../../../router/page/community_page_router.dart';
 import '../community_pageview_idx_data.dart';
 import '../community_vm.dart';
 import '../newsfeed_detail/newsfeed_detail_page.dart';
-import 'news_respository.dart';
 import 'news_state.dart';
 
 part 'news_vm.g.dart';
 
 @riverpod
 class NewsVm extends _$NewsVm {
-  late NewsRepository NewsRepositoryInstance;
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  late NewsFeedNewsRepository repositoryInstance;
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -36,7 +38,7 @@ class NewsVm extends _$NewsVm {
   @override
   NewsState build(){
     // 引入数据仓库
-    NewsRepositoryInstance = ref.read(newsRepositoryProvider);
+    repositoryInstance = ref.read(newsFeedNewsRepositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -63,16 +65,16 @@ class NewsVm extends _$NewsVm {
     if(isShowing){
       Log.d("----news_vm-----loadMore");
       // await Future.delayed(const Duration(seconds: 2));
-      // if(state.list.length >= state.filterCount){
+      // if(state.list.length >= state.count){
       //   return;
       // }else {
-      //   int curPage = state.curPage + 1;
-      //   state = state.copyWith(curPage: curPage,);
+      //   int page = state.page + 1;
+      //   state = state.copyWith(page: page,);
       //   getListData();
       // }
-      // 检查 curPage 是否为 null,并初始化为 1
-      int newCurPage = state.curPage ?? 1;
-      state = state.copyWith(curPage: ++newCurPage);
+      // 检查 page 是否为 null,并初始化为 1
+      int newCurPage = state.page ?? 1;
+      state = state.copyWith(page: ++newCurPage);
       getListData();
     }else {
       refreshController.finishRefresh();
@@ -87,12 +89,10 @@ class NewsVm extends _$NewsVm {
       // 当前pageView 页面正处于显示状态
       Log.d("----forsale_vm-----onRefresh ");
       // await Future.delayed(const Duration(seconds: 2));
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       getListData();
     }else {
       refreshController.finishRefresh();
-      // //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
     }
   }
 
@@ -100,7 +100,7 @@ class NewsVm extends _$NewsVm {
   Future retryRequest() async {
     bool isShowing = await ref.read(communityVmProvider.notifier).isCurrentPageViewShowing(CommunityPageViewIdxData.news);
     if(isShowing){
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       _needShowPlaceholder = true;
       getListData();
     }
@@ -113,12 +113,12 @@ class NewsVm extends _$NewsVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.curPage}---");
+    Log.d("加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -138,131 +138,244 @@ class NewsVm extends _$NewsVm {
     //     ToastEngine.show("Error: $e");
     //   }
 
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        'id':1,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'William Jefferson',
-        'isFollow': false,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': true,
-        'likeno': 12
-      },
-      {
-        'id':2,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'William fdsaf的飞洒发生的',
-        'isFollow': true,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': [],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': true,
-        'likeno': 12
-      },
-      {
-        'id':3,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'Fsjfkds  dfsk',
-        'isFollow': false,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': [],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': false,
-        'likeno': 12
-      },
-      {
-        'id':4,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'Fsjfkds  dfsk',
-        'isFollow': false,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': [],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': false,
-        'likeno': 12
-      },
-      {
-        'id':5,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'Fsjfkds  dfsk',
-        'isFollow': false,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': [],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': false,
-        'likeno': 12
-      },
-      {
-        'id':6,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': 'Fsjfkds  dfsk',
-        'isFollow': false,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': [],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': false,
-        'likeno': 12
-      },
-      {
-        'id':7,
-        'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-        'title': '放大发大水',
-        'isFollow': false,
-        'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-        'imageUrls': [],
-        'time': 'June 17,2016 at 7:23 p.m.',
-        'isLike': false,
-        'likeno': 12
-      },
-    ];
-
-    if (state.curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(list: listData);
-      refreshController.finishRefresh();
-      // //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
-    } else {
-      //加载更多
-      final allList = state.list;
-      allList?.addAll(listData);
-      state = state.copyWith(list: allList);
-      refreshController.finishLoad();
+    // await Future.delayed(const Duration(milliseconds: 1500));
+    // final List<Map<String, dynamic>> listData = [
+    //   {
+    //     'id':1,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'William Jefferson',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': true,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':2,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'William fdsaf的飞洒发生的',
+    //     'isFollow': true,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': true,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':3,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'Fsjfkds  dfsk',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':4,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'Fsjfkds  dfsk',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':5,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'Fsjfkds  dfsk',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':6,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': 'Fsjfkds  dfsk',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    //   {
+    //     'id':7,
+    //     'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //     'title': '放大发大水',
+    //     'isFollow': false,
+    //     'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //     'imageUrls': [],
+    //     'time': 'June 17,2016 at 7:23 p.m.',
+    //     'isLike': false,
+    //     'likeno': 12
+    //   },
+    // ];
+    //
+    // if (state.page == 1) {
+    //   //刷新的方式
+    //   state = state.copyWith(list: listData);
+    //   refreshController.finishRefresh();
+    //   // //更新展示的状态
+    //   changeLoadingState(LoadState.State_Success, null);
+    // } else {
+    //   //加载更多
+    //   final allList = state.list;
+    //   allList?.addAll(listData);
+    //   state = state.copyWith(list: allList);
+    //   refreshController.finishLoad();
+    //
+    // }
+    //
+    // // 最后赋值
+    // _needShowPlaceholder = false;
 
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "page": state.page,
+        "limit": state.limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await repositoryInstance.fetchNewsList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList((result.data  as NewsfeedNewsEntity).list);
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
     }
+  }
 
-    // 最后赋值
-    _needShowPlaceholder = false;
+
+  void handlerResultList(List<NewsfeedNewsList>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (state.page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
+
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      if (state.page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        if(state.list!.length == 0){
+          changeLoadingState(LoadState.State_Empty, null);
+        }else {
+          if(_needShowPlaceholder){
+            changeLoadingState(LoadState.State_Success, null);
+          }
+        }
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
   }
 
+  // 点赞/取消点赞
+  Future handlerLikeClick(int id, bool isLike, int itemidx) async {
+    try {
+      final result = await repositoryInstance.fetchLikeClick({
+        "id": id,
+      });
+      if (result.isSuccess) {
+        //重新赋值data或list
+        // final json = result.getDataJson();
+        // var data = NewsfeedNewsEntity.fromJson(json!);
+        //重新赋值data或list
+        // state.list![id].liked = data.list![0].liked;
+        // state.list![id].likeno = data.list![0].likeno;
+        final String toastMsg = isLike ? "Cancel successfully": "Liked successfully";
+        ToastEngine.show(toastMsg);
+        // 修改 state.list[itemIdx] 中的 like 状态 和 likes_count
+        state.list![itemidx]['liked'] = !isLike;
+        if(isLike){
+          // 取消点赞
+          if(state.list![itemidx]['likes_count']>0){
+            state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] - 1;
+          }
+        }else {
+          state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] + 1;
+        }
+        //重新赋值data或list
+        changeLoadingState(LoadState.State_Success, null);
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error) {
+      return false;
+    }
+  }
 
   // 点击 like comments  share
-  void handlerClickActionBtn(String? actionStr, item){
+  Future<bool?> handlerClickActionBtn(String? actionStr, Map<String, dynamic> item, int itemidx) async{
     final id = item['id'];
+    final liked = item.getValue('liked', false);
     switch (actionStr) {
       case 'like':
-        Log.d("点击了 点赞");
-        handlerGotoDetail(id);
-        break;
+        return await handlerLikeClick(id, liked, itemidx);
       case 'comments':
         Log.d("点击了 评论");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
       case 'share':
         Log.d("点击了 分享");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
       default:
         Log.d("点击了卡片");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
     }
   }
+  Future handlerFollow(BuildContext context, bool isFollow) async{
+    Log.d("点击了 关注");
+    // try {
+    //   //请求网络
+    //   Map<String, dynamic>  params = {
+    //
+    //   };
+    //   Log.d("请求参数------$params");
+    //   final result = await repositoryInstance.fetchNewsList(params);
+    //   //校验成功失败
+    //   if (result.isSuccess) {
+    //     handlerResultList((result.data  as NewsfeedNewsEntity).list);
+    //   } else {
+    //     String errorMessage = result.errorMsg!;
+    //     changeLoadingState(LoadState.State_Error, errorMessage);
+    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
+    //   }
+    // } catch (e) {
+    //   ToastEngine.show("Error: $e");
+    // }
+  }
   // 去详情页面
-  void handlerGotoDetail(id){
+  void handlerGotoDetail(BuildContext? context, int id){
     Log.d("去详情页面");
     appRouter.push(NewsfeedDetailPageRoute(id: id, type:'news'));
   }

+ 1 - 1
packages/cpt_community/lib/modules/community/news/news_vm.g.dart

@@ -6,7 +6,7 @@ part of 'news_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$newsVmHash() => r'ce792a3814b2a3da4d164c030346eca5e9d77798';
+String _$newsVmHash() => r'e8eaf4270dd8636d5b34f539949f030d84fc5758';
 
 /// See also [NewsVm].
 @ProviderFor(NewsVm)

+ 18 - 18
packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_state.dart

@@ -5,9 +5,9 @@ class NewsfeedDetailState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 1;
+  int? page;
+  int? limit = 10;
+  int? count = 1;
 
   // 评论框信息
   Map<String, dynamic>? commentFieldInfo;
@@ -18,9 +18,9 @@ class NewsfeedDetailState {
   NewsfeedDetailState({
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 1,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 1,
     Map<String, dynamic>? commentFieldInfo,
     required this.detailInfo,
     required this.list,
@@ -30,9 +30,9 @@ class NewsfeedDetailState {
   NewsfeedDetailState copyWith({
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     Map<String, dynamic>? detailInfo,
     Map<String, dynamic>? commentFieldInfo,
     List<Map<String, dynamic>>? list,
@@ -40,9 +40,9 @@ class NewsfeedDetailState {
     return NewsfeedDetailState(
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       commentFieldInfo: commentFieldInfo ?? this.commentFieldInfo,
       detailInfo: detailInfo ?? this.detailInfo,
       list: list ?? this.list,
@@ -53,9 +53,9 @@ class NewsfeedDetailState {
     return {
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
-      'curPage': this.curPage,
-      'pageSize': this.pageSize,
-      'filterCount': this.filterCount,
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
       'commentFieldInfo': this.commentFieldInfo,
       'detailInfo': this.detailInfo,
       'list': this.list,
@@ -66,9 +66,9 @@ class NewsfeedDetailState {
     return NewsfeedDetailState(
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
-      curPage: map['curPage'] as int,
-      pageSize: map['pageSize'] as int,
-      filterCount: map['filterCount'] as int,
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
       commentFieldInfo: map['commentFieldInfo'] as Map<String, dynamic>,
       detailInfo: map['detailInfo'] as Map<String, dynamic>,
       list: map['list'] as List<Map<String, dynamic>>,

+ 13 - 13
packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_vm.dart

@@ -33,7 +33,7 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
   };
 
 
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -104,16 +104,16 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
   Future loadMore({int? id}) async {
     Log.d("----property_news_vm-----loadMore");
     // await Future.delayed(const Duration(seconds: 2));
-    // if(state.list.length >= state.filterCount){
+    // if(state.list.length >= state.count){
     //   return;
     // }else {
-    //   int curPage = state.curPage + 1;
-    //   state = state.copyWith(curPage: curPage,);
+    //   int page = state.page + 1;
+    //   state = state.copyWith(page: page,);
     //   getListData();
     // }
-    // 检查 curPage 是否为 null,并初始化为 1
-    int newCurPage = state.curPage ?? 1;
-    state = state.copyWith(curPage: ++newCurPage);
+    // 检查 page 是否为 null,并初始化为 1
+    int newCurPage = state.page ?? 1;
+    state = state.copyWith(page: ++newCurPage);
     getListData();
   }
 
@@ -123,13 +123,13 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
     Log.d("----property_news_vm-----onRefresh ");
 
     // await Future.delayed(const Duration(seconds: 2));
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     getListData();
   }
 
   // 重试请求
   Future retryRequest() async {
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     _needShowPlaceholder = true;
     getListData();
   }
@@ -141,12 +141,12 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("加载listData数据---------------start--${state.curPage}---");
+    Log.d("加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -185,7 +185,7 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
     ];
 
 
-    if (state.curPage == 1) {
+    if (state.page == 1) {
       //刷新的方式
       state = state.copyWith(list: listData);
       refreshController.finishRefresh();

+ 1 - 1
packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_vm.g.dart

@@ -6,7 +6,7 @@ part of 'newsfeed_detail_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$newsfeedDetailVmHash() => r'2a36483461d9e5ca76e5f65ac524f0a972325735';
+String _$newsfeedDetailVmHash() => r'32fbd262aef1042cdde66553d6fe65f51f658e6b';
 
 /// See also [NewsfeedDetailVm].
 @ProviderFor(NewsfeedDetailVm)

+ 18 - 18
packages/cpt_community/lib/modules/garage/for_rent/for_rent_state.dart

@@ -6,9 +6,9 @@ class ForrentState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 0;
+  int? page;
+  int? limit = 10;
+  int? count = 0;
   List<Map<String, dynamic>> list;
 
 
@@ -16,9 +16,9 @@ class ForrentState {
     this.activeTabIndex,
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 0,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 0,
     required this.list,
   });
 
@@ -26,18 +26,18 @@ class ForrentState {
     int? activeTabIndex,
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
   }) {
     return ForrentState(
       activeTabIndex: activeTabIndex ?? this.activeTabIndex,
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
     );
   }
@@ -47,9 +47,9 @@ class ForrentState {
       'activeTabIndex': this.activeTabIndex,
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
-      'curPage': this.curPage,
-      'pageSize': this.pageSize,
-      'filterCount': this.filterCount,
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
       'list': this.list,
     };
   }
@@ -59,9 +59,9 @@ class ForrentState {
       activeTabIndex: map['activeTabIndex'] as int,
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
-      curPage: map['curPage'] as int,
-      pageSize: map['pageSize'] as int,
-      filterCount: map['filterCount'] as int,
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
       list: map['list'] as List<Map<String, dynamic>>,
     );
   }

+ 13 - 13
packages/cpt_community/lib/modules/garage/for_rent/for_rent_vm.dart

@@ -19,7 +19,7 @@ part 'for_rent_vm.g.dart';
 @riverpod
 class ForrentVm extends _$ForrentVm {
   late ForrentRepository ForrentRepositoryInstance;
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -97,16 +97,16 @@ class ForrentVm extends _$ForrentVm {
     if(isShowing){
       Log.d("----for_rent_vm-----loadMore");
       // await Future.delayed(const Duration(seconds: 2));
-      // if(state.list.length >= state.filterCount){
+      // if(state.list.length >= state.count){
       //   return;
       // }else {
-      //   int curPage = state.curPage + 1;
-      //   state = state.copyWith(curPage: curPage,);
+      //   int page = state.page + 1;
+      //   state = state.copyWith(page: page,);
       //   getListData();
       // }
-      // 检查 curPage 是否为 null,并初始化为 1
-      int newCurPage = state.curPage ?? 1;
-      state = state.copyWith(curPage: ++newCurPage);
+      // 检查 page 是否为 null,并初始化为 1
+      int newCurPage = state.page ?? 1;
+      state = state.copyWith(page: ++newCurPage);
       getListData();
     }else {
       refreshController.finishRefresh();
@@ -121,7 +121,7 @@ class ForrentVm extends _$ForrentVm {
       // 当前pageView 页面正处于显示状态
       Log.d("----for_rent_vm-----onRefresh ");
       // await Future.delayed(const Duration(seconds: 2));
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       getListData();
     }else {
       refreshController.finishRefresh();
@@ -134,7 +134,7 @@ class ForrentVm extends _$ForrentVm {
   Future retryRequest() async {
     bool isShowing = await ref.read(communityVmProvider.notifier).isCurrentPageViewShowing(CommunityPageViewIdxData.forRent);
     if(isShowing){
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       _needShowPlaceholder = true;
       getListData();
     }
@@ -147,12 +147,12 @@ class ForrentVm extends _$ForrentVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_rent加载listData数据---------------start--${state.curPage}---");
+    Log.d("for_rent加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -209,7 +209,7 @@ class ForrentVm extends _$ForrentVm {
       },
     ];
 
-    if (state.curPage == 1) {
+    if (state.page == 1) {
       //刷新的方式
       state = state.copyWith(list: listData);
       refreshController.finishRefresh();

+ 1 - 1
packages/cpt_community/lib/modules/garage/for_rent/for_rent_vm.g.dart

@@ -6,7 +6,7 @@ part of 'for_rent_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$forrentVmHash() => r'057fddba190bba20681aadf8965195e6ec1c54be';
+String _$forrentVmHash() => r'1dc0df10f17ff092fd7f521c28a0cf71d9e0671c';
 
 /// See also [ForrentVm].
 @ProviderFor(ForrentVm)

+ 18 - 18
packages/cpt_community/lib/modules/garage/for_sale/for_sale_state.dart

@@ -6,9 +6,9 @@ class ForsaleState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 0;
+  int? page;
+  int? limit = 10;
+  int? count = 0;
   List<Map<String, dynamic>> list;
 
 
@@ -16,9 +16,9 @@ class ForsaleState {
     this.activeTabIndex,
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 0,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 0,
     required this.list,
   });
 
@@ -26,9 +26,9 @@ class ForsaleState {
     int? activeTabIndex,
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
     List<String>? tabsList,
   }) {
@@ -36,9 +36,9 @@ class ForsaleState {
       activeTabIndex: activeTabIndex ?? this.activeTabIndex,
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
     );
   }
@@ -48,9 +48,9 @@ class ForsaleState {
       'activeTabIndex': this.activeTabIndex,
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
-      'curPage': this.curPage,
-      'pageSize': this.pageSize,
-      'filterCount': this.filterCount,
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
       'list': this.list,
     };
   }
@@ -60,9 +60,9 @@ class ForsaleState {
       activeTabIndex: map['activeTabIndex'] as int,
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
-      curPage: map['curPage'] as int,
-      pageSize: map['pageSize'] as int,
-      filterCount: map['filterCount'] as int,
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
       list: map['list'] as List<Map<String, dynamic>>,
     );
   }

+ 13 - 13
packages/cpt_community/lib/modules/garage/for_sale/for_sale_vm.dart

@@ -20,7 +20,7 @@ part 'for_sale_vm.g.dart';
 @riverpod
 class ForsaleVm extends _$ForsaleVm {
   late ForsaleRepository ForsaleRepositoryInstance;
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
 
   // Refresh 控制器
@@ -66,16 +66,16 @@ class ForsaleVm extends _$ForsaleVm {
     if(isShowing){
       Log.d("----for_sale_vm-----loadMore");
       // await Future.delayed(const Duration(seconds: 2));
-      // if(state.list.length >= state.filterCount){
+      // if(state.list.length >= state.count){
       //   return;
       // }else {
-      //   int curPage = state.curPage + 1;
-      //   state = state.copyWith(curPage: curPage,);
+      //   int page = state.page + 1;
+      //   state = state.copyWith(page: page,);
       //   getListData();
       // }
-      // 检查 curPage 是否为 null,并初始化为 1
-      int newCurPage = state.curPage ?? 1;
-      state = state.copyWith(curPage: ++newCurPage);
+      // 检查 page 是否为 null,并初始化为 1
+      int newCurPage = state.page ?? 1;
+      state = state.copyWith(page: ++newCurPage);
       getListData();
     }else {
       refreshController.finishRefresh();
@@ -90,7 +90,7 @@ class ForsaleVm extends _$ForsaleVm {
       // 当前pageView 页面正处于显示状态
       Log.d("----forsale_vm-----onRefresh ");
       // await Future.delayed(const Duration(seconds: 2));
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       getListData();
     }else {
       refreshController.finishRefresh();
@@ -103,7 +103,7 @@ class ForsaleVm extends _$ForsaleVm {
   Future retryRequest() async {
     bool isShowing = await ref.read(communityVmProvider.notifier).isCurrentPageViewShowing(CommunityPageViewIdxData.forSale);
     if(isShowing){
-      state = state.copyWith(curPage: 1);
+      state = state.copyWith(page: 1);
       _needShowPlaceholder = true;
       getListData();
     }
@@ -116,12 +116,12 @@ class ForsaleVm extends _$ForsaleVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale_vm加载listData数据---------------start--${state.curPage}---");
+    Log.d("for_sale_vm加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -211,7 +211,7 @@ class ForsaleVm extends _$ForsaleVm {
       },
     ];
 
-    if (state.curPage == 1) {
+    if (state.page == 1) {
       //刷新的方式
       state = state.copyWith(list: listData);
       refreshController.finishRefresh();

+ 1 - 1
packages/cpt_community/lib/modules/garage/for_sale/for_sale_vm.g.dart

@@ -6,7 +6,7 @@ part of 'for_sale_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$forsaleVmHash() => r'bbbdd29799a5d2bf561b9a247ec85768c3fc607b';
+String _$forsaleVmHash() => r'e94a8a4c8ca889796a23b37f6a1ae6dd6a709b23';
 
 /// See also [ForsaleVm].
 @ProviderFor(ForsaleVm)

+ 3 - 3
packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_vm.dart

@@ -16,7 +16,7 @@ part 'garagesale_detail_vm.g.dart';
 @riverpod
 class GaragesaleDetailVm extends _$GaragesaleDetailVm {
   // late GaragesaleDetailRepository GaragesaleDetailRepositoryInstance;
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -69,8 +69,8 @@ class GaragesaleDetailVm extends _$GaragesaleDetailVm {
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
 

+ 1 - 1
packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_vm.g.dart

@@ -7,7 +7,7 @@ part of 'garagesale_detail_vm.dart';
 // **************************************************************************
 
 String _$garagesaleDetailVmHash() =>
-    r'7ee0bd467ff952716fbe9a949c6bf072969c3932';
+    r'59335b8961337b00baf96d91bbc92da4b65d52de';
 
 /// See also [GaragesaleDetailVm].
 @ProviderFor(GaragesaleDetailVm)

+ 12 - 12
packages/cpt_community/lib/modules/my_following/my_follow/my_follow_state.dart

@@ -5,34 +5,34 @@ class MyFollowState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 0;
+  int? page;
+  int? limit = 10;
+  int? count = 0;
   List<Map<String, dynamic>> list;
 
   MyFollowState({
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 0,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 0,
     required this.list,
   });
 
   MyFollowState copyWith({
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
   }) {
     return MyFollowState(
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
     );
   }

+ 13 - 13
packages/cpt_community/lib/modules/my_following/my_follow/my_follow_vm.dart

@@ -14,7 +14,7 @@ part 'my_follow_vm.g.dart';
 @riverpod
 class MyFollowVm extends _$MyFollowVm {
 
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -54,16 +54,16 @@ class MyFollowVm extends _$MyFollowVm {
   Future loadMore() async {
     Log.d("----for_sale_vm-----loadMore");
     // await Future.delayed(const Duration(seconds: 2));
-    // if(state.list.length >= state.filterCount){
+    // if(state.list.length >= state.count){
     //   return;
     // }else {
-    //   int curPage = state.curPage + 1;
-    //   state = state.copyWith(curPage: curPage,);
+    //   int page = state.page + 1;
+    //   state = state.copyWith(page: page,);
     //   getListData();
     // }
-    // 检查 curPage 是否为 null,并初始化为 1
-    int newCurPage = state.curPage ?? 1;
-    state = state.copyWith(curPage: ++newCurPage);
+    // 检查 page 是否为 null,并初始化为 1
+    int newCurPage = state.page ?? 1;
+    state = state.copyWith(page: ++newCurPage);
     getListData();
   }
 
@@ -73,13 +73,13 @@ class MyFollowVm extends _$MyFollowVm {
     Log.d("----forsale_vm-----onRefresh ");
 
     // await Future.delayed(const Duration(seconds: 2));
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     getListData();
   }
 
   // 重试请求
   Future retryRequest() async {
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     _needShowPlaceholder = true;
     getListData();
   }
@@ -91,12 +91,12 @@ class MyFollowVm extends _$MyFollowVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.curPage}---");
+    Log.d("for_sale加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -132,7 +132,7 @@ class MyFollowVm extends _$MyFollowVm {
       },
     ];
 
-    if (state.curPage == 1) {
+    if (state.page == 1) {
       //刷新的方式
       state = state.copyWith(list: listData);
       refreshController.finishRefresh();

+ 1 - 1
packages/cpt_community/lib/modules/my_following/my_follow/my_follow_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_follow_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myFollowVmHash() => r'8c6f9fbf7a522cfd47ee34c5de7cf24916587c36';
+String _$myFollowVmHash() => r'ad3b17b9dadc3d2164fa56eda2596c2366f9a8f5';
 
 /// See also [MyFollowVm].
 @ProviderFor(MyFollowVm)

+ 12 - 12
packages/cpt_community/lib/modules/my_following/my_follower/my_follower_state.dart

@@ -5,34 +5,34 @@ class MyFollowerState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 0;
+  int? page;
+  int? limit = 10;
+  int? count = 0;
   List<Map<String, dynamic>> list;
 
   MyFollowerState({
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 0,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 0,
     required this.list,
   });
 
   MyFollowerState copyWith({
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
   }) {
     return MyFollowerState(
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
     );
   }

+ 13 - 13
packages/cpt_community/lib/modules/my_following/my_follower/my_follower_vm.dart

@@ -14,7 +14,7 @@ part 'my_follower_vm.g.dart';
 @riverpod
 class MyFollowerVm extends _$MyFollowerVm {
 
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -58,16 +58,16 @@ class MyFollowerVm extends _$MyFollowerVm {
   Future loadMore() async {
     Log.d("----for_sale_vm-----loadMore");
     // await Future.delayed(const Duration(seconds: 2));
-    // if(state.list.length >= state.filterCount){
+    // if(state.list.length >= state.count){
     //   return;
     // }else {
-    //   int curPage = state.curPage + 1;
-    //   state = state.copyWith(curPage: curPage,);
+    //   int page = state.page + 1;
+    //   state = state.copyWith(page: page,);
     //   getListData();
     // }
-    // 检查 curPage 是否为 null,并初始化为 1
-    int newCurPage = state.curPage ?? 1;
-    state = state.copyWith(curPage: ++newCurPage);
+    // 检查 page 是否为 null,并初始化为 1
+    int newCurPage = state.page ?? 1;
+    state = state.copyWith(page: ++newCurPage);
     getListData();
   }
 
@@ -77,13 +77,13 @@ class MyFollowerVm extends _$MyFollowerVm {
     Log.d("----forsale_vm-----onRefresh ");
 
     // await Future.delayed(const Duration(seconds: 2));
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     getListData();
   }
 
   // 重试请求
   Future retryRequest() async {
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     _needShowPlaceholder = true;
     getListData();
   }
@@ -95,12 +95,12 @@ class MyFollowerVm extends _$MyFollowerVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.curPage}---");
+    Log.d("for_sale加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -136,7 +136,7 @@ class MyFollowerVm extends _$MyFollowerVm {
       },
     ];
 
-    if (state.curPage == 1) {
+    if (state.page == 1) {
       //刷新的方式
       state = state.copyWith(list: listData);
       refreshController.finishRefresh();

+ 1 - 1
packages/cpt_community/lib/modules/my_following/my_follower/my_follower_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_follower_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myFollowerVmHash() => r'3069f27c5676bb740990ead2ddf9041bec412ca0';
+String _$myFollowerVmHash() => r'94dbe2b359863bd7ea8bc90efc0b273d05aa9613';
 
 /// See also [MyFollowerVm].
 @ProviderFor(MyFollowerVm)

+ 18 - 18
packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_state.dart

@@ -6,9 +6,9 @@ class MyPostsForRentState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 0;
+  int? page;
+  int? limit = 10;
+  int? count = 0;
   List<Map<String, dynamic>> list;
 
   List<String>? tabsList = ['For Sale', 'For Rent'];
@@ -17,9 +17,9 @@ class MyPostsForRentState {
     this.activeTabIndex,
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 0,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 0,
     required this.list,
     this.tabsList,
   });
@@ -28,9 +28,9 @@ class MyPostsForRentState {
     int? activeTabIndex,
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
     List<String>? tabsList,
   }) {
@@ -38,9 +38,9 @@ class MyPostsForRentState {
       activeTabIndex: activeTabIndex ?? this.activeTabIndex,
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       tabsList: tabsList ?? this.tabsList,
       list: list ?? this.list,
     );
@@ -51,9 +51,9 @@ class MyPostsForRentState {
       'activeTabIndex': this.activeTabIndex,
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
-      'curPage': this.curPage,
-      'pageSize': this.pageSize,
-      'filterCount': this.filterCount,
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
       'list': this.list,
       'tabsList': this.tabsList,
     };
@@ -64,9 +64,9 @@ class MyPostsForRentState {
       activeTabIndex: map['activeTabIndex'] as int,
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
-      curPage: map['curPage'] as int,
-      pageSize: map['pageSize'] as int,
-      filterCount: map['filterCount'] as int,
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
       list: map['list'] as List<Map<String, dynamic>>,
       tabsList: map['tabsList'] as List<String>,
     );

+ 13 - 13
packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_vm.dart

@@ -17,7 +17,7 @@ part 'my_posts_forrent_vm.g.dart';
 @riverpod
 class MyPostsForRentVm extends _$MyPostsForRentVm {
   // late MyPostsForRentRepository MyPostsForRentRepositoryInstance;
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -60,16 +60,16 @@ class MyPostsForRentVm extends _$MyPostsForRentVm {
   Future loadMore() async {
     Log.d("----for_sale_vm-----loadMore");
     // await Future.delayed(const Duration(seconds: 2));
-    // if(state.list.length >= state.filterCount){
+    // if(state.list.length >= state.count){
     //   return;
     // }else {
-    //   int curPage = state.curPage + 1;
-    //   state = state.copyWith(curPage: curPage,);
+    //   int page = state.page + 1;
+    //   state = state.copyWith(page: page,);
     //   getListData();
     // }
-    // 检查 curPage 是否为 null,并初始化为 1
-    int newCurPage = state.curPage ?? 1;
-    state = state.copyWith(curPage: ++newCurPage);
+    // 检查 page 是否为 null,并初始化为 1
+    int newCurPage = state.page ?? 1;
+    state = state.copyWith(page: ++newCurPage);
     getListData();
   }
 
@@ -79,13 +79,13 @@ class MyPostsForRentVm extends _$MyPostsForRentVm {
     Log.d("----forrent_vm-----onRefresh ");
 
     // await Future.delayed(const Duration(seconds: 2));
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     getListData();
   }
 
   // 重试请求
   Future retryRequest() async {
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     _needShowPlaceholder = true;
     getListData();
   }
@@ -97,12 +97,12 @@ class MyPostsForRentVm extends _$MyPostsForRentVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.curPage}---");
+    Log.d("for_sale加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -159,7 +159,7 @@ class MyPostsForRentVm extends _$MyPostsForRentVm {
       },
     ];
 
-    if (state.curPage == 1) {
+    if (state.page == 1) {
       //刷新的方式
       state = state.copyWith(list: listData);
       refreshController.finishRefresh();

+ 1 - 1
packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_posts_forrent_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myPostsForRentVmHash() => r'e5a687e67c0d47f3fa8bc0929154c1583ab5532c';
+String _$myPostsForRentVmHash() => r'ee3f8fee8a2c0b11102959d0c9800622a8957b75';
 
 /// See also [MyPostsForRentVm].
 @ProviderFor(MyPostsForRentVm)

+ 18 - 18
packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_state.dart

@@ -6,9 +6,9 @@ class MyPostsForSaleState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 0;
+  int? page;
+  int? limit = 10;
+  int? count = 0;
   List<Map<String, dynamic>> list;
 
   List<String>? tabsList = ['For Sale', 'For Rent'];
@@ -17,9 +17,9 @@ class MyPostsForSaleState {
     this.activeTabIndex,
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.curPage = 1,
-    this.pageSize = 10,
-    this.filterCount = 0,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 0,
     required this.list,
     this.tabsList,
   });
@@ -28,9 +28,9 @@ class MyPostsForSaleState {
     int? activeTabIndex,
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
     List<String>? tabsList,
   }) {
@@ -38,9 +38,9 @@ class MyPostsForSaleState {
       activeTabIndex: activeTabIndex ?? this.activeTabIndex,
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       tabsList: tabsList ?? this.tabsList,
       list: list ?? this.list,
     );
@@ -51,9 +51,9 @@ class MyPostsForSaleState {
       'activeTabIndex': this.activeTabIndex,
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
-      'curPage': this.curPage,
-      'pageSize': this.pageSize,
-      'filterCount': this.filterCount,
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
       'list': this.list,
       'tabsList': this.tabsList,
     };
@@ -64,9 +64,9 @@ class MyPostsForSaleState {
       activeTabIndex: map['activeTabIndex'] as int,
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
-      curPage: map['curPage'] as int,
-      pageSize: map['pageSize'] as int,
-      filterCount: map['filterCount'] as int,
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
       list: map['list'] as List<Map<String, dynamic>>,
       tabsList: map['tabsList'] as List<String>,
     );

+ 13 - 13
packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_vm.dart

@@ -20,7 +20,7 @@ class MyPostsForSaleVm extends _$MyPostsForSaleVm {
   // late MyPostsForSaleRepository MyPostsForSaleRepositoryInstance;
   late BuildContext _currentPageContext;
 
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -66,16 +66,16 @@ class MyPostsForSaleVm extends _$MyPostsForSaleVm {
   Future loadMore() async {
     Log.d("----for_sale_vm-----loadMore");
     // await Future.delayed(const Duration(seconds: 2));
-    // if(state.list.length >= state.filterCount){
+    // if(state.list.length >= state.count){
     //   return;
     // }else {
-    //   int curPage = state.curPage + 1;
-    //   state = state.copyWith(curPage: curPage,);
+    //   int page = state.page + 1;
+    //   state = state.copyWith(page: page,);
     //   getListData();
     // }
-    // 检查 curPage 是否为 null,并初始化为 1
-    int newCurPage = state.curPage ?? 1;
-    state = state.copyWith(curPage: ++newCurPage);
+    // 检查 page 是否为 null,并初始化为 1
+    int newCurPage = state.page ?? 1;
+    state = state.copyWith(page: ++newCurPage);
     getListData();
   }
 
@@ -85,13 +85,13 @@ class MyPostsForSaleVm extends _$MyPostsForSaleVm {
     Log.d("----forsale_vm-----onRefresh ");
 
     // await Future.delayed(const Duration(seconds: 2));
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     getListData();
   }
 
   // 重试请求
   Future retryRequest() async {
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     _needShowPlaceholder = true;
     getListData();
   }
@@ -103,12 +103,12 @@ class MyPostsForSaleVm extends _$MyPostsForSaleVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.curPage}---");
+    Log.d("for_sale加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -198,7 +198,7 @@ class MyPostsForSaleVm extends _$MyPostsForSaleVm {
       },
     ];
 
-    if (state.curPage == 1) {
+    if (state.page == 1) {
       //刷新的方式
       state = state.copyWith(list: listData);
       refreshController.finishRefresh();

+ 1 - 1
packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_posts_forsale_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myPostsForSaleVmHash() => r'a46ff1edb66dfc73747a68946d6607dd0b5a3998';
+String _$myPostsForSaleVmHash() => r'e5d86704c4d68a8ba887e740bd37ffa1ff816b6a';
 
 /// See also [MyPostsForSaleVm].
 @ProviderFor(MyPostsForSaleVm)

+ 2 - 0
packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_page.dart

@@ -186,6 +186,8 @@ class MyPostsNewsfeedPage extends HookConsumerWidget {
               child: NewsFeedCardFooter(
                 key: UniqueKey(),
                 isLike: true,
+                likes_count: item['likes_count']?? 0,
+                comments_count: item['comments_count']?? 0,
                 onLike: () {
                   vm.handlerClickActionBtn('like', item);
                 },

+ 18 - 18
packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_state.dart

@@ -7,9 +7,9 @@ class MyPostsNewsfeedState {
   String? errorMessage;
 
   int? activeTabIndex =0;
-  int? curPage =0;
-  int? pageSize =10;
-  int? filterCount =1;
+  int? page =0;
+  int? limit =10;
+  int? count =1;
   List<Map<String, dynamic>>? tabsList;
   List<NewsFeedItemGroupState>? list = [];
 
@@ -17,9 +17,9 @@ class MyPostsNewsfeedState {
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
     this.activeTabIndex,
-    this.curPage,
-    this.pageSize,
-    this.filterCount = 1,
+    this.page,
+    this.limit,
+    this.count = 1,
     List<Map<String, dynamic>>? tabsList,
     this.list,
   }): tabsList = tabsList ?? [
@@ -44,9 +44,9 @@ class MyPostsNewsfeedState {
     LoadState? loadingState,
     String? errorMessage,
     int? activeTabIndex,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? tabsList,
     List<NewsFeedItemGroupState>? list,
   }) {
@@ -54,9 +54,9 @@ class MyPostsNewsfeedState {
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
       activeTabIndex: activeTabIndex ?? this.activeTabIndex,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       tabsList: tabsList ?? this.tabsList,
       list: list ?? this.list,
     );
@@ -67,9 +67,9 @@ class MyPostsNewsfeedState {
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
       'activeTabIndex': this.activeTabIndex,
-      'curPage': this.curPage,
-      'pageSize': this.pageSize,
-      'filterCount': this.filterCount,
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
       'tabsList': this.tabsList,
       'list': this.list,
     };
@@ -80,9 +80,9 @@ class MyPostsNewsfeedState {
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
       activeTabIndex: map['activeTabIndex'] as int,
-      curPage: map['curPage'] as int,
-      pageSize: map['pageSize'] as int,
-      filterCount: map['filterCount'] as int,
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
       tabsList: map['tabsList'] as List<Map<String, dynamic>>,
       list: map['list'] as List<NewsFeedItemGroupState>,
     );

+ 13 - 13
packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_vm.dart

@@ -21,7 +21,7 @@ part 'my_posts_newsfeed_vm.g.dart';
 class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
   // late MyPostsRepository MyPostsRepositoryInstance;
 
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
     controlFinishRefresh: true,  //允许刷新
@@ -71,16 +71,16 @@ class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
   Future loadMore() async {
     Log.d("----for_sale_vm-----loadMore");
     // await Future.delayed(const Duration(seconds: 2));
-    // if(state.list.length >= state.filterCount){
+    // if(state.list.length >= state.count){
     //   return;
     // }else {
-    //   int curPage = state.curPage + 1;
-    //   state = state.copyWith(curPage: curPage,);
+    //   int page = state.page + 1;
+    //   state = state.copyWith(page: page,);
     //   getListData();
     // }
-    // 检查 curPage 是否为 null,并初始化为 1
-    int newCurPage = state.curPage ?? 1;
-    state = state.copyWith(curPage: ++newCurPage);
+    // 检查 page 是否为 null,并初始化为 1
+    int newCurPage = state.page ?? 1;
+    state = state.copyWith(page: ++newCurPage);
     getListData();
   }
 
@@ -90,13 +90,13 @@ class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
     Log.d("----forsale_vm-----onRefresh ");
 
     // await Future.delayed(const Duration(seconds: 2));
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     getListData();
   }
 
   // 重试请求
   Future retryRequest() async {
-    state = state.copyWith(curPage: 1);
+    state = state.copyWith(page: 1);
     _needShowPlaceholder = true;
     getListData();
   }
@@ -109,12 +109,12 @@ class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.curPage}---");
+    Log.d("for_sale加载listData数据---------------start--${state.page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "curPage": state.curPage,
-    //       "pageSize": state.pageSize,
+    //       "page": state.page,
+    //       "limit": state.limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -170,7 +170,7 @@ class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
 
 
 
-    if (state.curPage == 1) {
+    if (state.page == 1) {
       //刷新的方式
       state = state.copyWith(list: listData);
       refreshController.finishRefresh();

+ 1 - 1
packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_posts_newsfeed_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myPostsNewsfeedVmHash() => r'2af8142a67de591d78b46987ead439a13c0e04a6';
+String _$myPostsNewsfeedVmHash() => r'69c6e00141d482bd5a3cf5ad845076253bfed412';
 
 /// See also [MyPostsNewsfeedVm].
 @ProviderFor(MyPostsNewsfeedVm)

+ 1 - 1
packages/cpt_community/lib/modules/my_posts/my_posts_vm.dart

@@ -21,7 +21,7 @@ class MyPostsVm extends _$MyPostsVm {
 
   int _currentPageIndex = 0;
 
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
     controlFinishRefresh: true,  //允许刷新

+ 1 - 1
packages/cpt_community/lib/modules/my_posts/my_posts_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_posts_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myPostsVmHash() => r'd082a849c83a9339b9bba3b172fa2b5f1b00d4b7';
+String _$myPostsVmHash() => r'134090db50f7f8ad405fcdb29cd78f08fadb49ab';
 
 /// See also [MyPostsVm].
 @ProviderFor(MyPostsVm)

+ 16 - 22
packages/cpt_community/lib/modules/community/news/news_respository.dart

@@ -1,71 +1,65 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
+import 'package:domain/entity/newsfeed_news_entity.dart';
 import 'package:domain/entity/server_time.dart';
 import 'package:plugin_platform/platform_export.dart';
 import 'package:plugin_platform/http/dio_engine.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
 import 'package:shared/utils/util.dart';
 
 import 'package:flutter_riverpod/flutter_riverpod.dart';
 import 'package:plugin_basic/provider/http_provider/http_provider.dart';
 
-import 'news_state.dart';
 
-part 'news_respository.g.dart';
+part 'newsfeed_comment_repository.g.dart';
 
 @Riverpod(keepAlive: true)
-NewsRepository newsRepository(Ref ref) {
+NewsFeedCommentRepository newsFeedCommentRepository(Ref ref) {
   final dioEngine = ref.watch(dioEngineProvider);
-  return NewsRepository(dioEngine: dioEngine);
+  return NewsFeedCommentRepository(dioEngine: dioEngine);
 }
 
 /*
  * 数据仓库
  */
-class NewsRepository {
+class NewsFeedCommentRepository {
   DioEngine dioEngine;
 
-  NewsRepository({required this.dioEngine});
-
-  Future<HttpResult<Object>> fetchNewsList(
+  NewsFeedCommentRepository({required this.dioEngine});
+  
+  // news feed -news 点赞/取消点赞
+  Future<HttpResult<Object>> fetchNewsfeedCommentSubmit(
       Map<String, dynamic>? data, {
         CancelToken? cancelToken,
       }) async {
     Map<String, dynamic> params = {};
-
-    // if (!Utils.isEmpty(type)) {
-    //   params["type"] = type!;
-    // }
-
     params = data!;
-
-
     Map<String, String> headers = {};
-
     headers["Content-Type"] = "application/x-www-form-urlencoded";
     headers["Accept"] = "application/x.yyjobs-api.v1+json";
 
     final result = await dioEngine.requestNetResult(
       // ApiConstants.apiServerTime, // api 地址
-      '/index.php/api/employee/extra/time', // api 地址
+      '/api/v1/user/news-feed/comment/publish', // api 地址
       params: params,
       headers: headers,
-      method: HttpMethod.GET,
+      method: HttpMethod.POST,
       isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
       networkDebounce: true,   //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
-
     //根据返回的结果,封装原始数据为Bean/Entity对象
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = NewsState.fromMap(json!);
+      var data = NewsfeedCommentPublishEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert<NewsState>(data: data);
+      return result.convert(data: data);
     }
     return result.convert();
   }
 
-
+  
 }

+ 29 - 0
packages/cpt_community/lib/respository/newsfeed_comment_repository.g.dart

@@ -0,0 +1,29 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'newsfeed_comment_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$newsFeedCommentRepositoryHash() =>
+    r'd4e82743b8c627b06d404d2a3218fe8980ae505b';
+
+/// See also [newsFeedCommentRepository].
+@ProviderFor(newsFeedCommentRepository)
+final newsFeedCommentRepositoryProvider =
+    Provider<NewsFeedCommentRepository>.internal(
+  newsFeedCommentRepository,
+  name: r'newsFeedCommentRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$newsFeedCommentRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef NewsFeedCommentRepositoryRef = ProviderRef<NewsFeedCommentRepository>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 99 - 0
packages/cpt_community/lib/respository/newsfeed_following_repository.dart

@@ -0,0 +1,99 @@
+import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/newsfeed_following_entity.dart';
+import 'package:domain/entity/newsfeed_news_entity.dart';
+import 'package:domain/entity/server_time.dart';
+import 'package:plugin_platform/platform_export.dart';
+import 'package:plugin_platform/http/dio_engine.dart';
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+
+part 'newsfeed_following_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+NewsFeedFollowingRepository newsFeedFollowingRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return NewsFeedFollowingRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class NewsFeedFollowingRepository {
+  DioEngine dioEngine;
+
+  NewsFeedFollowingRepository({required this.dioEngine});
+
+  // news feed - news 列表
+  Future<HttpResult<Object>> fetchFollowingList(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/feed/following', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = NewsfeedFollowingEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: data);
+    }
+    return result.convert();
+  }
+
+  // news feed -news 点赞/取消点赞
+  Future<HttpResult<Object>> fetchLikeClick(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/like/click', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final boolData = result.getDataDynamic();
+      // var data = NewsfeedFollowingEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: boolData);
+    }
+    return result.convert();
+  }
+
+
+
+}

+ 30 - 0
packages/cpt_community/lib/respository/newsfeed_following_repository.g.dart

@@ -0,0 +1,30 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'newsfeed_following_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$newsFeedFollowingRepositoryHash() =>
+    r'5104ae97a6afb5f318af1a102e5ed3c8f85523d2';
+
+/// See also [newsFeedFollowingRepository].
+@ProviderFor(newsFeedFollowingRepository)
+final newsFeedFollowingRepositoryProvider =
+    Provider<NewsFeedFollowingRepository>.internal(
+  newsFeedFollowingRepository,
+  name: r'newsFeedFollowingRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$newsFeedFollowingRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef NewsFeedFollowingRepositoryRef
+    = ProviderRef<NewsFeedFollowingRepository>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 99 - 0
packages/cpt_community/lib/respository/newsfeed_foryou_repository.dart

@@ -0,0 +1,99 @@
+import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/newsfeed_foryou_entity.dart';
+import 'package:domain/entity/newsfeed_news_entity.dart';
+import 'package:domain/entity/server_time.dart';
+import 'package:plugin_platform/platform_export.dart';
+import 'package:plugin_platform/http/dio_engine.dart';
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+
+part 'newsfeed_foryou_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+NewsFeedForyouRepository newsFeedForyouRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return NewsFeedForyouRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class NewsFeedForyouRepository {
+  DioEngine dioEngine;
+
+  NewsFeedForyouRepository({required this.dioEngine});
+
+  // news feed - news 列表
+  Future<HttpResult<Object>> fetchForyouList(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/feed/for-you', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = NewsfeedForyouEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: data);
+    }
+    return result.convert();
+  }
+
+  // news feed -news 点赞/取消点赞
+  Future<HttpResult<Object>> fetchLikeClick(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/like/click', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final boolData = result.getDataDynamic();
+      // var data = NewsfeedForyouEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: boolData);
+    }
+    return result.convert();
+  }
+
+
+
+}

+ 11 - 9
packages/cpt_community/lib/modules/community/news/news_respository.g.dart

@@ -1,27 +1,29 @@
 // GENERATED CODE - DO NOT MODIFY BY HAND
 
-part of 'news_respository.dart';
+part of 'newsfeed_foryou_repository.dart';
 
 // **************************************************************************
 // RiverpodGenerator
 // **************************************************************************
 
-String _$newsRepositoryHash() => r'097145b82f467702467a6b71c1500d8364d69eb7';
+String _$newsFeedForyouRepositoryHash() =>
+    r'71ac847dc2c3d53094e7198d1c329a011b3ae8aa';
 
-/// See also [newsRepository].
-@ProviderFor(newsRepository)
-final newsRepositoryProvider = Provider<NewsRepository>.internal(
-  newsRepository,
-  name: r'newsRepositoryProvider',
+/// See also [newsFeedForyouRepository].
+@ProviderFor(newsFeedForyouRepository)
+final newsFeedForyouRepositoryProvider =
+    Provider<NewsFeedForyouRepository>.internal(
+  newsFeedForyouRepository,
+  name: r'newsFeedForyouRepositoryProvider',
   debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
       ? null
-      : _$newsRepositoryHash,
+      : _$newsFeedForyouRepositoryHash,
   dependencies: null,
   allTransitiveDependencies: null,
 );
 
 @Deprecated('Will be removed in 3.0. Use Ref instead')
 // ignore: unused_element
-typedef NewsRepositoryRef = ProviderRef<NewsRepository>;
+typedef NewsFeedForyouRepositoryRef = ProviderRef<NewsFeedForyouRepository>;
 // ignore_for_file: type=lint
 // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 98 - 0
packages/cpt_community/lib/respository/newsfeed_news_repository.dart

@@ -0,0 +1,98 @@
+import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/newsfeed_news_entity.dart';
+import 'package:domain/entity/server_time.dart';
+import 'package:plugin_platform/platform_export.dart';
+import 'package:plugin_platform/http/dio_engine.dart';
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+
+part 'newsfeed_news_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+NewsFeedNewsRepository newsFeedNewsRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return NewsFeedNewsRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class NewsFeedNewsRepository {
+  DioEngine dioEngine;
+
+  NewsFeedNewsRepository({required this.dioEngine});
+
+  // news feed - news 列表
+  Future<HttpResult<Object>> fetchNewsList(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/feed/news', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = NewsfeedNewsEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: data);
+    }
+    return result.convert();
+  }
+
+  // news feed -news 点赞/取消点赞
+  Future<HttpResult<Object>> fetchLikeClick(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/like/click', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final boolData = result.getDataDynamic();
+      // var data = NewsfeedNewsEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: boolData);
+    }
+    return result.convert();
+  }
+
+
+
+}

+ 11 - 9
packages/cpt_community/lib/modules/community/foryou/foryou_respository.g.dart

@@ -1,27 +1,29 @@
 // GENERATED CODE - DO NOT MODIFY BY HAND
 
-part of 'foryou_respository.dart';
+part of 'newsfeed_news_repository.dart';
 
 // **************************************************************************
 // RiverpodGenerator
 // **************************************************************************
 
-String _$foryouRepositoryHash() => r'e56fd60e2f4586dd9f445e0dc74353e0eaa8cdab';
+String _$newsFeedNewsRepositoryHash() =>
+    r'97db5621bdc5be4656b3347b7f32fde23584c0a0';
 
-/// See also [foryouRepository].
-@ProviderFor(foryouRepository)
-final foryouRepositoryProvider = Provider<ForyouRepository>.internal(
-  foryouRepository,
-  name: r'foryouRepositoryProvider',
+/// See also [newsFeedNewsRepository].
+@ProviderFor(newsFeedNewsRepository)
+final newsFeedNewsRepositoryProvider =
+    Provider<NewsFeedNewsRepository>.internal(
+  newsFeedNewsRepository,
+  name: r'newsFeedNewsRepositoryProvider',
   debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
       ? null
-      : _$foryouRepositoryHash,
+      : _$newsFeedNewsRepositoryHash,
   dependencies: null,
   allTransitiveDependencies: null,
 );
 
 @Deprecated('Will be removed in 3.0. Use Ref instead')
 // ignore: unused_element
-typedef ForyouRepositoryRef = ProviderRef<ForyouRepository>;
+typedef NewsFeedNewsRepositoryRef = ProviderRef<NewsFeedNewsRepository>;
 // ignore_for_file: type=lint
 // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 14 - 20
packages/cpt_community/lib/modules/community/foryou/foryou_respository.dart

@@ -1,68 +1,62 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
+import 'package:domain/entity/newsfeed_news_entity.dart';
 import 'package:domain/entity/server_time.dart';
 import 'package:plugin_platform/platform_export.dart';
 import 'package:plugin_platform/http/dio_engine.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
 import 'package:shared/utils/util.dart';
 
 import 'package:flutter_riverpod/flutter_riverpod.dart';
 import 'package:plugin_basic/provider/http_provider/http_provider.dart';
 
-import 'foryou_state.dart';
 
-part 'foryou_respository.g.dart';
+part 'newsfeed_publish_repository.g.dart';
 
 @Riverpod(keepAlive: true)
-ForyouRepository foryouRepository(Ref ref) {
+NewsFeedPublishRepository newsFeedPublishRepository(Ref ref) {
   final dioEngine = ref.watch(dioEngineProvider);
-  return ForyouRepository(dioEngine: dioEngine);
+  return NewsFeedPublishRepository(dioEngine: dioEngine);
 }
 
 /*
  * 数据仓库
  */
-class ForyouRepository {
+class NewsFeedPublishRepository {
   DioEngine dioEngine;
 
-  ForyouRepository({required this.dioEngine});
+  NewsFeedPublishRepository({required this.dioEngine});
 
-  Future<HttpResult<Object>> fetchForyouList(
+  // news feed -news 点赞/取消点赞
+  Future<HttpResult<Object>> fetchNewsfeedPublish(
       Map<String, dynamic>? data, {
         CancelToken? cancelToken,
       }) async {
     Map<String, dynamic> params = {};
-
-    // if (!Utils.isEmpty(type)) {
-    //   params["type"] = type!;
-    // }
-
     params = data!;
-
-
     Map<String, String> headers = {};
-
     headers["Content-Type"] = "application/x-www-form-urlencoded";
     headers["Accept"] = "application/x.yyjobs-api.v1+json";
 
     final result = await dioEngine.requestNetResult(
       // ApiConstants.apiServerTime, // api 地址
-      '/index.php/api/employee/extra/time', // api 地址
+      '/api/v1/user/news-feed/index/publish', // api 地址
       params: params,
       headers: headers,
-      method: HttpMethod.GET,
+      method: HttpMethod.POST,
       isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
       networkDebounce: true,   //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
-
     //根据返回的结果,封装原始数据为Bean/Entity对象
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = ForyouState.fromMap(json!);
+      var data = NewsfeedCommentPublishEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert<ForyouState>(data: data);
+      return result.convert(data: data);
     }
     return result.convert();
   }

+ 29 - 0
packages/cpt_community/lib/respository/newsfeed_publish_repository.g.dart

@@ -0,0 +1,29 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'newsfeed_publish_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$newsFeedPublishRepositoryHash() =>
+    r'c7233b4abdd852c7a3749a62671192b0740c4295';
+
+/// See also [newsFeedPublishRepository].
+@ProviderFor(newsFeedPublishRepository)
+final newsFeedPublishRepositoryProvider =
+    Provider<NewsFeedPublishRepository>.internal(
+  newsFeedPublishRepository,
+  name: r'newsFeedPublishRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$newsFeedPublishRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef NewsFeedPublishRepositoryRef = ProviderRef<NewsFeedPublishRepository>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 1 - 1
packages/cpt_property/lib/modules/ioan/property_ioan_vm.dart

@@ -17,7 +17,7 @@ part 'property_ioan_vm.g.dart';
 
 @riverpod
 class PropertyIoanVm extends _$PropertyIoanVm {
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(

+ 1 - 1
packages/cpt_property/lib/modules/news/page/property_news_page.dart

@@ -55,7 +55,7 @@ class PropertyNewsPage extends HookConsumerWidget {
             height: item['cover_image']!.isNotEmpty? cardHeight : 60.5,
             width: item['cover_image']!.isNotEmpty? cardLeftWidth : 60.5,
             // fit: BoxFit.cover,
-            fit: BoxFit.fill,
+            fit: BoxFit.contain,
             cornerRadius: 8,
           ),
         )

+ 1 - 1
packages/cpt_property/lib/modules/news/repository/property_news_repository.dart

@@ -48,7 +48,7 @@ class PropertyNewsRepository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
       networkDebounce: true,   //是否防抖防止重复请求
       cancelToken: cancelToken,
     );

+ 23 - 21
packages/cpt_property/lib/modules/news/vm/property_news_vm.dart

@@ -14,7 +14,7 @@ part 'property_news_vm.g.dart';
 class PropertyNewsVm extends _$PropertyNewsVm {
   late PropertyNewsRepository propertyNewsRepository;
 
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -94,25 +94,25 @@ class PropertyNewsVm extends _$PropertyNewsVm {
     }
 
     Log.d("加载listData数据---------------start--${state.page}---");
-      try {
-        //请求网络
-        Map<String, dynamic>  params = {
-          "page": state.page,
-          "limit": state.limit,
-        };
-        Log.d("请求参数------$params");
-        final result = await propertyNewsRepository.fetchList(params);
-        //校验成功失败
-        if (result.isSuccess) {
-          handlerResultList((result.data as PropertyNewsEntity).list);
-        } else {
-          String errorMessage = result.errorMsg!;
-          changeLoadingState(LoadState.State_Error, errorMessage);
-          ToastEngine.show(result.errorMsg ?? "Network Load Error");
-        }
-      } catch (e) {
-        ToastEngine.show("Error: $e");
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "page": state.page,
+        "limit": state.limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await propertyNewsRepository.fetchList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList((result.data  as PropertyNewsEntity).list);
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
       }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
 
 
     // await Future.delayed(const Duration(milliseconds: 1500));
@@ -158,13 +158,13 @@ class PropertyNewsVm extends _$PropertyNewsVm {
     // _needShowPlaceholder = false;
   }
 
-  void handlerResultList(List? list) {
+  void handlerResultList(List<PropertyNewsList>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (state.page == 1) {
         //刷新的方式
         state.list!.clear();
-        state.list!.addAll(list as List<Map<String, dynamic>>);
+        state.list!.addAll(list.map((item)=> item.toJson()).toList());
         refreshController.finishRefresh();
 
         //更新展示的状态
@@ -186,6 +186,8 @@ class PropertyNewsVm extends _$PropertyNewsVm {
         //展示加载完成,没有更多数据了
         if(state.list!.length == 0){
           changeLoadingState(LoadState.State_Empty, null);
+        }else {
+          changeLoadingState(LoadState.State_Success, null);
         }
         refreshController.finishLoad(IndicatorResult.noMore);
       }

+ 2 - 2
packages/cpt_property/lib/modules/rent/page/property_rent_page.dart

@@ -69,12 +69,12 @@ class PropertyRentPage extends HookConsumerWidget {
             mainAxisAlignment: MainAxisAlignment.center,
             children: [
               MyTextView(
-                item['price'],
+                item['price_show'],
                 fontSize: 17,
                 isFontMedium: true,
               ),
               MyTextView(
-                item['unit'],
+                'per month',
                 fontSize: 12,
               ),
             ],

+ 8 - 6
packages/cpt_property/lib/modules/rent/vm/property_rent_vm.dart

@@ -1,4 +1,4 @@
-import 'package:domain/entity/property_sale_entity.dart';
+import 'package:domain/entity/property_sale_rent_entity.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:riverpod/src/framework.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -14,7 +14,7 @@ part 'property_rent_vm.g.dart';
 class PropertyRentVm extends _$PropertyRentVm {
   late PropertySaleRepository propertySaleRepository;
 
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -168,8 +168,8 @@ class PropertyRentVm extends _$PropertyRentVm {
       final result = await propertySaleRepository.fetchList(params);
       //校验成功失败
       if (result.isSuccess) {
-        // state = state.copyWith(count: (result.data as PropertySaleEntity).count);
-        handlerResultList((result.data as PropertySaleEntity).list);
+        // state = state.copyWith(count: (result.data as PropertySaleRentEntity).count);
+        handlerResultList((result.data  as PropertySaleRentEntity).list);
       } else {
         String errorMessage = result.errorMsg!;
         changeLoadingState(LoadState.State_Error, errorMessage);
@@ -182,13 +182,13 @@ class PropertyRentVm extends _$PropertyRentVm {
   }
 
 
-  void handlerResultList(List? list) {
+  void handlerResultList(List<PropertySaleRentList>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (state.page == 1) {
         //刷新的方式
         state.list!.clear();
-        state.list!.addAll(list as List<Map<String, dynamic>>);
+        state.list!.addAll(list.map((item)=> item.toJson()).toList());
         refreshController.finishRefresh();
 
         //更新展示的状态
@@ -210,6 +210,8 @@ class PropertyRentVm extends _$PropertyRentVm {
         //展示加载完成,没有更多数据了
         if(state.list!.length == 0){
           changeLoadingState(LoadState.State_Empty, null);
+        }else {
+          changeLoadingState(LoadState.State_Success, null);
         }
         refreshController.finishLoad(IndicatorResult.noMore);
       }

+ 1 - 1
packages/cpt_property/lib/modules/sale/page/property_sale_page.dart

@@ -64,7 +64,7 @@ class PropertySalePage extends HookConsumerWidget {
           ),
         ),
         child:MyTextView(
-          '${item['units']}${item['price']}',
+          item['price_show'],
           fontSize: 17,
           textColor: context.appColors.textBlack,
           isFontMedium: true,

+ 4 - 4
packages/cpt_property/lib/modules/sale/repository/property_sale_repository.dart

@@ -1,5 +1,5 @@
 import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/property_sale_entity.dart';
+import 'package:domain/entity/property_sale_rent_entity.dart';
 import 'package:domain/entity/server_time.dart';
 import 'package:plugin_platform/platform_export.dart';
 import 'package:plugin_platform/http/dio_engine.dart';
@@ -49,7 +49,7 @@ class PropertySaleRepository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
       networkDebounce: true,   //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
@@ -58,9 +58,9 @@ class PropertySaleRepository {
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = PropertySaleEntity.fromJson(json!);
+      var data = PropertySaleRentEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert<PropertySaleEntity>(data: data);
+      return result.convert(data: data);
     }
     return result.convert();
   }

+ 8 - 6
packages/cpt_property/lib/modules/sale/vm/property_sale_vm.dart

@@ -1,4 +1,4 @@
-import 'package:domain/entity/property_sale_entity.dart';
+import 'package:domain/entity/property_sale_rent_entity.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
@@ -12,7 +12,7 @@ part 'property_sale_vm.g.dart';
 @riverpod
 class PropertySaleVm extends _$PropertySaleVm {
   late PropertySaleRepository propertySaleRepository;
-  bool _needShowPlaceholder = true; //是否展示LoadingView
+  bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -165,8 +165,8 @@ class PropertySaleVm extends _$PropertySaleVm {
       final result = await propertySaleRepository.fetchList(params);
       //校验成功失败
       if (result.isSuccess) {
-        // state = state.copyWith(count: (result.data as PropertySaleEntity).count);
-        handlerResultList((result.data as PropertySaleEntity).list);
+        // state = state.copyWith(count: (result.data as PropertySaleRentEntity).count);
+        handlerResultList((result.data  as PropertySaleRentEntity).list);
       } else {
         String errorMessage = result.errorMsg!;
         changeLoadingState(LoadState.State_Error, errorMessage);
@@ -179,13 +179,13 @@ class PropertySaleVm extends _$PropertySaleVm {
   }
 
 
-  void handlerResultList(List? list) {
+  void handlerResultList(List<PropertySaleRentList>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (state.page == 1) {
         //刷新的方式
         state.list!.clear();
-        state.list!.addAll(list as List<Map<String, dynamic>>);
+        state.list!.addAll(list.map((item)=> item.toJson()).toList());
         refreshController.finishRefresh();
         //更新展示的状态
         changeLoadingState(LoadState.State_Success, null);
@@ -205,6 +205,8 @@ class PropertySaleVm extends _$PropertySaleVm {
         //展示加载完成,没有更多数据了
         if(state.list!.length == 0){
           changeLoadingState(LoadState.State_Empty, null);
+        }else {
+          changeLoadingState(LoadState.State_Success, null);
         }
         refreshController.finishLoad(IndicatorResult.noMore);
       }

+ 23 - 0
packages/cs_domain/lib/entity/newsfeed_comment_publish_entity.dart

@@ -0,0 +1,23 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/newsfeed_comment_publish_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/newsfeed_comment_publish_entity.g.dart';
+
+@JsonSerializable()
+class NewsfeedCommentPublishEntity {
+  int? id;
+  String? content;
+  @JSONField(name: "to_user_id")
+  int? toUserId;
+
+  NewsfeedCommentPublishEntity();
+
+  factory NewsfeedCommentPublishEntity.fromJson(Map<String, dynamic> json) => $NewsfeedCommentPublishEntityFromJson(json);
+
+  Map<String, dynamic> toJson() => $NewsfeedCommentPublishEntityToJson(this);
+
+  @override
+  String toString() {
+    return jsonEncode(this);
+  }
+}

+ 70 - 0
packages/cs_domain/lib/entity/newsfeed_following_entity.dart

@@ -0,0 +1,70 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/newsfeed_following_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/newsfeed_following_entity.g.dart';
+
+@JsonSerializable()
+class NewsfeedFollowingEntity {
+	int? count;
+	int? page;
+	int? limit;
+	@JSONField(name: "count_page")
+	int? countPage;
+	List<NewsfeedFollowingList>? list;
+
+	NewsfeedFollowingEntity();
+
+	factory NewsfeedFollowingEntity.fromJson(Map<String, dynamic> json) => $NewsfeedFollowingEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $NewsfeedFollowingEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class NewsfeedFollowingList {
+	int? id;
+	String? content;
+	List<String>? resources;
+	@JSONField(name: "likes_count")
+	int? likesCount;
+	@JSONField(name: "comments_count")
+	int? commentsCount;
+	bool? liked;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	NewsfeedFollowingListAccount? account;
+
+	NewsfeedFollowingList();
+
+	factory NewsfeedFollowingList.fromJson(Map<String, dynamic> json) => $NewsfeedFollowingListFromJson(json);
+
+	Map<String, dynamic> toJson() => $NewsfeedFollowingListToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class NewsfeedFollowingListAccount {
+	int? id;
+	String? name;
+	String? avatar;
+	bool? followed;
+
+	NewsfeedFollowingListAccount();
+
+	factory NewsfeedFollowingListAccount.fromJson(Map<String, dynamic> json) => $NewsfeedFollowingListAccountFromJson(json);
+
+	Map<String, dynamic> toJson() => $NewsfeedFollowingListAccountToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 70 - 0
packages/cs_domain/lib/entity/newsfeed_foryou_entity.dart

@@ -0,0 +1,70 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/newsfeed_foryou_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/newsfeed_foryou_entity.g.dart';
+
+@JsonSerializable()
+class NewsfeedForyouEntity {
+	int? count;
+	int? page;
+	int? limit;
+	@JSONField(name: "count_page")
+	int? countPage;
+	List<NewsfeedForyouList>? list;
+
+	NewsfeedForyouEntity();
+
+	factory NewsfeedForyouEntity.fromJson(Map<String, dynamic> json) => $NewsfeedForyouEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $NewsfeedForyouEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class NewsfeedForyouList {
+	int? id;
+	String? content;
+	List<String>? resources;
+	@JSONField(name: "likes_count")
+	int? likesCount;
+	@JSONField(name: "comments_count")
+	int? commentsCount;
+	bool? liked;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	NewsfeedForyouListAccount? account;
+
+	NewsfeedForyouList();
+
+	factory NewsfeedForyouList.fromJson(Map<String, dynamic> json) => $NewsfeedForyouListFromJson(json);
+
+	Map<String, dynamic> toJson() => $NewsfeedForyouListToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class NewsfeedForyouListAccount {
+	int? id;
+	String? name;
+	String? avatar;
+	bool? followed;
+
+	NewsfeedForyouListAccount();
+
+	factory NewsfeedForyouListAccount.fromJson(Map<String, dynamic> json) => $NewsfeedForyouListAccountFromJson(json);
+
+	Map<String, dynamic> toJson() => $NewsfeedForyouListAccountToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 70 - 0
packages/cs_domain/lib/entity/newsfeed_news_entity.dart

@@ -0,0 +1,70 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/newsfeed_news_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/newsfeed_news_entity.g.dart';
+
+@JsonSerializable()
+class NewsfeedNewsEntity {
+	int? count;
+	int? page;
+	int? limit;
+	@JSONField(name: "count_page")
+	int? countPage;
+	List<NewsfeedNewsList>? list;
+
+	NewsfeedNewsEntity();
+
+	factory NewsfeedNewsEntity.fromJson(Map<String, dynamic> json) => $NewsfeedNewsEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $NewsfeedNewsEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class NewsfeedNewsList {
+	int? id;
+	String? content;
+	List<String>? resources;
+	@JSONField(name: "likes_count")
+	int? likesCount;
+	@JSONField(name: "comments_count")
+	int? commentsCount;
+	bool? liked;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	NewsfeedNewsListAccount? account;
+
+	NewsfeedNewsList();
+
+	factory NewsfeedNewsList.fromJson(Map<String, dynamic> json) => $NewsfeedNewsListFromJson(json);
+
+	Map<String, dynamic> toJson() => $NewsfeedNewsListToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class NewsfeedNewsListAccount {
+	int? id;
+	String? name;
+	String? avatar;
+	bool? followed;
+
+	NewsfeedNewsListAccount();
+
+	factory NewsfeedNewsListAccount.fromJson(Map<String, dynamic> json) => $NewsfeedNewsListAccountFromJson(json);
+
+	Map<String, dynamic> toJson() => $NewsfeedNewsListAccountToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 26 - 1
packages/cs_domain/lib/entity/property_news_entity.dart

@@ -10,7 +10,7 @@ class PropertyNewsEntity {
 	int? limit;
 	@JSONField(name: "count_page")
 	int? countPage;
-	List<dynamic>? list;
+	List<PropertyNewsList>? list;
 
 	PropertyNewsEntity();
 
@@ -22,4 +22,29 @@ class PropertyNewsEntity {
 	String toString() {
 		return jsonEncode(this);
 	}
+}
+
+@JsonSerializable()
+class PropertyNewsList {
+	int? id;
+	String? title;
+	@JSONField(name: "cover_image")
+	String? coverImage;
+	String? content;
+	@JSONField(name: "likes_count")
+	int? likesCount;
+	bool? liked;
+	@JSONField(name: "created_at")
+	String? createdAt;
+
+	PropertyNewsList();
+
+  factory PropertyNewsList.fromJson(Map<String, dynamic> json) => $PropertyNewsListFromJson(json);
+
+  Map<String, dynamic> toJson() => $PropertyNewsListToJson(this);
+
+  @override
+	String toString() {
+		return jsonEncode(this);
+	}
 }

+ 0 - 25
packages/cs_domain/lib/entity/property_sale_entity.dart

@@ -1,25 +0,0 @@
-import 'package:domain/generated/json/base/json_field.dart';
-import 'package:domain/generated/json/property_sale_entity.g.dart';
-import 'dart:convert';
-export 'package:domain/generated/json/property_sale_entity.g.dart';
-
-@JsonSerializable()
-class PropertySaleEntity {
-	int? count;
-	int? page;
-	int? limit;
-	@JSONField(name: "count_page")
-	int? countPage;
-	List<dynamic>? list;
-
-	PropertySaleEntity();
-
-	factory PropertySaleEntity.fromJson(Map<String, dynamic> json) => $PropertySaleEntityFromJson(json);
-
-	Map<String, dynamic> toJson() => $PropertySaleEntityToJson(this);
-
-	@override
-	String toString() {
-		return jsonEncode(this);
-	}
-}

+ 49 - 0
packages/cs_domain/lib/entity/property_sale_rent_entity.dart

@@ -0,0 +1,49 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/property_sale_rent_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/property_sale_rent_entity.g.dart';
+
+@JsonSerializable()
+class PropertySaleRentEntity {
+	int? count;
+	int? page;
+	int? limit;
+	@JSONField(name: "count_page")
+	int? countPage;
+	List<PropertySaleRentList>? list;
+
+	PropertySaleRentEntity();
+
+	factory PropertySaleRentEntity.fromJson(Map<String, dynamic> json) => $PropertySaleRentEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $PropertySaleRentEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class PropertySaleRentList {
+	int? id;
+	int? type;
+	String? title;
+	String? price;
+	@JSONField(name: "price_show")
+	String? priceShow;
+	String? units;
+	@JSONField(name: "created_at")
+	String? createdAt;
+
+	PropertySaleRentList();
+
+	factory PropertySaleRentList.fromJson(Map<String, dynamic> json) => $PropertySaleRentListFromJson(json);
+
+	Map<String, dynamic> toJson() => $PropertySaleRentListToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 107 - 22
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -9,8 +9,12 @@ import 'package:domain/entity/captcha_img_entity.dart';
 import 'package:domain/entity/feedback_detail_entity.dart';
 import 'package:domain/entity/feedback_list_entity.dart';
 import 'package:domain/entity/id_name_entity.dart';
+import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
+import 'package:domain/entity/newsfeed_following_entity.dart';
+import 'package:domain/entity/newsfeed_foryou_entity.dart';
+import 'package:domain/entity/newsfeed_news_entity.dart';
 import 'package:domain/entity/property_news_entity.dart';
-import 'package:domain/entity/property_sale_entity.dart';
+import 'package:domain/entity/property_sale_rent_entity.dart';
 import 'package:domain/entity/server_time.dart';
 import 'package:domain/entity/user_me_entity.dart';
 
@@ -70,12 +74,14 @@ class JsonConvert {
     }
   }
 
-  List<T?>? convertList<T>(List<dynamic>? value, {EnumConvertFunction? enumConvert}) {
+  List<T?>? convertList<T>(List<dynamic>? value,
+      {EnumConvertFunction? enumConvert}) {
     if (value == null) {
       return null;
     }
     try {
-      return value.map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)).toList();
+      return value.map((dynamic e) => _asT<T>(e, enumConvert: enumConvert))
+          .toList();
     } catch (e, stackTrace) {
       debugPrint('asT<$T> $e $stackTrace');
       if (onError != null) {
@@ -85,12 +91,14 @@ class JsonConvert {
     }
   }
 
-  List<T>? convertListNotNull<T>(dynamic value, {EnumConvertFunction? enumConvert}) {
+  List<T>? convertListNotNull<T>(dynamic value,
+      {EnumConvertFunction? enumConvert}) {
     if (value == null) {
       return null;
     }
     try {
-      return (value as List<dynamic>).map((dynamic e) => _asT<T>(e, enumConvert: enumConvert)!).toList();
+      return (value as List<dynamic>).map((dynamic e) =>
+      _asT<T>(e, enumConvert: enumConvert)!).toList();
     } catch (e, stackTrace) {
       debugPrint('asT<$T> $e $stackTrace');
       if (onError != null) {
@@ -138,7 +146,8 @@ class JsonConvert {
           return covertFunc(Map<String, dynamic>.from(value)) as T;
         }
       } else {
-        throw UnimplementedError('$type unimplemented,you can try running the app again');
+        throw UnimplementedError(
+            '$type unimplemented,you can try running the app again');
       }
     }
   }
@@ -146,10 +155,12 @@ class JsonConvert {
   //list is returned by type
   static M? _getListChildType<M>(List<Map<String, dynamic>> data) {
     if (<AuthLoginEntity>[] is M) {
-      return data.map<AuthLoginEntity>((Map<String, dynamic> e) => AuthLoginEntity.fromJson(e)).toList() as M;
+      return data.map<AuthLoginEntity>((Map<String, dynamic> e) =>
+          AuthLoginEntity.fromJson(e)).toList() as M;
     }
     if (<CaptchaImgEntity>[] is M) {
-      return data.map<CaptchaImgEntity>((Map<String, dynamic> e) => CaptchaImgEntity.fromJson(e)).toList() as M;
+      return data.map<CaptchaImgEntity>((Map<String, dynamic> e) =>
+          CaptchaImgEntity.fromJson(e)).toList() as M;
     }
     if (<FeedbackDetailEntity>[] is M) {
       return data.map<FeedbackDetailEntity>((Map<String, dynamic> e) => FeedbackDetailEntity.fromJson(e)).toList() as M;
@@ -164,37 +175,96 @@ class JsonConvert {
       return data.map<FeedbackItemEntity>((Map<String, dynamic> e) => FeedbackItemEntity.fromJson(e)).toList() as M;
     }
     if (<IdNameEntity>[] is M) {
-      return data.map<IdNameEntity>((Map<String, dynamic> e) => IdNameEntity.fromJson(e)).toList() as M;
+      return data.map<IdNameEntity>((Map<String, dynamic> e) =>
+          IdNameEntity.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedCommentPublishEntity>[] is M) {
+      return data.map<NewsfeedCommentPublishEntity>((Map<String, dynamic> e) =>
+          NewsfeedCommentPublishEntity.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedFollowingEntity>[] is M) {
+      return data.map<NewsfeedFollowingEntity>((Map<String, dynamic> e) =>
+          NewsfeedFollowingEntity.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedFollowingList>[] is M) {
+      return data.map<NewsfeedFollowingList>((Map<String, dynamic> e) =>
+          NewsfeedFollowingList.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedFollowingListAccount>[] is M) {
+      return data.map<NewsfeedFollowingListAccount>((Map<String, dynamic> e) =>
+          NewsfeedFollowingListAccount.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedForyouEntity>[] is M) {
+      return data.map<NewsfeedForyouEntity>((Map<String, dynamic> e) =>
+          NewsfeedForyouEntity.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedForyouList>[] is M) {
+      return data.map<NewsfeedForyouList>((Map<String, dynamic> e) =>
+          NewsfeedForyouList.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedForyouListAccount>[] is M) {
+      return data.map<NewsfeedForyouListAccount>((Map<String, dynamic> e) =>
+          NewsfeedForyouListAccount.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedNewsEntity>[] is M) {
+      return data.map<NewsfeedNewsEntity>((Map<String, dynamic> e) =>
+          NewsfeedNewsEntity.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedNewsList>[] is M) {
+      return data.map<NewsfeedNewsList>((Map<String, dynamic> e) =>
+          NewsfeedNewsList.fromJson(e)).toList() as M;
+    }
+    if (<NewsfeedNewsListAccount>[] is M) {
+      return data.map<NewsfeedNewsListAccount>((Map<String, dynamic> e) =>
+          NewsfeedNewsListAccount.fromJson(e)).toList() as M;
     }
     if (<PropertyNewsEntity>[] is M) {
-      return data.map<PropertyNewsEntity>((Map<String, dynamic> e) => PropertyNewsEntity.fromJson(e)).toList() as M;
+      return data.map<PropertyNewsEntity>((Map<String, dynamic> e) =>
+          PropertyNewsEntity.fromJson(e)).toList() as M;
+    }
+    if (<PropertyNewsList>[] is M) {
+      return data.map<PropertyNewsList>((Map<String, dynamic> e) =>
+          PropertyNewsList.fromJson(e)).toList() as M;
+    }
+    if (<PropertySaleRentEntity>[] is M) {
+      return data.map<PropertySaleRentEntity>((Map<String, dynamic> e) =>
+          PropertySaleRentEntity.fromJson(e)).toList() as M;
     }
-    if (<PropertySaleEntity>[] is M) {
-      return data.map<PropertySaleEntity>((Map<String, dynamic> e) => PropertySaleEntity.fromJson(e)).toList() as M;
+    if (<PropertySaleRentList>[] is M) {
+      return data.map<PropertySaleRentList>((Map<String, dynamic> e) =>
+          PropertySaleRentList.fromJson(e)).toList() as M;
     }
     if (<ServerTime>[] is M) {
-      return data.map<ServerTime>((Map<String, dynamic> e) => ServerTime.fromJson(e)).toList() as M;
+      return data.map<ServerTime>((Map<String, dynamic> e) =>
+          ServerTime.fromJson(e)).toList() as M;
     }
     if (<UserMeEntity>[] is M) {
-      return data.map<UserMeEntity>((Map<String, dynamic> e) => UserMeEntity.fromJson(e)).toList() as M;
+      return data.map<UserMeEntity>((Map<String, dynamic> e) =>
+          UserMeEntity.fromJson(e)).toList() as M;
     }
     if (<UserMeHouseholds>[] is M) {
-      return data.map<UserMeHouseholds>((Map<String, dynamic> e) => UserMeHouseholds.fromJson(e)).toList() as M;
+      return data.map<UserMeHouseholds>((Map<String, dynamic> e) =>
+          UserMeHouseholds.fromJson(e)).toList() as M;
     }
     if (<UserMeEstates>[] is M) {
-      return data.map<UserMeEstates>((Map<String, dynamic> e) => UserMeEstates.fromJson(e)).toList() as M;
+      return data.map<UserMeEstates>((Map<String, dynamic> e) =>
+          UserMeEstates.fromJson(e)).toList() as M;
     }
     if (<UserMeEstatesAccounts>[] is M) {
-      return data.map<UserMeEstatesAccounts>((Map<String, dynamic> e) => UserMeEstatesAccounts.fromJson(e)).toList() as M;
+      return data.map<UserMeEstatesAccounts>((Map<String, dynamic> e) =>
+          UserMeEstatesAccounts.fromJson(e)).toList() as M;
     }
     if (<UserMeEstatesAccountsUnit>[] is M) {
-      return data.map<UserMeEstatesAccountsUnit>((Map<String, dynamic> e) => UserMeEstatesAccountsUnit.fromJson(e)).toList() as M;
+      return data.map<UserMeEstatesAccountsUnit>((Map<String, dynamic> e) =>
+          UserMeEstatesAccountsUnit.fromJson(e)).toList() as M;
     }
     if (<UserMeDefaultUnit>[] is M) {
-      return data.map<UserMeDefaultUnit>((Map<String, dynamic> e) => UserMeDefaultUnit.fromJson(e)).toList() as M;
+      return data.map<UserMeDefaultUnit>((Map<String, dynamic> e) =>
+          UserMeDefaultUnit.fromJson(e)).toList() as M;
     }
     if (<UserMeInformation>[] is M) {
-      return data.map<UserMeInformation>((Map<String, dynamic> e) => UserMeInformation.fromJson(e)).toList() as M;
+      return data.map<UserMeInformation>((Map<String, dynamic> e) =>
+          UserMeInformation.fromJson(e)).toList() as M;
     }
 
     debugPrint("$M not found");
@@ -207,7 +277,8 @@ class JsonConvert {
       return json;
     }
     if (json is List) {
-      return _getListChildType<M>(json.map((dynamic e) => e as Map<String, dynamic>).toList());
+      return _getListChildType<M>(
+          json.map((dynamic e) => e as Map<String, dynamic>).toList());
     } else {
       return jsonConvert.convert<M>(json);
     }
@@ -223,8 +294,22 @@ class JsonConvertClassCollection {
     (FeedbackListEntity).toString(): FeedbackListEntity.fromJson,
     (FeedbackItemEntity).toString(): FeedbackItemEntity.fromJson,
     (IdNameEntity).toString(): IdNameEntity.fromJson,
+    (NewsfeedCommentPublishEntity).toString(): NewsfeedCommentPublishEntity
+        .fromJson,
+    (NewsfeedFollowingEntity).toString(): NewsfeedFollowingEntity.fromJson,
+    (NewsfeedFollowingList).toString(): NewsfeedFollowingList.fromJson,
+    (NewsfeedFollowingListAccount).toString(): NewsfeedFollowingListAccount
+        .fromJson,
+    (NewsfeedForyouEntity).toString(): NewsfeedForyouEntity.fromJson,
+    (NewsfeedForyouList).toString(): NewsfeedForyouList.fromJson,
+    (NewsfeedForyouListAccount).toString(): NewsfeedForyouListAccount.fromJson,
+    (NewsfeedNewsEntity).toString(): NewsfeedNewsEntity.fromJson,
+    (NewsfeedNewsList).toString(): NewsfeedNewsList.fromJson,
+    (NewsfeedNewsListAccount).toString(): NewsfeedNewsListAccount.fromJson,
     (PropertyNewsEntity).toString(): PropertyNewsEntity.fromJson,
-    (PropertySaleEntity).toString(): PropertySaleEntity.fromJson,
+    (PropertyNewsList).toString(): PropertyNewsList.fromJson,
+    (PropertySaleRentEntity).toString(): PropertySaleRentEntity.fromJson,
+    (PropertySaleRentList).toString(): PropertySaleRentList.fromJson,
     (ServerTime).toString(): ServerTime.fromJson,
     (UserMeEntity).toString(): UserMeEntity.fromJson,
     (UserMeHouseholds).toString(): UserMeHouseholds.fromJson,

+ 42 - 0
packages/cs_domain/lib/generated/json/newsfeed_comment_publish_entity.g.dart

@@ -0,0 +1,42 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
+
+NewsfeedCommentPublishEntity $NewsfeedCommentPublishEntityFromJson(
+    Map<String, dynamic> json) {
+  final NewsfeedCommentPublishEntity newsfeedCommentPublishEntity = NewsfeedCommentPublishEntity();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    newsfeedCommentPublishEntity.id = id;
+  }
+  final String? content = jsonConvert.convert<String>(json['content']);
+  if (content != null) {
+    newsfeedCommentPublishEntity.content = content;
+  }
+  final int? toUserId = jsonConvert.convert<int>(json['to_user_id']);
+  if (toUserId != null) {
+    newsfeedCommentPublishEntity.toUserId = toUserId;
+  }
+  return newsfeedCommentPublishEntity;
+}
+
+Map<String, dynamic> $NewsfeedCommentPublishEntityToJson(
+    NewsfeedCommentPublishEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['content'] = entity.content;
+  data['to_user_id'] = entity.toUserId;
+  return data;
+}
+
+extension NewsfeedCommentPublishEntityExtension on NewsfeedCommentPublishEntity {
+  NewsfeedCommentPublishEntity copyWith({
+    int? id,
+    String? content,
+    int? toUserId,
+  }) {
+    return NewsfeedCommentPublishEntity()
+      ..id = id ?? this.id
+      ..content = content ?? this.content
+      ..toUserId = toUserId ?? this.toUserId;
+  }
+}

+ 184 - 0
packages/cs_domain/lib/generated/json/newsfeed_following_entity.g.dart

@@ -0,0 +1,184 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/newsfeed_following_entity.dart';
+
+NewsfeedFollowingEntity $NewsfeedFollowingEntityFromJson(
+    Map<String, dynamic> json) {
+  final NewsfeedFollowingEntity newsfeedFollowingEntity = NewsfeedFollowingEntity();
+  final int? count = jsonConvert.convert<int>(json['count']);
+  if (count != null) {
+    newsfeedFollowingEntity.count = count;
+  }
+  final int? page = jsonConvert.convert<int>(json['page']);
+  if (page != null) {
+    newsfeedFollowingEntity.page = page;
+  }
+  final int? limit = jsonConvert.convert<int>(json['limit']);
+  if (limit != null) {
+    newsfeedFollowingEntity.limit = limit;
+  }
+  final int? countPage = jsonConvert.convert<int>(json['count_page']);
+  if (countPage != null) {
+    newsfeedFollowingEntity.countPage = countPage;
+  }
+  final List<NewsfeedFollowingList>? list = (json['list'] as List<dynamic>?)
+      ?.map(
+          (e) =>
+      jsonConvert.convert<NewsfeedFollowingList>(e) as NewsfeedFollowingList)
+      .toList();
+  if (list != null) {
+    newsfeedFollowingEntity.list = list;
+  }
+  return newsfeedFollowingEntity;
+}
+
+Map<String, dynamic> $NewsfeedFollowingEntityToJson(
+    NewsfeedFollowingEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['count'] = entity.count;
+  data['page'] = entity.page;
+  data['limit'] = entity.limit;
+  data['count_page'] = entity.countPage;
+  data['list'] = entity.list?.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension NewsfeedFollowingEntityExtension on NewsfeedFollowingEntity {
+  NewsfeedFollowingEntity copyWith({
+    int? count,
+    int? page,
+    int? limit,
+    int? countPage,
+    List<NewsfeedFollowingList>? list,
+  }) {
+    return NewsfeedFollowingEntity()
+      ..count = count ?? this.count
+      ..page = page ?? this.page
+      ..limit = limit ?? this.limit
+      ..countPage = countPage ?? this.countPage
+      ..list = list ?? this.list;
+  }
+}
+
+NewsfeedFollowingList $NewsfeedFollowingListFromJson(
+    Map<String, dynamic> json) {
+  final NewsfeedFollowingList newsfeedFollowingList = NewsfeedFollowingList();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    newsfeedFollowingList.id = id;
+  }
+  final String? content = jsonConvert.convert<String>(json['content']);
+  if (content != null) {
+    newsfeedFollowingList.content = content;
+  }
+  final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<String>(e) as String).toList();
+  if (resources != null) {
+    newsfeedFollowingList.resources = resources;
+  }
+  final int? likesCount = jsonConvert.convert<int>(json['likes_count']);
+  if (likesCount != null) {
+    newsfeedFollowingList.likesCount = likesCount;
+  }
+  final int? commentsCount = jsonConvert.convert<int>(json['comments_count']);
+  if (commentsCount != null) {
+    newsfeedFollowingList.commentsCount = commentsCount;
+  }
+  final bool? liked = jsonConvert.convert<bool>(json['liked']);
+  if (liked != null) {
+    newsfeedFollowingList.liked = liked;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    newsfeedFollowingList.createdAt = createdAt;
+  }
+  final NewsfeedFollowingListAccount? account = jsonConvert.convert<
+      NewsfeedFollowingListAccount>(json['account']);
+  if (account != null) {
+    newsfeedFollowingList.account = account;
+  }
+  return newsfeedFollowingList;
+}
+
+Map<String, dynamic> $NewsfeedFollowingListToJson(
+    NewsfeedFollowingList entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['content'] = entity.content;
+  data['resources'] = entity.resources;
+  data['likes_count'] = entity.likesCount;
+  data['comments_count'] = entity.commentsCount;
+  data['liked'] = entity.liked;
+  data['created_at'] = entity.createdAt;
+  data['account'] = entity.account?.toJson();
+  return data;
+}
+
+extension NewsfeedFollowingListExtension on NewsfeedFollowingList {
+  NewsfeedFollowingList copyWith({
+    int? id,
+    String? content,
+    List<String>? resources,
+    int? likesCount,
+    int? commentsCount,
+    bool? liked,
+    String? createdAt,
+    NewsfeedFollowingListAccount? account,
+  }) {
+    return NewsfeedFollowingList()
+      ..id = id ?? this.id
+      ..content = content ?? this.content
+      ..resources = resources ?? this.resources
+      ..likesCount = likesCount ?? this.likesCount
+      ..commentsCount = commentsCount ?? this.commentsCount
+      ..liked = liked ?? this.liked
+      ..createdAt = createdAt ?? this.createdAt
+      ..account = account ?? this.account;
+  }
+}
+
+NewsfeedFollowingListAccount $NewsfeedFollowingListAccountFromJson(
+    Map<String, dynamic> json) {
+  final NewsfeedFollowingListAccount newsfeedFollowingListAccount = NewsfeedFollowingListAccount();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    newsfeedFollowingListAccount.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    newsfeedFollowingListAccount.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    newsfeedFollowingListAccount.avatar = avatar;
+  }
+  final bool? followed = jsonConvert.convert<bool>(json['followed']);
+  if (followed != null) {
+    newsfeedFollowingListAccount.followed = followed;
+  }
+  return newsfeedFollowingListAccount;
+}
+
+Map<String, dynamic> $NewsfeedFollowingListAccountToJson(
+    NewsfeedFollowingListAccount entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  data['followed'] = entity.followed;
+  return data;
+}
+
+extension NewsfeedFollowingListAccountExtension on NewsfeedFollowingListAccount {
+  NewsfeedFollowingListAccount copyWith({
+    int? id,
+    String? name,
+    String? avatar,
+    bool? followed,
+  }) {
+    return NewsfeedFollowingListAccount()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar
+      ..followed = followed ?? this.followed;
+  }
+}

+ 180 - 0
packages/cs_domain/lib/generated/json/newsfeed_foryou_entity.g.dart

@@ -0,0 +1,180 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/newsfeed_foryou_entity.dart';
+
+NewsfeedForyouEntity $NewsfeedForyouEntityFromJson(Map<String, dynamic> json) {
+  final NewsfeedForyouEntity newsfeedForyouEntity = NewsfeedForyouEntity();
+  final int? count = jsonConvert.convert<int>(json['count']);
+  if (count != null) {
+    newsfeedForyouEntity.count = count;
+  }
+  final int? page = jsonConvert.convert<int>(json['page']);
+  if (page != null) {
+    newsfeedForyouEntity.page = page;
+  }
+  final int? limit = jsonConvert.convert<int>(json['limit']);
+  if (limit != null) {
+    newsfeedForyouEntity.limit = limit;
+  }
+  final int? countPage = jsonConvert.convert<int>(json['count_page']);
+  if (countPage != null) {
+    newsfeedForyouEntity.countPage = countPage;
+  }
+  final List<NewsfeedForyouList>? list = (json['list'] as List<dynamic>?)
+      ?.map(
+          (e) =>
+      jsonConvert.convert<NewsfeedForyouList>(e) as NewsfeedForyouList)
+      .toList();
+  if (list != null) {
+    newsfeedForyouEntity.list = list;
+  }
+  return newsfeedForyouEntity;
+}
+
+Map<String, dynamic> $NewsfeedForyouEntityToJson(NewsfeedForyouEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['count'] = entity.count;
+  data['page'] = entity.page;
+  data['limit'] = entity.limit;
+  data['count_page'] = entity.countPage;
+  data['list'] = entity.list?.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension NewsfeedForyouEntityExtension on NewsfeedForyouEntity {
+  NewsfeedForyouEntity copyWith({
+    int? count,
+    int? page,
+    int? limit,
+    int? countPage,
+    List<NewsfeedForyouList>? list,
+  }) {
+    return NewsfeedForyouEntity()
+      ..count = count ?? this.count
+      ..page = page ?? this.page
+      ..limit = limit ?? this.limit
+      ..countPage = countPage ?? this.countPage
+      ..list = list ?? this.list;
+  }
+}
+
+NewsfeedForyouList $NewsfeedForyouListFromJson(Map<String, dynamic> json) {
+  final NewsfeedForyouList newsfeedForyouList = NewsfeedForyouList();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    newsfeedForyouList.id = id;
+  }
+  final String? content = jsonConvert.convert<String>(json['content']);
+  if (content != null) {
+    newsfeedForyouList.content = content;
+  }
+  final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<String>(e) as String).toList();
+  if (resources != null) {
+    newsfeedForyouList.resources = resources;
+  }
+  final int? likesCount = jsonConvert.convert<int>(json['likes_count']);
+  if (likesCount != null) {
+    newsfeedForyouList.likesCount = likesCount;
+  }
+  final int? commentsCount = jsonConvert.convert<int>(json['comments_count']);
+  if (commentsCount != null) {
+    newsfeedForyouList.commentsCount = commentsCount;
+  }
+  final bool? liked = jsonConvert.convert<bool>(json['liked']);
+  if (liked != null) {
+    newsfeedForyouList.liked = liked;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    newsfeedForyouList.createdAt = createdAt;
+  }
+  final NewsfeedForyouListAccount? account = jsonConvert.convert<
+      NewsfeedForyouListAccount>(json['account']);
+  if (account != null) {
+    newsfeedForyouList.account = account;
+  }
+  return newsfeedForyouList;
+}
+
+Map<String, dynamic> $NewsfeedForyouListToJson(NewsfeedForyouList entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['content'] = entity.content;
+  data['resources'] = entity.resources;
+  data['likes_count'] = entity.likesCount;
+  data['comments_count'] = entity.commentsCount;
+  data['liked'] = entity.liked;
+  data['created_at'] = entity.createdAt;
+  data['account'] = entity.account?.toJson();
+  return data;
+}
+
+extension NewsfeedForyouListExtension on NewsfeedForyouList {
+  NewsfeedForyouList copyWith({
+    int? id,
+    String? content,
+    List<String>? resources,
+    int? likesCount,
+    int? commentsCount,
+    bool? liked,
+    String? createdAt,
+    NewsfeedForyouListAccount? account,
+  }) {
+    return NewsfeedForyouList()
+      ..id = id ?? this.id
+      ..content = content ?? this.content
+      ..resources = resources ?? this.resources
+      ..likesCount = likesCount ?? this.likesCount
+      ..commentsCount = commentsCount ?? this.commentsCount
+      ..liked = liked ?? this.liked
+      ..createdAt = createdAt ?? this.createdAt
+      ..account = account ?? this.account;
+  }
+}
+
+NewsfeedForyouListAccount $NewsfeedForyouListAccountFromJson(
+    Map<String, dynamic> json) {
+  final NewsfeedForyouListAccount newsfeedForyouListAccount = NewsfeedForyouListAccount();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    newsfeedForyouListAccount.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    newsfeedForyouListAccount.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    newsfeedForyouListAccount.avatar = avatar;
+  }
+  final bool? followed = jsonConvert.convert<bool>(json['followed']);
+  if (followed != null) {
+    newsfeedForyouListAccount.followed = followed;
+  }
+  return newsfeedForyouListAccount;
+}
+
+Map<String, dynamic> $NewsfeedForyouListAccountToJson(
+    NewsfeedForyouListAccount entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  data['followed'] = entity.followed;
+  return data;
+}
+
+extension NewsfeedForyouListAccountExtension on NewsfeedForyouListAccount {
+  NewsfeedForyouListAccount copyWith({
+    int? id,
+    String? name,
+    String? avatar,
+    bool? followed,
+  }) {
+    return NewsfeedForyouListAccount()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar
+      ..followed = followed ?? this.followed;
+  }
+}

+ 179 - 0
packages/cs_domain/lib/generated/json/newsfeed_news_entity.g.dart

@@ -0,0 +1,179 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/newsfeed_news_entity.dart';
+
+NewsfeedNewsEntity $NewsfeedNewsEntityFromJson(Map<String, dynamic> json) {
+  final NewsfeedNewsEntity newsfeedNewsEntity = NewsfeedNewsEntity();
+  final int? count = jsonConvert.convert<int>(json['count']);
+  if (count != null) {
+    newsfeedNewsEntity.count = count;
+  }
+  final int? page = jsonConvert.convert<int>(json['page']);
+  if (page != null) {
+    newsfeedNewsEntity.page = page;
+  }
+  final int? limit = jsonConvert.convert<int>(json['limit']);
+  if (limit != null) {
+    newsfeedNewsEntity.limit = limit;
+  }
+  final int? countPage = jsonConvert.convert<int>(json['count_page']);
+  if (countPage != null) {
+    newsfeedNewsEntity.countPage = countPage;
+  }
+  final List<NewsfeedNewsList>? list = (json['list'] as List<dynamic>?)
+      ?.map(
+          (e) => jsonConvert.convert<NewsfeedNewsList>(e) as NewsfeedNewsList)
+      .toList();
+  if (list != null) {
+    newsfeedNewsEntity.list = list;
+  }
+  return newsfeedNewsEntity;
+}
+
+Map<String, dynamic> $NewsfeedNewsEntityToJson(NewsfeedNewsEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['count'] = entity.count;
+  data['page'] = entity.page;
+  data['limit'] = entity.limit;
+  data['count_page'] = entity.countPage;
+  data['list'] = entity.list?.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension NewsfeedNewsEntityExtension on NewsfeedNewsEntity {
+  NewsfeedNewsEntity copyWith({
+    int? count,
+    int? page,
+    int? limit,
+    int? countPage,
+    List<NewsfeedNewsList>? list,
+  }) {
+    return NewsfeedNewsEntity()
+      ..count = count ?? this.count
+      ..page = page ?? this.page
+      ..limit = limit ?? this.limit
+      ..countPage = countPage ?? this.countPage
+      ..list = list ?? this.list;
+  }
+}
+
+NewsfeedNewsList $NewsfeedNewsListFromJson(Map<String, dynamic> json) {
+  final NewsfeedNewsList newsfeedNewsList = NewsfeedNewsList();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    newsfeedNewsList.id = id;
+  }
+  final String? content = jsonConvert.convert<String>(json['content']);
+  if (content != null) {
+    newsfeedNewsList.content = content;
+  }
+  final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<String>(e) as String).toList();
+  if (resources != null) {
+    newsfeedNewsList.resources = resources;
+  }
+  final int? likesCount = jsonConvert.convert<int>(json['likes_count']);
+  if (likesCount != null) {
+    newsfeedNewsList.likesCount = likesCount;
+  }
+  final int? commentsCount = jsonConvert.convert<int>(json['comments_count']);
+  if (commentsCount != null) {
+    newsfeedNewsList.commentsCount = commentsCount;
+  }
+  final bool? liked = jsonConvert.convert<bool>(json['liked']);
+  if (liked != null) {
+    newsfeedNewsList.liked = liked;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    newsfeedNewsList.createdAt = createdAt;
+  }
+  final NewsfeedNewsListAccount? account = jsonConvert.convert<
+      NewsfeedNewsListAccount>(json['account']);
+  if (account != null) {
+    newsfeedNewsList.account = account;
+  }
+  return newsfeedNewsList;
+}
+
+Map<String, dynamic> $NewsfeedNewsListToJson(NewsfeedNewsList entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['content'] = entity.content;
+  data['resources'] = entity.resources;
+  data['likes_count'] = entity.likesCount;
+  data['comments_count'] = entity.commentsCount;
+  data['liked'] = entity.liked;
+  data['created_at'] = entity.createdAt;
+  data['account'] = entity.account?.toJson();
+  return data;
+}
+
+extension NewsfeedNewsListExtension on NewsfeedNewsList {
+  NewsfeedNewsList copyWith({
+    int? id,
+    String? content,
+    List<String>? resources,
+    int? likesCount,
+    int? commentsCount,
+    bool? liked,
+    String? createdAt,
+    NewsfeedNewsListAccount? account,
+  }) {
+    return NewsfeedNewsList()
+      ..id = id ?? this.id
+      ..content = content ?? this.content
+      ..resources = resources ?? this.resources
+      ..likesCount = likesCount ?? this.likesCount
+      ..commentsCount = commentsCount ?? this.commentsCount
+      ..liked = liked ?? this.liked
+      ..createdAt = createdAt ?? this.createdAt
+      ..account = account ?? this.account;
+  }
+}
+
+NewsfeedNewsListAccount $NewsfeedNewsListAccountFromJson(
+    Map<String, dynamic> json) {
+  final NewsfeedNewsListAccount newsfeedNewsListAccount = NewsfeedNewsListAccount();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    newsfeedNewsListAccount.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    newsfeedNewsListAccount.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    newsfeedNewsListAccount.avatar = avatar;
+  }
+  final bool? followed = jsonConvert.convert<bool>(json['followed']);
+  if (followed != null) {
+    newsfeedNewsListAccount.followed = followed;
+  }
+  return newsfeedNewsListAccount;
+}
+
+Map<String, dynamic> $NewsfeedNewsListAccountToJson(
+    NewsfeedNewsListAccount entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  data['followed'] = entity.followed;
+  return data;
+}
+
+extension NewsfeedNewsListAccountExtension on NewsfeedNewsListAccount {
+  NewsfeedNewsListAccount copyWith({
+    int? id,
+    String? name,
+    String? avatar,
+    bool? followed,
+  }) {
+    return NewsfeedNewsListAccount()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar
+      ..followed = followed ?? this.followed;
+  }
+}

+ 72 - 4
packages/cs_domain/lib/generated/json/property_news_entity.g.dart

@@ -19,8 +19,10 @@ PropertyNewsEntity $PropertyNewsEntityFromJson(Map<String, dynamic> json) {
   if (countPage != null) {
     propertyNewsEntity.countPage = countPage;
   }
-  final List<dynamic>? list = (json['list'] as List<dynamic>?)?.map(
-          (e) => e).toList();
+  final List<PropertyNewsList>? list = (json['list'] as List<dynamic>?)
+      ?.map(
+          (e) => jsonConvert.convert<PropertyNewsList>(e) as PropertyNewsList)
+      .toList();
   if (list != null) {
     propertyNewsEntity.list = list;
   }
@@ -33,7 +35,7 @@ Map<String, dynamic> $PropertyNewsEntityToJson(PropertyNewsEntity entity) {
   data['page'] = entity.page;
   data['limit'] = entity.limit;
   data['count_page'] = entity.countPage;
-  data['list'] = entity.list;
+  data['list'] = entity.list?.map((v) => v.toJson()).toList();
   return data;
 }
 
@@ -43,7 +45,7 @@ extension PropertyNewsEntityExtension on PropertyNewsEntity {
     int? page,
     int? limit,
     int? countPage,
-    List<dynamic>? list,
+    List<PropertyNewsList>? list,
   }) {
     return PropertyNewsEntity()
       ..count = count ?? this.count
@@ -52,4 +54,70 @@ extension PropertyNewsEntityExtension on PropertyNewsEntity {
       ..countPage = countPage ?? this.countPage
       ..list = list ?? this.list;
   }
+}
+
+PropertyNewsList $PropertyNewsListFromJson(Map<String, dynamic> json) {
+  final PropertyNewsList propertyNewsList = PropertyNewsList();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    propertyNewsList.id = id;
+  }
+  final String? title = jsonConvert.convert<String>(json['title']);
+  if (title != null) {
+    propertyNewsList.title = title;
+  }
+  final String? coverImage = jsonConvert.convert<String>(json['cover_image']);
+  if (coverImage != null) {
+    propertyNewsList.coverImage = coverImage;
+  }
+  final String? content = jsonConvert.convert<String>(json['content']);
+  if (content != null) {
+    propertyNewsList.content = content;
+  }
+  final int? likesCount = jsonConvert.convert<int>(json['likes_count']);
+  if (likesCount != null) {
+    propertyNewsList.likesCount = likesCount;
+  }
+  final bool? liked = jsonConvert.convert<bool>(json['liked']);
+  if (liked != null) {
+    propertyNewsList.liked = liked;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    propertyNewsList.createdAt = createdAt;
+  }
+  return propertyNewsList;
+}
+
+Map<String, dynamic> $PropertyNewsListToJson(PropertyNewsList entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['title'] = entity.title;
+  data['cover_image'] = entity.coverImage;
+  data['content'] = entity.content;
+  data['likes_count'] = entity.likesCount;
+  data['liked'] = entity.liked;
+  data['created_at'] = entity.createdAt;
+  return data;
+}
+
+extension PropertyNewsListExtension on PropertyNewsList {
+  PropertyNewsList copyWith({
+    int? id,
+    String? title,
+    String? coverImage,
+    String? content,
+    int? likesCount,
+    bool? liked,
+    String? createdAt,
+  }) {
+    return PropertyNewsList()
+      ..id = id ?? this.id
+      ..title = title ?? this.title
+      ..coverImage = coverImage ?? this.coverImage
+      ..content = content ?? this.content
+      ..likesCount = likesCount ?? this.likesCount
+      ..liked = liked ?? this.liked
+      ..createdAt = createdAt ?? this.createdAt;
+  }
 }

+ 0 - 55
packages/cs_domain/lib/generated/json/property_sale_entity.g.dart

@@ -1,55 +0,0 @@
-import 'package:domain/generated/json/base/json_convert_content.dart';
-import 'package:domain/entity/property_sale_entity.dart';
-
-PropertySaleEntity $PropertySaleEntityFromJson(Map<String, dynamic> json) {
-  final PropertySaleEntity propertySaleEntity = PropertySaleEntity();
-  final int? count = jsonConvert.convert<int>(json['count']);
-  if (count != null) {
-    propertySaleEntity.count = count;
-  }
-  final int? page = jsonConvert.convert<int>(json['page']);
-  if (page != null) {
-    propertySaleEntity.page = page;
-  }
-  final int? limit = jsonConvert.convert<int>(json['limit']);
-  if (limit != null) {
-    propertySaleEntity.limit = limit;
-  }
-  final int? countPage = jsonConvert.convert<int>(json['count_page']);
-  if (countPage != null) {
-    propertySaleEntity.countPage = countPage;
-  }
-  final List<dynamic>? list = (json['list'] as List<dynamic>?)?.map(
-          (e) => e).toList();
-  if (list != null) {
-    propertySaleEntity.list = list;
-  }
-  return propertySaleEntity;
-}
-
-Map<String, dynamic> $PropertySaleEntityToJson(PropertySaleEntity entity) {
-  final Map<String, dynamic> data = <String, dynamic>{};
-  data['count'] = entity.count;
-  data['page'] = entity.page;
-  data['limit'] = entity.limit;
-  data['count_page'] = entity.countPage;
-  data['list'] = entity.list;
-  return data;
-}
-
-extension PropertySaleEntityExtension on PropertySaleEntity {
-  PropertySaleEntity copyWith({
-    int? count,
-    int? page,
-    int? limit,
-    int? countPage,
-    List<dynamic>? list,
-  }) {
-    return PropertySaleEntity()
-      ..count = count ?? this.count
-      ..page = page ?? this.page
-      ..limit = limit ?? this.limit
-      ..countPage = countPage ?? this.countPage
-      ..list = list ?? this.list;
-  }
-}

+ 126 - 0
packages/cs_domain/lib/generated/json/property_sale_rent_entity.g.dart

@@ -0,0 +1,126 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/property_sale_rent_entity.dart';
+
+PropertySaleRentEntity $PropertySaleRentEntityFromJson(
+    Map<String, dynamic> json) {
+  final PropertySaleRentEntity propertySaleRentEntity = PropertySaleRentEntity();
+  final int? count = jsonConvert.convert<int>(json['count']);
+  if (count != null) {
+    propertySaleRentEntity.count = count;
+  }
+  final int? page = jsonConvert.convert<int>(json['page']);
+  if (page != null) {
+    propertySaleRentEntity.page = page;
+  }
+  final int? limit = jsonConvert.convert<int>(json['limit']);
+  if (limit != null) {
+    propertySaleRentEntity.limit = limit;
+  }
+  final int? countPage = jsonConvert.convert<int>(json['count_page']);
+  if (countPage != null) {
+    propertySaleRentEntity.countPage = countPage;
+  }
+  final List<PropertySaleRentList>? list = (json['list'] as List<dynamic>?)
+      ?.map(
+          (e) =>
+      jsonConvert.convert<PropertySaleRentList>(e) as PropertySaleRentList)
+      .toList();
+  if (list != null) {
+    propertySaleRentEntity.list = list;
+  }
+  return propertySaleRentEntity;
+}
+
+Map<String, dynamic> $PropertySaleRentEntityToJson(
+    PropertySaleRentEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['count'] = entity.count;
+  data['page'] = entity.page;
+  data['limit'] = entity.limit;
+  data['count_page'] = entity.countPage;
+  data['list'] = entity.list?.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension PropertySaleRentEntityExtension on PropertySaleRentEntity {
+  PropertySaleRentEntity copyWith({
+    int? count,
+    int? page,
+    int? limit,
+    int? countPage,
+    List<PropertySaleRentList>? list,
+  }) {
+    return PropertySaleRentEntity()
+      ..count = count ?? this.count
+      ..page = page ?? this.page
+      ..limit = limit ?? this.limit
+      ..countPage = countPage ?? this.countPage
+      ..list = list ?? this.list;
+  }
+}
+
+PropertySaleRentList $PropertySaleRentListFromJson(Map<String, dynamic> json) {
+  final PropertySaleRentList propertySaleRentList = PropertySaleRentList();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    propertySaleRentList.id = id;
+  }
+  final int? type = jsonConvert.convert<int>(json['type']);
+  if (type != null) {
+    propertySaleRentList.type = type;
+  }
+  final String? title = jsonConvert.convert<String>(json['title']);
+  if (title != null) {
+    propertySaleRentList.title = title;
+  }
+  final String? price = jsonConvert.convert<String>(json['price']);
+  if (price != null) {
+    propertySaleRentList.price = price;
+  }
+  final String? priceShow = jsonConvert.convert<String>(json['price_show']);
+  if (priceShow != null) {
+    propertySaleRentList.priceShow = priceShow;
+  }
+  final String? units = jsonConvert.convert<String>(json['units']);
+  if (units != null) {
+    propertySaleRentList.units = units;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    propertySaleRentList.createdAt = createdAt;
+  }
+  return propertySaleRentList;
+}
+
+Map<String, dynamic> $PropertySaleRentListToJson(PropertySaleRentList entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['type'] = entity.type;
+  data['title'] = entity.title;
+  data['price'] = entity.price;
+  data['price_show'] = entity.priceShow;
+  data['units'] = entity.units;
+  data['created_at'] = entity.createdAt;
+  return data;
+}
+
+extension PropertySaleRentListExtension on PropertySaleRentList {
+  PropertySaleRentList copyWith({
+    int? id,
+    int? type,
+    String? title,
+    String? price,
+    String? priceShow,
+    String? units,
+    String? createdAt,
+  }) {
+    return PropertySaleRentList()
+      ..id = id ?? this.id
+      ..type = type ?? this.type
+      ..title = title ?? this.title
+      ..price = price ?? this.price
+      ..priceShow = priceShow ?? this.priceShow
+      ..units = units ?? this.units
+      ..createdAt = createdAt ?? this.createdAt;
+  }
+}

+ 33 - 15
packages/cs_domain/lib/generated/json/user_me_entity.g.dart

@@ -23,11 +23,13 @@ UserMeEntity $UserMeEntityFromJson(Map<String, dynamic> json) {
   if (email != null) {
     userMeEntity.email = email;
   }
-  final String? followsCount = jsonConvert.convert<String>(json['follows_count']);
+  final String? followsCount = jsonConvert.convert<String>(
+      json['follows_count']);
   if (followsCount != null) {
     userMeEntity.followsCount = followsCount;
   }
-  final String? flowersCount = jsonConvert.convert<String>(json['flowers_count']);
+  final String? flowersCount = jsonConvert.convert<String>(
+      json['flowers_count']);
   if (flowersCount != null) {
     userMeEntity.flowersCount = flowersCount;
   }
@@ -35,21 +37,28 @@ UserMeEntity $UserMeEntityFromJson(Map<String, dynamic> json) {
   if (postsCount != null) {
     userMeEntity.postsCount = postsCount;
   }
-  final List<UserMeHouseholds>? households = (json['households'] as List<dynamic>?)?.map(
-          (e) => jsonConvert.convert<UserMeHouseholds>(e) as UserMeHouseholds).toList();
+  final List<UserMeHouseholds>? households = (json['households'] as List<
+      dynamic>?)
+      ?.map(
+          (e) => jsonConvert.convert<UserMeHouseholds>(e) as UserMeHouseholds)
+      .toList();
   if (households != null) {
     userMeEntity.households = households;
   }
-  final List<UserMeEstates>? estates = (json['estates'] as List<dynamic>?)?.map(
-          (e) => jsonConvert.convert<UserMeEstates>(e) as UserMeEstates).toList();
+  final List<UserMeEstates>? estates = (json['estates'] as List<dynamic>?)
+      ?.map(
+          (e) => jsonConvert.convert<UserMeEstates>(e) as UserMeEstates)
+      .toList();
   if (estates != null) {
     userMeEntity.estates = estates;
   }
-  final UserMeDefaultUnit? defaultUnit = jsonConvert.convert<UserMeDefaultUnit>(json['default_unit']);
+  final UserMeDefaultUnit? defaultUnit = jsonConvert.convert<UserMeDefaultUnit>(
+      json['default_unit']);
   if (defaultUnit != null) {
     userMeEntity.defaultUnit = defaultUnit;
   }
-  final UserMeInformation? information = jsonConvert.convert<UserMeInformation>(json['information']);
+  final UserMeInformation? information = jsonConvert.convert<UserMeInformation>(
+      json['information']);
   if (information != null) {
     userMeEntity.information = information;
   }
@@ -152,8 +161,12 @@ UserMeEstates $UserMeEstatesFromJson(Map<String, dynamic> json) {
   if (name != null) {
     userMeEstates.name = name;
   }
-  final List<UserMeEstatesAccounts>? accounts = (json['accounts'] as List<dynamic>?)?.map(
-          (e) => jsonConvert.convert<UserMeEstatesAccounts>(e) as UserMeEstatesAccounts).toList();
+  final List<UserMeEstatesAccounts>? accounts = (json['accounts'] as List<
+      dynamic>?)
+      ?.map(
+          (e) =>
+      jsonConvert.convert<UserMeEstatesAccounts>(e) as UserMeEstatesAccounts)
+      .toList();
   if (accounts != null) {
     userMeEstates.accounts = accounts;
   }
@@ -181,7 +194,8 @@ extension UserMeEstatesExtension on UserMeEstates {
   }
 }
 
-UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(Map<String, dynamic> json) {
+UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(
+    Map<String, dynamic> json) {
   final UserMeEstatesAccounts userMeEstatesAccounts = UserMeEstatesAccounts();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -207,14 +221,16 @@ UserMeEstatesAccounts $UserMeEstatesAccountsFromJson(Map<String, dynamic> json)
   if (status != null) {
     userMeEstatesAccounts.status = status;
   }
-  final UserMeEstatesAccountsUnit? unit = jsonConvert.convert<UserMeEstatesAccountsUnit>(json['unit']);
+  final UserMeEstatesAccountsUnit? unit = jsonConvert.convert<
+      UserMeEstatesAccountsUnit>(json['unit']);
   if (unit != null) {
     userMeEstatesAccounts.unit = unit;
   }
   return userMeEstatesAccounts;
 }
 
-Map<String, dynamic> $UserMeEstatesAccountsToJson(UserMeEstatesAccounts entity) {
+Map<String, dynamic> $UserMeEstatesAccountsToJson(
+    UserMeEstatesAccounts entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['name'] = entity.name;
@@ -247,7 +263,8 @@ extension UserMeEstatesAccountsExtension on UserMeEstatesAccounts {
   }
 }
 
-UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(Map<String, dynamic> json) {
+UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(
+    Map<String, dynamic> json) {
   final UserMeEstatesAccountsUnit userMeEstatesAccountsUnit = UserMeEstatesAccountsUnit();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -272,7 +289,8 @@ UserMeEstatesAccountsUnit $UserMeEstatesAccountsUnitFromJson(Map<String, dynamic
   return userMeEstatesAccountsUnit;
 }
 
-Map<String, dynamic> $UserMeEstatesAccountsUnitToJson(UserMeEstatesAccountsUnit entity) {
+Map<String, dynamic> $UserMeEstatesAccountsUnitToJson(
+    UserMeEstatesAccountsUnit entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['block'] = entity.block;

+ 10 - 0
packages/cs_shared/lib/utils/ext_dart.dart

@@ -87,6 +87,16 @@ extension IntExtension on int {
 }
 
 /*
+   Map的扩展方法,用于根据键提取对应值
+ */
+extension MapExtension on Map<String, dynamic> {
+  T? getValue<T>(String key, defaultValue) {
+    return this.containsKey(key)? this[key] as T : defaultValue as T?;
+  }
+}
+
+
+/*
    ViewModel中的扩展方法,用于处理网络错误
  */
 extension ControllerExtension on AutoDisposeNotifier {