Browse Source

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

# Conflicts:
#	packages/cs_domain/lib/generated/json/base/json_convert_content.dart
#	packages/cs_domain/lib/generated/json/user_me_entity.g.dart
liukai 3 months ago
parent
commit
4ac3dbaeef
100 changed files with 8804 additions and 426 deletions
  1. 11 7
      packages/cpt_notice_board/lib/modules/announcement_detail/page/announcement_detail_page.dart
  2. 25 29
      packages/cpt_notice_board/lib/modules/event/page/event_page.dart
  3. 8 5
      packages/cpt_notice_board/lib/modules/event_detail/page/event_detail_page.dart
  4. 2 5
      packages/cpt_notice_board/lib/modules/notice_board/page/notice_board_page.dart
  5. 28 28
      packages/cpt_property/lib/modules/news/page/property_news_page.dart
  6. 30 37
      packages/cpt_property/lib/modules/news/page/property_news_state.dart
  7. 48 9
      packages/cpt_property/lib/modules/news/repository/property_news_repository.dart
  8. 128 114
      packages/cpt_property/lib/modules/news/vm/property_news_vm.dart
  9. 1 1
      packages/cpt_property/lib/modules/news/vm/property_news_vm.g.dart
  10. 1 1
      packages/cpt_property/lib/modules/rent/page/property_rent_page.dart
  11. 18 18
      packages/cpt_property/lib/modules/rent/page/property_rent_state.dart
  12. 107 47
      packages/cpt_property/lib/modules/rent/vm/property_rent_vm.dart
  13. 1 1
      packages/cpt_property/lib/modules/rent/vm/property_rent_vm.g.dart
  14. 2 1
      packages/cpt_property/lib/modules/sale/page/property_sale_page.dart
  15. 18 18
      packages/cpt_property/lib/modules/sale/page/property_sale_state.dart
  16. 5 6
      packages/cpt_property/lib/modules/sale/repository/property_sale_repository.dart
  17. 99 41
      packages/cpt_property/lib/modules/sale/vm/property_sale_vm.dart
  18. 1 1
      packages/cpt_property/lib/modules/sale/vm/property_sale_vm.g.dart
  19. 5 2
      packages/cpt_property/pubspec.yaml
  20. 0 33
      packages/cpt_rewards/lib/modules/rewards/page/rewards_page.dart
  21. 918 0
      packages/cpt_rewards/lib/modules/rewards/rewards_page.dart
  22. 8 8
      packages/cpt_property/lib/modules/rent/repository/property_rent_repository.dart
  23. 27 0
      packages/cpt_rewards/lib/modules/rewards/rewards_repository.g.dart
  24. 49 0
      packages/cpt_rewards/lib/modules/rewards/rewards_state.dart
  25. 108 0
      packages/cpt_rewards/lib/modules/rewards/rewards_vm.dart
  26. 25 0
      packages/cpt_rewards/lib/modules/rewards/rewards_vm.g.dart
  27. 0 14
      packages/cpt_rewards/lib/modules/rewards/vm/rewards_view_model.dart
  28. 170 0
      packages/cpt_rewards/lib/modules/rewards_address/rewards_address_page.dart
  29. 70 0
      packages/cpt_rewards/lib/modules/rewards_address/rewards_address_repository.dart
  30. 27 0
      packages/cpt_rewards/lib/modules/rewards_address/rewards_address_repository.g.dart
  31. 49 0
      packages/cpt_rewards/lib/modules/rewards_address/rewards_address_state.dart
  32. 109 0
      packages/cpt_rewards/lib/modules/rewards_address/rewards_address_vm.dart
  33. 25 0
      packages/cpt_rewards/lib/modules/rewards_address/rewards_address_vm.g.dart
  34. 129 0
      packages/cpt_rewards/lib/modules/rewards_code/rewards_code_page.dart
  35. 70 0
      packages/cpt_rewards/lib/modules/rewards_code/rewards_code_repository.dart
  36. 27 0
      packages/cpt_rewards/lib/modules/rewards_code/rewards_code_repository.g.dart
  37. 49 0
      packages/cpt_rewards/lib/modules/rewards_code/rewards_code_state.dart
  38. 109 0
      packages/cpt_rewards/lib/modules/rewards_code/rewards_code_vm.dart
  39. 25 0
      packages/cpt_rewards/lib/modules/rewards_code/rewards_code_vm.g.dart
  40. 144 0
      packages/cpt_rewards/lib/modules/rewards_confirm/dialog/account_deactivation_dialog.dart
  41. 388 0
      packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_page.dart
  42. 70 0
      packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_repository.dart
  43. 27 0
      packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_repository.g.dart
  44. 49 0
      packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_state.dart
  45. 118 0
      packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_vm.dart
  46. 25 0
      packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_vm.g.dart
  47. 632 0
      packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_page.dart
  48. 70 0
      packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_repository.dart
  49. 27 0
      packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_repository.g.dart
  50. 49 0
      packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_state.dart
  51. 109 0
      packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_vm.dart
  52. 25 0
      packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_vm.g.dart
  53. 130 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_page.dart
  54. 70 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_repository.dart
  55. 27 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_repository.g.dart
  56. 49 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_state.dart
  57. 105 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_vm.dart
  58. 25 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_vm.g.dart
  59. 124 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_page.dart
  60. 129 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_page.dart
  61. 70 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_repository.dart
  62. 27 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_repository.g.dart
  63. 49 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_state.dart
  64. 105 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_vm.dart
  65. 25 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_vm.g.dart
  66. 86 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_vm.dart
  67. 25 0
      packages/cpt_rewards/lib/modules/rewards_history/rewards_history_vm.g.dart
  68. 500 0
      packages/cpt_rewards/lib/modules/rewards_home/rewards_home_page.dart
  69. 70 0
      packages/cpt_rewards/lib/modules/rewards_home/rewards_home_repository.dart
  70. 27 0
      packages/cpt_rewards/lib/modules/rewards_home/rewards_home_repository.g.dart
  71. 57 0
      packages/cpt_rewards/lib/modules/rewards_home/rewards_home_state.dart
  72. 122 0
      packages/cpt_rewards/lib/modules/rewards_home/rewards_home_vm.dart
  73. 25 0
      packages/cpt_rewards/lib/modules/rewards_home/rewards_home_vm.g.dart
  74. 212 0
      packages/cpt_rewards/lib/modules/rewards_list/dialog/reward_listfilter_all_dialog.dart
  75. 338 0
      packages/cpt_rewards/lib/modules/rewards_list/dialog/reward_listfilter_dialog.dart
  76. 283 0
      packages/cpt_rewards/lib/modules/rewards_list/rewards_list_page.dart
  77. 70 0
      packages/cpt_rewards/lib/modules/rewards_list/rewards_list_repository.dart
  78. 27 0
      packages/cpt_rewards/lib/modules/rewards_list/rewards_list_repository.g.dart
  79. 55 0
      packages/cpt_rewards/lib/modules/rewards_list/rewards_list_state.dart
  80. 147 0
      packages/cpt_rewards/lib/modules/rewards_list/rewards_list_vm.dart
  81. 25 0
      packages/cpt_rewards/lib/modules/rewards_list/rewards_list_vm.g.dart
  82. 205 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_page.dart
  83. 70 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_repository.dart
  84. 27 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_repository.g.dart
  85. 49 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_state.dart
  86. 105 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_vm.dart
  87. 25 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_vm.g.dart
  88. 184 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_page.dart
  89. 70 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_repository.dart
  90. 27 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_repository.g.dart
  91. 49 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_state.dart
  92. 105 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_vm.dart
  93. 25 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_vm.g.dart
  94. 125 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_page.dart
  95. 218 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_page.dart
  96. 70 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_repository.dart
  97. 27 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_repository.g.dart
  98. 49 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_state.dart
  99. 105 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_vm.dart
  100. 0 0
      packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_vm.g.dart

+ 11 - 7
packages/cpt_notice_board/lib/modules/announcement_detail/page/announcement_detail_page.dart

@@ -28,7 +28,6 @@ class AnnouncementDetailPage extends HookConsumerWidget {
     }
   }
 
-
   Widget _buildDetailTop(BuildContext context, WidgetRef ref, _vm) {
     // List itemsList = _vm.state.list.toList();
     return Column(
@@ -116,8 +115,10 @@ class AnnouncementDetailPage extends HookConsumerWidget {
               ),
             ],
           ).marginOnly(top: 15),
-        ]).paddingOnly(bottom: 25).border(bottom: 1,color: ColorUtils.string2Color('#F2F3F6')),
-         Column(
+        ])
+            .paddingOnly(bottom: 25)
+            .border(bottom: 1, color: ColorUtils.string2Color('#F2F3F6')),
+        Column(
           children: [
             const Column(
               mainAxisAlignment: MainAxisAlignment.center,
@@ -157,10 +158,13 @@ class AnnouncementDetailPage extends HookConsumerWidget {
       ),
       body: Container(
           child: EasyRefresh(
-        child: Container(
-            color: ColorUtils.string2Color('#FFFFFF'),
-            padding: const EdgeInsets.only(top: 30, left: 15, right: 15),
-            child: _buildDetailTop(context, ref, _vm)),
+        child: SingleChildScrollView(
+            scrollDirection: Axis.vertical,
+            physics: const BouncingScrollPhysics(),
+            clipBehavior: Clip.none,
+            child: Padding(
+                padding: const EdgeInsets.only(left: 15, right: 15, top: 15),
+                child: _buildDetailTop(context, ref, _vm))),
       )),
     );
   }

+ 25 - 29
packages/cpt_notice_board/lib/modules/event/page/event_page.dart

@@ -28,17 +28,14 @@ class EventPage extends HookConsumerWidget {
   }
 
   Widget _buildItemLeftSection(BuildContext context, WidgetRef ref, item, _vm) {
-    return Container(
-      // color: Colors.blue,
-      child: Text(
-        maxLines: 2, // 设置最大行数为2
-        overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
-        item['title'],
-        style: const TextStyle(
-            fontSize: 16.0,
-            color: Colors.black,
-            fontWeight: FontWeight.w700), // 设置字体大小
-      ),
+    return Text(
+      maxLines: 2, // 设置最大行数为2
+      overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+      item['title'],
+      style: const TextStyle(
+          fontSize: 16.0,
+          color: Colors.black,
+          fontWeight: FontWeight.w700), // 设置字体大小
     );
   }
 
@@ -68,7 +65,7 @@ class EventPage extends HookConsumerWidget {
       ),
       child: Column(
         children: [
-          Container(
+          SizedBox(
             width: MediaQuery.of(context).size.width - 30,
             height: 100,
             // margin: const EdgeInsets.only(left: 15, right: 15, top: 12.5),
@@ -113,23 +110,22 @@ class EventPage extends HookConsumerWidget {
 
     return Scaffold(
       // appBar: AppBar(title: Text("资产")),
-      body: Container(
-          child: EasyRefresh(
-        // 上拉加载
-        onLoad: () async {
-          Log.d("----onLoad");
-          _vm.onLoadData();
-        },
-        // 下拉刷新
-        onRefresh: () async {
-          Log.d("----onRefresh");
-          _vm.refreshListData();
-        },
-        child: Container(
-            color: ColorUtils.string2Color('#F2F3F6'),
-            padding: const EdgeInsets.only(top: 15),
-            child: _buildSaleList(context, ref, _vm)),
-      )),
+      body: EasyRefresh(
+              // 上拉加载
+              onLoad: () async {
+      Log.d("----onLoad");
+      _vm.onLoadData();
+              },
+              // 下拉刷新
+              onRefresh: () async {
+      Log.d("----onRefresh");
+      _vm.refreshListData();
+              },
+              child: Container(
+        color: ColorUtils.string2Color('#F2F3F6'),
+        padding: const EdgeInsets.only(top: 15),
+        child: _buildSaleList(context, ref, _vm)),
+            ),
     );
   }
 }

+ 8 - 5
packages/cpt_notice_board/lib/modules/event_detail/page/event_detail_page.dart

@@ -29,7 +29,7 @@ class EventDetailPage extends HookConsumerWidget {
   }
 
   Widget _buildDetailTop(BuildContext context, WidgetRef ref, _vm) {
-    // List itemsList = _vm.state.list.toList();
+    // List itemsList = _vm.state.list.toList();3
     return Column(
       children: [
         Column(children: [
@@ -111,10 +111,13 @@ class EventDetailPage extends HookConsumerWidget {
       ),
       body: Container(
           child: EasyRefresh(
-        child: Container(
-            color: ColorUtils.string2Color('#FFFFFF'),
-            padding: const EdgeInsets.only(top: 30, left: 15, right: 15),
-            child: _buildDetailTop(context, ref, _vm)),
+        child: SingleChildScrollView(
+            scrollDirection: Axis.vertical,
+            physics: const BouncingScrollPhysics(),
+            clipBehavior: Clip.none,
+            child: Padding(
+                padding: const EdgeInsets.only(left: 15, right: 15, top: 15),
+                child: _buildDetailTop(context, ref, _vm))),
       )),
     );
   }

+ 2 - 5
packages/cpt_notice_board/lib/modules/notice_board/page/notice_board_page.dart

@@ -43,9 +43,7 @@ class NoticeBoardPage extends HookConsumerWidget {
           crossAxisAlignment: CrossAxisAlignment.center,
           children: List.generate(topSectionsData.length, (index) {
             final item = topSectionsData[index];
-            return Flexible(
-              flex: 1,
-              child: Column(
+            return Column(
                 children: [
                   Container(
                     width: MediaQuery.of(context).size.width /
@@ -92,8 +90,7 @@ class NoticeBoardPage extends HookConsumerWidget {
                     isFontMedium: true,
                   ),
                 ],
-              ),
-            ).marginOnly(left: 18, right: 18, top: 10, bottom: 10);
+              ).marginOnly(left: 18, right: 18, top: 10, bottom: 10);
           }),
         ),
       ),

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

@@ -35,10 +35,10 @@ class PropertyNewsPage extends HookConsumerWidget {
   static double cardHeight = 117.5 + 50;
   static double cardLeftWidth = 125;
 
-  Widget _buildItemLeftSection(BuildContext context,WidgetRef ref, item, _vm) {
-    final imageHeight = item['pic']!.isNotEmpty? cardHeight + 15 : cardHeight;
+  Widget _buildItemLeftSection(BuildContext context,WidgetRef ref, item, vm) {
+    // final imageHeight = item['pic']!.isNotEmpty? cardHeight : cardHeight;
     return Container(
-        height: imageHeight,
+        height: cardHeight,
         width: cardLeftWidth,
         decoration: BoxDecoration(
           color: ColorUtils.string2Color('#F2F3F6'),
@@ -50,26 +50,26 @@ class PropertyNewsPage extends HookConsumerWidget {
         ),
         child: Center(
           child: MyLoadImage(
-            item['pic'],
+            item['cover_image'],
             placeholderPath: Assets.propertyNewsItemBg,
-            height: item['pic']!.isNotEmpty? imageHeight : 60.5,
-            width: item['pic']!.isNotEmpty? cardLeftWidth : 50.5,
+            height: item['cover_image']!.isNotEmpty? cardHeight : 60.5,
+            width: item['cover_image']!.isNotEmpty? cardLeftWidth : 60.5,
             // fit: BoxFit.cover,
-            fit: BoxFit.cover,
+            fit: BoxFit.fill,
             cornerRadius: 8,
           ),
         )
     );
   }
 
-  Widget _buildItemRightSection(BuildContext context,WidgetRef ref, item, _vm) {
-    // 使用 ref.select 监听 list 中 item 的 Map 对象中的 isCollection 字段
-    final isCollection = ref.watch(propertyNewsVmProvider.select((state) {
-      final curItem = state.list.firstWhere(
+  Widget _buildItemRightSection(BuildContext context,WidgetRef ref, item, vm) {
+    // 使用 ref.select 监听 list 中 item 的 Map 对象中的 liked 字段
+    final liked = ref.watch(propertyNewsVmProvider.select((state) {
+      final curItem = state.list!.firstWhere(
             (valueItem) => valueItem['id'] == item['id'],
-        orElse: () => {'isCollection': false},
+        orElse: () => {'liked': false},
       );
-      return curItem['isCollection'] as bool;
+      return curItem['liked'] as bool;
     }));
 
     return Container(
@@ -106,7 +106,7 @@ class PropertyNewsPage extends HookConsumerWidget {
                 children: [
                   Expanded(
                     child: MyTextView(
-                      item['description'],
+                      item['content'],
                       maxLines: 2, // 设置最大行数为2
                       isTextEllipsis: true, // 超出部分用省略号表示
                       fontSize: 12,
@@ -136,9 +136,9 @@ class PropertyNewsPage extends HookConsumerWidget {
           Positioned(
             right: 5,
             bottom: 0,
-            child: MyAssetImage(isCollection? Assets.propertyCollectionActive:Assets.propertyCollection,width:22,height: 20.5,).onTap((){
+            child: MyAssetImage(liked? Assets.propertyCollectionActive:Assets.propertyCollection,width:22,height: 20.5,).onTap((){
               Log.d("点击了收藏按钮");
-              _vm.handlerCollection(item, isCollection);
+              vm.handlerCollection(item, liked);
             }),
           ),
         ],
@@ -149,7 +149,7 @@ class PropertyNewsPage extends HookConsumerWidget {
   }
 
   // listitem
-  Widget _buildNewsItem(BuildContext context,WidgetRef ref, item, _vm) {
+  Widget _buildNewsItem(BuildContext context,WidgetRef ref, item, vm) {
     return Row(
       mainAxisAlignment: MainAxisAlignment.center,
       crossAxisAlignment: CrossAxisAlignment.center,
@@ -173,8 +173,8 @@ class PropertyNewsPage extends HookConsumerWidget {
             mainAxisAlignment: MainAxisAlignment.start,
             crossAxisAlignment: CrossAxisAlignment.start,
             children: [
-              _buildItemLeftSection(context, ref, item, _vm),
-              Expanded(child: _buildItemRightSection(context, ref, item, _vm)),
+              _buildItemLeftSection(context, ref, item, vm),
+              Expanded(child: _buildItemRightSection(context, ref, item, vm)),
             ],
           ),
         ).constrained(
@@ -183,18 +183,18 @@ class PropertyNewsPage extends HookConsumerWidget {
       ],
     ).onTap((){
       // 去详情
-      // _vm.goNewsDetail(item);
+      // vm.goNewsDetail(item);
     });
   }
 
 
   @override
   Widget build(BuildContext context, WidgetRef ref) {
-    final _vm = ref.read(propertyNewsVmProvider.notifier);
+    final vm = ref.read(propertyNewsVmProvider.notifier);
     final state = ref.watch(propertyNewsVmProvider);
     useEffect(() {
       // 组件挂载时执行 - 执行接口请求
-      Future.microtask(() => _vm.initPageData());
+      Future.microtask(() => vm.initPageData());
       return () {
         // 组件卸载时执行
         Log.d("property_news_page 组件卸载时执行");
@@ -209,30 +209,30 @@ class PropertyNewsPage extends HookConsumerWidget {
         width: double.infinity,
         height: double.infinity,
         child: EasyRefresh(
-          controller: _vm.refreshController,
+          controller: vm.refreshController,
           // 上拉加载
           onLoad: () async{
             Log.d("----onLoad");
-            _vm.loadMore();
+            vm.loadMore();
           },
           // 下拉刷新
           onRefresh: () async{
             Log.d("----onRefresh");
-            _vm.onRefresh();
+            vm.onRefresh();
           },
           child: LoadStateLayout(
             state: state.loadingState,
             errorMessage: state.errorMessage,
             errorRetry: () {
-              _vm.retryRequest();
+              vm.retryRequest();
             },
             successSliverWidget: [
                 SliverList(
                   delegate: SliverChildBuilderDelegate(
                         (context, index){
-                          return _buildNewsItem(context, ref, state.list[index], _vm);
+                          return _buildNewsItem(context, ref, state.list![index], vm);
                         },
-                    childCount: state.list.length
+                    childCount: state.list!.length
                   )
                 )
             ],

+ 30 - 37
packages/cpt_property/lib/modules/news/page/property_news_state.dart

@@ -9,60 +9,53 @@ class PropertyNewsState {
     LoadState loadingState;
     String? errorMessage;
 
-    int? curPage;
-    int? pageSize = 10;
-    int? filterCount = 1;
-    List<Map<String, dynamic>> list;
+    int? page;
+    int? limit = 10;
+    int? count = 1;
+    List<Map<String, dynamic>>? list;
 
     PropertyNewsState({
         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,
         required this.list,
     });
 
-
-
+    PropertyNewsState copyWith({
+    LoadState? loadingState,
+    String? errorMessage,
+    int? page,
+    int? limit,
+    int? count,
+    List<Map<String, dynamic>>? list,
+  }) {
+    return PropertyNewsState(
+      loadingState: loadingState ?? this.loadingState,
+      errorMessage: errorMessage ?? this.errorMessage,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
+      list: list ?? this.list,
+    );
+  }
 
     Map<String, dynamic> toMap() {
     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,
     };
   }
 
   factory PropertyNewsState.fromMap(Map<String, dynamic> map) {
     return PropertyNewsState(
-      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>>,
     );
   }
-
-    PropertyNewsState copyWith({
-    LoadState? loadingState,
-    String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
-    List<Map<String, dynamic>>? list,
-  }) {
-    return PropertyNewsState(
-      loadingState: loadingState ?? this.loadingState,
-      errorMessage: errorMessage ?? this.errorMessage,
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
-      filterCount: filterCount ?? this.filterCount,
-      list: list ?? this.list,
-    );
-  }
 }

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

@@ -1,9 +1,11 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/property_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';
@@ -27,19 +29,14 @@ class PropertyNewsRepository {
 
   PropertyNewsRepository({required this.dioEngine});
 
-  Future<HttpResult<Object>> fetchPropertyNewsList(
+  Future<HttpResult<Object>> fetchList(
       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";
@@ -47,7 +44,7 @@ class PropertyNewsRepository {
 
     final result = await dioEngine.requestNetResult(
       // ApiConstants.apiServerTime, // api 地址
-      '/index.php/api/employee/extra/time', // api 地址
+      '/api/v1/user/property/news/list', // api 地址
       params: params,
       headers: headers,
       method: HttpMethod.GET,
@@ -56,16 +53,58 @@ class PropertyNewsRepository {
       cancelToken: cancelToken,
     );
 
+    Log.d("------请求返回的result--$result--------");
     //根据返回的结果,封装原始数据为Bean/Entity对象
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = PropertyNewsState.fromMap(json!);
+      var data = PropertyNewsEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert<PropertyNewsState>(data: data);
+      return result.convert<PropertyNewsEntity>(data: data);
     }
     return result.convert();
   }
 
 
+  // 点赞/取消点赞
+  Future<HttpResult<Object>> fetchPropertyNewsLikeClick(
+      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/property/like/click', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    Log.d("------请求返回的result--$result--------");
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+
+      if(json!=null && json['data'] == true){
+        return result.convert<bool>(data: true);
+      }else {
+        return result.convert<bool>(data: false);
+      }
+    }
+    return result.convert();
+  }
+
 }
+

+ 128 - 114
packages/cpt_property/lib/modules/news/vm/property_news_vm.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/property_news_entity.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
@@ -55,16 +56,16 @@ class PropertyNewsVm extends _$PropertyNewsVm {
   Future loadMore() 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();
   }
 
@@ -74,13 +75,13 @@ class PropertyNewsVm extends _$PropertyNewsVm {
     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();
   }
@@ -92,72 +93,103 @@ class PropertyNewsVm extends _$PropertyNewsVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("加载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");
+    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");
+      }
+
+
+    // await Future.delayed(const Duration(milliseconds: 1500));
+    // final List<Map<String, dynamic>> listData = [
+    //   {
+    //     "id": 1,
+    //     "title": "法国进口高档国家的看过艰苦奋斗是感觉扣税的房价过快岁的法国艰苦奋斗是架构开发更加开放的国际法的是",
+    //     "description": "fsklfdsk罚款乱收费上课了发送卡fsklfdsk罚款乱收费上课了发送卡fsklfdsk罚款乱收费上课了发送卡fsklfdsk罚款乱收费上课了发送卡fsklfdsk罚款乱收费上课了发送卡",
+    //     "time": "2024-02-15 12:00:00",
+    //     "isCollection": true,
+    //     "pic": "https://img1.baidu.com/it/u=2500825327,873404587&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500"
+    //   },
+    //   {
+    //     "id": 2,
+    //     "title": "JHKFDSAJKjfkdsfjkasjkjklfajfkajifwoqirujweiqofjndsaikfniasdhfiasdhfiadshfifjadslfjkdlsafjlkadsj",
+    //     "description": "oifosjf fjdskafj hjiwehfriohjfiash",
+    //     "time": "2024-10-16 12:00:00",
+    //     "isCollection": false,
+    //     "pic": ""
+    //   },
+    // ];
+    //
+    // if (state.page == 1) {
+    //   //刷新的方式
+    //   state = state.copyWith(list: listData);
+    //   refreshController.finishRefresh();
+    //   //更新展示的状态
+    //   changeLoadingState(LoadState.State_Success, null);
+    // } else {
+    //   //加载更多
+    //   final allList = state.list;
+    //   if(allList.length >= state.count! * state.limit!){
+    //     //更新展示的状态
+    //     changeLoadingState(LoadState.State_Success, null);
+    //     refreshController.finishLoad(IndicatorResult.noMore);
+    //   }else {
+    //     allList.addAll(listData);
+    //     state = state.copyWith(list: allList);
+    //     refreshController.finishLoad();
     //   }
+    // }
+    // // 最后赋值
+    // _needShowPlaceholder = false;
+  }
+
+  void handlerResultList(List? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (state.page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list as List<Map<String, dynamic>>);
+        refreshController.finishRefresh();
 
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        "id": 1,
-        "title": "法国进口高档国家的看过艰苦奋斗是感觉扣税的房价过快岁的法国艰苦奋斗是架构开发更加开放的国际法的是",
-        "description": "fsklfdsk罚款乱收费上课了发送卡fsklfdsk罚款乱收费上课了发送卡fsklfdsk罚款乱收费上课了发送卡fsklfdsk罚款乱收费上课了发送卡fsklfdsk罚款乱收费上课了发送卡",
-        "time": "2024-02-15 12:00:00",
-        "isCollection": true,
-        "pic": "https://img1.baidu.com/it/u=2500825327,873404587&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500"
-      },
-      {
-        "id": 2,
-        "title": "JHKFDSAJKjfkdsfjkasjkjklfajfkajifwoqirujweiqofjndsaikfniasdhfiasdhfiadshfifjadslfjkdlsafjlkadsj",
-        "description": "oifosjf fjdskafj hjiwehfriohjfiash",
-        "time": "2024-10-16 12:00:00",
-        "isCollection": false,
-        "pic": ""
-      },
-    ];
-
-    if (state.curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(list: listData);
-      refreshController.finishRefresh();
-      //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
-    } else {
-      //加载更多
-      final allList = state.list;
-      if(allList.length >= state.filterCount! * state.pageSize!){
         //更新展示的状态
         changeLoadingState(LoadState.State_Success, null);
-        refreshController.finishLoad(IndicatorResult.noMore);
-      }else {
-        allList.addAll(listData);
+      } else {
+        //加载更多
+        final allList = state.list;
         state = state.copyWith(list: allList);
         refreshController.finishLoad();
+        // update();
+      }
+    } 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);
+        }
+        refreshController.finishLoad(IndicatorResult.noMore);
       }
     }
-    // 最后赋值
-    _needShowPlaceholder = false;
   }
 
 
@@ -168,56 +200,38 @@ class PropertyNewsVm extends _$PropertyNewsVm {
   }
 
   // 收藏/取消收藏
-  void handlerCollection(curItem, bool isCollection){
-
-    List<Map<String, dynamic>> newList = state.list.map((item) {
-        if(item['id'] == curItem['id']){
-          return {
-            ...item,
-            'isCollection': !isCollection
-          };
+  void handlerCollection(curItem, bool liked) async {
+    try {
+      Map<String, dynamic> params = {
+        "id": curItem['id'],
+      };
+      final result = await propertyNewsRepository.fetchPropertyNewsLikeClick(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        List<Map<String, dynamic>>? newList = state.list?.map((item) {
+          if(item['id'] == curItem['id']){
+            return {
+              ...item,
+              'liked': !liked
+            };
+          }
+          return item;
+        }).toList();
+        // Log.d("handlerCollection $newList");
+        state = state.copyWith(list: newList);
+        if(liked){
+          ToastEngine.show("取消收藏");
+        }else {
+          ToastEngine.show("收藏成功");
         }
-        return item;
-    }).toList();
-    // Log.d("handlerCollection $newList");
-    state = state.copyWith(list: newList);
-    if(isCollection){
-      ToastEngine.show("取消收藏");
-    }else {
-      ToastEngine.show("收藏成功");
+      } else {
+        String errorMessage = result.errorMsg!;
+        ToastEngine.show(errorMessage ?? "Network Load Error");
+      }
+
+    } catch (e) {
+      ToastEngine.show("Error: $e");
     }
   }
 
-
-
-// 处理数据与展示的逻辑
-// void handleList(List<JobAppliedListSGRows>? list) {
-//   if (list != null && list.isNotEmpty) {
-//     //有数据,判断是刷新还是加载更多的数据
-//     if (_curPage == 1) {
-//       //刷新的方式
-//       state.list.clear();
-//       state.list.addAll(list);
-//       refreshController.finishRefresh();
-//
-//       //更新展示的状态
-//       changeLoadingState(LoadState.State_Success);
-//     } else {
-//       //加载更多
-//       state.list.addAll(list);
-//       refreshController.finishLoad();
-//       update();
-//     }
-//   } else {
-//     if (_curPage == 1) {
-//       //展示无数据的布局
-//       state.list.clear();
-//       changeLoadingState(LoadState.State_Empty);
-//       refreshController.finishRefresh();
-//     } else {
-//       //展示加载完成,没有更多数据了
-//       refreshController.finishLoad(IndicatorResult.noMore);
-//     }
-//   }
-// }
 }

+ 1 - 1
packages/cpt_property/lib/modules/news/vm/property_news_vm.g.dart

@@ -6,7 +6,7 @@ part of 'property_news_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$propertyNewsVmHash() => r'0a31694e75c48792b56b3e8bf7fbf442af24659a';
+String _$propertyNewsVmHash() => r'0cae6de1cd893ca95b0f8219b04f29c362f77a13';
 
 /// See also [PropertyNewsVm].
 @ProviderFor(PropertyNewsVm)

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

@@ -168,7 +168,7 @@ class PropertyRentPage extends HookConsumerWidget {
                 )
               ],
             ),
-          )
+          ).marginOnly(top: 5, bottom: 5)
       ),
     );
   }

+ 18 - 18
packages/cpt_property/lib/modules/rent/page/property_rent_state.dart

@@ -9,26 +9,26 @@ class PropertyRentState {
   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;
 
   PropertyRentState({
     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,
   });
   Map<String, dynamic> toMap() {
     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,
     };
   }
@@ -37,9 +37,9 @@ class PropertyRentState {
     return PropertyRentState(
       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>>,
     );
   }
@@ -47,17 +47,17 @@ class PropertyRentState {
   PropertyRentState copyWith({
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
   }) {
     return PropertyRentState(
       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,
     );
   }

+ 107 - 47
packages/cpt_property/lib/modules/rent/vm/property_rent_vm.dart

@@ -1,16 +1,19 @@
+import 'package:domain/entity/property_sale_entity.dart';
 import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod/src/framework.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
+import '../../sale/repository/property_sale_repository.dart';
 import '../page/property_rent_state.dart';
-import '../repository/property_rent_repository.dart';
 part 'property_rent_vm.g.dart';
 
 @riverpod
 class PropertyRentVm extends _$PropertyRentVm {
-  late PropertyRentRepository propertyRentRepository;
+  late PropertySaleRepository propertySaleRepository;
+
   bool _needShowPlaceholder = true; //是否展示LoadingView
 
   // Refresh 控制器
@@ -28,7 +31,8 @@ class PropertyRentVm extends _$PropertyRentVm {
   @override
   PropertyRentState build() {
     // 引入数据仓库
-    propertyRentRepository = ref.read(propertyRentRepositoryProvider);
+    propertySaleRepository = ref.read(propertySaleRepositoryProvider);
+    // 引入数据仓库
     // 初始化状态
     PropertyRentState state = initState();
     // 初始化列表数据
@@ -53,16 +57,16 @@ class PropertyRentVm extends _$PropertyRentVm {
   Future loadMore() 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();
   }
 
@@ -72,13 +76,13 @@ class PropertyRentVm extends _$PropertyRentVm {
     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();
   }
@@ -90,12 +94,12 @@ class PropertyRentVm extends _$PropertyRentVm {
       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);
@@ -115,44 +119,100 @@ class PropertyRentVm extends _$PropertyRentVm {
     //     ToastEngine.show("Error: $e");
     //   }
 
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        "id": 1,
-        "title": "Jul 2024  Blk XX #XX to XX 1,100 - 1,200 sqft",
-        "price": "\$4000",
-        "unit": "per month",
-      },
-      {
-        "id": 2,
-        "title": "Jul 2024  Blk XX #XX to XX 1,100 - 1,200 sqft",
-        "price": "\$4000",
-        "unit": "per month",
-      },
-    ];
-
-    if (state.curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(list: listData);
-      refreshController.finishRefresh();
-      //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
-    } else {
-      //加载更多
-      final allList = state.list;
-      if(allList.length >= state.filterCount! * state.pageSize!){
+    // await Future.delayed(const Duration(milliseconds: 1500));
+    // final List<Map<String, dynamic>> listData = [
+    //   {
+    //     "id": 1,
+    //     "title": "Jul 2024  Blk XX #XX to XX 1,100 - 1,200 sqft",
+    //     "price": "\$4000",
+    //     "unit": "per month",
+    //   },
+    //   {
+    //     "id": 2,
+    //     "title": "Jul 2024  Blk XX #XX to XX 1,100 - 1,200 sqft",
+    //     "price": "\$4000",
+    //     "unit": "per month",
+    //   },
+    // ];
+    //
+    // if (state.page == 1) {
+    //   //刷新的方式
+    //   state = state.copyWith(list: listData);
+    //   refreshController.finishRefresh();
+    //   //更新展示的状态
+    //   changeLoadingState(LoadState.State_Success, null);
+    // } else {
+    //   //加载更多
+    //   final allList = state.list;
+    //   if(allList.length >= state.count! * state.limit!){
+    //     //更新展示的状态
+    //     changeLoadingState(LoadState.State_Success, null);
+    //     refreshController.finishLoad(IndicatorResult.noMore, true);
+    //   }else {
+    //     allList.addAll(listData);
+    //     state = state.copyWith(list: allList);
+    //     refreshController.finishLoad();
+    //   }
+    // }
+    //
+    // // 最后赋值
+    // _needShowPlaceholder = false;
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "type": 2, // 1 sale 2 rent
+        "page": state.page,
+        "limit": state.limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await propertySaleRepository.fetchList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(count: (result.data as PropertySaleEntity).count);
+        handlerResultList((result.data as PropertySaleEntity).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 handlerResultList(List? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (state.page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list as List<Map<String, dynamic>>);
+        refreshController.finishRefresh();
+
         //更新展示的状态
         changeLoadingState(LoadState.State_Success, null);
-        refreshController.finishLoad(IndicatorResult.noMore, true);
-      }else {
-        allList.addAll(listData);
+      } else {
+        //加载更多
+        final allList = state.list;
         state = state.copyWith(list: allList);
         refreshController.finishLoad();
+        // update();
+      }
+    } 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);
+        }
+        refreshController.finishLoad(IndicatorResult.noMore);
       }
     }
-
-    // 最后赋值
-    _needShowPlaceholder = false;
   }
-
 }

+ 1 - 1
packages/cpt_property/lib/modules/rent/vm/property_rent_vm.g.dart

@@ -6,7 +6,7 @@ part of 'property_rent_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$propertyRentVmHash() => r'bc707e343a4e5db430176e316ff8ae3a0cfe4477';
+String _$propertyRentVmHash() => r'2e62b3a1a11cd5e3896b7fb46e2506a9273ef861';
 
 /// See also [PropertyRentVm].
 @ProviderFor(PropertyRentVm)

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

@@ -5,6 +5,7 @@ import 'package:auto_route/auto_route.dart';
 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/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:shared/utils/color_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
@@ -63,7 +64,7 @@ class PropertySalePage extends HookConsumerWidget {
           ),
         ),
         child:MyTextView(
-          item['price'],
+          '${item['units']}${item['price']}',
           fontSize: 17,
           textColor: context.appColors.textBlack,
           isFontMedium: true,

+ 18 - 18
packages/cpt_property/lib/modules/sale/page/property_sale_state.dart

@@ -9,17 +9,17 @@ class PropertySaleState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? curPage;
-  int? pageSize = 10;
-  int? filterCount = 1;
+  int? page;
+  int? limit = 10;
+  int? count = 1;
   List<Map<String, dynamic>> list;
 
   PropertySaleState({
     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,
     required this.list,
   });
 
@@ -27,9 +27,9 @@ class PropertySaleState {
     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,
     };
   }
@@ -37,9 +37,9 @@ class PropertySaleState {
     return PropertySaleState(
       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>>,
     );
   }
@@ -47,17 +47,17 @@ class PropertySaleState {
   PropertySaleState copyWith({
     LoadState? loadingState,
     String? errorMessage,
-    int? curPage,
-    int? pageSize,
-    int? filterCount,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
   }) {
     return PropertySaleState(
       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,
     );
   }

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

@@ -1,4 +1,5 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/property_sale_entity.dart';
 import 'package:domain/entity/server_time.dart';
 import 'package:plugin_platform/platform_export.dart';
 import 'package:plugin_platform/http/dio_engine.dart';
@@ -26,7 +27,7 @@ class PropertySaleRepository {
 
   PropertySaleRepository({required this.dioEngine});
 
-  Future<HttpResult<Object>> fetchPropertyNewsList(
+  Future<HttpResult<Object>> fetchList(
       Map<String, dynamic>? data, {
         CancelToken? cancelToken,
       }) async {
@@ -35,10 +36,8 @@ class PropertySaleRepository {
     // if (!Utils.isEmpty(type)) {
     //   params["type"] = type!;
     // }
-
     params = data!;
 
-
     Map<String, String> headers = {};
 
     headers["Content-Type"] = "application/x-www-form-urlencoded";
@@ -46,7 +45,7 @@ class PropertySaleRepository {
 
     final result = await dioEngine.requestNetResult(
       // ApiConstants.apiServerTime, // api 地址
-      '/index.php/api/employee/extra/time', // api 地址
+      '/api/v1/user/property/transaction/list', // api 地址
       params: params,
       headers: headers,
       method: HttpMethod.GET,
@@ -59,9 +58,9 @@ class PropertySaleRepository {
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = PropertySaleState.fromMap(json!);
+      var data = PropertySaleEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert<PropertySaleState>(data: data);
+      return result.convert<PropertySaleEntity>(data: data);
     }
     return result.convert();
   }

+ 99 - 41
packages/cpt_property/lib/modules/sale/vm/property_sale_vm.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/property_sale_entity.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
@@ -53,16 +54,16 @@ class PropertySaleVm extends _$PropertySaleVm {
   Future loadMore() 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();
   }
 
@@ -72,13 +73,13 @@ class PropertySaleVm extends _$PropertySaleVm {
     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();
   }
@@ -90,12 +91,12 @@ class PropertySaleVm extends _$PropertySaleVm {
       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);
@@ -115,42 +116,99 @@ class PropertySaleVm extends _$PropertySaleVm {
     //     ToastEngine.show("Error: $e");
     //   }
 
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        "id": 1,
-        "title": "18 Sep 2024 BIK 39#09-XX 1337 psd 1001 sqft",
-        "price": "\$1.338 M",
-      },
-      {
-        "id": 2,
-        "title": "18 Sep 2024 BIK 39#09-XX 1337 psd 1001 sqft",
-        "price": "\$1.338 M",
-      },
-    ];
-
-    if (state.curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(list: listData);
-      refreshController.finishRefresh();
-      //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
-    } else {
-      //加载更多
-      final allList = state.list;
-      if(allList.length >= state.filterCount! * state.pageSize!){
+    // await Future.delayed(const Duration(milliseconds: 1500));
+    // final List<Map<String, dynamic>> listData = [
+    //   {
+    //     "id": 1,
+    //     "title": "18 Sep 2024 BIK 39#09-XX 1337 psd 1001 sqft",
+    //     "price": "\$1.338 M",
+    //   },
+    //   {
+    //     "id": 2,
+    //     "title": "18 Sep 2024 BIK 39#09-XX 1337 psd 1001 sqft",
+    //     "price": "\$1.338 M",
+    //   },
+    // ];
+    //
+    // if (state.page == 1) {
+    //   //刷新的方式
+    //   state = state.copyWith(list: listData);
+    //   refreshController.finishRefresh();
+    //   //更新展示的状态
+    //   changeLoadingState(LoadState.State_Success, null);
+    // } else {
+    //   //加载更多
+    //   final allList = state.list;
+    //   if(allList.length >= state.count! * state.limit!){
+    //     //更新展示的状态
+    //     changeLoadingState(LoadState.State_Success, null);
+    //     refreshController.finishLoad(IndicatorResult.noMore, true);
+    //   }else {
+    //     allList.addAll(listData);
+    //     state = state.copyWith(list: allList);
+    //     refreshController.finishLoad();
+    //   }
+    // }
+    //
+    // // 最后赋值
+    // _needShowPlaceholder = false;
+
+
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "type": 1, // 1 sale 2 rent
+        "page": state.page,
+        "limit": state.limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await propertySaleRepository.fetchList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(count: (result.data as PropertySaleEntity).count);
+        handlerResultList((result.data as PropertySaleEntity).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 handlerResultList(List? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (state.page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list as List<Map<String, dynamic>>);
+        refreshController.finishRefresh();
         //更新展示的状态
         changeLoadingState(LoadState.State_Success, null);
-        refreshController.finishLoad(IndicatorResult.noMore, true);
-      }else {
-        allList.addAll(listData);
+      } 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);
+        }
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
     }
-
-    // 最后赋值
-    _needShowPlaceholder = false;
   }
 
 }

+ 1 - 1
packages/cpt_property/lib/modules/sale/vm/property_sale_vm.g.dart

@@ -6,7 +6,7 @@ part of 'property_sale_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$propertySaleVmHash() => r'19d1b7d65dc326d454df74af5fd9d7632d795811';
+String _$propertySaleVmHash() => r'8a612924f792107d19776759ce44c7e5a4bac9cb';
 
 /// See also [PropertySaleVm].
 @ProviderFor(PropertySaleVm)

+ 5 - 2
packages/cpt_property/pubspec.yaml

@@ -69,8 +69,11 @@ dev_dependencies:
   # AutoRouter 生成代码
   auto_route_generator: ^8.0.0
 
-  # json序列化
-  freezed: ^2.2.0
+#  # json序列化
+#  freezed: ^2.2.0
+
+  # json 序列化和反序列化
+#  json_annotation: ^4.8.0
 
 
 flutter:

+ 0 - 33
packages/cpt_rewards/lib/modules/rewards/page/rewards_page.dart

@@ -1,33 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:auto_route/auto_route.dart';
-import 'package:hooks_riverpod/hooks_riverpod.dart';
-import 'package:router/ext/auto_router_extensions.dart';
-
-import '../../../router/page/rewards_page_router.dart';
-import '../../rewards/vm/rewards_view_model.dart';
-
-@RoutePage()
-class RewardsPage extends HookConsumerWidget {
-  const RewardsPage({Key? key}) : super(key: key);
-
-  //启动当前页面
-  static void startInstance({BuildContext? context}) {
-    if (context != null) {
-      context.router.push(const RewardsPageRoute());
-    } else {
-      appRouter.push(const RewardsPageRoute());
-    }
-  }
-
-  @override
-  Widget build(BuildContext context, WidgetRef ref) {
-    final _viewModel = ref.read(rewardsViewModelProvider.notifier);
-
-    return Scaffold(
-      appBar: AppBar(title: Text("奖励")),
-      body: Center(
-        child: Text("奖励的主页面"),
-      ),
-    );
-  }
-}

+ 918 - 0
packages/cpt_rewards/lib/modules/rewards/rewards_page.dart

@@ -0,0 +1,918 @@
+import 'package:cpt_rewards/modules/rewards_address/rewards_address_page.dart';
+import 'package:cpt_rewards/modules/rewards_code/rewards_code_page.dart';
+import 'package:cpt_rewards/modules/rewards_history/rewards_history_page.dart';
+import 'package:cpt_rewards/modules/rewards_home/rewards_home_page.dart';
+import 'package:cpt_rewards/modules/rewards_list/rewards_list_page.dart';
+import 'package:cpt_rewards/modules/rewards_my/rewards_my_page.dart';
+import 'package:cs_resources/generated/assets.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_platform/engine/image/image_nine_grid.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_vm.dart';
+
+@RoutePage()
+class RewardsPage extends HookConsumerWidget {
+  const RewardsPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsPageRoute());
+    } else {
+      appRouter.push(const RewardsPageRoute());
+    }
+  }
+
+  Widget _buildTop(BuildContext context, WidgetRef ref, _vm) {
+    // List itemsList = _vm.state.list.toList();
+    return Container(
+        decoration: BoxDecoration(
+          border: Border(
+              bottom: BorderSide(
+            color: ColorUtils.string2Color('#4161D0'), // 设置bottom边框的颜色
+            width: 45.0, // 设置bottom边框的宽度
+          )),
+          borderRadius: const BorderRadius.only(
+            topLeft: Radius.circular(0.0),
+            topRight: Radius.circular(0.0),
+            bottomLeft: Radius.circular(30.0),
+            bottomRight: Radius.circular(30.0),
+          ), // 圆角
+        ),
+        child: Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            const MyAssetImage(
+              Assets.rewardsRewardsBack,
+              width: 44,
+              height: 44,
+            ),
+            // const Text(
+            //   '1526 Available Points',
+            //   style: TextStyle(
+            //       fontSize: 18.0,
+            //       color: Colors.white,
+            //       fontWeight: FontWeight.w500), // 设置字体大小
+            // ).paddingOnly(left: 10, top: 20, bottom: 18),
+            Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                const Text(
+                  'Available Points',
+                  style: TextStyle(
+                      fontSize: 17.0,
+                      color: Colors.white,
+                      fontWeight: FontWeight.w500), // 设置字体大小
+                ),
+                Container(
+                  decoration: BoxDecoration(
+                    border: Border.all(color: Colors.white, width: 1), // 边框
+                    borderRadius: BorderRadius.circular(8), // 圆角
+                  ),
+                  child: Row(
+                    children: [
+                      const MyAssetImage(
+                        Assets.rewardsRewardsIconJb,
+                        width: 23,
+                        height: 23,
+                      ).marginOnly(right: 5),
+                      const Text(
+                        '1022',
+                        style: TextStyle(
+                            fontSize: 15.0,
+                            color: Colors.white,
+                            fontWeight: FontWeight.w400), // 设置字体大小
+                      ),
+                    ],
+                  ).paddingOnly(left: 10, top: 7, bottom: 7, right: 10),
+                ),
+              ],
+            ).paddingOnly(left: 10, top: 20, bottom: 18),
+          ],
+        )
+            .paddingOnly(top: 15, left: 5, right: 15, bottom: 0)
+            .border(bottom: 0, color: ColorUtils.string2Color('#4161D0'))
+            .backgroundColor(ColorUtils.string2Color('#4161D0')));
+  }
+
+  Widget _buildSearch(BuildContext context, WidgetRef ref, _vm) {
+    // List itemsList = _vm.state.list.toList();
+    return Container(
+      width: MediaQuery.of(context).size.width - 30,
+      decoration: BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.circular(10),
+        boxShadow: const [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Column(
+        crossAxisAlignment: CrossAxisAlignment.start,
+        mainAxisAlignment: MainAxisAlignment.center,
+        children: [
+          Text(
+            'Continuous Login 8 Day',
+            style: TextStyle(
+                fontSize: 15.0,
+                color: ColorUtils.string2Color('#000000'),
+                fontWeight: FontWeight.w500), // 设置字体大小
+          ),
+          Flex(
+            direction: Axis.horizontal,
+            children: [
+              Expanded(
+                flex: 1,
+                child: Container(
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#F2F3F6'),
+                    borderRadius: BorderRadius.circular(10),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#4161D0'), width: 1),
+                  ),
+                  height: 78,
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.center,
+                    children: [
+                      Text(
+                        '11/01',
+                        style: TextStyle(
+                            fontSize: 13.0,
+                            color: ColorUtils.string2Color('#4161D0'),
+                            fontWeight: FontWeight.w400), // 设置字体大小
+                      ),
+                      const MyAssetImage(
+                        Assets.rewardsRewardsIconJb,
+                        width: 23,
+                        height: 23,
+                      ),
+                      Text(
+                        '+2',
+                        style: TextStyle(
+                            fontSize: 15.0,
+                            color: ColorUtils.string2Color('#4161D0'),
+                            fontWeight: FontWeight.w500), // 设置字体大小
+                      ),
+                    ],
+                  ),
+                ),
+              ),
+              const SizedBox(width: 15.0),
+              Expanded(
+                flex: 1,
+                child: Container(
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#4161D0'),
+                    borderRadius: BorderRadius.circular(10),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#4161D0'), width: 1),
+                  ),
+                  height: 78,
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.center,
+                    children: [
+                      Text(
+                        'Today',
+                        style: TextStyle(
+                            fontSize: 13.0,
+                            color: ColorUtils.string2Color('#ffffff'),
+                            fontWeight: FontWeight.w400), // 设置字体大小
+                      ),
+                      const MyAssetImage(
+                        Assets.rewardsRewardsIconJb,
+                        width: 23,
+                        height: 23,
+                      ),
+                      Text(
+                        '+2',
+                        style: TextStyle(
+                            fontSize: 15.0,
+                            color: ColorUtils.string2Color('#ffffff'),
+                            fontWeight: FontWeight.w500), // 设置字体大小
+                      ),
+                    ],
+                  ),
+                ),
+              ),
+              const SizedBox(width: 15.0),
+              Expanded(
+                flex: 1,
+                child: Container(
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#F2F3F6'),
+                    borderRadius: BorderRadius.circular(10),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#F2F3F6'), width: 1),
+                  ),
+                  height: 78,
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.center,
+                    children: [
+                      Text(
+                        'Today',
+                        style: TextStyle(
+                            fontSize: 13.0,
+                            color: ColorUtils.string2Color('#000000'),
+                            fontWeight: FontWeight.w400), // 设置字体大小
+                      ),
+                      const MyAssetImage(
+                        Assets.rewardsRewardsIconJb,
+                        width: 23,
+                        height: 23,
+                      ),
+                      Text(
+                        '+2',
+                        style: TextStyle(
+                            fontSize: 15.0,
+                            color: ColorUtils.string2Color('#000000'),
+                            fontWeight: FontWeight.w500), // 设置字体大小
+                      ),
+                    ],
+                  ),
+                ),
+              ),
+              const SizedBox(width: 15.0),
+              Expanded(
+                flex: 1,
+                child: Container(
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#F2F3F6'),
+                    borderRadius: BorderRadius.circular(10),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#F2F3F6'), width: 1),
+                  ),
+                  height: 78,
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.center,
+                    children: [
+                      Text(
+                        'Today',
+                        style: TextStyle(
+                            fontSize: 13.0,
+                            color: ColorUtils.string2Color('#000000'),
+                            fontWeight: FontWeight.w400), // 设置字体大小
+                      ),
+                      const MyAssetImage(
+                        Assets.rewardsRewardsIconJb,
+                        width: 23,
+                        height: 23,
+                      ),
+                      Text(
+                        '+2',
+                        style: TextStyle(
+                            fontSize: 15.0,
+                            color: ColorUtils.string2Color('#000000'),
+                            fontWeight: FontWeight.w500), // 设置字体大小
+                      ),
+                    ],
+                  ),
+                ),
+              ),
+            ],
+          ).marginOnly(top: 13, bottom: 13),
+          Flex(
+            direction: Axis.horizontal,
+            children: [
+              Expanded(
+                flex: 1,
+                child: Container(
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#F2F3F6'),
+                    borderRadius: BorderRadius.circular(10),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#F2F3F6'), width: 1),
+                  ),
+                  height: 78,
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.center,
+                    children: [
+                      Text(
+                        'Today',
+                        style: TextStyle(
+                            fontSize: 13.0,
+                            color: ColorUtils.string2Color('#000000'),
+                            fontWeight: FontWeight.w400), // 设置字体大小
+                      ),
+                      const MyAssetImage(
+                        Assets.rewardsRewardsIconJb,
+                        width: 23,
+                        height: 23,
+                      ),
+                      Text(
+                        '+2',
+                        style: TextStyle(
+                            fontSize: 15.0,
+                            color: ColorUtils.string2Color('#000000'),
+                            fontWeight: FontWeight.w500), // 设置字体大小
+                      ),
+                    ],
+                  ),
+                ),
+              ),
+              const SizedBox(width: 15.0),
+              Expanded(
+                flex: 1,
+                child: Container(
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#F2F3F6'),
+                    borderRadius: BorderRadius.circular(10),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#F2F3F6'), width: 1),
+                  ),
+                  height: 78,
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.center,
+                    children: [
+                      Text(
+                        'Today',
+                        style: TextStyle(
+                            fontSize: 13.0,
+                            color: ColorUtils.string2Color('#000000'),
+                            fontWeight: FontWeight.w400), // 设置字体大小
+                      ),
+                      const MyAssetImage(
+                        Assets.rewardsRewardsIconJb,
+                        width: 23,
+                        height: 23,
+                      ),
+                      Text(
+                        '+2',
+                        style: TextStyle(
+                            fontSize: 15.0,
+                            color: ColorUtils.string2Color('#000000'),
+                            fontWeight: FontWeight.w500), // 设置字体大小
+                      ),
+                    ],
+                  ),
+                ),
+              ),
+              const SizedBox(width: 15.0),
+              Expanded(
+                flex: 2,
+                child: Container(
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#F2F3F6'),
+                    borderRadius: BorderRadius.circular(10),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#F2F3F6'), width: 1),
+                  ),
+                  height: 78,
+                  child: Row(
+                    crossAxisAlignment: CrossAxisAlignment.start,
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                    children: [
+                      Column(
+                        crossAxisAlignment: CrossAxisAlignment.center,
+                        // mainAxisAlignment: MainAxisAlignment.center,
+                        children: [
+                          Text(
+                            'Today',
+                            style: TextStyle(
+                                fontSize: 13.0,
+                                color: ColorUtils.string2Color('#000000'),
+                                fontWeight: FontWeight.w400), // 设置字体大小
+                          ),
+                          Text(
+                            '+ More',
+                            style: TextStyle(
+                                fontSize: 12.0,
+                                color: ColorUtils.string2Color('#000000'),
+                                fontWeight: FontWeight.w500), // 设置字体大小
+                          ),
+                        ],
+                      ),
+                      const MyAssetImage(
+                        Assets.rewardsRewardsIconYdjb,
+                        width: 67,
+                        height: 57,
+                      ).paddingOnly(top: 7),
+                    ],
+                  ).paddingOnly(top: 8, left: 13, right: 4),
+                ),
+              ),
+            ],
+          ),
+        ],
+      ).paddingOnly(left: 15, right: 15, top: 15, bottom: 15),
+    );
+  }
+
+  Widget _buildSwiper(BuildContext context, WidgetRef ref, _vm) {
+    return Container(
+      // color: Colors.white,
+      height: 55,
+      decoration: BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.circular(10),
+        boxShadow: const [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Row(
+        crossAxisAlignment: CrossAxisAlignment.center,
+        mainAxisAlignment: MainAxisAlignment.spaceBetween,
+        children: [
+          Text(
+            'How To Get Rewards?',
+            style: TextStyle(
+                fontSize: 15.0,
+                color: ColorUtils.string2Color('#000000'),
+                fontWeight: FontWeight.w500), // 设置字体大小
+          ),
+          Container(
+            padding:
+                const EdgeInsets.only(top: 10, bottom: 10, left: 17, right: 17),
+            decoration: BoxDecoration(
+              color: ColorUtils.string2Color('#4161D0'),
+              borderRadius: BorderRadius.circular(5),
+            ),
+            child: Text(
+              'Rewards',
+              style: TextStyle(
+                  fontSize: 14.0,
+                  color: ColorUtils.string2Color('#ffffff'),
+                  fontWeight: FontWeight.w400), // 设置字体大小
+            ).onTap(() {
+              RewardsHomePage.startInstance();
+            }),
+          ),
+        ],
+      ).paddingOnly(left: 15, right: 15),
+    ).marginOnly(top: 12, bottom: 12);
+  }
+
+  Widget _buildList(BuildContext context, WidgetRef ref, _vm) {
+    return Container(
+      decoration: BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.circular(10),
+        boxShadow: const [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Column(
+        crossAxisAlignment: CrossAxisAlignment.center,
+        mainAxisAlignment: MainAxisAlignment.center,
+        children: [
+          Container(
+            padding:
+                const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
+            decoration: BoxDecoration(
+                border: Border(
+                    bottom: BorderSide(
+              width: 1.0, // 底边边框的宽度
+              color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+            ))),
+            child: Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                Row(
+                  children: [
+                    Container(
+                      padding: const EdgeInsets.only(
+                          top: 10, bottom: 10, left: 17, right: 17),
+                      decoration: BoxDecoration(
+                        color: ColorUtils.string2Color('#f2f3f6'),
+                        borderRadius: BorderRadius.circular(5),
+                      ),
+                      child: const MyAssetImage(
+                        Assets.rewardsRewardsIconIm,
+                        width: 29,
+                        height: 24,
+                      ),
+                    ).marginOnly(right: 12),
+                    Column(
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                      mainAxisAlignment: MainAxisAlignment.center,
+                      children: [
+                        Text(
+                          'Daily Login',
+                          style: TextStyle(
+                              fontSize: 15.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w500), // 设置字体大小
+                        ).marginOnly(bottom: 6),
+                        Row(
+                          children: [
+                            Text(
+                              '+2',
+                              style: TextStyle(
+                                  fontSize: 15.0,
+                                  color: ColorUtils.string2Color('#4161D0'),
+                                  fontWeight: FontWeight.w500), // 设置字体大小
+                            ),
+                            const MyAssetImage(
+                              Assets.rewardsRewardsIconJb,
+                              width: 14,
+                              height: 14,
+                            )
+                          ],
+                        )
+                      ],
+                    )
+                  ],
+                ),
+                Container(
+                  width: 86,
+                  height: 30,
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#ffffff'),
+                    borderRadius: BorderRadius.circular(5),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#4161D0'), width: 1),
+                  ),
+                  child: Center(
+                    child: Text(
+                      'Check In',
+                      style: TextStyle(
+                          fontSize: 14.0,
+                          color: ColorUtils.string2Color('#4161D0'),
+                          fontWeight: FontWeight.w400), // 设置字体大小
+                    ),
+                  ),
+                ),
+              ],
+            ),
+          ),
+          Container(
+            padding:
+                const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
+            decoration: BoxDecoration(
+                border: Border(
+                    bottom: BorderSide(
+              width: 1.0, // 底边边框的宽度
+              color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+            ))),
+            child: Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                Row(
+                  children: [
+                    Container(
+                      padding: const EdgeInsets.only(
+                          top: 10, bottom: 10, left: 17, right: 17),
+                      decoration: BoxDecoration(
+                        color: ColorUtils.string2Color('#f2f3f6'),
+                        borderRadius: BorderRadius.circular(5),
+                      ),
+                      child: const MyAssetImage(
+                        Assets.rewardsRewardsIconIm,
+                        width: 29,
+                        height: 24,
+                      ),
+                    ).marginOnly(right: 12),
+                    Column(
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                      mainAxisAlignment: MainAxisAlignment.center,
+                      children: [
+                        Text(
+                          'Daily Login',
+                          style: TextStyle(
+                              fontSize: 15.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w500), // 设置字体大小
+                        ).marginOnly(bottom: 6),
+                        Row(
+                          children: [
+                            Text(
+                              '+2',
+                              style: TextStyle(
+                                  fontSize: 15.0,
+                                  color: ColorUtils.string2Color('#4161D0'),
+                                  fontWeight: FontWeight.w500), // 设置字体大小
+                            ),
+                            const MyAssetImage(
+                              Assets.rewardsRewardsIconJb,
+                              width: 14,
+                              height: 14,
+                            )
+                          ],
+                        )
+                      ],
+                    )
+                  ],
+                ),
+                Container(
+                  width: 86,
+                  height: 30,
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#ffffff'),
+                    borderRadius: BorderRadius.circular(5),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#4161D0'), width: 1),
+                  ),
+                  child: Center(
+                    child: Text(
+                      'Check In',
+                      style: TextStyle(
+                          fontSize: 14.0,
+                          color: ColorUtils.string2Color('#4161D0'),
+                          fontWeight: FontWeight.w400), // 设置字体大小
+                    ),
+                  ),
+                ),
+              ],
+            ),
+          ),
+          Container(
+            padding:
+                const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
+            decoration: BoxDecoration(
+                border: Border(
+                    bottom: BorderSide(
+              width: 1.0, // 底边边框的宽度
+              color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+            ))),
+            child: Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                Row(
+                  children: [
+                    Container(
+                      padding: const EdgeInsets.only(
+                          top: 10, bottom: 10, left: 17, right: 17),
+                      decoration: BoxDecoration(
+                        color: ColorUtils.string2Color('#f2f3f6'),
+                        borderRadius: BorderRadius.circular(5),
+                      ),
+                      child: const MyAssetImage(
+                        Assets.rewardsRewardsIconIm,
+                        width: 29,
+                        height: 24,
+                      ),
+                    ).marginOnly(right: 12),
+                    Column(
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                      mainAxisAlignment: MainAxisAlignment.center,
+                      children: [
+                        Text(
+                          'Daily Login',
+                          style: TextStyle(
+                              fontSize: 15.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w500), // 设置字体大小
+                        ).marginOnly(bottom: 6),
+                        Row(
+                          children: [
+                            Text(
+                              '+2',
+                              style: TextStyle(
+                                  fontSize: 15.0,
+                                  color: ColorUtils.string2Color('#4161D0'),
+                                  fontWeight: FontWeight.w500), // 设置字体大小
+                            ),
+                            const MyAssetImage(
+                              Assets.rewardsRewardsIconJb,
+                              width: 14,
+                              height: 14,
+                            )
+                          ],
+                        )
+                      ],
+                    )
+                  ],
+                ),
+                Container(
+                  width: 86,
+                  height: 30,
+                  decoration: BoxDecoration(
+                    color: ColorUtils.string2Color('#ffffff'),
+                    borderRadius: BorderRadius.circular(5),
+                    border: Border.all(
+                        color: ColorUtils.string2Color('#4161D0'), width: 1),
+                  ),
+                  child: Center(
+                    child: Text(
+                      'Check In',
+                      style: TextStyle(
+                          fontSize: 14.0,
+                          color: ColorUtils.string2Color('#4161D0'),
+                          fontWeight: FontWeight.w400), // 设置字体大小
+                    ),
+                  ),
+                ),
+              ],
+            ),
+          )
+        ],
+      ),
+    ).marginOnly(bottom: 12);
+  }
+
+  Widget _buildHistory(BuildContext context, WidgetRef ref, _vm) {
+    return Container(
+      decoration: BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.circular(10),
+        boxShadow: const [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Column(
+        crossAxisAlignment: CrossAxisAlignment.center,
+        mainAxisAlignment: MainAxisAlignment.center,
+        children: [
+          Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                Text(
+                  'Points History',
+                  style: TextStyle(
+                      fontSize: 15.0,
+                      color: ColorUtils.string2Color('#000000'),
+                      fontWeight: FontWeight.w500), // 设置字体大小
+                ),
+                Text(
+                  'More >',
+                  style: TextStyle(
+                      fontSize: 15.0,
+                      color: ColorUtils.string2Color('#4161D0'),
+                      fontWeight: FontWeight.w500), // 设置字体大小
+                ).onTap(() {
+                  RewardsHistoryPage.startInstance();
+                })
+              ]).paddingOnly(left: 15, right: 15, top: 15, bottom: 5),
+          Container(
+            padding:
+                const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
+            decoration: BoxDecoration(
+                border: Border(
+                    bottom: BorderSide(
+              width: 1.0, // 底边边框的宽度
+              color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+            ))),
+            child: Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                Column(
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  children: [
+                    Text(
+                      'Daily Login',
+                      style: TextStyle(
+                          fontSize: 15.0,
+                          color: ColorUtils.string2Color('#000000'),
+                          fontWeight: FontWeight.w500), // 设置字体大小
+                    ).marginOnly(bottom: 6),
+                    Text(
+                      '14 Oct 2024  10:00PM',
+                      style: TextStyle(
+                          fontSize: 13.0,
+                          color: ColorUtils.string2Color('#808DAF'),
+                          fontWeight: FontWeight.w400), // 设置字体大小
+                    ),
+                  ],
+                ),
+                Text(
+                  '+2',
+                  style: TextStyle(
+                      fontSize: 20.0,
+                      color: ColorUtils.string2Color('#FDB429'),
+                      fontWeight: FontWeight.w500), // 设置字体大小
+                ),
+              ],
+            ),
+          ),
+          Container(
+            padding:
+                const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
+            decoration: BoxDecoration(
+                border: Border(
+                    bottom: BorderSide(
+              width: 1.0, // 底边边框的宽度
+              color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+            ))),
+            child: Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                Column(
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  children: [
+                    Text(
+                      'Daily Login',
+                      style: TextStyle(
+                          fontSize: 15.0,
+                          color: ColorUtils.string2Color('#000000'),
+                          fontWeight: FontWeight.w500), // 设置字体大小
+                    ).marginOnly(bottom: 6),
+                    Text(
+                      '14 Oct 2024  10:00PM',
+                      style: TextStyle(
+                          fontSize: 13.0,
+                          color: ColorUtils.string2Color('#808DAF'),
+                          fontWeight: FontWeight.w400), // 设置字体大小
+                    ),
+                  ],
+                ),
+                Text(
+                  '+2',
+                  style: TextStyle(
+                      fontSize: 20.0,
+                      color: ColorUtils.string2Color('#FDB429'),
+                      fontWeight: FontWeight.w500), // 设置字体大小
+                ),
+              ],
+            ),
+          ),
+          Container(
+            padding:
+                const EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15),
+            decoration: BoxDecoration(
+                border: Border(
+                    bottom: BorderSide(
+              width: 1.0, // 底边边框的宽度
+              color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+            ))),
+            child: Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                Column(
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  children: [
+                    Text(
+                      'Daily Login',
+                      style: TextStyle(
+                          fontSize: 15.0,
+                          color: ColorUtils.string2Color('#000000'),
+                          fontWeight: FontWeight.w500), // 设置字体大小
+                    ).marginOnly(bottom: 6),
+                    Text(
+                      '14 Oct 2024  10:00PM',
+                      style: TextStyle(
+                          fontSize: 13.0,
+                          color: ColorUtils.string2Color('#808DAF'),
+                          fontWeight: FontWeight.w400), // 设置字体大小
+                    ),
+                  ],
+                ),
+                Text(
+                  '+2',
+                  style: TextStyle(
+                      fontSize: 20.0,
+                      color: ColorUtils.string2Color('#FDB429'),
+                      fontWeight: FontWeight.w500), // 设置字体大小
+                ),
+              ],
+            ),
+          ),
+        ],
+      ),
+    ).marginOnly(bottom: 12);
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsVmProvider.notifier);
+
+    return Scaffold(
+      // appBar: AppBar(title: Text("奖励")),
+      body: Column(children: [
+        Expanded(
+          child: SingleChildScrollView(
+              scrollDirection: Axis.vertical,
+              physics: const BouncingScrollPhysics(),
+              clipBehavior: Clip.none,
+              child: Column(
+                children: [
+                  _buildTop(context, ref, _vm),
+                  Container(
+                    transform: Matrix4.translationValues(0.0, -45.0, 0.0),
+                    child: Column(
+                      children: [
+                        _buildSearch(context, ref, _vm),
+                        _buildSwiper(context, ref, _vm),
+                        _buildList(context, ref, _vm),
+                        _buildHistory(context, ref, _vm),
+                      ],
+                    ), // 使用负数margin
+                  ).paddingOnly(left: 15, right: 15),
+                ],
+              )),
+        ),
+      ]).backgroundColor(ColorUtils.string2Color('#F2F3F6')),
+    );
+  }
+}

+ 8 - 8
packages/cpt_property/lib/modules/rent/repository/property_rent_repository.dart

@@ -9,22 +9,22 @@ import 'package:shared/utils/util.dart';
 import 'package:flutter_riverpod/flutter_riverpod.dart';
 import 'package:plugin_basic/provider/http_provider/http_provider.dart';
 
-import '../page/property_rent_state.dart';
-part 'property_rent_repository.g.dart';
+import './rewards_state.dart';
+part 'rewards_repository.g.dart';
 
 @Riverpod(keepAlive: true)
-PropertyRentRepository propertyRentRepository(Ref ref) {
+RewardsRepository rewardsRepository(Ref ref) {
   final dioEngine = ref.watch(dioEngineProvider);
-  return PropertyRentRepository(dioEngine: dioEngine);
+  return RewardsRepository(dioEngine: dioEngine);
 }
 
 /*
  * 数据仓库
  */
-class PropertyRentRepository {
+class RewardsRepository {
   DioEngine dioEngine;
 
-  PropertyRentRepository({required this.dioEngine});
+  RewardsRepository({required this.dioEngine});
 
   Future<HttpResult<Object>> fetchPropertyNewsList(
       Map<String, dynamic>? data, {
@@ -59,9 +59,9 @@ class PropertyRentRepository {
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = PropertyRentState.fromMap(json!);
+      var data = RewardsState.fromJson(json!);
       //重新赋值data或list
-      return result.convert<PropertyRentState>(data: data);
+      return result.convert<RewardsState>(data: data);
     }
     return result.convert();
   }

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards/rewards_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsRepository].
+@ProviderFor(rewardsRepository)
+final rewardsRepositoryProvider = Provider<RewardsRepository>.internal(
+  rewardsRepository,
+  name: r'rewardsRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsRepositoryRef = ProviderRef<RewardsRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards/rewards_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsState rewardsStateFromJson(String str) => RewardsState.fromJson(json.decode(str));
+
+String rewardsStateToJson(RewardsState data) => json.encode(data.toJson());
+
+class RewardsState {
+  RewardsState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsState.fromJson(Map<dynamic, dynamic> json) => RewardsState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 108 - 0
packages/cpt_rewards/lib/modules/rewards/rewards_vm.dart

@@ -0,0 +1,108 @@
+import 'package:flutter/material.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:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import './rewards_state.dart';
+import './rewards_repository.dart';
+part 'rewards_vm.g.dart';
+
+@riverpod
+class RewardsVm extends _$RewardsVm {
+  late RewardsRepository rewardsRepository;
+  RewardsState initState() {
+    return RewardsState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsState build() {
+    // 引入数据仓库
+    rewardsRepository = ref.read(rewardsRepositoryProvider);
+    // 初始化状态
+    RewardsState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result =
+          await rewardsRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards/rewards_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsVm].
+@ProviderFor(RewardsVm)
+final rewardsVmProvider =
+    AutoDisposeNotifierProvider<RewardsVm, RewardsState>.internal(
+  RewardsVm.new,
+  name: r'rewardsVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsVm = AutoDisposeNotifier<RewardsState>;
+// 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

+ 0 - 14
packages/cpt_rewards/lib/modules/rewards/vm/rewards_view_model.dart

@@ -1,14 +0,0 @@
-
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-
-part 'rewards_view_model.g.dart';
-
-@riverpod
-class RewardsViewModel extends _$RewardsViewModel {
-
-  @override
-  void build(){
-
-  }
-
-}

+ 170 - 0
packages/cpt_rewards/lib/modules/rewards_address/rewards_address_page.dart

@@ -0,0 +1,170 @@
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_appbar.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/shatter/picker_container.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:cs_resources/generated/assets.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_address_vm.dart';
+
+@RoutePage()
+class RewardsAddressPage extends HookConsumerWidget {
+  const RewardsAddressPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsAddressPageRoute());
+    } else {
+      appRouter.push(const RewardsAddressPageRoute());
+    }
+  }
+
+  Widget _buildItemLeftSection(BuildContext context, WidgetRef ref, item, _vm) {
+    return Column(
+      children: [
+        Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            const Text(
+              maxLines: 1, // 设置最大行数为2
+              overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+              'Delibowl Group',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: Colors.black,
+                  fontWeight: FontWeight.w500),
+            ),
+            Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.center,
+              children: [
+                const MyAssetImage(
+                  Assets.rewardsRewardsIconAddes,
+                  width: 15,
+                  height: 19,
+                ).marginOnly(right: 10),
+                const Expanded(
+                  child: Text(
+                    maxLines: 2, // 设置最大行数为2
+                    overflow: TextOverflow.ellipsis,
+                    softWrap: true, // 启用自动换行
+                    '176 Orchard Rd, #02-29/30 Song Fa Bak Kut Teh The Centrepoint, Singapore 238843',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: Color.fromARGB(255, 69, 33, 33),
+                        fontWeight: FontWeight.w400),
+                  ),
+                ),
+              ],
+            ).marginOnly(top: 10, bottom: 10),
+            Container(
+              height: 40,
+              decoration: BoxDecoration(
+                color: Colors.white,
+                borderRadius: const BorderRadius.all(Radius.circular(6.0)),
+                border: Border.all(
+                    color: ColorUtils.string2Color('#4161D0'), width: 1.0),
+              ),
+              child: Center(
+                child: Text(
+                  '+65 26593458',
+                  style: TextStyle(
+                      fontSize: 15.0,
+                      color: ColorUtils.string2Color('#4161D0'),
+                      fontWeight: FontWeight.w500),
+                ),
+              ),
+            ),
+          ],
+        ),
+      ],
+    );
+  }
+
+  // listitem
+  Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      decoration: const BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.all(Radius.circular(6.0)),
+        boxShadow: [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Column(
+        children: [
+          SizedBox(
+            width: MediaQuery.of(context).size.width - 30,
+            height: 160,
+            // margin: const EdgeInsets.only(left: 15, right: 15, top: 12.5),
+            child: Column(
+              crossAxisAlignment: CrossAxisAlignment.start,
+              mainAxisAlignment: MainAxisAlignment.start,
+              children: [_buildItemLeftSection(context, ref, item, _vm)],
+            ).paddingOnly(left: 20, right: 20, top: 15),
+          ).constrained(
+            minHeight: 160,
+          ),
+        ],
+      ),
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  // list
+  Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
+    List itemsList = _vm.state.list.toList();
+    return ListView.builder(
+      itemCount: itemsList.length,
+      itemBuilder: (context, index) {
+        return _buildSaleItem(context, ref, itemsList[index], _vm);
+      },
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsAddressVmProvider.notifier);
+    final state = ref.watch(rewardsAddressVmProvider);
+    return Scaffold(
+      appBar: MyAppBar.appBar(
+        context,
+        "Redeem Deal At",
+        backgroundColor: context.appColors.whiteBG,
+      ),
+      body: Container(
+        child: Column(
+          children: [
+            Expanded(
+              child: EasyRefresh(
+                // 上拉加载
+                onLoad: () async {
+                  Log.d("----onLoad");
+                  _vm.onLoadData();
+                },
+                // 下拉刷新
+                onRefresh: () async {
+                  Log.d("----onRefresh");
+                  _vm.refreshListData();
+                },
+                child: Container(
+                    color: ColorUtils.string2Color('#F2F3F6'),
+                    padding: const EdgeInsets.only(top: 15),
+                    child: _buildSaleList(context, ref, _vm)),
+              ),
+            )
+          ],
+        ),
+      ),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_address/rewards_address_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_address_state.dart';
+part 'rewards_address_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsAddressRepository rewardsAddressRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsAddressRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsAddressRepository {
+  DioEngine dioEngine;
+
+  RewardsAddressRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsAddressState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsAddressState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_address/rewards_address_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_address_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsAddressRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsAddressRepository].
+@ProviderFor(rewardsAddressRepository)
+final rewardsAddressRepositoryProvider = Provider<RewardsAddressRepository>.internal(
+  rewardsAddressRepository,
+  name: r'rewardsAddressRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsAddressRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsAddressRepositoryRef = ProviderRef<RewardsAddressRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards_address/rewards_address_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsAddressState rewardsAddressStateFromJson(String str) => RewardsAddressState.fromJson(json.decode(str));
+
+String rewardsAddressStateToJson(RewardsAddressState data) => json.encode(data.toJson());
+
+class RewardsAddressState {
+  RewardsAddressState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsAddressState.fromJson(Map<dynamic, dynamic> json) => RewardsAddressState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsAddressState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsAddressState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 109 - 0
packages/cpt_rewards/lib/modules/rewards_address/rewards_address_vm.dart

@@ -0,0 +1,109 @@
+import 'package:flutter/material.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:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import './rewards_address_state.dart';
+import './rewards_address_repository.dart';
+part 'rewards_address_vm.g.dart';
+
+@riverpod
+class RewardsAddressVm extends _$RewardsAddressVm {
+  late RewardsAddressRepository rewardsAddressRepository;
+  RewardsAddressState initState() {
+    return RewardsAddressState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsAddressState build() {
+    // 引入数据仓库
+    rewardsAddressRepository = ref.read(rewardsAddressRepositoryProvider);
+    // 初始化状态
+    RewardsAddressState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsAddressRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+
+
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_address/rewards_address_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_address_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsAddressVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsAddressVm].
+@ProviderFor(RewardsAddressVm)
+final rewardsAddressVmProvider =
+    AutoDisposeNotifierProvider<RewardsAddressVm, RewardsAddressState>.internal(
+  RewardsAddressVm.new,
+  name: r'rewardsAddressVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsAddressVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsAddressVm = AutoDisposeNotifier<RewardsAddressState>;
+// 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

+ 129 - 0
packages/cpt_rewards/lib/modules/rewards_code/rewards_code_page.dart

@@ -0,0 +1,129 @@
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_appbar.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/shatter/picker_container.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:cs_resources/generated/assets.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_code_vm.dart';
+
+@RoutePage()
+class RewardsCodePage extends HookConsumerWidget {
+  const RewardsCodePage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsCodePageRoute());
+    } else {
+      appRouter.push(const RewardsCodePageRoute());
+    }
+  }
+
+  Widget _buildItemLeftSection(BuildContext context, WidgetRef ref, item, _vm) {
+    return Column(
+      children: [
+        Column(
+          crossAxisAlignment: CrossAxisAlignment.center,
+          mainAxisAlignment: MainAxisAlignment.center,
+          children: [
+            const Center(
+              child: Text(
+                'SHOW THE VERIFICATION CODE TO YOUR MERCHANT',
+                textAlign: TextAlign.center,
+                style: TextStyle(
+                    fontSize: 20.0,
+                    color: Colors.black,
+                    fontWeight: FontWeight.w500),
+              ),
+            ),
+            Text(
+              'VERIFICATION CODE',
+              style: TextStyle(
+                  fontSize: 18.0,
+                  color: ColorUtils.string2Color('#54638C'),
+                  fontWeight: FontWeight.w500),
+            ).marginOnly(top: 35, bottom: 20),
+            Text(
+              '778890',
+              style: TextStyle(
+                  fontSize: 36.0,
+                  color: ColorUtils.string2Color('#4161D0'),
+                  fontWeight: FontWeight.w500),
+            ),
+          ],
+        ),
+      ],
+    );
+  }
+
+  // listitem
+  Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+    return Column(
+      children: [
+        Container(
+          decoration: const BoxDecoration(
+            color: Colors.white,
+            borderRadius: BorderRadius.all(Radius.circular(6.0)),
+            boxShadow: [
+              BoxShadow(
+                  color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+            ],
+          ),
+          width: MediaQuery.of(context).size.width - 30,
+          height: 250,
+          // margin: const EdgeInsets.only(left: 15, right: 15, top: 12.5),
+          child: Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            mainAxisAlignment: MainAxisAlignment.start,
+            children: [_buildItemLeftSection(context, ref, item, _vm)],
+          ).paddingOnly(left: 26, right: 26, top: 40),
+        ),
+      ],
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  // list
+  Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
+    List itemsList = _vm.state.list.toList();
+    return _buildSaleItem(context, ref, itemsList[0], _vm);
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsCodeVmProvider.notifier);
+    final state = ref.watch(rewardsCodeVmProvider);
+    return Scaffold(
+      appBar: MyAppBar.appBar(
+        context,
+        "Verification Code",
+        backgroundColor: context.appColors.whiteBG,
+      ),
+      body: Container(
+        child: Column(
+          children: [
+            Expanded(
+              child: 
+              EasyRefresh(
+                child: 
+                Container(
+                    color: ColorUtils.string2Color('#F2F3F6'),
+                    padding: const EdgeInsets.only(top: 15),
+                    child: _buildSaleList(context, ref, _vm)),
+              ),
+            )
+          ],
+        ),
+      ),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_code/rewards_code_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_code_state.dart';
+part 'rewards_code_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsCodeRepository rewardsCodeRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsCodeRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsCodeRepository {
+  DioEngine dioEngine;
+
+  RewardsCodeRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsCodeState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsCodeState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_code/rewards_code_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_code_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsCodeRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsCodeRepository].
+@ProviderFor(rewardsCodeRepository)
+final rewardsCodeRepositoryProvider = Provider<RewardsCodeRepository>.internal(
+  rewardsCodeRepository,
+  name: r'rewardsCodeRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsCodeRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsCodeRepositoryRef = ProviderRef<RewardsCodeRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards_code/rewards_code_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsCodeState rewardsCodeStateFromJson(String str) => RewardsCodeState.fromJson(json.decode(str));
+
+String rewardsCodeStateToJson(RewardsCodeState data) => json.encode(data.toJson());
+
+class RewardsCodeState {
+  RewardsCodeState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsCodeState.fromJson(Map<dynamic, dynamic> json) => RewardsCodeState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsCodeState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsCodeState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 109 - 0
packages/cpt_rewards/lib/modules/rewards_code/rewards_code_vm.dart

@@ -0,0 +1,109 @@
+import 'package:flutter/material.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:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import './rewards_code_state.dart';
+import './rewards_code_repository.dart';
+part 'rewards_code_vm.g.dart';
+
+@riverpod
+class RewardsCodeVm extends _$RewardsCodeVm {
+  late RewardsCodeRepository rewardsCodeRepository;
+  RewardsCodeState initState() {
+    return RewardsCodeState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsCodeState build() {
+    // 引入数据仓库
+    rewardsCodeRepository = ref.read(rewardsCodeRepositoryProvider);
+    // 初始化状态
+    RewardsCodeState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsCodeRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+
+
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_code/rewards_code_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_code_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsCodeVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsCodeVm].
+@ProviderFor(RewardsCodeVm)
+final rewardsCodeVmProvider =
+    AutoDisposeNotifierProvider<RewardsCodeVm, RewardsCodeState>.internal(
+  RewardsCodeVm.new,
+  name: r'rewardsCodeVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsCodeVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsCodeVm = AutoDisposeNotifier<RewardsCodeState>;
+// 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

+ 144 - 0
packages/cpt_rewards/lib/modules/rewards_confirm/dialog/account_deactivation_dialog.dart

@@ -0,0 +1,144 @@
+import 'package:cpt_rewards/modules/rewards_successful/rewards_successful_page.dart';
+import 'package:cs_resources/generated/assets.dart';
+import 'package:cs_resources/generated/l10n.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/widget_export.dart';
+import '../rewards_confirm_vm.dart';
+
+class AccountDeactivationDialog extends HookConsumerWidget {
+  VoidCallback confirmAction;
+
+  AccountDeactivationDialog({
+    required this.confirmAction,
+  });
+
+  Widget CheckboxList(BuildContext context) {
+    // final List<String> items = ['苹果', '香蕉', '橙子'];
+    // final List<bool> selections = [false, false, false];
+    // return Expanded(child:ListView.builder(
+    //   itemCount: items.length,
+    //   itemBuilder: (context, index) {
+    //     return Container(
+    //       padding: EdgeInsets.symmetric(vertical: 5.0),
+    //       child: CheckboxListTile(
+    //         value: selections[index],
+    //         onChanged: (bool? val) {
+    //           print('Option 1 is now ${val ?? false}');
+    //           selections[index] = val!;
+    //         },
+    //         title: Text(items[index]),
+    //       ),
+    //     );
+    //   },
+    // )
+    // );
+    var _rangeValues = RangeValues(20.0, 80.0);
+    return Column(
+      mainAxisAlignment: MainAxisAlignment.center,
+      crossAxisAlignment: CrossAxisAlignment.center,
+      children: [
+        const Text(
+          textAlign: TextAlign.center,
+          'Are you sure to spend 600 points to redeem goods?',
+          style: TextStyle(
+              fontSize: 19.0, color: Colors.black, fontWeight: FontWeight.w500),
+        ).paddingOnly(left: 40, right: 40)
+      ],
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsConfirmVmProvider.notifier);
+    final state = ref.watch(rewardsConfirmVmProvider);
+    List itemsList = _vm.state.list.toList();
+    return Column(
+      crossAxisAlignment: CrossAxisAlignment.center,
+      mainAxisAlignment: MainAxisAlignment.center,
+      children: [
+        Container(
+          width: double.infinity,
+          height: 55,
+          decoration: BoxDecoration(
+            color: context.appColors.btnBgDefault,
+            borderRadius: const BorderRadius.only(
+              topRight: Radius.circular(15),
+              topLeft: Radius.circular(15),
+            ),
+          ),
+          child: Row(
+            children: [
+              const SizedBox(width: 45),
+              MyTextView(
+                'Points payment',
+                fontSize: 18,
+                textAlign: TextAlign.center,
+                isFontMedium: true,
+                textColor: Colors.white,
+              ).expanded(),
+              const MyAssetImage(
+                Assets.baseServiceDialogDeleteIcon,
+                width: 25,
+                height: 25.5,
+              ).onTap(() {
+                onCancel();
+              }, padding: 10)
+            ],
+          ),
+        ),
+        Container(
+          width: double.infinity,
+          padding: const EdgeInsets.only(top: 22),
+          decoration: BoxDecoration(
+            color: context.appColors.whiteSecondBG,
+            borderRadius: const BorderRadius.only(
+              bottomLeft: Radius.circular(15),
+              bottomRight: Radius.circular(15),
+            ),
+          ),
+          child: Column(
+            children: [
+              Container(height: 150, child: CheckboxList(context)),
+              Row(
+                children: [
+                  const SizedBox(width: 18),
+                  Expanded(
+                      flex: 1,
+                      child: InkWell(
+                        onTap: () async {
+                          onCancel();
+                          RewardsSuccessfulPage.startInstance();
+                          // confirmAction();
+                        },
+                        child: MyTextView(
+                          'Pay Now',
+                          fontSize: 16,
+                          paddingTop: 13,
+                          paddingBottom: 13,
+                          isFontMedium: true,
+                          textAlign: TextAlign.center,
+                          textColor: Colors.white,
+                          backgroundColor: context.appColors.btnBgDefault,
+                          cornerRadius: 7,
+                        ),
+                      )),
+                  const SizedBox(width: 18),
+                ],
+              ).marginOnly(bottom: 30, top: 28),
+            ],
+          ),
+        ),
+      ],
+    ).constrained(width: 340);
+  }
+
+//取消弹框
+  void onCancel() async {
+    SmartDialog.dismiss();
+  }
+}

+ 388 - 0
packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_page.dart

@@ -0,0 +1,388 @@
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_appbar.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/shatter/picker_container.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:cs_resources/generated/assets.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_confirm_vm.dart';
+
+@RoutePage()
+class RewardsConfirmPage extends HookConsumerWidget {
+  const RewardsConfirmPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsConfirmPageRoute());
+    } else {
+      appRouter.push(const RewardsConfirmPageRoute());
+    }
+  }
+
+  // listitem
+  Widget _buildSaleItem(BuildContext context, WidgetRef ref, _vm) {
+    return Column(
+      children: [
+        Container(
+            decoration: const BoxDecoration(
+              color: Colors.white,
+              borderRadius: BorderRadius.all(Radius.circular(6.0)),
+              boxShadow: [
+                BoxShadow(
+                    color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+              ],
+            ),
+            width: MediaQuery.of(context).size.width - 30,
+            // height: 420,
+            // margin: const EdgeInsets.only(left: 15, right: 15, top: 12.5),
+            child: Column(
+              crossAxisAlignment: CrossAxisAlignment.start,
+              mainAxisAlignment: MainAxisAlignment.start,
+              children: [
+                const MyAssetImage(
+                  Assets.rewardsRewardsIndex1,
+                  // width: 110,
+                  height: 150,
+                ),
+                const Column(
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  mainAxisAlignment: MainAxisAlignment.start,
+                  children: [
+                    Text(
+                      maxLines: 1, // 设置最大行数为2
+                      overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+                      'Cute children multifunctional umbrella',
+                      style: TextStyle(
+                          fontSize: 17.0,
+                          color: Colors.black,
+                          fontWeight: FontWeight.w500),
+                    ),
+                  ],
+                ).paddingOnly(left: 15, right: 15, top: 10, bottom: 30),
+              ],
+            )),
+      ],
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  Widget _buildDeal(BuildContext context, WidgetRef ref, _vm) {
+    return Column(
+      children: [
+        Container(
+          decoration: const BoxDecoration(
+            color: Colors.white,
+            borderRadius: BorderRadius.all(Radius.circular(6.0)),
+            boxShadow: [
+              BoxShadow(
+                  color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+            ],
+          ),
+          width: MediaQuery.of(context).size.width - 30,
+          child: Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            children: [
+              Row(
+                mainAxisSize: MainAxisSize.min,
+                mainAxisAlignment: MainAxisAlignment.start,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: [
+                  const MyAssetImage(
+                    Assets.rewardsRewardsDetailDeal,
+                    width: 25,
+                    height: 25,
+                  ).marginOnly(right: 5),
+                  Text(
+                    'Redeem Deal At',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: ColorUtils.string2Color('#000000'),
+                        fontWeight: FontWeight.w500),
+                  )
+                ],
+              ),
+              Row(
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: [
+                  Text(
+                    'Also redeemable in 1 more location',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: ColorUtils.string2Color('#54638C'),
+                        fontWeight: FontWeight.w400),
+                  ),
+                ],
+              ).marginOnly(top: 10, bottom: 15),
+              Container(
+                height: 40,
+                decoration: BoxDecoration(
+                  color: Colors.white,
+                  borderRadius: const BorderRadius.all(Radius.circular(6.0)),
+                  border: Border.all(
+                      color: ColorUtils.string2Color('#4161D0'), width: 1.0),
+                ),
+                child: Center(
+                  child: Text(
+                    'See More Locations',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: ColorUtils.string2Color('#4161D0'),
+                        fontWeight: FontWeight.w500),
+                  ),
+                ),
+              ),
+            ],
+          ).paddingOnly(left: 15, right: 15, top: 12, bottom: 20),
+        ),
+      ],
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  Widget _buildPackage(BuildContext context, WidgetRef ref, _vm) {
+    return Column(
+      children: [
+        Container(
+          decoration: const BoxDecoration(
+            color: Colors.white,
+            borderRadius: BorderRadius.all(Radius.circular(6.0)),
+            boxShadow: [
+              BoxShadow(
+                  color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+            ],
+          ),
+          width: MediaQuery.of(context).size.width - 30,
+          child: Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            children: [
+              Row(
+                mainAxisSize: MainAxisSize.min,
+                mainAxisAlignment: MainAxisAlignment.start,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: [
+                  const MyAssetImage(
+                    Assets.rewardsRewardsIconDatd,
+                    width: 15,
+                    height: 15,
+                  ).marginOnly(right: 10),
+                  Text(
+                    'Redeem From',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: ColorUtils.string2Color('#000000'),
+                        fontWeight: FontWeight.w500),
+                  )
+                ],
+              ).marginOnly(bottom: 10),
+              Column(
+                crossAxisAlignment: CrossAxisAlignment.start,
+                children: [
+                  Text(
+                    '17 Mar 2020 until 15 Jul 2020',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: ColorUtils.string2Color('#54638C'),
+                        fontWeight: FontWeight.w400),
+                  ),
+                ],
+              ),
+            ],
+          ).paddingOnly(left: 15, right: 15, top: 12, bottom: 20),
+        ),
+      ],
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  Widget _buildNotice(BuildContext context, WidgetRef ref, _vm) {
+    return Column(
+      children: [
+        Container(
+          decoration: const BoxDecoration(
+            color: Colors.white,
+            borderRadius: BorderRadius.all(Radius.circular(6.0)),
+            boxShadow: [
+              BoxShadow(
+                  color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+            ],
+          ),
+          width: MediaQuery.of(context).size.width - 30,
+          child: Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            children: [
+              Row(
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: [
+                  Text(
+                    'Quantity:',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: ColorUtils.string2Color('#333333'),
+                        fontWeight: FontWeight.w400),
+                  ),
+                  Row(
+                    children: [
+                      const MyAssetImage(
+                        Assets.rewardsRewardsJian,
+                        width: 21,
+                        height: 21,
+                      ),
+                      Text(
+                        '2',
+                        style: TextStyle(
+                            fontSize: 19.0,
+                            color: ColorUtils.string2Color('#333333'),
+                            fontWeight: FontWeight.w500),
+                      ).marginOnly(left: 15, right: 15),
+                      const MyAssetImage(
+                        Assets.rewardsRewardsJia,
+                        width: 21,
+                        height: 21,
+                      ),
+                    ],
+                  ),
+                ],
+              ),
+              Row(
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: [
+                  Text(
+                    'Points:',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: ColorUtils.string2Color('#333333'),
+                        fontWeight: FontWeight.w400),
+                  ),
+                  Row(
+                    children: [
+                      Text(
+                        '350',
+                        style: TextStyle(
+                            decoration: TextDecoration.lineThrough,
+                            decorationColor: ColorUtils.string2Color('#54638C'),
+                            decorationStyle: TextDecorationStyle.solid,
+                            fontSize: 14.0,
+                            color: ColorUtils.string2Color('#54638C'),
+                            fontWeight: FontWeight.w400),
+                      ),
+                      Text(
+                        '300',
+                        style: TextStyle(
+                            fontSize: 19.0,
+                            color: ColorUtils.string2Color('#333333'),
+                            fontWeight: FontWeight.w500),
+                      ).marginOnly(left: 10),
+                    ],
+                  ),
+                ],
+              ).marginOnly(top: 30, bottom: 30),
+              Row(
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: [
+                  Text(
+                    'Amount:',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: ColorUtils.string2Color('#333333'),
+                        fontWeight: FontWeight.w400),
+                  ),
+                  Row(
+                    children: [
+                      Text(
+                        '600',
+                        style: TextStyle(
+                            fontSize: 19.0,
+                            color: ColorUtils.string2Color('#4161D0'),
+                            fontWeight: FontWeight.w500),
+                      ),
+                    ],
+                  ),
+                ],
+              ),
+            ],
+          ).paddingOnly(left: 15, right: 15, top: 30, bottom: 30),
+        ),
+      ],
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsConfirmVmProvider.notifier);
+    final state = ref.watch(rewardsConfirmVmProvider);
+    return Scaffold(
+      appBar: MyAppBar.appBar(
+        context,
+        "Verification Confirm",
+        backgroundColor: context.appColors.whiteBG,
+      ),
+      body: Column(
+        children: [
+          Expanded(
+              child: SingleChildScrollView(
+                  scrollDirection: Axis.vertical,
+                  physics: const BouncingScrollPhysics(),
+                  clipBehavior: Clip.none,
+                  child: Column(
+                    children: [
+                      Container(
+                          color: ColorUtils.string2Color('#F2F3F6'),
+                          padding: const EdgeInsets.only(top: 15),
+                          child: Column(
+                            children: [
+                              _buildSaleItem(context, ref, _vm),
+                              _buildDeal(context, ref, _vm),
+                              _buildPackage(context, ref, _vm),
+                              _buildNotice(context, ref, _vm),
+                            ],
+                          )),
+                    ],
+                  ))),
+          Container(
+            height: 50,
+            color: ColorUtils.string2Color('#4161D0'),
+            child: Flex(
+              direction: Axis.horizontal,
+              children: [
+                Expanded(
+                  flex: 1,
+                  child: Container(
+                    color: ColorUtils.string2Color('#4161D0'),
+                    height: 100,
+                    child: Row(
+                      mainAxisAlignment: MainAxisAlignment.center,
+                      crossAxisAlignment: CrossAxisAlignment.center,
+                      children: [
+                        MyTextView(
+                          "Redeem",
+                          fontSize: 16,
+                          textColor: Colors.white,
+                          isFontMedium: true,
+                        ),
+                      ],
+                    ),
+                  ).onTap(() {
+                    // 去详情
+                    _vm.doDeleteAccount();
+                  }),
+                ),
+              ],
+            ),
+          )
+        ],
+      ),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_confirm_state.dart';
+part 'rewards_confirm_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsConfirmRepository rewardsConfirmRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsConfirmRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsConfirmRepository {
+  DioEngine dioEngine;
+
+RewardsConfirmRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsConfirmState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsConfirmState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_confirm_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsConfirmRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsConfirmRepository].
+@ProviderFor(rewardsConfirmRepository)
+final rewardsConfirmRepositoryProvider = Provider<RewardsConfirmRepository>.internal(
+  rewardsConfirmRepository,
+  name: r'rewardsConfirmRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsConfirmRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsConfirmRepositoryRef = ProviderRef<RewardsConfirmRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsConfirmState rewardsConfirmStateFromJson(String str) => RewardsConfirmState.fromJson(json.decode(str));
+
+String rewardsConfirmStateToJson(RewardsConfirmState data) => json.encode(data.toJson());
+
+class RewardsConfirmState {
+  RewardsConfirmState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsConfirmState.fromJson(Map<dynamic, dynamic> json) => RewardsConfirmState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsConfirmState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsConfirmState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 118 - 0
packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_vm.dart

@@ -0,0 +1,118 @@
+import 'package:cpt_rewards/modules/rewards_confirm/dialog/account_deactivation_dialog.dart';
+import 'package:flutter/material.dart';
+import 'package:plugin_platform/engine/dialog/dialog_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:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import './rewards_confirm_state.dart';
+import './rewards_confirm_repository.dart';
+part 'rewards_confirm_vm.g.dart';
+
+@riverpod
+class RewardsConfirmVm extends _$RewardsConfirmVm {
+  late RewardsConfirmRepository rewardsConfirmRepository;
+  RewardsConfirmState initState() {
+    return RewardsConfirmState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsConfirmState build() {
+    // 引入数据仓库
+    rewardsConfirmRepository = ref.read(rewardsConfirmRepositoryProvider);
+    // 初始化状态
+    RewardsConfirmState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsConfirm(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result =
+          await rewardsConfirmRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+
+  void doDeleteAccount() {
+    DialogEngine.show(widget: AccountDeactivationDialog(
+      confirmAction: () {
+        ToastEngine.show("点击了确定");
+      },
+    ));
+  }
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_confirm/rewards_confirm_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_confirm_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsConfirmVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsConfirmVm].
+@ProviderFor(RewardsConfirmVm)
+final rewardsConfirmVmProvider =
+    AutoDisposeNotifierProvider<RewardsConfirmVm, RewardsConfirmState>.internal(
+  RewardsConfirmVm.new,
+  name: r'rewardsConfirmVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsConfirmVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsConfirmVm = AutoDisposeNotifier<RewardsConfirmState>;
+// 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

File diff suppressed because it is too large
+ 632 - 0
packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_page.dart


+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_detail_state.dart';
+part 'rewards_detail_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsDetailRepository rewardsDetailRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsDetailRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsDetailRepository {
+  DioEngine dioEngine;
+
+  RewardsDetailRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsDetailState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsDetailState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_detail_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsDetailRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsDetailRepository].
+@ProviderFor(rewardsDetailRepository)
+final rewardsDetailRepositoryProvider = Provider<RewardsDetailRepository>.internal(
+  rewardsDetailRepository,
+  name: r'rewardsDetailRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsDetailRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsDetailRepositoryRef = ProviderRef<RewardsDetailRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsDetailState rewardsDetailStateFromJson(String str) => RewardsDetailState.fromJson(json.decode(str));
+
+String rewardsDetailStateToJson(RewardsDetailState data) => json.encode(data.toJson());
+
+class RewardsDetailState {
+  RewardsDetailState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsDetailState.fromJson(Map<dynamic, dynamic> json) => RewardsDetailState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsDetailState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsDetailState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 109 - 0
packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_vm.dart

@@ -0,0 +1,109 @@
+import 'package:flutter/material.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:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import './rewards_detail_state.dart';
+import './rewards_detail_repository.dart';
+part 'rewards_detail_vm.g.dart';
+
+@riverpod
+class RewardsDetailVm extends _$RewardsDetailVm {
+  late RewardsDetailRepository rewardsDetailRepository;
+  RewardsDetailState initState() {
+    return RewardsDetailState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsDetailState build() {
+    // 引入数据仓库
+    rewardsDetailRepository = ref.read(rewardsDetailRepositoryProvider);
+    // 初始化状态
+    RewardsDetailState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsDetailRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+
+
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_detail/rewards_detail_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_detail_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsDetailVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsDetailVm].
+@ProviderFor(RewardsDetailVm)
+final rewardsDetailVmProvider =
+    AutoDisposeNotifierProvider<RewardsDetailVm, RewardsDetailState>.internal(
+  RewardsDetailVm.new,
+  name: r'rewardsDetailVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsDetailVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsDetailVm = AutoDisposeNotifier<RewardsDetailState>;
+// 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

+ 130 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_page.dart

@@ -0,0 +1,130 @@
+import 'package:cpt_rewards/modules/rewards_code/rewards_code_page.dart';
+import 'package:cpt_rewards/modules/rewards_redeem/rewards_redeem_page.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:cs_resources/generated/assets.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_history_earned_vm.dart';
+
+@RoutePage()
+class RewardsHistoryEarnedPage extends HookConsumerWidget {
+  const RewardsHistoryEarnedPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsHistoryEarnedPageRoute());
+    } else {
+      appRouter.push(const RewardsHistoryEarnedPageRoute());
+    }
+  }
+
+  // listitem
+  Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      padding: const EdgeInsets.only(top: 15, bottom: 15, left: 18, right: 18),
+      decoration: BoxDecoration(
+          border: Border(
+              bottom: BorderSide(
+        width: 1.0, // 底边边框的宽度
+        color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+      ))),
+      child: Row(
+        crossAxisAlignment: CrossAxisAlignment.center,
+        mainAxisAlignment: MainAxisAlignment.spaceBetween,
+        children: [
+          Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: [
+              Text(
+                'Daily Login',
+                style: TextStyle(
+                    fontSize: 15.0,
+                    color: ColorUtils.string2Color('#000000'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ).marginOnly(bottom: 6),
+              Text(
+                '14 Oct 2024  10:00PM',
+                style: TextStyle(
+                    fontSize: 13.0,
+                    color: ColorUtils.string2Color('#808DAF'),
+                    fontWeight: FontWeight.w400), // 设置字体大小
+              ),
+            ],
+          ),
+          Text(
+            '+2',
+            style: TextStyle(
+                fontSize: 20.0,
+                color: ColorUtils.string2Color('#FDB429'),
+                fontWeight: FontWeight.w500), // 设置字体大小
+          ),
+        ],
+      ),
+    );
+  }
+
+  // list
+  Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
+    List itemsList = _vm.state.list.toList();
+    return Container(
+        decoration: BoxDecoration(
+          color: Colors.white,
+          borderRadius: BorderRadius.circular(10),
+          boxShadow: const [
+            BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+          ],
+        ),
+        child:
+            // Column(
+            //     crossAxisAlignment: CrossAxisAlignment.center,
+            //     mainAxisAlignment: MainAxisAlignment.center,
+            //     children: [
+            ListView.builder(
+          itemCount: itemsList.length,
+          itemBuilder: (context, index) {
+            return _buildSaleItem(context, ref, itemsList[index], _vm);
+          },
+        )
+        // ])
+        );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsHistoryEarnedVmProvider.notifier);
+
+    return Scaffold(
+      // appBar: AppBar(title: Text("资产")),
+      body: Container(
+        color: ColorUtils.string2Color('#F2F3F6'),
+        padding: const EdgeInsets.only(top: 15, left: 15, right: 15),
+        child: EasyRefresh(
+          // 上拉加载
+          onLoad: () async {
+            Log.d("----onLoad");
+            _vm.onLoadData();
+          },
+          // 下拉刷新
+          onRefresh: () async {
+            Log.d("----onRefresh");
+            _vm.refreshListData();
+          },
+          child: Container(
+              // color: ColorUtils.string2Color('#F2F3F6'),
+              // padding: const EdgeInsets.only(top: 15, left: 15, right: 15),
+              child: _buildSaleList(context, ref, _vm)),
+        ),
+      ),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_history_earned_state.dart';
+part 'rewards_history_earned_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsHistoryEarnedRepository rewardsHistoryEarnedRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsHistoryEarnedRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsHistoryEarnedRepository {
+  DioEngine dioEngine;
+
+  RewardsHistoryEarnedRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsHistoryEarnedState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsHistoryEarnedState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_history_earned_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsHistoryEarnedRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsHistoryEarnedRepository].
+@ProviderFor(rewardsHistoryEarnedRepository)
+final rewardsHistoryEarnedRepositoryProvider = Provider<RewardsHistoryEarnedRepository>.internal(
+  rewardsHistoryEarnedRepository,
+  name: r'rewardsHistoryEarnedRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsHistoryEarnedRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsHistoryEarnedRepositoryRef = ProviderRef<RewardsHistoryEarnedRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsHistoryEarnedState rewardsHistoryEarnedStateFromJson(String str) => RewardsHistoryEarnedState.fromJson(json.decode(str));
+
+String rewardsHistoryEarnedStateToJson(RewardsHistoryEarnedState data) => json.encode(data.toJson());
+
+class RewardsHistoryEarnedState {
+  RewardsHistoryEarnedState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsHistoryEarnedState.fromJson(Map<dynamic, dynamic> json) => RewardsHistoryEarnedState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsHistoryEarnedState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsHistoryEarnedState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 105 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_vm.dart

@@ -0,0 +1,105 @@
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import './rewards_history_earned_state.dart';
+import './rewards_history_earned_repository.dart';
+part 'rewards_history_earned_vm.g.dart';
+
+@riverpod
+class RewardsHistoryEarnedVm extends _$RewardsHistoryEarnedVm {
+  late RewardsHistoryEarnedRepository rewardsHistoryEarnedRepository;
+  RewardsHistoryEarnedState initState() {
+    return RewardsHistoryEarnedState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsHistoryEarnedState build() {
+    // 引入数据仓库
+    rewardsHistoryEarnedRepository = ref.read(rewardsHistoryEarnedRepositoryProvider);
+    // 初始化状态
+    RewardsHistoryEarnedState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsHistoryEarnedRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_earned/rewards_history_earned_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_history_earned_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsHistoryEarnedVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsHistoryEarnedVm].
+@ProviderFor(RewardsHistoryEarnedVm)
+final rewardsHistoryEarnedVmProvider =
+    AutoDisposeNotifierProvider<RewardsHistoryEarnedVm, RewardsHistoryEarnedState>.internal(
+  RewardsHistoryEarnedVm.new,
+  name: r'rewardsHistoryEarnedVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsHistoryEarnedVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsHistoryEarnedVm = AutoDisposeNotifier<RewardsHistoryEarnedState>;
+// 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

+ 124 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_page.dart

@@ -0,0 +1,124 @@
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/material.dart';
+// ignore: depend_on_referenced_packages
+import 'package:auto_route/auto_route.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/log_utils.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/my_appbar.dart';
+
+import '../../router/page/rewards_page_router.dart';
+import './rewards_history_vm.dart';
+
+@RoutePage()
+class RewardsHistoryPage extends HookConsumerWidget {
+  const RewardsHistoryPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsHistoryPageRoute());
+    } else {
+      appRouter.push(const RewardsHistoryPageRoute());
+    }
+  }
+
+  // 顶部tab 切换
+  Widget _buildTopSection(
+      BuildContext context, WidgetRef ref, _vm, tabsRouter) {
+    final topSectionsData = _vm.topSectionsData;
+    final currentTabIdx = tabsRouter.activeIndex;
+    return Container(
+      color: ColorUtils.string2Color('#F2F3F6'),
+      child: Center(
+        child: Row(
+          mainAxisAlignment: MainAxisAlignment.center,
+          crossAxisAlignment: CrossAxisAlignment.center,
+          children: List.generate(topSectionsData.length, (index) {
+            final item = topSectionsData[index];
+            return Container(
+              width:
+                  MediaQuery.of(context).size.width / topSectionsData.length -
+                      45,
+              height: 43,
+              padding: const EdgeInsets.only(
+                  top: 10, bottom: 10, left: 10, right: 10),
+              decoration: index == currentTabIdx
+                  ? BoxDecoration(
+                      color: index == currentTabIdx
+                          ? context.appColors.btnBgDefault
+                          : ColorUtils.string2Color("#F2F3F6"),
+                      borderRadius: BorderRadius.circular(20),
+                      boxShadow: [
+                        BoxShadow(
+                          color: Colors.grey.withOpacity(0.5),
+                          spreadRadius: 1,
+                          blurRadius: 5,
+                          offset:
+                              const Offset(0, 2), // changes position of shadow
+                        ),
+                      ],
+                    )
+                  : null,
+              child: Row(
+                children: [
+                  Expanded(
+                    child: Container(
+                      alignment: Alignment.center,
+                      child: MyTextView(
+                        item['title'],
+                        fontSize: 16,
+                        textAlign: TextAlign.center,
+                        isFontMedium: true,
+                        textColor: index == currentTabIdx
+                            ? Colors.white
+                            : ColorUtils.string2Color("#000000"),
+                      ),
+                    ).onTap(
+                      () {
+                        tabsRouter.setActiveIndex(index);
+                      },
+                      type: ClickType.throttle,
+                    ),
+                  ),
+                ],
+              ),
+            ).marginOnly(left: 20, right: 0, top: 15, bottom: 5);
+          }),
+        ),
+      ),
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsHistoryVmProvider.notifier);
+    return Scaffold(
+        appBar: MyAppBar.appBar(
+          context,
+          "Points History",
+          backgroundColor: context.appColors.whiteBG,
+        ),
+        body: AutoTabsRouter.pageView(
+          routes: const [
+            RewardsHistoryEarnedPageRoute(),
+            RewardsHistorySpentPageRoute(),
+          ],
+          builder: (context, child, pageController) {
+            final tabsRouter = AutoTabsRouter.of(context);
+            return Column(
+              children: [
+                _buildTopSection(context, ref, _vm, tabsRouter),
+                Expanded(
+                  child: child,
+                ),
+              ],
+            );
+          },
+        ));
+  }
+}

+ 129 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_page.dart

@@ -0,0 +1,129 @@
+import 'package:cpt_rewards/modules/rewards_transaction/rewards_transaction_page.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:cs_resources/generated/assets.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_history_spent_vm.dart';
+
+@RoutePage()
+class RewardsHistorySpentPage extends HookConsumerWidget {
+  const RewardsHistorySpentPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsHistorySpentPageRoute());
+    } else {
+      appRouter.push(const RewardsHistorySpentPageRoute());
+    }
+  }
+
+  // listitem
+  Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      padding: const EdgeInsets.only(top: 15, bottom: 15, left: 18, right: 18),
+      decoration: BoxDecoration(
+          border: Border(
+              bottom: BorderSide(
+        width: 1.0, // 底边边框的宽度
+        color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+      ))),
+      child: Row(
+        crossAxisAlignment: CrossAxisAlignment.center,
+        mainAxisAlignment: MainAxisAlignment.spaceBetween,
+        children: [
+          Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: [
+              Text(
+                'Daily Login',
+                style: TextStyle(
+                    fontSize: 15.0,
+                    color: ColorUtils.string2Color('#000000'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ).marginOnly(bottom: 6),
+              Text(
+                '14 Oct 2024  10:00PM',
+                style: TextStyle(
+                    fontSize: 13.0,
+                    color: ColorUtils.string2Color('#808DAF'),
+                    fontWeight: FontWeight.w400), // 设置字体大小
+              ),
+            ],
+          ),
+          Text(
+            '-4.500',
+            style: TextStyle(
+                fontSize: 20.0,
+                color: ColorUtils.string2Color('#4161D0'),
+                fontWeight: FontWeight.w500), // 设置字体大小
+          ),
+        ],
+      ),
+    );
+  }
+
+  // list
+  Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
+    List itemsList = _vm.state.list.toList();
+    return Container(
+        decoration: BoxDecoration(
+          color: Colors.white,
+          borderRadius: BorderRadius.circular(10),
+          boxShadow: const [
+            BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+          ],
+        ),
+        child:
+            // Column(
+            //     crossAxisAlignment: CrossAxisAlignment.center,
+            //     mainAxisAlignment: MainAxisAlignment.center,
+            //     children: [
+            ListView.builder(
+          itemCount: itemsList.length,
+          itemBuilder: (context, index) {
+            return _buildSaleItem(context, ref, itemsList[index], _vm);
+          },
+        )
+        // ])
+        );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsHistorySpentVmProvider.notifier);
+
+    return Scaffold(
+      // appBar: AppBar(title: Text("资产")),
+      body: Container(
+        color: ColorUtils.string2Color('#F2F3F6'),
+        padding: const EdgeInsets.only(top: 15, left: 15, right: 15),
+        child: EasyRefresh(
+          // 上拉加载
+          onLoad: () async {
+            Log.d("----onLoad");
+            _vm.onLoadData();
+          },
+          // 下拉刷新
+          onRefresh: () async {
+            Log.d("----onRefresh");
+            _vm.refreshListData();
+          },
+          child: Container(
+              // color: ColorUtils.string2Color('#F2F3F6'),
+              // padding: const EdgeInsets.only(top: 15, left: 15, right: 15),
+              child: _buildSaleList(context, ref, _vm)),
+        ),
+      ),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_history_spent_state.dart';
+part 'rewards_history_spent_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsHistorySpentRepository rewardsHistorySpentRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsHistorySpentRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsHistorySpentRepository {
+  DioEngine dioEngine;
+
+  RewardsHistorySpentRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsHistorySpentState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsHistorySpentState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_history_spent_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsHistorySpentRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsHistorySpentRepository].
+@ProviderFor(rewardsHistorySpentRepository)
+final rewardsHistorySpentRepositoryProvider = Provider<RewardsHistorySpentRepository>.internal(
+  rewardsHistorySpentRepository,
+  name: r'rewardsHistorySpentRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsHistorySpentRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsHistorySpentRepositoryRef = ProviderRef<RewardsHistorySpentRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsHistorySpentState rewardsHistorySpentStateFromJson(String str) => RewardsHistorySpentState.fromJson(json.decode(str));
+
+String rewardsHistorySpentStateToJson(RewardsHistorySpentState data) => json.encode(data.toJson());
+
+class RewardsHistorySpentState {
+  RewardsHistorySpentState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsHistorySpentState.fromJson(Map<dynamic, dynamic> json) => RewardsHistorySpentState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsHistorySpentState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsHistorySpentState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 105 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_vm.dart

@@ -0,0 +1,105 @@
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import './rewards_history_spent_state.dart';
+import './rewards_history_spent_repository.dart';
+part 'rewards_history_spent_vm.g.dart';
+
+@riverpod
+class RewardsHistorySpentVm extends _$RewardsHistorySpentVm {
+  late RewardsHistorySpentRepository rewardsHistorySpentRepository;
+  RewardsHistorySpentState initState() {
+    return RewardsHistorySpentState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsHistorySpentState build() {
+    // 引入数据仓库
+    rewardsHistorySpentRepository = ref.read(rewardsHistorySpentRepositoryProvider);
+    // 初始化状态
+    RewardsHistorySpentState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsHistorySpentRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_spent/rewards_history_spent_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_history_spent_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsHistorySpentVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsHistorySpentVm].
+@ProviderFor(RewardsHistorySpentVm)
+final rewardsHistorySpentVmProvider =
+    AutoDisposeNotifierProvider<RewardsHistorySpentVm, RewardsHistorySpentState>.internal(
+  RewardsHistorySpentVm.new,
+  name: r'rewardsHistorySpentVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsHistorySpentVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsHistorySpentVm = AutoDisposeNotifier<RewardsHistorySpentState>;
+// 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

+ 86 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_vm.dart

@@ -0,0 +1,86 @@
+
+import 'package:cs_resources/generated/assets.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+
+import './rewards_history_earned/rewards_history_earned_page.dart';
+import './rewards_history_spent/rewards_history_spent_page.dart';
+
+part 'rewards_history_vm.g.dart';
+
+
+class RewardsHistoryVmState {
+  List<Map<String, dynamic>>? topSectionsData;
+  int? curIdx;
+
+  RewardsHistoryVmState({
+    List<Map<String, dynamic>>? topSectionsData,
+    this.curIdx = 0,
+  }) : topSectionsData = topSectionsData?? [
+    {
+      "title": "Earned Points",
+      "icon": Assets.propertyIoan,
+      "pageStartInstanceFn": RewardsHistoryEarnedPage.startInstance,
+      "page": const RewardsHistoryEarnedPage(),
+    },
+    {
+      "title": "Spent Points",
+      "icon": Assets.propertyNews,
+      "pageStartInstanceFn": RewardsHistorySpentPage.startInstance,
+      "page": const RewardsHistorySpentPage(),
+    },
+  ];
+
+  RewardsHistoryVmState copyWith({
+    List<Map<String, dynamic>>? topSectionsData,
+    int? curIdx = 0,
+  }) {
+    return RewardsHistoryVmState(
+      topSectionsData: topSectionsData ?? this.topSectionsData,
+      curIdx: curIdx ?? 0,
+    );
+  }
+}
+
+@riverpod
+class RewardsHistoryVm extends _$RewardsHistoryVm {
+  get topSectionsData => state.topSectionsData;
+
+  RewardsHistoryVmState initState() {
+    return RewardsHistoryVmState();
+  }
+
+  @override
+  RewardsHistoryVmState build(){
+    final state = initState();
+    Log.d("--------------------------build---------------------");
+
+    // 初始时导航到子路由
+    WidgetsBinding.instance.addPostFrameCallback((_) {
+    });
+
+    return state;
+  }
+
+  // 页面切换
+  switchPage(int index,BuildContext? context, [bool? isFirstInitSwitch] ){
+    if(state.curIdx != index){
+      state = state.copyWith(curIdx: index);
+      final List<Map<String, dynamic>>? topSectionsData = state.topSectionsData;
+      // Log.d("当前页面${topSectionsData?[index]['pageStartInstanceFn']}");
+      final pageStartInstanceFn = topSectionsData?[index]['pageStartInstanceFn'] as Function({BuildContext? context});
+      pageStartInstanceFn(context:context);
+    }else {
+      if(isFirstInitSwitch??false){
+        final List<Map<String, dynamic>>? topSectionsData = state.topSectionsData;
+        // Log.d("当前页面${topSectionsData?[index]['pageStartInstanceFn']}");
+        final pageStartInstanceFn = topSectionsData?[index]['pageStartInstanceFn'] as Function({BuildContext? context});
+        pageStartInstanceFn(context:context);
+      }
+    }
+  }
+
+}
+

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_history/rewards_history_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_history_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsHistoryVmHash() => r'9b08b5e83d2b45f67b653daf60bb66bacb9c47ed';
+
+/// See also [RewardsHistoryVm].
+@ProviderFor(RewardsHistoryVm)
+final rewardsHistoryVmProvider =
+    AutoDisposeNotifierProvider<RewardsHistoryVm, RewardsHistoryVmState>.internal(
+  RewardsHistoryVm.new,
+  name: r'rewardsHistoryVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsHistoryVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsHistoryVm = AutoDisposeNotifier<RewardsHistoryVmState>;
+// 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

+ 500 - 0
packages/cpt_rewards/lib/modules/rewards_home/rewards_home_page.dart

@@ -0,0 +1,500 @@
+import 'package:cpt_rewards/modules/rewards_address/rewards_address_page.dart';
+import 'package:cpt_rewards/modules/rewards_code/rewards_code_page.dart';
+import 'package:cpt_rewards/modules/rewards_detail/rewards_detail_page.dart';
+import 'package:cpt_rewards/modules/rewards_list/rewards_list_page.dart';
+import 'package:cpt_rewards/modules/rewards_my/rewards_my_page.dart';
+import 'package:cpt_rewards/modules/rewards_search/rewards_search_page.dart';
+import 'package:cs_resources/generated/assets.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_platform/engine/image/image_nine_grid.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_home_vm.dart';
+
+@RoutePage()
+class RewardsHomePage extends HookConsumerWidget {
+  const RewardsHomePage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsHomePageRoute());
+    } else {
+      appRouter.push(const RewardsHomePageRoute());
+    }
+  }
+
+  Widget _buildTop(BuildContext context, WidgetRef ref, _vm) {
+    // List itemsList = _vm.state.list.toList();
+    return Container(
+        decoration: BoxDecoration(
+          border: Border(
+              bottom: BorderSide(
+            color: ColorUtils.string2Color('#4161D0'), // 设置bottom边框的颜色
+            width: 45.0, // 设置bottom边框的宽度
+          )),
+          borderRadius: const BorderRadius.only(
+            topLeft: Radius.circular(0.0),
+            topRight: Radius.circular(0.0),
+            bottomLeft: Radius.circular(30.0),
+            bottomRight: Radius.circular(30.0),
+          ), // 圆角
+        ),
+        child: Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            const MyAssetImage(
+              Assets.rewardsRewardsBack,
+              width: 44,
+              height: 44,
+            ),
+            const Text(
+              '1526 Available Points',
+              style: TextStyle(
+                  fontSize: 18.0,
+                  color: Colors.white,
+                  fontWeight: FontWeight.w500), // 设置字体大小
+            ).paddingOnly(left: 10, top: 20, bottom: 18),
+            Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: [
+                Container(
+                  decoration: BoxDecoration(
+                    border: Border.all(color: Colors.white, width: 1), // 边框
+                    borderRadius: BorderRadius.circular(8), // 圆角
+                  ),
+                  child: const Text(
+                    'My Rewards',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: Colors.white,
+                        fontWeight: FontWeight.w400), // 设置字体大小
+                  )
+                      .paddingOnly(left: 10, top: 7, bottom: 7, right: 10)
+                      .onTap(() {
+                    RewardsMyPage.startInstance();
+                  }),
+                ),
+                Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  children: [
+                    const MyAssetImage(
+                      Assets.rewardsRewardsY,
+                      width: 26,
+                      height: 26,
+                    ),
+                    Text(
+                      'Bronze',
+                      style: TextStyle(
+                          fontSize: 17.0,
+                          color: ColorUtils.string2Color('#FFCC00'),
+                          fontWeight: FontWeight.w500), // 设置字体大小
+                    ).marginOnly(
+                      left: 9,
+                      right: 7,
+                    ),
+                    const MyAssetImage(
+                      Assets.rewardsRewardsRight,
+                      width: 7,
+                      height: 12,
+                    ),
+                  ],
+                )
+              ],
+            ).paddingOnly(left: 10)
+          ],
+        )
+            .paddingOnly(top: 15, left: 5, right: 15, bottom: 0)
+            .border(bottom: 0, color: ColorUtils.string2Color('#4161D0'))
+            .backgroundColor(ColorUtils.string2Color('#4161D0')));
+  }
+
+  Widget _buildSearch(BuildContext context, WidgetRef ref, _vm) {
+    // List itemsList = _vm.state.list.toList();
+    return Container(
+      height: 50,
+      decoration: BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.circular(10),
+      ),
+      child: Row(
+        crossAxisAlignment: CrossAxisAlignment.center,
+        mainAxisAlignment: MainAxisAlignment.spaceBetween,
+        children: [
+          Text(
+            'Search',
+            style: TextStyle(
+                fontSize: 15.0,
+                color: ColorUtils.string2Color('#C7CDE3'),
+                fontWeight: FontWeight.w500), // 设置字体大小
+          ),
+          const MyAssetImage(
+            Assets.rewardsRewardsIndexSearch,
+            width: 21,
+            height: 21,
+          ),
+        ],
+      ).paddingOnly(left: 15, right: 15),
+    ).onTap(() {
+      RewardsSearchPage.startInstance();
+    });
+  }
+
+  Widget _buildSwiper(BuildContext context, WidgetRef ref, _vm) {
+    List itemsList = _vm.state.lists.toList();
+    return Container(
+      transform: Matrix4.translationValues(0.0, -10.0, 0.0),
+      // color: Colors.white,
+      height: 110,
+      decoration: const BoxDecoration(
+        color: Colors.white,
+        borderRadius: const BorderRadius.only(
+          topLeft: Radius.circular(10.0),
+          topRight: Radius.circular(0.0),
+          bottomLeft: Radius.circular(10.0),
+          bottomRight: Radius.circular(0.0),
+        ),
+        boxShadow: [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: ClipRect(
+          child: SingleChildScrollView(
+        scrollDirection: Axis.horizontal,
+        physics: const BouncingScrollPhysics(),
+        clipBehavior: Clip.none,
+        child: Row(
+          crossAxisAlignment: CrossAxisAlignment.center,
+          mainAxisAlignment: MainAxisAlignment.center,
+          children: List.generate(itemsList.length, (index) {
+            final item = itemsList[index];
+            return Column(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.center,
+              children: [
+                MyAssetImage(
+                  item['icon'],
+                  width: 70,
+                  height: 70,
+                ),
+                Text(
+                  item['title']!,
+                  style: TextStyle(
+                      fontSize: 14.0,
+                      color: ColorUtils.string2Color('#000001'),
+                      fontWeight: FontWeight.w600), // 设置字体大小
+                ),
+              ],
+            ).marginOnly(right: 5).onTap(() {
+              RewardsListPage.startInstance();
+            });
+          }),
+        ).marginOnly(left: 15, right: 15),
+      )),
+    ).paddingOnly(left: 15);
+  }
+
+  Widget _buildRecommend(BuildContext context, WidgetRef ref, _vm) {
+    return Container(
+      child: Column(
+        children: [
+          Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: [
+              Text(
+                'Recommend',
+                style: TextStyle(
+                    fontSize: 17.0,
+                    color: ColorUtils.string2Color('#000001'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ),
+              Text(
+                'See All',
+                style: TextStyle(
+                    fontSize: 17.0,
+                    color: ColorUtils.string2Color('#4161D0'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ).onTap(() {
+                RewardsListPage.startInstance();
+              }),
+            ],
+          ).marginOnly(bottom: 15),
+          Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: List.generate(2, (index) {
+                double hg = 70;
+                return Container(
+                    width: MediaQuery.of(context).size.width / 2 - 25,
+                    height: 185,
+                    decoration: const BoxDecoration(
+                      color: Colors.white,
+                      borderRadius: BorderRadius.all(Radius.circular(6.0)),
+                      boxShadow: [
+                        BoxShadow(
+                            color: Color.fromRGBO(184, 191, 217, 0.3),
+                            blurRadius: 6)
+                      ],
+                    ),
+                    child: _buildItem(context, ref, _vm, hg));
+              }))
+        ],
+      ),
+    ).paddingOnly(left: 15, right: 15, top: 10);
+  }
+
+  Widget _buildHottest(BuildContext context, WidgetRef ref, _vm) {
+    return Container(
+      child: Column(
+        children: [
+          Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: [
+              Text(
+                'Hottest',
+                style: TextStyle(
+                    fontSize: 17.0,
+                    color: ColorUtils.string2Color('#000001'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ),
+              Text(
+                'See All',
+                style: TextStyle(
+                    fontSize: 17.0,
+                    color: ColorUtils.string2Color('#4161D0'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ).onTap(() {
+                RewardsListPage.startInstance();
+              }),
+            ],
+          ).marginOnly(bottom: 15),
+          Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: List.generate(2, (index) {
+                double hg = 70;
+                return Container(
+                    width: MediaQuery.of(context).size.width / 2 - 25,
+                    height: 185,
+                    decoration: const BoxDecoration(
+                      color: Colors.white,
+                      borderRadius: BorderRadius.all(Radius.circular(6.0)),
+                      boxShadow: [
+                        BoxShadow(
+                            color: Color.fromRGBO(184, 191, 217, 0.3),
+                            blurRadius: 6)
+                      ],
+                    ),
+                    child: _buildItem(context, ref, _vm, hg));
+              }))
+        ],
+      ),
+    ).paddingOnly(left: 15, right: 15, top: 10);
+  }
+
+  Widget _buildItem(BuildContext context, WidgetRef ref, _vm, height) {
+    double hg = height;
+    return Column(
+      children: [
+        MyAssetImage(
+          Assets.rewardsRewardsIndex1,
+          // width: 110,
+          height: hg,
+        ),
+        Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            const Text(
+              maxLines: 2, // 设置最大行数为2
+              overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+              'Cute children multifunctional ……',
+              style: TextStyle(
+                  fontSize: 15.0,
+                  color: Colors.black,
+                  fontWeight: FontWeight.w500),
+            ),
+            Text(
+              maxLines: 1, // 设置最大行数为2
+              overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+              'Hong Ye Group Co., Ltd',
+              style: TextStyle(
+                  fontSize: 13.0,
+                  color: ColorUtils.string2Color('#808DAF'),
+                  fontWeight: FontWeight.w400),
+            ).marginOnly(bottom: 5),
+            Row(
+              children: [
+                const Text(
+                  '300',
+                  style: TextStyle(
+                      fontSize: 18.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w500),
+                ),
+                Text(
+                  '350',
+                  style: TextStyle(
+                      decoration: TextDecoration.lineThrough,
+                      decorationColor: ColorUtils.string2Color('#808DAF'),
+                      decorationStyle: TextDecorationStyle.solid,
+                      fontSize: 13.0,
+                      color: ColorUtils.string2Color('#808DAF'),
+                      fontWeight: FontWeight.w400),
+                ).marginOnly(left: 5, right: 5),
+                const Text(
+                  'Points',
+                  style: TextStyle(
+                      fontSize: 13.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w400),
+                ),
+              ],
+            )
+          ],
+        ).paddingOnly(top: 12, left: 12, right: 12)
+      ],
+    ).onTap(() {
+      RewardsDetailPage.startInstance();
+    });
+  }
+
+  Widget _buildFood(BuildContext context, WidgetRef ref, _vm) {
+    return Container(
+      child: Column(
+        children: [
+          Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: [
+              Text(
+                'Food & Beverage',
+                style: TextStyle(
+                    fontSize: 17.0,
+                    color: ColorUtils.string2Color('#000001'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ),
+              Text(
+                'See All',
+                style: TextStyle(
+                    fontSize: 17.0,
+                    color: ColorUtils.string2Color('#4161D0'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ).onTap(() {
+                RewardsListPage.startInstance();
+              }),
+            ],
+          ).marginOnly(bottom: 15),
+          Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: List.generate(2, (index) {
+                double hg = 70;
+                return Container(
+                    width: MediaQuery.of(context).size.width / 2 - 25,
+                    height: 185,
+                    decoration: const BoxDecoration(
+                      color: Colors.white,
+                      borderRadius: BorderRadius.all(Radius.circular(6.0)),
+                      boxShadow: [
+                        BoxShadow(
+                            color: Color.fromRGBO(184, 191, 217, 0.3),
+                            blurRadius: 6)
+                      ],
+                    ),
+                    child: _buildItem(context, ref, _vm, hg));
+              }))
+        ],
+      ),
+    ).paddingOnly(left: 15, right: 15, top: 10);
+  }
+
+  Widget _buildBest(BuildContext context, WidgetRef ref, _vm) {
+    return Container(
+      child: Column(
+        children: [
+          Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: [
+              Text(
+                'Best Offers in Singapore',
+                style: TextStyle(
+                    fontSize: 17.0,
+                    color: ColorUtils.string2Color('#000001'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ),
+              Text(
+                'See All',
+                style: TextStyle(
+                    fontSize: 17.0,
+                    color: ColorUtils.string2Color('#4161D0'),
+                    fontWeight: FontWeight.w500), // 设置字体大小
+              ),
+            ],
+          ).marginOnly(bottom: 15),
+          Column(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              children: List.generate(2, (index) {
+                double hg = 140;
+                return Container(
+                        // width: MediaQuery.of(context).size.width / 2 - 25,
+                        height: 240,
+                        decoration: const BoxDecoration(
+                          color: Colors.white,
+                          borderRadius: BorderRadius.all(Radius.circular(6.0)),
+                          boxShadow: [
+                            BoxShadow(
+                                color: Color.fromRGBO(184, 191, 217, 0.3),
+                                blurRadius: 6)
+                          ],
+                        ),
+                        child: _buildItem(context, ref, _vm, hg))
+                    .marginOnly(bottom: 13);
+              }))
+        ],
+      ),
+    ).paddingOnly(left: 15, right: 15, top: 10);
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsVmProvider.notifier);
+
+    return Scaffold(
+      // appBar: AppBar(title: Text("奖励")),
+      body: Column(children: [
+        Expanded(
+          child: SingleChildScrollView(
+              scrollDirection: Axis.vertical,
+              physics: const BouncingScrollPhysics(),
+              clipBehavior: Clip.none,
+              child: Column(
+                children: [
+                  _buildTop(context, ref, _vm),
+                  Container(
+                    transform: Matrix4.translationValues(0.0, -25.0, 0.0),
+                    child: _buildSearch(context, ref, _vm), // 使用负数margin
+                  ).paddingOnly(left: 15, right: 15),
+                  _buildSwiper(context, ref, _vm),
+                  _buildRecommend(context, ref, _vm).marginOnly(bottom: 15),
+                  _buildHottest(context, ref, _vm).marginOnly(bottom: 15),
+                  _buildFood(context, ref, _vm).marginOnly(bottom: 15),
+                  _buildBest(context, ref, _vm).marginOnly(bottom: 15),
+                ],
+              )),
+        ),
+      ]).backgroundColor(ColorUtils.string2Color('#F2F3F6')),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_home/rewards_home_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_home_state.dart';
+part 'rewards_home_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsHomeRepository rewardsHomeRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsHomeRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsHomeRepository {
+  DioEngine dioEngine;
+
+  RewardsHomeRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsHomeState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsHomeState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_home/rewards_home_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_home_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsHomeRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsHomeRepository].
+@ProviderFor(rewardsHomeRepository)
+final rewardsHomeRepositoryProvider = Provider<RewardsHomeRepository>.internal(
+  rewardsHomeRepository,
+  name: r'rewardsHomeRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsHomeRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsHomeRepositoryRef = ProviderRef<RewardsHomeRepository>;
+// 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

+ 57 - 0
packages/cpt_rewards/lib/modules/rewards_home/rewards_home_state.dart

@@ -0,0 +1,57 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsHomeState rewardsHomeStateFromJson(String str) =>
+    RewardsHomeState.fromJson(json.decode(str));
+
+String rewardsHomeStateToJson(RewardsHomeState data) =>
+    json.encode(data.toJson());
+
+class RewardsHomeState {
+  RewardsHomeState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+    required this.lists,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+  List<Map<String, dynamic>> lists;
+
+  factory RewardsHomeState.fromJson(Map<dynamic, dynamic> json) =>
+      RewardsHomeState(
+        curPage: json["curPage"],
+        pageSize: json["pageSize"],
+        list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+        filterCount: json["filterCount"],
+        lists: List<Map<String, dynamic>>.from(json["lists"].map((x) => x)),
+      );
+
+  Map<dynamic, dynamic> toJson() => {
+        "curPage": curPage,
+        "pageSize": pageSize,
+        "list": List<dynamic>.from(list.map((x) => x)),
+        "filterCount": filterCount,
+        "lists": List<dynamic>.from(lists.map((x) => x)),
+      };
+  RewardsHomeState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+    List<Map<String, dynamic>>? lists,
+  }) {
+    return RewardsHomeState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+      lists: list ?? this.lists,
+    );
+  }
+}

+ 122 - 0
packages/cpt_rewards/lib/modules/rewards_home/rewards_home_vm.dart

@@ -0,0 +1,122 @@
+import 'package:cs_resources/generated/assets.dart';
+import 'package:flutter/material.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:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import './rewards_home_state.dart';
+import './rewards_home_repository.dart';
+part 'rewards_home_vm.g.dart';
+
+@riverpod
+class RewardsHomeVm extends _$RewardsHomeVm {
+  late RewardsHomeRepository rewardsHomeRepository;
+  RewardsHomeState initState() {
+    return RewardsHomeState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+      lists: [
+        {'title': 'YY', 'icon': Assets.rewardsRewardsIndex1},
+        {'title': 'F&B', 'icon': Assets.rewardsRewardsIndex2},
+        {'title': 'F&B', 'icon': Assets.rewardsRewardsIndex3},
+        {'title': 'Beauty', 'icon': Assets.rewardsRewardsIndex4},
+        {'title': 'Activites', 'icon': Assets.rewardsRewardsIndex5},
+        {'title': 'Travel', 'icon': Assets.rewardsRewardsIndex6},
+        {'title': 'Electronics', 'icon': Assets.rewardsRewardsIndex7},
+        {'title': 'Gifts', 'icon': Assets.rewardsRewardsIndex8},
+        {'title': 'Services', 'icon': Assets.rewardsRewardsIndex9},
+      ],
+    );
+  }
+
+  @override
+  RewardsHomeState build() {
+    // 初始化列表数据
+    // 初始化列表数据
+    // 引入数据仓库
+    Log.d("----property_news_vm-----initPageData");
+    rewardsHomeRepository = ref.read(rewardsHomeRepositoryProvider);
+    // 初始化状态
+    RewardsHomeState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount)Home{
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsHomeRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_home/rewards_home_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_home_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsHomeVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsHomeVm].
+@ProviderFor(RewardsHomeVm)
+final rewardsVmProvider =
+    AutoDisposeNotifierProvider<RewardsHomeVm, RewardsHomeState>.internal(
+  RewardsHomeVm.new,
+  name: r'rewardsHomeVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsHomeVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsHomeVm = AutoDisposeNotifier<RewardsHomeState>;
+// 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

+ 212 - 0
packages/cpt_rewards/lib/modules/rewards_list/dialog/reward_listfilter_all_dialog.dart

@@ -0,0 +1,212 @@
+import 'package:cpt_rewards/modules/rewards_successful/rewards_successful_page.dart';
+import 'package:cs_resources/generated/assets.dart';
+import 'package:cs_resources/generated/l10n.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/widget_export.dart';
+import '../rewards_list_vm.dart';
+
+class RewardsListfilterAllDialo extends HookConsumerWidget {
+  VoidCallback confirmAction;
+
+  RewardsListfilterAllDialo({
+    required this.confirmAction,
+  });
+
+  Widget CheckboxList(BuildContext context) {
+    return Column(
+      children: [
+        Column(
+          children: [
+            Container(
+                height: 45,
+                decoration: BoxDecoration(
+                    border: Border(
+                        bottom: BorderSide(
+                  width: 1.0, // 底边边框的宽度
+                  color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+                ))),
+                child: Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    Row(
+                      children: [
+                        Text(
+                          'Latest',
+                          style: TextStyle(
+                              fontSize: 16.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w400),
+                        ),
+                      ],
+                    ),
+                    const MyAssetImage(
+                      Assets.rewardsRewardsIconDomn,
+                      width: 17,
+                      height: 17,
+                    )
+                  ],
+                )),
+            Container(
+                height: 45,
+                decoration: BoxDecoration(
+                    border: Border(
+                        bottom: BorderSide(
+                  width: 1.0, // 底边边框的宽度
+                  color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+                ))),
+                child: Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    Row(
+                      children: [
+                        Text(
+                          'Latest',
+                          style: TextStyle(
+                              fontSize: 16.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w400),
+                        ),
+                      ],
+                    ),
+                    const MyAssetImage(
+                      Assets.rewardsRewardsIconDomn,
+                      width: 17,
+                      height: 17,
+                    )
+                  ],
+                )),
+            Container(
+                height: 45,
+                decoration: BoxDecoration(
+                    border: Border(
+                        bottom: BorderSide(
+                  width: 1.0, // 底边边框的宽度
+                  color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+                ))),
+                child: Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    Row(
+                      children: [
+                        Text(
+                          'Latest',
+                          style: TextStyle(
+                              fontSize: 16.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w400),
+                        ),
+                      ],
+                    ),
+                    const MyAssetImage(
+                      Assets.rewardsRewardsIconDomn,
+                      width: 17,
+                      height: 17,
+                    )
+                  ],
+                )),
+            Container(
+                height: 45,
+                decoration: BoxDecoration(
+                    border: Border(
+                        bottom: BorderSide(
+                  width: 1.0, // 底边边框的宽度
+                  color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+                ))),
+                child: Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    Row(
+                      children: [
+                        Text(
+                          'Latest',
+                          style: TextStyle(
+                              fontSize: 16.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w400),
+                        ),
+                      ],
+                    ),
+                    const MyAssetImage(
+                      Assets.rewardsRewardsIconDomn,
+                      width: 17,
+                      height: 17,
+                    )
+                  ],
+                )),
+          ],
+        ).paddingOnly(left: 15, right: 15),
+      ],
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsListVmProvider.notifier);
+    final state = ref.watch(rewardsListVmProvider);
+    List itemsList = _vm.state.list.toList();
+    return Column(
+      crossAxisAlignment: CrossAxisAlignment.start,
+      mainAxisAlignment: MainAxisAlignment.start,
+      children: [
+        Container(
+          transform: Matrix4.translationValues(0.0, 160.0, 0.0),
+          width: double.infinity,
+          padding: const EdgeInsets.only(top: 22),
+          decoration: BoxDecoration(
+            color: context.appColors.whiteSecondBG,
+            boxShadow: const [
+              BoxShadow(
+                  color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+            ],
+          ),
+          child: Column(
+            children: [
+              Container(child: CheckboxList(context)),
+              Row(
+                children: [
+                  const SizedBox(width: 18),
+                  Expanded(
+                      flex: 1,
+                      child: InkWell(
+                        onTap: () async {
+                          onCancel();
+                          RewardsSuccessfulPage.startInstance();
+                          // confirmAction();
+                        },
+                        child: MyTextView(
+                          'Apply',
+                          fontSize: 16,
+                          paddingTop: 13,
+                          paddingBottom: 13,
+                          isFontMedium: true,
+                          textAlign: TextAlign.center,
+                          textColor: Colors.white,
+                          backgroundColor: context.appColors.btnBgDefault,
+                          cornerRadius: 7,
+                        ),
+                      )),
+                  const SizedBox(width: 18),
+                ],
+              ).marginOnly(bottom: 30, top: 28),
+            ],
+          ),
+        ),
+      ],
+    );
+  }
+
+//取消弹框
+  void onCancel() async {
+    SmartDialog.dismiss();
+  }
+}

+ 338 - 0
packages/cpt_rewards/lib/modules/rewards_list/dialog/reward_listfilter_dialog.dart

@@ -0,0 +1,338 @@
+import 'package:cpt_rewards/modules/rewards_successful/rewards_successful_page.dart';
+import 'package:cs_resources/generated/assets.dart';
+import 'package:cs_resources/generated/l10n.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/widget_export.dart';
+import '../rewards_list_vm.dart';
+
+class RewardsListfilterDialo extends HookConsumerWidget {
+  VoidCallback confirmAction;
+
+  RewardsListfilterDialo({
+    required this.confirmAction,
+  });
+
+  Widget CheckboxList(BuildContext context) {
+    var _rangeValues = RangeValues(20.0, 80.0);
+    var isSelected = false;
+    return Column(
+      children: [
+        Container(
+          height: 40,
+          color: ColorUtils.string2Color('#F1F1F1'),
+          child: Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            mainAxisAlignment: MainAxisAlignment.start,
+            children: [
+              Text(
+                textAlign: TextAlign.center,
+                'Sort by',
+                style: TextStyle(
+                    fontSize: 16.0,
+                    color: ColorUtils.string2Color('#767676'),
+                    fontWeight: FontWeight.w500),
+              ),
+            ],
+          ).paddingOnly(left: 15, right: 15),
+        ),
+        Column(
+          children: [
+            Container(
+                height: 45,
+                decoration: BoxDecoration(
+                    border: Border(
+                        bottom: BorderSide(
+                  width: 1.0, // 底边边框的宽度
+                  color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+                ))),
+                child: Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    Row(
+                      children: [
+                        const MyAssetImage(
+                          Assets.rewardsRewardsIconDomn,
+                          width: 13,
+                          height: 16,
+                        ).marginOnly(right: 15),
+                        Text(
+                          'Latest',
+                          style: TextStyle(
+                              fontSize: 16.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w400),
+                        ),
+                      ],
+                    ),
+                    const MyAssetImage(
+                      Assets.rewardsRewardsIconDomn,
+                      width: 17,
+                      height: 17,
+                    )
+                  ],
+                )),
+            Container(
+                height: 45,
+                decoration: BoxDecoration(
+                    border: Border(
+                        bottom: BorderSide(
+                  width: 1.0, // 底边边框的宽度
+                  color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+                ))),
+                child: Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    Row(
+                      children: [
+                        const MyAssetImage(
+                          Assets.rewardsRewardsIconDomn,
+                          width: 13,
+                          height: 16,
+                        ).marginOnly(right: 15),
+                        Text(
+                          'Latest',
+                          style: TextStyle(
+                              fontSize: 16.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w400),
+                        ),
+                      ],
+                    ),
+                    const MyAssetImage(
+                      Assets.rewardsRewardsIconDomn,
+                      width: 17,
+                      height: 17,
+                    )
+                  ],
+                )),
+            Container(
+                height: 45,
+                decoration: BoxDecoration(
+                    border: Border(
+                        bottom: BorderSide(
+                  width: 1.0, // 底边边框的宽度
+                  color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+                ))),
+                child: Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    Row(
+                      children: [
+                        const MyAssetImage(
+                          Assets.rewardsRewardsIconDomn,
+                          width: 13,
+                          height: 16,
+                        ).marginOnly(right: 15),
+                        Text(
+                          'Latest',
+                          style: TextStyle(
+                              fontSize: 16.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w400),
+                        ),
+                      ],
+                    ),
+                    const MyAssetImage(
+                      Assets.rewardsRewardsIconDomn,
+                      width: 17,
+                      height: 17,
+                    )
+                  ],
+                )),
+            Container(
+                height: 45,
+                decoration: BoxDecoration(
+                    border: Border(
+                        bottom: BorderSide(
+                  width: 1.0, // 底边边框的宽度
+                  color: ColorUtils.string2Color('#F2F3F6'), // 底边边框的颜色
+                ))),
+                child: Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    Row(
+                      children: [
+                        const MyAssetImage(
+                          Assets.rewardsRewardsIconDomn,
+                          width: 13,
+                          height: 16,
+                        ).marginOnly(right: 15),
+                        Text(
+                          'Latest',
+                          style: TextStyle(
+                              fontSize: 16.0,
+                              color: ColorUtils.string2Color('#000000'),
+                              fontWeight: FontWeight.w400),
+                        ),
+                      ],
+                    ),
+                    const MyAssetImage(
+                      Assets.rewardsRewardsIconDomn,
+                      width: 17,
+                      height: 17,
+                    )
+                  ],
+                )),
+          ],
+        ).paddingOnly(left: 15, right: 15),
+        Container(
+          height: 40,
+          color: ColorUtils.string2Color('#F1F1F1'),
+          child: Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            mainAxisAlignment: MainAxisAlignment.start,
+            children: [
+              Text(
+                textAlign: TextAlign.center,
+                'Filter By',
+                style: TextStyle(
+                    fontSize: 16.0,
+                    color: ColorUtils.string2Color('#767676'),
+                    fontWeight: FontWeight.w500),
+              ),
+            ],
+          ).paddingOnly(left: 15, right: 15),
+        ),
+        Row(
+          crossAxisAlignment: CrossAxisAlignment.center,
+          mainAxisAlignment: MainAxisAlignment.start,
+          children: [
+            Text(
+              '0',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: ColorUtils.string2Color('#000000'),
+                  fontWeight: FontWeight.w400),
+            ).marginOnly(right: 3),
+            Text(
+              'points',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: ColorUtils.string2Color('#000000'),
+                  fontWeight: FontWeight.w400),
+            ).marginOnly(right: 3),
+            Text(
+              '-',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: ColorUtils.string2Color('#000000'),
+                  fontWeight: FontWeight.w400),
+            ).marginOnly(right: 3),
+            Text(
+              '1200+',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: ColorUtils.string2Color('#000000'),
+                  fontWeight: FontWeight.w400),
+            ).marginOnly(right: 3),
+            Text(
+              'points',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: ColorUtils.string2Color('#000000'),
+                  fontWeight: FontWeight.w400),
+            ).marginOnly(right: 3),
+          ],
+        ).paddingOnly(left: 15, right: 15, top: 20),
+        RangeSlider(
+          values: _rangeValues, // 初始化范围
+          min: 0, // 最小值
+          max: 100, // 最大值
+          onChanged: (RangeValues values) {
+            // 处理范围改变事件
+            _rangeValues = values;
+            print('Selected range: ${values.start} to ${values.end}');
+          },
+        ).marginOnly(top: 5),
+        CheckboxListTile(
+          title: Container(
+            transform: Matrix4.translationValues(-20.0, 0.0, 0.0),
+            child: Text(
+              'Only show rewards I can redeem',
+              style: TextStyle(
+                  fontSize: 14.0,
+                  color: ColorUtils.string2Color('#767676'),
+                  fontWeight: FontWeight.w400),
+            ),
+          ),
+          controlAffinity: ListTileControlAffinity.leading,
+          value: isSelected,
+          onChanged: (value) {
+            isSelected = value!;
+          },
+        )
+      ],
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsListVmProvider.notifier);
+    final state = ref.watch(rewardsListVmProvider);
+    List itemsList = _vm.state.list.toList();
+    return Column(
+      crossAxisAlignment: CrossAxisAlignment.start,
+      mainAxisAlignment: MainAxisAlignment.start,
+      children: [
+        Container(
+          transform: Matrix4.translationValues(0.0, 160.0, 0.0),
+          width: double.infinity,
+          padding: const EdgeInsets.only(top: 22),
+          decoration: BoxDecoration(
+            color: context.appColors.whiteSecondBG,
+            boxShadow: const [
+              BoxShadow(
+                  color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+            ],
+          ),
+          child: Column(
+            children: [
+              Container(child: CheckboxList(context)),
+              Row(
+                children: [
+                  const SizedBox(width: 18),
+                  Expanded(
+                      flex: 1,
+                      child: InkWell(
+                        onTap: () async {
+                          onCancel();
+                          RewardsSuccessfulPage.startInstance();
+                          // confirmAction();
+                        },
+                        child: MyTextView(
+                          'Apply',
+                          fontSize: 16,
+                          paddingTop: 13,
+                          paddingBottom: 13,
+                          isFontMedium: true,
+                          textAlign: TextAlign.center,
+                          textColor: Colors.white,
+                          backgroundColor: context.appColors.btnBgDefault,
+                          cornerRadius: 7,
+                        ),
+                      )),
+                  const SizedBox(width: 18),
+                ],
+              ).marginOnly(bottom: 30, top: 28),
+            ],
+          ),
+        ),
+      ],
+    );
+  }
+
+//取消弹框
+  void onCancel() async {
+    SmartDialog.dismiss();
+  }
+}

+ 283 - 0
packages/cpt_rewards/lib/modules/rewards_list/rewards_list_page.dart

@@ -0,0 +1,283 @@
+import 'package:cpt_rewards/modules/rewards_detail/rewards_detail_page.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_appbar.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/shatter/picker_container.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:cs_resources/generated/assets.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_list_vm.dart';
+
+@RoutePage()
+class RewardsListPage extends HookConsumerWidget {
+  const RewardsListPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsListPageRoute());
+    } else {
+      appRouter.push(const RewardsListPageRoute());
+    }
+  }
+
+  Widget _buildItemLeftSection(BuildContext context, WidgetRef ref, item, _vm) {
+    return Column(
+      children: [
+        Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            const MyAssetImage(
+              Assets.rewardsRewardsIndex1,
+              // width: 110,
+              height: 150,
+            ),
+            const Text(
+              maxLines: 1, // 设置最大行数为2
+              overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+              'Cute children multifunctional ……',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: Colors.black,
+                  fontWeight: FontWeight.w500),
+            ),
+            Text(
+              maxLines: 1, // 设置最大行数为2
+              overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+              'Hong Ye Group Co., Ltd',
+              style: TextStyle(
+                  fontSize: 13.0,
+                  color: ColorUtils.string2Color('#808DAF'),
+                  fontWeight: FontWeight.w400),
+            ).marginOnly(bottom: 5),
+            Row(
+              children: [
+                const Text(
+                  '300',
+                  style: TextStyle(
+                      fontSize: 19.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w500),
+                ),
+                Text(
+                  '350',
+                  style: TextStyle(
+                      decoration: TextDecoration.lineThrough,
+                      decorationColor: ColorUtils.string2Color('#000000'),
+                      decorationStyle: TextDecorationStyle.solid,
+                      fontSize: 12.0,
+                      color: ColorUtils.string2Color('#000000'),
+                      fontWeight: FontWeight.w400),
+                ).marginOnly(left: 5, right: 5),
+                const Text(
+                  'Points',
+                  style: TextStyle(
+                      fontSize: 13.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w400),
+                ),
+              ],
+            ),
+          ],
+        ).onTap(() {
+          RewardsDetailPage.startInstance();
+        }),
+      ],
+    ).paddingOnly(top: 0);
+  }
+
+  Widget _buildItemRightSection(
+      BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      // color: Colors.green,
+      child: Text(
+        item['price'],
+        style: const TextStyle(
+            fontSize: 14.0,
+            color: Colors.black,
+            fontWeight: FontWeight.w400), // 设置字体大小
+      ),
+    );
+  }
+
+  // listitem
+  Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      decoration: const BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.all(Radius.circular(6.0)),
+        boxShadow: [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Column(
+        children: [
+          SizedBox(
+            width: MediaQuery.of(context).size.width - 30,
+            height: 235,
+            // margin: const EdgeInsets.only(left: 15, right: 15, top: 12.5),
+            child: Column(
+              crossAxisAlignment: CrossAxisAlignment.start,
+              mainAxisAlignment: MainAxisAlignment.start,
+              children: [
+                _buildItemLeftSection(context, ref, item, _vm)
+                // .marginOnly(bottom: 5),
+                // _buildItemRightSection(context, ref, item, _vm),
+              ],
+            ).paddingOnly(left: 20, right: 20),
+          ).constrained(
+            minHeight: 235,
+          ),
+        ],
+      ),
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  // list
+  Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
+    List itemsList = _vm.state.list.toList();
+    return ListView.builder(
+      itemCount: itemsList.length,
+      itemBuilder: (context, index) {
+        return _buildSaleItem(context, ref, itemsList[index], _vm);
+      },
+    );
+  }
+
+  Widget _buildTop(BuildContext context, WidgetRef ref, _vm) {
+    final state = ref.watch(rewardsListVmProvider);
+    return Container(
+      height: 55,
+      decoration: const BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.all(Radius.circular(6.0)),
+        boxShadow: [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Row(
+        children: [
+          SizedBox(
+              width: MediaQuery.of(context).size.width / 2 - 60,
+              child:
+                  // Column(
+                  //   children: [
+                  //     PickerContainer(
+                  //       content: state.selectedOption ?? "",
+                  //       hint: 'All',
+                  //       bgColor: Colors.white,
+                  //       margin: const EdgeInsets.only(top: 0),
+                  //       onClick: _vm.pickCategory,
+                  //     ),
+                  //   ],
+                  // ),
+                  const Row(
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: [
+                  Text(
+                    'All',
+                    style: TextStyle(
+                        fontSize: 15.0,
+                        color: Colors.black,
+                        fontWeight: FontWeight.w500), // 设置字体大小
+                  ),
+                  MyAssetImage(
+                    Assets.rewardsRewardsIconDomn,
+                    width: 12,
+                    height: 7,
+                  ),
+                ],
+              ).onTap(() {
+                // 去详情
+                _vm.doDeleteAccountAll(context);
+              })).paddingOnly(left: 15, right: 15),
+          SizedBox(
+              width: MediaQuery.of(context).size.width / 2 - 40,
+              child:
+                  // Column(
+                  //   children: [
+                  //     PickerContainer(
+                  //       content: state.selectedOption ?? "",
+                  //       hint: 'Popularity',
+                  //       bgColor: Colors.white,
+                  //       margin: const EdgeInsets.only(top: 0),
+                  //       onClick: _vm.pickCategory,
+                  //     ),
+                  //   ],
+                  // )
+                  const Row(
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: [
+                  Text(
+                    'Popularity',
+                    style: const TextStyle(
+                        fontSize: 15.0,
+                        color: Colors.black,
+                        fontWeight: FontWeight.w500), // 设置字体大小
+                  ),
+                  MyAssetImage(
+                    Assets.rewardsRewardsIconDomn,
+                    width: 12,
+                    height: 7,
+                  ),
+                ],
+              ).onTap(() {
+                // 去详情
+                _vm.doDeleteAccount(context);
+              })).paddingOnly(left: 15, right: 15)
+        ],
+      ),
+    )
+        .marginOnly(top: 12, left: 15, right: 15)
+        .backgroundColor(ColorUtils.string2Color('#F2F3F6'));
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsListVmProvider.notifier);
+    final state = ref.watch(rewardsListVmProvider);
+    return Scaffold(
+      appBar: MyAppBar.appBar(
+        context,
+        "Recommend",
+        backgroundColor: context.appColors.whiteBG,
+      ),
+      body: Container(
+        child: Column(
+          children: [
+            _buildTop(context, ref, _vm),
+            Expanded(
+              child: EasyRefresh(
+                // 上拉加载
+                onLoad: () async {
+                  Log.d("----onLoad");
+                  _vm.onLoadData();
+                },
+                // 下拉刷新
+                onRefresh: () async {
+                  Log.d("----onRefresh");
+                  _vm.refreshListData();
+                },
+                child: Container(
+                    color: ColorUtils.string2Color('#F2F3F6'),
+                    padding: const EdgeInsets.only(top: 15),
+                    child: _buildSaleList(context, ref, _vm)),
+              ),
+            )
+          ],
+        ),
+      ),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_list/rewards_list_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_list_state.dart';
+part 'rewards_list_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsListRepository rewardsListRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsListRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsListRepository {
+  DioEngine dioEngine;
+
+  RewardsListRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsListState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsListState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_list/rewards_list_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_list_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsListRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsListRepository].
+@ProviderFor(rewardsListRepository)
+final rewardsListRepositoryProvider = Provider<RewardsListRepository>.internal(
+  rewardsListRepository,
+  name: r'rewardsListRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsListRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsListRepositoryRef = ProviderRef<RewardsListRepository>;
+// 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

+ 55 - 0
packages/cpt_rewards/lib/modules/rewards_list/rewards_list_state.dart

@@ -0,0 +1,55 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsListState rewardsListStateFromJson(String str) => RewardsListState.fromJson(json.decode(str));
+
+String rewardsListStateToJson(RewardsListState data) => json.encode(data.toJson());
+
+class RewardsListState {
+  //类型选项
+  final List<String> optionList = ["条件1", "条件2", "条件3", "条件4"];
+  String? selectedOption;
+  RewardsListState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+    this.selectedOption,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsListState.fromJson(Map<dynamic, dynamic> json) => RewardsListState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsListState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+    String? selectedOption,
+  }) {
+    return RewardsListState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+      selectedOption: selectedOption ?? this.selectedOption,
+    );
+  }
+}

+ 147 - 0
packages/cpt_rewards/lib/modules/rewards_list/rewards_list_vm.dart

@@ -0,0 +1,147 @@
+import 'package:cpt_rewards/modules/rewards_list/dialog/reward_listfilter_all_dialog.dart';
+import 'package:flutter/material.dart';
+import 'package:cpt_rewards/modules/rewards_list/dialog/reward_listfilter_dialog.dart';
+import 'package:plugin_platform/engine/dialog/dialog_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:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import './rewards_list_state.dart';
+import './rewards_list_repository.dart';
+part 'rewards_list_vm.g.dart';
+
+@riverpod
+class RewardsListVm extends _$RewardsListVm {
+  late RewardsListRepository rewardsListRepository;
+  RewardsListState initState() {
+    return RewardsListState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsListState build() {
+    // 引入数据仓库
+    rewardsListRepository = ref.read(rewardsListRepositoryProvider);
+    // 初始化状态
+    RewardsListState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsListRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+
+  //选择选项
+  void pickCategory() {
+    OptionPickerUtil.showCupertinoOptionPicker(
+      items: state.optionList,
+      initialSelectIndex: 0,
+      onPickerChanged: (_, index) {
+        state = state.copyWith(selectedOption: state.optionList[index]);
+      },
+    );
+  }
+
+  void doDeleteAccount(context) {
+    DialogEngine.show(
+      maskColor: Colors.transparent,
+      animType: DialogAnimation.centerScale_otherSlide,
+      position: DialogPosition.top,
+      widget: RewardsListfilterDialo(
+        confirmAction: () {
+          ToastEngine.show("点击了确定");
+        },
+      ),
+    );
+  }
+
+  void doDeleteAccountAll(context) {
+    DialogEngine.show(
+      maskColor: Colors.transparent,
+      animType: DialogAnimation.centerScale_otherSlide,
+      position: DialogPosition.top,
+      widget: RewardsListfilterAllDialo(
+        confirmAction: () {
+          ToastEngine.show("点击了确定");
+        },
+      ),
+    );
+  }
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_list/rewards_list_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_list_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsListVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsListVm].
+@ProviderFor(RewardsListVm)
+final rewardsListVmProvider =
+    AutoDisposeNotifierProvider<RewardsListVm, RewardsListState>.internal(
+  RewardsListVm.new,
+  name: r'rewardsListVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsListVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsListVm = AutoDisposeNotifier<RewardsListState>;
+// 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

+ 205 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_page.dart

@@ -0,0 +1,205 @@
+import 'package:cpt_rewards/modules/rewards_code/rewards_code_page.dart';
+import 'package:cpt_rewards/modules/rewards_redeem/rewards_redeem_page.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:cs_resources/generated/assets.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_my_active_vm.dart';
+
+@RoutePage()
+class RewardsMyActivePage extends HookConsumerWidget {
+  const RewardsMyActivePage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsMyActivePageRoute());
+    } else {
+      appRouter.push(const RewardsMyActivePageRoute());
+    }
+  }
+
+  Widget _buildItemLeftSection(BuildContext context, WidgetRef ref, item, _vm) {
+    return Column(
+      children: [
+        Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            const Text(
+              maxLines: 1, // 设置最大行数为2
+              overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+              'Cute children multifunctional ……',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: Colors.black,
+                  fontWeight: FontWeight.w500),
+            ),
+            Row(
+              children: [
+                const Text(
+                  '300',
+                  style: TextStyle(
+                      fontSize: 19.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w500),
+                ),
+                Text(
+                  '350',
+                  style: TextStyle(
+                      decoration: TextDecoration.lineThrough,
+                      decorationColor: ColorUtils.string2Color('#000000'),
+                      decorationStyle: TextDecorationStyle.solid,
+                      fontSize: 12.0,
+                      color: ColorUtils.string2Color('#000000'),
+                      fontWeight: FontWeight.w400),
+                ).marginOnly(left: 5, right: 5),
+                const Text(
+                  'Points',
+                  style: TextStyle(
+                      fontSize: 13.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w400),
+                ),
+              ],
+            ),
+            Row(
+              children: [
+                const MyAssetImage(
+                  Assets.rewardsRewardsIconDatd,
+                  width: 15,
+                  height: 15,
+                ),
+                const Text(
+                  'Redeem From: 17 Mar 2024 until 15 Jul 2024',
+                  style: TextStyle(
+                      fontSize: 13.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w400),
+                ).marginOnly(left: 6)
+              ],
+            ).paddingOnly(left: 6),
+            Container(
+                height: 43,
+                decoration: BoxDecoration(
+                  color: ColorUtils.string2Color('#4161D0'),
+                  borderRadius: BorderRadius.circular(8), // 圆角
+                ),
+                child: Expanded(
+                    child: Container(
+                        alignment: Alignment.center,
+                        child: Text(
+                          'Redeem Now',
+                          style: TextStyle(
+                              fontSize: 15.0,
+                              color: ColorUtils.string2Color('#FFFFFF'),
+                              fontWeight: FontWeight.w500),
+                        )))).marginOnly(top: 10, bottom: 5),
+          ],
+        ),
+        const MyAssetImage(
+          Assets.rewardsRewardsIndex1,
+          // width: 110,
+          height: 133,
+        ),
+      ],
+    ).paddingOnly(top: 20).onTap(() {
+      bool isd = true;
+      if (isd) {
+        RewardsRedeemPage.startInstance();
+      } else {
+        RewardsCodePage.startInstance();
+      }
+    });
+  }
+
+  Widget _buildItemRightSection(
+      BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      // color: Colors.green,
+      child: Text(
+        item['price'],
+        style: const TextStyle(
+            fontSize: 14.0,
+            color: Colors.black,
+            fontWeight: FontWeight.w400), // 设置字体大小
+      ),
+    );
+  }
+
+  // listitem
+  Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      decoration: const BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.all(Radius.circular(6.0)),
+        boxShadow: [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Column(
+        children: [
+          SizedBox(
+            width: MediaQuery.of(context).size.width - 30,
+            height: 302,
+            // margin: const EdgeInsets.only(left: 15, right: 15, top: 12.5),
+            child: Column(
+              crossAxisAlignment: CrossAxisAlignment.start,
+              mainAxisAlignment: MainAxisAlignment.start,
+              children: [
+                _buildItemLeftSection(context, ref, item, _vm)
+                // .marginOnly(bottom: 5),
+                // _buildItemRightSection(context, ref, item, _vm),
+              ],
+            ).paddingOnly(left: 20, right: 20),
+          ).constrained(
+            minHeight: 300.5,
+          ),
+        ],
+      ),
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  // list
+  Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
+    List itemsList = _vm.state.list.toList();
+    return ListView.builder(
+      itemCount: itemsList.length,
+      itemBuilder: (context, index) {
+        return _buildSaleItem(context, ref, itemsList[index], _vm);
+      },
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsMyActiveVmProvider.notifier);
+
+    return Scaffold(
+      // appBar: AppBar(title: Text("资产")),
+      body: EasyRefresh(
+        // 上拉加载
+        onLoad: () async {
+          Log.d("----onLoad");
+          _vm.onLoadData();
+        },
+        // 下拉刷新
+        onRefresh: () async {
+          Log.d("----onRefresh");
+          _vm.refreshListData();
+        },
+        child: Container(
+            color: ColorUtils.string2Color('#F2F3F6'),
+            padding: const EdgeInsets.only(top: 15),
+            child: _buildSaleList(context, ref, _vm)),
+      ),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_my_active_state.dart';
+part 'rewards_my_active_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsMyActiveRepository rewardsMyActiveRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsMyActiveRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsMyActiveRepository {
+  DioEngine dioEngine;
+
+  RewardsMyActiveRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsMyActiveState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsMyActiveState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_my_active_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsMyActiveRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsMyActiveRepository].
+@ProviderFor(rewardsMyActiveRepository)
+final rewardsMyActiveRepositoryProvider = Provider<RewardsMyActiveRepository>.internal(
+  rewardsMyActiveRepository,
+  name: r'rewardsMyActiveRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsMyActiveRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsMyActiveRepositoryRef = ProviderRef<RewardsMyActiveRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsMyActiveState rewardsMyActiveStateFromJson(String str) => RewardsMyActiveState.fromJson(json.decode(str));
+
+String rewardsMyActiveStateToJson(RewardsMyActiveState data) => json.encode(data.toJson());
+
+class RewardsMyActiveState {
+  RewardsMyActiveState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsMyActiveState.fromJson(Map<dynamic, dynamic> json) => RewardsMyActiveState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsMyActiveState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsMyActiveState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 105 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_vm.dart

@@ -0,0 +1,105 @@
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import './rewards_my_active_state.dart';
+import './rewards_my_active_repository.dart';
+part 'rewards_my_active_vm.g.dart';
+
+@riverpod
+class RewardsMyActiveVm extends _$RewardsMyActiveVm {
+  late RewardsMyActiveRepository rewardsMyActiveRepository;
+  RewardsMyActiveState initState() {
+    return RewardsMyActiveState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsMyActiveState build() {
+    // 引入数据仓库
+    rewardsMyActiveRepository = ref.read(rewardsMyActiveRepositoryProvider);
+    // 初始化状态
+    RewardsMyActiveState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsMyActiveRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_active/rewards_my_active_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_my_active_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsMyActiveVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsMyActiveVm].
+@ProviderFor(RewardsMyActiveVm)
+final rewardsMyActiveVmProvider =
+    AutoDisposeNotifierProvider<RewardsMyActiveVm, RewardsMyActiveState>.internal(
+  RewardsMyActiveVm.new,
+  name: r'rewardsMyActiveVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsMyActiveVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsMyActiveVm = AutoDisposeNotifier<RewardsMyActiveState>;
+// 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

+ 184 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_page.dart

@@ -0,0 +1,184 @@
+import 'package:cpt_rewards/modules/rewards_transaction/rewards_transaction_page.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:cs_resources/generated/assets.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_my_expired_vm.dart';
+
+@RoutePage()
+class RewardsMyExpiredPage extends HookConsumerWidget {
+  const RewardsMyExpiredPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsMyExpiredPageRoute());
+    } else {
+      appRouter.push(const RewardsMyExpiredPageRoute());
+    }
+  }
+
+  Widget _buildItemLeftSection(BuildContext context, WidgetRef ref, item, _vm) {
+    return Column(
+      children: [
+        Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            const Text(
+              maxLines: 1, // 设置最大行数为2
+              overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+              'Cute children multifunctional ……',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: Colors.black,
+                  fontWeight: FontWeight.w500),
+            ),
+            Row(
+              children: [
+                const Text(
+                  '300',
+                  style: TextStyle(
+                      fontSize: 19.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w500),
+                ),
+                Text(
+                  '350',
+                  style: TextStyle(
+                      decoration: TextDecoration.lineThrough,
+                      decorationColor: ColorUtils.string2Color('#000000'),
+                      decorationStyle: TextDecorationStyle.solid,
+                      fontSize: 12.0,
+                      color: ColorUtils.string2Color('#000000'),
+                      fontWeight: FontWeight.w400),
+                ).marginOnly(left: 5, right: 5),
+                const Text(
+                  'Points',
+                  style: TextStyle(
+                      fontSize: 13.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w400),
+                ),
+              ],
+            ),
+            Row(
+              children: [
+                const MyAssetImage(
+                  Assets.rewardsRewardsIconDatd,
+                  width: 15,
+                  height: 15,
+                ),
+                const Text(
+                  'Redeem From: 17 Mar 2024 until 15 Jul 2024',
+                  style: TextStyle(
+                      fontSize: 13.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w400),
+                ).marginOnly(left: 6)
+              ],
+            ).paddingOnly(left: 6),
+          ],
+        ),
+        const MyAssetImage(
+          Assets.rewardsRewardsIndex1,
+          // width: 110,
+          height: 133,
+        ),
+      ],
+    ).paddingOnly(top: 20).onTap(() {
+      // 去详情
+      RewardsTransactionPage.startInstance();
+    });
+  }
+
+  Widget _buildItemRightSection(
+      BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      // color: Colors.green,
+      child: Text(
+        item['price'],
+        style: const TextStyle(
+            fontSize: 14.0,
+            color: Colors.black,
+            fontWeight: FontWeight.w400), // 设置字体大小
+      ),
+    );
+  }
+
+  // listitem
+  Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      decoration: const BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.all(Radius.circular(6.0)),
+        boxShadow: [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Column(
+        children: [
+          SizedBox(
+            width: MediaQuery.of(context).size.width - 30,
+            height: 302,
+            // margin: const EdgeInsets.only(left: 15, right: 15, top: 12.5),
+            child: Column(
+              crossAxisAlignment: CrossAxisAlignment.start,
+              mainAxisAlignment: MainAxisAlignment.start,
+              children: [
+                _buildItemLeftSection(context, ref, item, _vm)
+                // .marginOnly(bottom: 5),
+                // _buildItemRightSection(context, ref, item, _vm),
+              ],
+            ).paddingOnly(left: 20, right: 20),
+          ).constrained(
+            minHeight: 300.5,
+          ),
+        ],
+      ),
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  // list
+  Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
+    List itemsList = _vm.state.list.toList();
+    return ListView.builder(
+      itemCount: itemsList.length,
+      itemBuilder: (context, index) {
+        return _buildSaleItem(context, ref, itemsList[index], _vm);
+      },
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsMyExpiredVmProvider.notifier);
+
+    return Scaffold(
+      // appBar: AppBar(title: Text("资产")),
+      body: EasyRefresh(
+        // 上拉加载
+        onLoad: () async {
+          Log.d("----onLoad");
+          _vm.onLoadData();
+        },
+        // 下拉刷新
+        onRefresh: () async {
+          Log.d("----onRefresh");
+          _vm.refreshListData();
+        },
+        child: Container(
+            color: ColorUtils.string2Color('#F2F3F6'),
+            padding: const EdgeInsets.only(top: 15),
+            child: _buildSaleList(context, ref, _vm)),
+      ),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_my_expired_state.dart';
+part 'rewards_my_expired_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsMyExpiredRepository rewardsMyExpiredRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsMyExpiredRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsMyExpiredRepository {
+  DioEngine dioEngine;
+
+  RewardsMyExpiredRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsMyExpiredState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsMyExpiredState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_my_expired_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsMyExpiredRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsMyExpiredRepository].
+@ProviderFor(rewardsMyExpiredRepository)
+final rewardsMyExpiredRepositoryProvider = Provider<RewardsMyExpiredRepository>.internal(
+  rewardsMyExpiredRepository,
+  name: r'rewardsMyExpiredRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsMyExpiredRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsMyExpiredRepositoryRef = ProviderRef<RewardsMyExpiredRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsMyExpiredState rewardsMyExpiredStateFromJson(String str) => RewardsMyExpiredState.fromJson(json.decode(str));
+
+String rewardsMyExpiredStateToJson(RewardsMyExpiredState data) => json.encode(data.toJson());
+
+class RewardsMyExpiredState {
+  RewardsMyExpiredState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsMyExpiredState.fromJson(Map<dynamic, dynamic> json) => RewardsMyExpiredState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsMyExpiredState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsMyExpiredState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 105 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_vm.dart

@@ -0,0 +1,105 @@
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import './rewards_my_expired_state.dart';
+import './rewards_my_expired_repository.dart';
+part 'rewards_my_expired_vm.g.dart';
+
+@riverpod
+class RewardsMyExpiredVm extends _$RewardsMyExpiredVm {
+  late RewardsMyExpiredRepository rewardsMyExpiredRepository;
+  RewardsMyExpiredState initState() {
+    return RewardsMyExpiredState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsMyExpiredState build() {
+    // 引入数据仓库
+    rewardsMyExpiredRepository = ref.read(rewardsMyExpiredRepositoryProvider);
+    // 初始化状态
+    RewardsMyExpiredState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsMyExpiredRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+}

+ 25 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_expired/rewards_my_expired_vm.g.dart

@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_my_expired_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsMyExpiredVmHash() => r'e773ac50dffaf8bb4d820118ee89a83aed303a76';
+
+/// See also [RewardsMyExpiredVm].
+@ProviderFor(RewardsMyExpiredVm)
+final rewardsMyExpiredVmProvider =
+    AutoDisposeNotifierProvider<RewardsMyExpiredVm, RewardsMyExpiredState>.internal(
+  RewardsMyExpiredVm.new,
+  name: r'rewardsMyExpiredVmProvider',
+  debugGetCreateSourceHash:
+      const bool.fromEnvironment('dart.vm.product') ? null : _$rewardsMyExpiredVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RewardsMyExpiredVm = AutoDisposeNotifier<RewardsMyExpiredState>;
+// 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

+ 125 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_page.dart

@@ -0,0 +1,125 @@
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/material.dart';
+// ignore: depend_on_referenced_packages
+import 'package:auto_route/auto_route.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/log_utils.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/my_appbar.dart';
+
+import '../../router/page/rewards_page_router.dart';
+import './rewards_my_vm.dart';
+
+@RoutePage()
+class RewardsMyPage extends HookConsumerWidget {
+  const RewardsMyPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsMyPageRoute());
+    } else {
+      appRouter.push(const RewardsMyPageRoute());
+    }
+  }
+
+  // 顶部tab 切换
+  Widget _buildTopSection(
+      BuildContext context, WidgetRef ref, _vm, tabsRouter) {
+    final topSectionsData = _vm.topSectionsData;
+    final currentTabIdx = tabsRouter.activeIndex;
+    return Container(
+      color: Colors.white,
+      child: Center(
+        child: Row(
+          mainAxisAlignment: MainAxisAlignment.spaceBetween,
+          crossAxisAlignment: CrossAxisAlignment.center,
+          children: List.generate(topSectionsData.length, (index) {
+            final item = topSectionsData[index];
+            return Container(
+              width:
+                  MediaQuery.of(context).size.width / topSectionsData.length -
+                      30,
+              height: 43,
+              padding: const EdgeInsets.only(
+                  top: 10, bottom: 10, left: 10, right: 10),
+              decoration: index == currentTabIdx
+                  ? BoxDecoration(
+                      color: index == currentTabIdx
+                          ? context.appColors.btnBgDefault
+                          : ColorUtils.string2Color("#F2F3F6"),
+                      borderRadius: BorderRadius.circular(20),
+                      boxShadow: [
+                        BoxShadow(
+                          color: Colors.grey.withOpacity(0.5),
+                          spreadRadius: 1,
+                          blurRadius: 5,
+                          offset:
+                              const Offset(0, 2), // changes position of shadow
+                        ),
+                      ],
+                    )
+                  : null,
+              child: Row(
+                children: [
+                  Expanded(
+                    child: Container(
+                      alignment: Alignment.center,
+                      child: MyTextView(
+                        item['title'],
+                        fontSize: 16,
+                        textAlign: TextAlign.center,
+                        isFontMedium: true,
+                        textColor: index == currentTabIdx
+                            ? Colors.white
+                            : ColorUtils.string2Color("#000000"),
+                      ),
+                    ).onTap(
+                      () {
+                        tabsRouter.setActiveIndex(index);
+                      },
+                      type: ClickType.throttle,
+                    ),
+                  ),
+                ],
+              ),
+            ).marginOnly(left: 20, right: 0, top: 10, bottom: 10);
+          }),
+        ),
+      ),
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsMyVmProvider.notifier);
+    return Scaffold(
+        appBar: MyAppBar.appBar(
+          context,
+          "My Rewards",
+          backgroundColor: context.appColors.whiteBG,
+        ),
+        body: AutoTabsRouter.pageView(
+          routes: const [
+            RewardsMyActivePageRoute(),
+            RewardsMyExpiredPageRoute(),
+            RewardsMyUsedPageRoute(),
+          ],
+          builder: (context, child, pageController) {
+            final tabsRouter = AutoTabsRouter.of(context);
+            return Column(
+              children: [
+                _buildTopSection(context, ref, _vm, tabsRouter),
+                Expanded(
+                  child: child,
+                ),
+              ],
+            );
+          },
+        ));
+  }
+}

+ 218 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_page.dart

@@ -0,0 +1,218 @@
+import 'package:cpt_rewards/modules/rewards_transaction/rewards_transaction_page.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/widget_export.dart';
+import 'package:cs_resources/generated/assets.dart';
+
+import '../../../router/page/rewards_page_router.dart';
+import './rewards_my_used_vm.dart';
+
+@RoutePage()
+class RewardsMyUsedPage extends HookConsumerWidget {
+  const RewardsMyUsedPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RewardsMyUsedPageRoute());
+    } else {
+      appRouter.push(const RewardsMyUsedPageRoute());
+    }
+  }
+
+  Widget _buildItemLeftSection(BuildContext context, WidgetRef ref, item, _vm) {
+    return Column(
+      children: [
+        Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: [
+            const Text(
+              maxLines: 1, // 设置最大行数为2
+              overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
+              'Cute children multifunctional ……',
+              style: TextStyle(
+                  fontSize: 16.0,
+                  color: Colors.black,
+                  fontWeight: FontWeight.w500),
+            ),
+            Row(
+              children: [
+                const Text(
+                  '300',
+                  style: TextStyle(
+                      fontSize: 19.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w500),
+                ),
+                Text(
+                  '350',
+                  style: TextStyle(
+                      decoration: TextDecoration.lineThrough,
+                      decorationColor: ColorUtils.string2Color('#000000'),
+                      decorationStyle: TextDecorationStyle.solid,
+                      fontSize: 12.0,
+                      color: ColorUtils.string2Color('#000000'),
+                      fontWeight: FontWeight.w400),
+                ).marginOnly(left: 5, right: 5),
+                const Text(
+                  'Points',
+                  style: TextStyle(
+                      fontSize: 13.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w400),
+                ),
+              ],
+            ),
+            Row(
+              children: [
+                const MyAssetImage(
+                  Assets.rewardsRewardsIconDatd,
+                  width: 15,
+                  height: 15,
+                ),
+                const Text(
+                  'Redeem From: 17 Mar 2024 until 15 Jul 2024',
+                  style: TextStyle(
+                      fontSize: 13.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w400),
+                ).marginOnly(left: 6)
+              ],
+            ).paddingOnly(left: 6),
+            Row(
+              children: [
+                const MyAssetImage(
+                  Assets.rewardsRewardsIconDraw,
+                  width: 15,
+                  height: 15,
+                ),
+                const Text(
+                  'Redeemed at: 2 July 2014, 17:23',
+                  style: TextStyle(
+                      fontSize: 13.0,
+                      color: Colors.black,
+                      fontWeight: FontWeight.w400),
+                ).marginOnly(left: 6)
+              ],
+            ).paddingOnly(left: 6),
+            Container(
+                height: 43,
+                decoration: BoxDecoration(
+                  color: ColorUtils.string2Color('#4161D0'),
+                  borderRadius: BorderRadius.circular(8), // 圆角
+                ),
+                child: Expanded(
+                    child: Container(
+                        alignment: Alignment.center,
+                        child: Text(
+                          'View',
+                          style: TextStyle(
+                              fontSize: 15.0,
+                              color: ColorUtils.string2Color('#FFFFFF'),
+                              fontWeight: FontWeight.w500),
+                        )))).marginOnly(top: 10, bottom: 5).onTap(() {
+              RewardsTransactionPage.startInstance();
+            }),
+          ],
+        ),
+        const MyAssetImage(
+          Assets.rewardsRewardsIndex1,
+          // width: 110,
+          height: 133,
+        ),
+      ],
+    ).paddingOnly(top: 20).onTap(() {
+      // 去详情
+      RewardsTransactionPage.startInstance();
+    });
+  }
+
+  Widget _buildItemRightSection(
+      BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      // color: Colors.green,
+      child: Text(
+        item['price'],
+        style: const TextStyle(
+            fontSize: 14.0,
+            color: Colors.black,
+            fontWeight: FontWeight.w400), // 设置字体大小
+      ),
+    );
+  }
+
+  // listitem
+  Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+    return Container(
+      decoration: const BoxDecoration(
+        color: Colors.white,
+        borderRadius: BorderRadius.all(Radius.circular(6.0)),
+        boxShadow: [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
+      ),
+      child: Column(
+        children: [
+          SizedBox(
+            width: MediaQuery.of(context).size.width - 30,
+            height: 302,
+            // margin: const EdgeInsets.only(left: 15, right: 15, top: 12.5),
+            child: Column(
+              crossAxisAlignment: CrossAxisAlignment.start,
+              mainAxisAlignment: MainAxisAlignment.start,
+              children: [
+                _buildItemLeftSection(context, ref, item, _vm)
+                // .marginOnly(bottom: 5),
+                // _buildItemRightSection(context, ref, item, _vm),
+              ],
+            ).paddingOnly(left: 20, right: 20),
+          ).constrained(
+            minHeight: 300.5,
+          ),
+        ],
+      ),
+    ).marginOnly(left: 15, bottom: 15, right: 15);
+  }
+
+  // list
+  Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
+    List itemsList = _vm.state.list.toList();
+    return ListView.builder(
+      itemCount: itemsList.length,
+      itemBuilder: (context, index) {
+        return _buildSaleItem(context, ref, itemsList[index], _vm);
+      },
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final _vm = ref.read(rewardsMyUsedVmProvider.notifier);
+
+    return Scaffold(
+      // appBar: AppBar(title: Text("资产")),
+      body: EasyRefresh(
+        // 上拉加载
+        onLoad: () async {
+          Log.d("----onLoad");
+          _vm.onLoadData();
+        },
+        // 下拉刷新
+        onRefresh: () async {
+          Log.d("----onRefresh");
+          _vm.refreshListData();
+        },
+        child: Container(
+            color: ColorUtils.string2Color('#F2F3F6'),
+            padding: const EdgeInsets.only(top: 15),
+            child: _buildSaleList(context, ref, _vm)),
+      ),
+    );
+  }
+}

+ 70 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_repository.dart

@@ -0,0 +1,70 @@
+import 'package:domain/constants/api_constants.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/util.dart';
+
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:plugin_basic/provider/http_provider/http_provider.dart';
+
+import './rewards_my_used_state.dart';
+part 'rewards_my_used_repository.g.dart';
+
+@Riverpod(keepAlive: true)
+RewardsMyUsedRepository rewardsMyUsedRepository(Ref ref) {
+  final dioEngine = ref.watch(dioEngineProvider);
+  return RewardsMyUsedRepository(dioEngine: dioEngine);
+}
+
+/*
+ * 数据仓库
+ */
+class RewardsMyUsedRepository {
+  DioEngine dioEngine;
+
+  RewardsMyUsedRepository({required this.dioEngine});
+
+  Future<HttpResult<Object>> fetchPropertyNewsList(
+      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 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = RewardsMyUsedState.fromJson(json!);
+      //重新赋值data或list
+      return result.convert<RewardsMyUsedState>(data: data);
+    }
+    return result.convert();
+  }
+
+
+}

+ 27 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_repository.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'rewards_my_used_repository.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$rewardsMyUsedRepositoryHash() => r'e91b26e60af186a007cb785effb50c16b4967969';
+
+/// See also [rewardsMyUsedRepository].
+@ProviderFor(rewardsMyUsedRepository)
+final rewardsMyUsedRepositoryProvider = Provider<RewardsMyUsedRepository>.internal(
+  rewardsMyUsedRepository,
+  name: r'rewardsMyUsedRepositoryProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$rewardsMyUsedRepositoryHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+@Deprecated('Will be removed in 3.0. Use Ref instead')
+// ignore: unused_element
+typedef RewardsMyUsedRepositoryRef = ProviderRef<RewardsMyUsedRepository>;
+// 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

+ 49 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_state.dart

@@ -0,0 +1,49 @@
+/// YApi QuickType插件生成,具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation
+
+import 'dart:convert';
+
+RewardsMyUsedState rewardsMyUsedStateFromJson(String str) => RewardsMyUsedState.fromJson(json.decode(str));
+
+String rewardsMyUsedStateToJson(RewardsMyUsedState data) => json.encode(data.toJson());
+
+class RewardsMyUsedState {
+  RewardsMyUsedState({
+    required this.curPage,
+    required this.pageSize,
+    required this.list,
+    required this.filterCount,
+  });
+
+  int curPage;
+  int pageSize;
+  List<Map<String, dynamic>> list;
+  int filterCount;
+
+  factory RewardsMyUsedState.fromJson(Map<dynamic, dynamic> json) => RewardsMyUsedState(
+    curPage: json["curPage"],
+    pageSize: json["pageSize"],
+    list: List<Map<String, dynamic>>.from(json["list"].map((x) => x)),
+    filterCount: json["filterCount"],
+  );
+
+  Map<dynamic, dynamic> toJson() => {
+    "curPage": curPage,
+    "pageSize": pageSize,
+    "list": List<dynamic>.from(list.map((x) => x)),
+    "filterCount": filterCount,
+  };
+
+  RewardsMyUsedState copyWith({
+    int? curPage,
+    int? pageSize,
+    List<Map<String, dynamic>>? list,
+    int? filterCount,
+  }) {
+    return RewardsMyUsedState(
+      curPage: curPage ?? this.curPage,
+      pageSize: pageSize ?? this.pageSize,
+      list: list ?? this.list,
+      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+}

+ 105 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_vm.dart

@@ -0,0 +1,105 @@
+import 'package:plugin_platform/http/http_result.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import './rewards_my_used_state.dart';
+import './rewards_my_used_repository.dart';
+part 'rewards_my_used_vm.g.dart';
+
+@riverpod
+class RewardsMyUsedVm extends _$RewardsMyUsedVm {
+  late RewardsMyUsedRepository rewardsMyUsedRepository;
+  RewardsMyUsedState initState() {
+    return RewardsMyUsedState(
+      curPage: 1,
+      pageSize: 10,
+      list: [
+        {
+          "id": 1,
+          "title":
+              "The community will hold the activity of making Zongzi on the Loong Boat ……",
+          "price": "Monday 14 0ct 2024, 15:00 PM~18:00PM",
+        },
+        {
+          "id": 2,
+          "title": "Community basketball competition activities",
+          "price": "Monday 14 Oct 2024, 10:19 AM",
+        },
+      ],
+      filterCount: 2,
+    );
+  }
+
+  @override
+  RewardsMyUsedState build() {
+    // 引入数据仓库
+    rewardsMyUsedRepository = ref.read(rewardsMyUsedRepositoryProvider);
+    // 初始化状态
+    RewardsMyUsedState state = initState();
+    // 初始化列表数据
+    return state;
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----property_news_vm-----initPageData");
+    refreshListData();
+  }
+
+  // 上拉加载
+  Future onLoadData() async {
+    Log.d("----property_news_vm-----initListData");
+    // await Future.delayed(const Duration(seconds: 2));
+    // if(state.list.length >= state.filterCount){
+    //   return;
+    // }else {
+    //   int curPage = state.curPage + 1;
+    //   state = state.copyWith(curPage: curPage,);
+    //   getListData();
+    // }
+    getListData();
+  }
+
+// 去新闻详情页
+  void goNewsDetail(String item) {
+    Log.d(item);
+    // PropertyPage.startInstance(context: context, item: item);
+  }
+
+  // 获取list 列表数据
+  void getListData<T>() async {
+    Log.d("加载listData数据---------------start-----");
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "curPage": state.curPage,
+        "pageSize": state.pageSize,
+      };
+      Log.d("请求参数------$params");
+      final result = await rewardsMyUsedRepository.fetchPropertyNewsList(params);
+      Log.d("请求完成结果------${result.data}");
+      //校验成功失败
+      if (result.isSuccess) {
+        // state = state.copyWith(serverTime: result.data);
+        state = state;
+        ToastEngine.show("获取数据成功");
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 下拉刷新
+  Future refreshListData() async {
+    Log.d("----property_news_vm-----refreshListData ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+
+    state = state.copyWith(curPage: 1, pageSize: 10);
+    // ref.invalidateSelf();
+    // ref.invalidate(propertyNewsVmProvider);
+    getListData();
+  }
+}

+ 0 - 0
packages/cpt_rewards/lib/modules/rewards_my/rewards_my_used/rewards_my_used_vm.g.dart


Some files were not shown because too many files changed in this diff