Browse Source

update community

glglove 4 months ago
parent
commit
5d8e81dc08
56 changed files with 1213 additions and 509 deletions
  1. 2 1
      packages/cpt_facility/lib/modules/booking/facility_booking_view_model.dart
  2. 1 1
      packages/cpt_facility/lib/modules/booking/facility_booking_view_model.g.dart
  3. 91 30
      packages/cpt_facility/lib/modules/detail/facility_detail_page.dart
  4. 16 2
      packages/cpt_facility/lib/modules/detail/facility_detail_state.dart
  5. 22 2
      packages/cpt_facility/lib/modules/detail/facility_detail_view_model.dart
  6. 1 1
      packages/cpt_facility/lib/modules/detail/facility_detail_view_model.g.dart
  7. 7 8
      packages/cpt_facility/lib/modules/facility/active/facility_active_screen.dart
  8. 2 2
      packages/cpt_facility/lib/modules/facility/active/facility_active_state.dart
  9. 2 2
      packages/cpt_facility/lib/modules/facility/active/facility_active_view_model.dart
  10. 1 1
      packages/cpt_facility/lib/modules/facility/active/facility_active_view_model.g.dart
  11. 1 1
      packages/cpt_facility/lib/modules/facility/active/item_facility_active.dart
  12. 11 2
      packages/cpt_facility/lib/modules/facility/deposit/facility_deposit_screen.dart
  13. 2 2
      packages/cpt_facility/lib/modules/facility/deposit/facility_deposit_state.dart
  14. 2 2
      packages/cpt_facility/lib/modules/facility/deposit/facility_deposit_view_model.dart
  15. 1 1
      packages/cpt_facility/lib/modules/facility/deposit/facility_deposit_view_model.g.dart
  16. 1 1
      packages/cpt_facility/lib/modules/facility/deposit/item_facility_deposit.dart
  17. 1 1
      packages/cpt_facility/lib/modules/facility/history/facility_history_screen.dart
  18. 2 2
      packages/cpt_facility/lib/modules/facility/history/facility_history_state.dart
  19. 2 2
      packages/cpt_facility/lib/modules/facility/history/facility_history_view_model.dart
  20. 1 1
      packages/cpt_facility/lib/modules/facility/history/facility_history_view_model.g.dart
  21. 1 1
      packages/cpt_facility/lib/modules/facility/history/item_facility_history.dart
  22. 34 5
      packages/cpt_facility/lib/router/page/facility_page_router.gr.dart
  23. 53 35
      packages/cpt_notice_board/lib/modules/announ/page/announ_page.dart
  24. 43 31
      packages/cpt_notice_board/lib/modules/announ/page/announ_state.dart
  25. 12 15
      packages/cpt_notice_board/lib/modules/announ/repository/announ_repository.dart
  26. 94 55
      packages/cpt_notice_board/lib/modules/announ/vm/announ_vm.dart
  27. 45 22
      packages/cpt_notice_board/lib/modules/documents/page/documents_page.dart
  28. 43 31
      packages/cpt_notice_board/lib/modules/documents/page/documents_state.dart
  29. 13 16
      packages/cpt_notice_board/lib/modules/documents/repository/documents_repository.dart
  30. 97 49
      packages/cpt_notice_board/lib/modules/documents/vm/documents_vm.dart
  31. 33 12
      packages/cpt_notice_board/lib/modules/event/page/event_page.dart
  32. 43 31
      packages/cpt_notice_board/lib/modules/event/page/event_state.dart
  33. 12 16
      packages/cpt_notice_board/lib/modules/event/repository/event_repository.dart
  34. 93 46
      packages/cpt_notice_board/lib/modules/event/vm/event_vm.dart
  35. 45 45
      packages/cpt_notice_board/lib/modules/notice_board/page/notice_board_page.dart
  36. 4 1
      packages/cpt_rewards/lib/modules/rewards/rewards_page.dart
  37. 4 1
      packages/cpt_rewards/lib/modules/rewards_home/rewards_home_page.dart
  38. 4 0
      packages/cs_domain/lib/constants/api_constants.dart
  39. 8 5
      packages/cs_domain/lib/entity/facility_page_entity.dart
  40. 25 0
      packages/cs_domain/lib/entity/notice_board_announ_entity.dart
  41. 25 0
      packages/cs_domain/lib/entity/notice_board_documents_entity.dart
  42. 25 0
      packages/cs_domain/lib/entity/notice_board_event_entity.dart
  43. 23 4
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  44. 30 15
      packages/cs_domain/lib/generated/json/facility_page_entity.g.dart
  45. 57 0
      packages/cs_domain/lib/generated/json/notice_board_announ_entity.g.dart
  46. 57 0
      packages/cs_domain/lib/generated/json/notice_board_documents_entity.g.dart
  47. 57 0
      packages/cs_domain/lib/generated/json/notice_board_event_entity.g.dart
  48. 35 8
      packages/cs_domain/lib/repository/facility_repository.dart
  49. BIN
      packages/cs_resources/assets/notice_board/announcement_icon.png
  50. BIN
      packages/cs_resources/assets/notice_board/documents_icon.png
  51. BIN
      packages/cs_resources/assets/notice_board/event_icon.png
  52. 3 0
      packages/cs_resources/lib/generated/intl/messages_en.dart
  53. 20 0
      packages/cs_resources/lib/generated/l10n.dart
  54. 2 0
      packages/cs_resources/lib/l10n/intl_en.arb
  55. 2 0
      packages/cs_resources/lib/l10n/intl_zh_CN.arb
  56. 2 0
      packages/cs_resources/lib/l10n/intl_zh_HK.arb

+ 2 - 1
packages/cpt_facility/lib/modules/booking/facility_booking_view_model.dart

@@ -149,7 +149,8 @@ class FacilityBookingViewModel extends _$FacilityBookingViewModel with DioCancel
     );
 
     if (result.isSuccess) {
-      FacilityDetailPage.startWithPop2Main();
+      final bookingId = result.data?.booking?.id;
+      FacilityDetailPage.startWithPop2Main(bookingId: bookingId);
     } else {
       ToastEngine.show(result.errorMsg ?? "UnKnow Error");
     }

+ 1 - 1
packages/cpt_facility/lib/modules/booking/facility_booking_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'facility_booking_view_model.dart';
 // **************************************************************************
 
 String _$facilityBookingViewModelHash() =>
-    r'5bfb55d67994d66800bb220385e48954d6aec449';
+    r'564f4a008b169156b09e3c2325eb1e1cd02e1a47';
 
 /// See also [FacilityBookingViewModel].
 @ProviderFor(FacilityBookingViewModel)

+ 91 - 30
packages/cpt_facility/lib/modules/detail/facility_detail_page.dart

@@ -3,6 +3,7 @@ import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';
 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:widgets/ext/ex_widget.dart';
@@ -14,21 +15,23 @@ import 'facility_detail_view_model.dart';
 
 @RoutePage()
 class FacilityDetailPage extends HookConsumerWidget {
-  const FacilityDetailPage({Key? key}) : super(key: key);
+  final String? bookingId;
+
+  const FacilityDetailPage({Key? key, required this.bookingId}) : super(key: key);
 
   //启动当前页面
-  static void startInstance({BuildContext? context}) {
+  static void startInstance({BuildContext? context, required String? bookingId}) {
     if (context != null) {
-      context.router.push(const FacilityDetailPageRoute());
+      context.router.push(FacilityDetailPageRoute(bookingId: bookingId));
     } else {
-      appRouter.push(const FacilityDetailPageRoute());
+      appRouter.push(FacilityDetailPageRoute(bookingId: bookingId));
     }
   }
 
   //启动当前页面并回退至设施首页
-  static void startWithPop2Main() {
+  static void startWithPop2Main({required String? bookingId}) {
     appRouter.pushAndPopUntil(
-      const FacilityDetailPageRoute(),
+      FacilityDetailPageRoute(bookingId: bookingId),
       predicate: (route) {
         return route.settings.name == 'FacilityPageRoute';
       },
@@ -40,8 +43,16 @@ class FacilityDetailPage extends HookConsumerWidget {
     final viewModel = ref.watch(facilityDetailViewModelProvider.notifier);
     final state = ref.watch(facilityDetailViewModelProvider);
 
+    useEffect(() {
+      // 组件挂载时执行 - 执行接口请求
+      Future.microtask(() => viewModel.fetchFacilityDetail(bookingId));
+      return () {
+        // 组件卸载时执行
+      };
+    }, []);
+
     return Scaffold(
-      appBar: MyAppBar.appBar(context, "Kids party room", backgroundColor: context.appColors.backgroundWhite),
+      appBar: MyAppBar.appBar(context, state.detail?.facility?.type?.name ?? "", backgroundColor: context.appColors.backgroundWhite),
       backgroundColor: context.appColors.backgroundDark,
       body: SingleChildScrollView(
         scrollDirection: Axis.vertical,
@@ -61,9 +72,9 @@ class FacilityDetailPage extends HookConsumerWidget {
               Assets.facilityConfirmDateIcon,
               28.5,
               29,
-              "Tue,24 Oct 2023",
+              state.detail?.booking?.date ?? "",
               null,
-              "05:00 PM-10:00 PM",
+              "${state.detail?.booking?.start ?? ""}-${state.detail?.booking?.end ?? ""}",
               null,
             ),
 
@@ -75,9 +86,9 @@ class FacilityDetailPage extends HookConsumerWidget {
               Assets.facilityConfirmFacilityIcon,
               25.0,
               30.5,
-              "Kids party room",
+              state.detail?.facility?.type?.name ?? "",
               null,
-              "Blue room",
+              state.detail?.facility?.name ?? "",
               null,
             ),
 
@@ -90,9 +101,9 @@ class FacilityDetailPage extends HookConsumerWidget {
               27.0,
               22.0,
               S.current.booking_fee,
-              "10.80",
+              state.detail?.timePeriod?.price ?? "",
               S.current.total,
-              "\$10.80",
+              "\$${state.detail?.timePeriod?.price ?? ""}",
             ),
 
             // 押金
@@ -104,7 +115,7 @@ class FacilityDetailPage extends HookConsumerWidget {
               28.0,
               26.5,
               S.current.on_hold,
-              "\$100.00",
+              "\$${state.detail?.timePeriod?.deposit ?? ""}",
               null,
               null,
             ),
@@ -115,6 +126,7 @@ class FacilityDetailPage extends HookConsumerWidget {
   }
 
   Widget _buildHeaderWidget(BuildContext context, WidgetRef ref) {
+    final state = ref.watch(facilityDetailViewModelProvider);
     return Container(
       width: double.infinity,
       color: context.appColors.whiteBG,
@@ -152,7 +164,7 @@ class FacilityDetailPage extends HookConsumerWidget {
             textColor: context.appColors.textBlack,
           ),
           MyTextView(
-            "\$10.80",
+            "\$${state.detail?.timePeriod?.price ?? ""}",
             fontSize: 15,
             isFontRegular: true,
             textColor: context.appColors.textPrimary,
@@ -187,7 +199,7 @@ class FacilityDetailPage extends HookConsumerWidget {
                 textColor: context.appColors.textBlack,
               ),
               MyTextView(
-                "24 Oct 2023 at 02:19 PM",
+                " ${state.detail?.booking?.date ?? ""}",
                 fontSize: 15,
                 isFontMedium: true,
                 textColor: context.appColors.textBlack,
@@ -195,21 +207,70 @@ class FacilityDetailPage extends HookConsumerWidget {
             ],
           ).marginOnly(top: 5),
 
-          Divider(height: 0.5, color: context.appColors.dividerDefault).marginOnly(top: 14, bottom: 14),
+          //退还押金的布局展示
+          Visibility(
+            visible: state.detail?.booking?.depositRefund != "0.00",
+            child: Column(
+              children: [
+                Divider(height: 0.5, color: context.appColors.dividerDefault).marginOnly(top: 14, bottom: 14),
 
-          //押金
-          MyTextView(
-            S.current.deposit_released_caps,
-            fontSize: 15,
-            isFontRegular: true,
-            textColor: context.appColors.textBlack,
-          ),
-          MyTextView(
-            "\$100.00",
-            fontSize: 15,
-            marginTop: 5,
-            isFontRegular: true,
-            textColor: context.appColors.textPrimary,
+                //退还的押金
+                MyTextView(
+                  S.current.deposit_released_caps,
+                  fontSize: 15,
+                  isFontRegular: true,
+                  textColor: context.appColors.textBlack,
+                ),
+
+                MyTextView(
+                  "\$${state.detail?.booking?.depositRefund ?? ""}",
+                  fontSize: 15,
+                  marginTop: 5,
+                  isFontRegular: true,
+                  textColor: context.appColors.textPrimary,
+                ),
+
+                Divider(height: 0.5, color: context.appColors.dividerDefault).marginOnly(top: 14, bottom: 14),
+
+                //押金付款于时间
+                Row(
+                  mainAxisSize: MainAxisSize.min,
+                  children: [
+                    MyTextView(
+                      S.current.hold_started_on,
+                      fontSize: 15,
+                      isFontRegular: true,
+                      textColor: context.appColors.textBlack,
+                    ),
+                    MyTextView(
+                      " ${state.detail?.booking?.date ?? ""}",
+                      fontSize: 15,
+                      isFontMedium: true,
+                      textColor: context.appColors.textBlack,
+                    ),
+                  ],
+                ).marginOnly(top: 5),
+
+                //押金退款于时间
+                Row(
+                  mainAxisSize: MainAxisSize.min,
+                  children: [
+                    MyTextView(
+                      S.current.released_on,
+                      fontSize: 15,
+                      isFontRegular: true,
+                      textColor: context.appColors.textBlack,
+                    ),
+                    MyTextView(
+                      " ${state.detail?.booking?.depositRefundAt ?? ""}",
+                      fontSize: 15,
+                      isFontMedium: true,
+                      textColor: context.appColors.textBlack,
+                    ),
+                  ],
+                ).marginOnly(top: 5),
+              ],
+            ),
           ),
 
           const SizedBox(height: 23),

+ 16 - 2
packages/cpt_facility/lib/modules/detail/facility_detail_state.dart

@@ -1,3 +1,17 @@
-class FacilityDetailState{
+import 'package:domain/entity/facility_page_entity.dart';
 
-}
+class FacilityDetailState {
+  final FacilityDetail? detail;
+
+  FacilityDetailState({
+    this.detail,
+  });
+
+  FacilityDetailState copyWith({
+    FacilityDetail? detail,
+  }) {
+    return FacilityDetailState(
+      detail: detail ?? this.detail,
+    );
+  }
+}

+ 22 - 2
packages/cpt_facility/lib/modules/detail/facility_detail_view_model.dart

@@ -1,3 +1,6 @@
+import 'package:domain/repository/facility_repository.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 
 import 'facility_detail_state.dart';
@@ -5,9 +8,26 @@ import 'facility_detail_state.dart';
 part 'facility_detail_view_model.g.dart';
 
 @riverpod
-class FacilityDetailViewModel extends _$FacilityDetailViewModel{
+class FacilityDetailViewModel extends _$FacilityDetailViewModel with DioCancelableMixin{
+  late final FacilityRepository _facilityRepository;
   @override
   FacilityDetailState build() {
-    return FacilityDetailState();
+    _facilityRepository = ref.read(facilityRepositoryProvider);
+    final state =  FacilityDetailState();
+    registerCancellation();
+    return state;
   }
+
+  /// 获取详情
+  Future fetchFacilityDetail(String? bookingId) async {
+    final result = await _facilityRepository.fetchFacilityBookingDetail(id: bookingId, cancelToken: cancelToken);
+
+    // 处理数据
+    if (result.isSuccess) {
+      state = state.copyWith(detail: result.data);
+    } else {
+      ToastEngine.show(result.errorMsg ?? "UnKnow Error");
+    }
+  }
+
 }

+ 1 - 1
packages/cpt_facility/lib/modules/detail/facility_detail_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'facility_detail_view_model.dart';
 // **************************************************************************
 
 String _$facilityDetailViewModelHash() =>
-    r'fc7e226b3c796f8790a9715a13656c06d1b98b20';
+    r'8a361195ada0787beab9b28c38810c95acc51156';
 
 /// See also [FacilityDetailViewModel].
 @ProviderFor(FacilityDetailViewModel)

+ 7 - 8
packages/cpt_facility/lib/modules/facility/active/facility_active_screen.dart

@@ -10,7 +10,6 @@ import '../../detail/facility_detail_page.dart';
 import 'facility_active_view_model.dart';
 import 'item_facility_active.dart';
 
-
 @RoutePage()
 class FacilityActiveScreen extends HookConsumerWidget {
   @override
@@ -42,13 +41,13 @@ class FacilityActiveScreen extends HookConsumerWidget {
           successSliverWidget: [
             SliverList(
                 delegate: SliverChildBuilderDelegate(
-                      (context, index) {
-                    return FacilityActiveItem(index: index, item: state.datas[index]).onTap((){
-                      // FacilityDetailPage.startInstance(context: context);
-                    });
-                  },
-                  childCount: state.datas.length,
-                ))
+              (context, index) {
+                return FacilityActiveItem(index: index, item: state.datas[index]).onTap(() {
+                  FacilityDetailPage.startInstance(context: context, bookingId: state.datas[index].booking?.id);
+                });
+              },
+              childCount: state.datas.length,
+            ))
           ],
         ),
       ).marginOnly(top: 5, bottom: 5),

+ 2 - 2
packages/cpt_facility/lib/modules/facility/active/facility_active_state.dart

@@ -7,7 +7,7 @@ class FacilityActiveState {
   LoadState loadingState;
   String? errorMessage;
 
-  List<FacilityPageList> datas; //页面列表数据
+  List<FacilityDetail> datas; //页面列表数据
 
   // ===================================  Begin  ↓  ===================================
 
@@ -21,7 +21,7 @@ class FacilityActiveState {
     LoadState? loadingState,
     String? errorMessage,
     bool? needShowPlaceholder,
-    List<FacilityPageList>? datas,
+    List<FacilityDetail>? datas,
   }) {
     return FacilityActiveState(
       errorMessage: errorMessage ?? this.errorMessage,

+ 2 - 2
packages/cpt_facility/lib/modules/facility/active/facility_active_view_model.dart

@@ -78,7 +78,7 @@ class FacilityActiveViewModel extends _$FacilityActiveViewModel with DioCancelab
   }
 
   // 处理数据与展示的逻辑
-  void handleList(List<FacilityPageList>? list) {
+  void handleList(List<FacilityDetail>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (_curPage == 1) {
@@ -90,7 +90,7 @@ class FacilityActiveViewModel extends _$FacilityActiveViewModel with DioCancelab
         changeLoadingState(LoadState.State_Success, null);
       } else {
         //加载更多
-        state.datas.addAll(List<FacilityPageList>.from(state.datas)..addAll(list));
+        state.datas.addAll(List<FacilityDetail>.from(state.datas)..addAll(list));
         refreshController.finishLoad();
       }
     } else {

+ 1 - 1
packages/cpt_facility/lib/modules/facility/active/facility_active_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'facility_active_view_model.dart';
 // **************************************************************************
 
 String _$facilityActiveViewModelHash() =>
-    r'57bc96b84547eef379f700777115155343b5cb78';
+    r'c15699785d72e6c5965eb0f97eed8b03386fc75b';
 
 /// See also [FacilityActiveViewModel].
 @ProviderFor(FacilityActiveViewModel)

+ 1 - 1
packages/cpt_facility/lib/modules/facility/active/item_facility_active.dart

@@ -9,7 +9,7 @@ import 'package:widgets/my_text_view.dart';
 ///  设施的Active的Item
 class FacilityActiveItem extends StatelessWidget {
   final int index;
-  final FacilityPageList item;
+  final FacilityDetail item;
 
   const FacilityActiveItem({
     required this.index,

+ 11 - 2
packages/cpt_facility/lib/modules/facility/deposit/facility_deposit_screen.dart

@@ -49,7 +49,7 @@ class FacilityDepositScreen extends HookConsumerWidget {
                 delegate: SliverChildBuilderDelegate(
               (context, index) {
                 return FacilityDepositItem(index: index, item: state.datas[index]).onTap(() {
-                  FacilityDetailPage.startInstance(context: context);
+                  FacilityDetailPage.startInstance(context: context,bookingId: state.datas[index].booking?.id);
                 });
               },
               childCount: state.datas.length,
@@ -116,12 +116,19 @@ class FacilityDepositScreen extends HookConsumerWidget {
     );
   }
 
-  //底部的说明文本脚布局
+  /// 构建页面底部组件
+  ///
+  /// [BuildContext context] 用于访问当前构建上下文,以便获取主题颜色等信息
+  /// [WidgetRef ref] 用于访问和操作应用状态
+  ///
+  /// 返回一个SliverToBoxAdapter,它包含一个列布局,其中包含两个文本视图
+  /// 第一个文本视图显示存款描述的标题,第二个文本视图显示具体的存款描述文本
   _buildFootWidget(BuildContext context, WidgetRef ref) {
     return SliverToBoxAdapter(
       child: Column(
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
+          // 显示存款描述标题的文本视图
           MyTextView(
             S.current.deposit_desc,
             fontSize: 20,
@@ -131,6 +138,7 @@ class FacilityDepositScreen extends HookConsumerWidget {
             isFontMedium: true,
             textColor: context.appColors.textBlack,
           ),
+          // 显示具体存款描述文本的文本视图
           MyTextView(
             S.current.deposit_desc_txt,
             marginTop: 14,
@@ -145,4 +153,5 @@ class FacilityDepositScreen extends HookConsumerWidget {
       ),
     );
   }
+
 }

+ 2 - 2
packages/cpt_facility/lib/modules/facility/deposit/facility_deposit_state.dart

@@ -9,7 +9,7 @@ class FacilityDepositState {
 
   String? totalDeposit;  //总金额
 
-  List<FacilityPageList> datas; //页面列表数据
+  List<FacilityDetail> datas; //页面列表数据
 
   // ===================================  Begin  ↓  ===================================
 
@@ -24,7 +24,7 @@ class FacilityDepositState {
     LoadState? loadingState,
     String? errorMessage,
     bool? needShowPlaceholder,
-    List<FacilityPageList>? datas,
+    List<FacilityDetail>? datas,
     String? totalDeposit,
   }) {
     return FacilityDepositState(

+ 2 - 2
packages/cpt_facility/lib/modules/facility/deposit/facility_deposit_view_model.dart

@@ -72,7 +72,7 @@ class FacilityDepositViewModel extends _$FacilityDepositViewModel with DioCancel
   }
 
   // 处理数据与展示的逻辑
-  void handleList(List<FacilityPageList>? list) {
+  void handleList(List<FacilityDetail>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (_curPage == 1) {
@@ -84,7 +84,7 @@ class FacilityDepositViewModel extends _$FacilityDepositViewModel with DioCancel
         changeLoadingState(LoadState.State_Success, null);
       } else {
         //加载更多
-        state.datas.addAll(List<FacilityPageList>.from(state.datas)..addAll(list));
+        state.datas.addAll(List<FacilityDetail>.from(state.datas)..addAll(list));
         refreshController.finishLoad();
       }
     } else {

+ 1 - 1
packages/cpt_facility/lib/modules/facility/deposit/facility_deposit_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'facility_deposit_view_model.dart';
 // **************************************************************************
 
 String _$facilityDepositViewModelHash() =>
-    r'2b35e0ffd671d3ab67217b51dc076475f7e2a00a';
+    r'8e4a73e233a2fad49624f2be471b578a5ff28bbd';
 
 /// See also [FacilityDepositViewModel].
 @ProviderFor(FacilityDepositViewModel)

+ 1 - 1
packages/cpt_facility/lib/modules/facility/deposit/item_facility_deposit.dart

@@ -9,7 +9,7 @@ import 'package:widgets/my_text_view.dart';
 ///  设施的Deposit的Item
 class FacilityDepositItem extends StatelessWidget {
   final int index;
-  final FacilityPageList item;
+  final FacilityDetail item;
 
   const FacilityDepositItem({
     required this.index,

+ 1 - 1
packages/cpt_facility/lib/modules/facility/history/facility_history_screen.dart

@@ -42,7 +42,7 @@ class FacilityHistoryScreen extends HookConsumerWidget {
             SliverList(
                 delegate: SliverChildBuilderDelegate((context, index) {
                     return FacilityHistoryItem(index: index, item: state.datas[index]).onTap((){
-                      FacilityDetailPage.startInstance(context: context);
+                      FacilityDetailPage.startInstance(context: context,bookingId: state.datas[index].booking?.id);
                     });
                   },
                   childCount: state.datas.length,

+ 2 - 2
packages/cpt_facility/lib/modules/facility/history/facility_history_state.dart

@@ -7,7 +7,7 @@ class FacilityHistoryState {
   LoadState loadingState;
   String? errorMessage;
 
-  List<FacilityPageList> datas; //页面列表数据
+  List<FacilityDetail> datas; //页面列表数据
 
   // ===================================  Begin  ↓  ===================================
 
@@ -21,7 +21,7 @@ class FacilityHistoryState {
     LoadState? loadingState,
     String? errorMessage,
     bool? needShowPlaceholder,
-    List<FacilityPageList>? datas,
+    List<FacilityDetail>? datas,
   }) {
     return FacilityHistoryState(
       errorMessage: errorMessage ?? this.errorMessage,

+ 2 - 2
packages/cpt_facility/lib/modules/facility/history/facility_history_view_model.dart

@@ -78,7 +78,7 @@ class FacilityHistoryViewModel extends _$FacilityHistoryViewModel with DioCancel
   }
 
   // 处理数据与展示的逻辑
-  void handleList(List<FacilityPageList>? list) {
+  void handleList(List<FacilityDetail>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (_curPage == 1) {
@@ -90,7 +90,7 @@ class FacilityHistoryViewModel extends _$FacilityHistoryViewModel with DioCancel
         changeLoadingState(LoadState.State_Success, null);
       } else {
         //加载更多
-        state.datas.addAll(List<FacilityPageList>.from(state.datas)..addAll(list));
+        state.datas.addAll(List<FacilityDetail>.from(state.datas)..addAll(list));
         refreshController.finishLoad();
       }
     } else {

+ 1 - 1
packages/cpt_facility/lib/modules/facility/history/facility_history_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'facility_history_view_model.dart';
 // **************************************************************************
 
 String _$facilityHistoryViewModelHash() =>
-    r'2565bb75a59c1a94a8c39d5d5985a9e9422b50f0';
+    r'303f1d156d9b2cf7e1fa90ee4922868897e7ddcc';
 
 /// See also [FacilityHistoryViewModel].
 @ProviderFor(FacilityHistoryViewModel)

+ 1 - 1
packages/cpt_facility/lib/modules/facility/history/item_facility_history.dart

@@ -9,7 +9,7 @@ import 'package:widgets/my_text_view.dart';
 ///  设施的History的Item
 class FacilityHistoryItem extends StatelessWidget {
   final int index;
-  final FacilityPageList item;
+  final FacilityDetail item;
 
   const FacilityHistoryItem({
     required this.index,

+ 34 - 5
packages/cpt_facility/lib/router/page/facility_page_router.gr.dart

@@ -51,9 +51,13 @@ abstract class _$FacilityPageRouter extends RootStackRouter {
       );
     },
     FacilityDetailPageRoute.name: (routeData) {
+      final args = routeData.argsAs<FacilityDetailPageRouteArgs>();
       return AutoRoutePage<dynamic>(
         routeData: routeData,
-        child: const FacilityDetailPage(),
+        child: FacilityDetailPage(
+          key: args.key,
+          bookingId: args.bookingId,
+        ),
       );
     },
     FacilityHistoryPageRoute.name: (routeData) {
@@ -183,16 +187,41 @@ class FacilityDepositPageRoute extends PageRouteInfo<void> {
 
 /// generated route for
 /// [FacilityDetailPage]
-class FacilityDetailPageRoute extends PageRouteInfo<void> {
-  const FacilityDetailPageRoute({List<PageRouteInfo>? children})
-      : super(
+class FacilityDetailPageRoute
+    extends PageRouteInfo<FacilityDetailPageRouteArgs> {
+  FacilityDetailPageRoute({
+    Key? key,
+    required String? bookingId,
+    List<PageRouteInfo>? children,
+  }) : super(
           FacilityDetailPageRoute.name,
+          args: FacilityDetailPageRouteArgs(
+            key: key,
+            bookingId: bookingId,
+          ),
           initialChildren: children,
         );
 
   static const String name = 'FacilityDetailPageRoute';
 
-  static const PageInfo<void> page = PageInfo<void>(name);
+  static const PageInfo<FacilityDetailPageRouteArgs> page =
+      PageInfo<FacilityDetailPageRouteArgs>(name);
+}
+
+class FacilityDetailPageRouteArgs {
+  const FacilityDetailPageRouteArgs({
+    this.key,
+    required this.bookingId,
+  });
+
+  final Key? key;
+
+  final String? bookingId;
+
+  @override
+  String toString() {
+    return 'FacilityDetailPageRouteArgs{key: $key, bookingId: $bookingId}';
+  }
 }
 
 /// generated route for

+ 53 - 35
packages/cpt_notice_board/lib/modules/announ/page/announ_page.dart

@@ -1,11 +1,13 @@
 import 'package:cpt_notice_board/modules/notice_board/page/notice_board_page.dart';
 import 'package:flutter/material.dart';
 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/log_utils.dart';
 import 'package:shared/utils/color_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/widget_export.dart';
 import 'package:cs_resources/generated/assets.dart';
@@ -28,7 +30,7 @@ class AnnounPage extends HookConsumerWidget {
     }
   }
 
-  Widget _buildItemLeftSection(BuildContext context, WidgetRef ref, item, _vm) {
+  Widget _buildItemLeftSection(BuildContext context, WidgetRef ref, item, vm) { 
     return Container(
       // color: Colors.blue,
       child: Text(
@@ -42,11 +44,12 @@ class AnnounPage extends HookConsumerWidget {
       ),
     );
   }
-  Widget _buildItemRightSection(BuildContext context, WidgetRef ref, item, _vm) {
+
+  Widget _buildItemRightSection(BuildContext context, WidgetRef ref, item, vm) {
     return Container(
       // color: Colors.green,
       child: Text(
-        item['price'],
+        item['created_at'],
         style: const TextStyle(
             fontSize: 14.0,
             color: Colors.black,
@@ -56,13 +59,14 @@ class AnnounPage extends HookConsumerWidget {
   }
 
   // listitem
-  Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
+  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)],
+        boxShadow: [
+          BoxShadow(color: Color.fromRGBO(184, 191, 217, 0.3), blurRadius: 6)
+        ],
       ),
       child: Column(
         children: [
@@ -74,60 +78,74 @@ class AnnounPage extends HookConsumerWidget {
               crossAxisAlignment: CrossAxisAlignment.start,
               mainAxisAlignment: MainAxisAlignment.center,
               children: [
-                 _buildItemLeftSection(context, ref, item, _vm).marginOnly(bottom: 5),
-                _buildItemRightSection(context, ref, item, _vm),
+                _buildItemLeftSection(context, ref, item, vm)
+                    .marginOnly(bottom: 5),
+                _buildItemRightSection(context, ref, item, vm),
               ],
-            ).paddingOnly(left: 20,right: 20),
+            ).paddingOnly(left: 20, right: 20),
           ).constrained(
             minHeight: 117.5,
           ),
         ],
       ).onTap(() {
         // 去详情
-        // Navigator.push(
-        //   context,
-        //   MaterialPageRoute(builder: (context) => AnnouncementDetailPage()),
-        // );
         AnnouncementDetailPage.startInstance(context: context);
-        // _vm.goNewsDetail(item['title']);
       }),
     ).marginOnly(left: 15, bottom: 15, right: 15);
   }
 
   // list
-  Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
-    List itemsList = _vm.state.list.toList();
+  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);
+        return _buildSaleItem(context, ref, itemsList[index], vm);
       },
     );
   }
 
   @override
   Widget build(BuildContext context, WidgetRef ref) {
-    final _vm = ref.read(announVmProvider.notifier);
-
+    final vm = ref.read(announVmProvider.notifier);
+    final state = ref.watch(announVmProvider);
+    useEffect(() {
+      // 组件挂载时执行 - 执行接口请求
+      Future.microtask(() => vm.initPageData());
+      return () {
+        // 组件卸载时执行
+        Log.d("property_news_page 组件卸载时执行");
+      };
+    }, []);
     return Scaffold(
       // appBar: AppBar(title: Text("资产")),
-      body: Container(
+      body: SizedBox(
+          width: double.infinity,
+          height: double.infinity,
           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)),
-      )),
+              controller: vm.refreshController,
+              // 上拉加载
+              onLoad: () async {
+                Log.d("----onLoad");
+                vm.loadMore();
+              },
+              // 下拉刷新
+              onRefresh: () async {
+                Log.d("----onRefresh");
+                vm.onRefresh();
+              },
+              child: Container(
+                color: ColorUtils.string2Color('#F2F3F6'),
+                padding: const EdgeInsets.only(top: 15),
+                child: LoadStateLayout(
+                  state: state.loadingState,
+                  errorMessage: state.errorMessage,
+                  errorRetry: () {
+                    vm.retryRequest();
+                  },
+                  successSliverWidget: [_buildSaleList(context, ref, vm)],
+                ),
+              ))),
     );
   }
 }

+ 43 - 31
packages/cpt_notice_board/lib/modules/announ/page/announ_state.dart

@@ -2,48 +2,60 @@
 
 import 'dart:convert';
 
-AnnounState announStateFromJson(String str) => AnnounState.fromJson(json.decode(str));
-
-String announStateToJson(AnnounState data) => json.encode(data.toJson());
+import 'package:widgets/load_state_layout.dart';
 
 class AnnounState {
+  //页面 LoadView 状态的展示
+  LoadState loadingState;
+  String? errorMessage;
+
+  int? page;
+  int? limit = 10;
+  int? count = 1;
+  List<Map<String, dynamic>>? list;
+
   AnnounState({
-    required this.curPage,
-    required this.pageSize,
+    this.loadingState = LoadState.State_Loading,
+    String? errorMessage,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 1,
     required this.list,
-    required this.filterCount,
   });
 
-  int curPage;
-  int pageSize;
-  List<Map<String, dynamic>> list;
-  int filterCount;
-
-  factory AnnounState.fromJson(Map<dynamic, dynamic> json) => AnnounState(
-    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,
-  };
-
   AnnounState copyWith({
-    int? curPage,
-    int? pageSize,
+    LoadState? loadingState,
+    String? errorMessage,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
-    int? filterCount,
   }) {
     return AnnounState(
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
+      loadingState: loadingState ?? this.loadingState,
+      errorMessage: errorMessage ?? this.errorMessage,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
-      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+
+  Map<String, dynamic> toMap() {
+    return {
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
+      'list': this.list,
+    };
+  }
+
+  factory AnnounState.fromMap(Map<String, dynamic> map) {
+    return AnnounState(
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
+      list: map['list'] as List<Map<String, dynamic>>,
     );
   }
 }

+ 12 - 15
packages/cpt_notice_board/lib/modules/announ/repository/announ_repository.dart

@@ -1,9 +1,11 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/notice_board_announ_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';
@@ -26,19 +28,14 @@ class AnnounRepository {
 
   AnnounRepository({required this.dioEngine});
 
-  Future<HttpResult<Object>> fetchPropertyNewsList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+  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";
@@ -46,25 +43,25 @@ class AnnounRepository {
 
     final result = await dioEngine.requestNetResult(
       // ApiConstants.apiServerTime, // api 地址
-      '/index.php/api/employee/extra/time', // api 地址
+      '/api/v1/user/notice/announcement/index', // api 地址
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false, //是否展示默认的Loading弹窗
+      networkDebounce: true, //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
+    Log.d("------请求返回的result--$result--------");
     //根据返回的结果,封装原始数据为Bean/Entity对象
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = AnnounState.fromJson(json!);
+      var data = NoticeBoardAnnounEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert<AnnounState>(data: data);
+      return result.convert<NoticeBoardAnnounEntity>(data: data);
     }
     return result.convert();
   }
 
-
 }

+ 94 - 55
packages/cpt_notice_board/lib/modules/announ/vm/announ_vm.dart

@@ -1,7 +1,10 @@
+import 'package:domain/entity/notice_board_announ_entity.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/load_state_layout.dart';
+import 'package:widgets/widget_export.dart';
 import '../page/announ_state.dart';
 import '../repository/announ_repository.dart';
 part 'announ_vm.g.dart';
@@ -9,33 +12,20 @@ part 'announ_vm.g.dart';
 @riverpod
 class AnnounVm extends _$AnnounVm {
   late AnnounRepository announRepository;
+  var page = 1;
+  var limit = 10;
+
+  bool _needShowPlaceholder = false; //是否展示LoadingView
+
+  // Refresh 控制器
+  final EasyRefreshController refreshController = EasyRefreshController(
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
+  );
+
   AnnounState initState() {
     return AnnounState(
-      curPage: 1,
-      pageSize: 10,
-      list: [
-        {
-          "id": 1,
-          "title": "Standard Operating procedure For Replacement V...",
-          "price": "Monday 14 Oct 2024, 10:19 AM",
-        },
-        {
-          "id": 2,
-          "title": "Removal Of Items In Dry Risers",
-          "price": "Monday 14 Oct 2024, 10:19 AM",
-        },
-        {
-          "id": 3,
-          "title": "Fire Safety Awareness And Guidelines",
-          "price": "Monday 14 Oct 2024, 10:19 AM",
-        },
-        {
-          "id": 4,
-          "title": "Bicycle Tagging Exercise",
-          "price": "Monday 14 Oct 2024, 10:19 AM",
-        },
-      ],
-      filterCount: 2,
+      list: [],
     );
   }
 
@@ -49,48 +39,73 @@ class AnnounVm extends _$AnnounVm {
     return state;
   }
 
-  // 初始化页面数据
+//刷新页面状态
+  void changeLoadingState(LoadState loadState, String? errorMsg) {
+    state = state.copyWith(loadingState: loadState, errorMessage: errorMsg);
+  }
+
+  // 初始化页面数据&0
   initPageData() {
     Log.d("----property_news_vm-----initPageData");
-    refreshListData();
+    onRefresh();
   }
 
-  // 上拉加载
-  Future onLoadData() async {
-    Log.d("----property_news_vm-----initListData");
+  // 上拉加载 更多
+  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 = page + 1;
+    //   state = state.copyWith(page: page,);
     //   getListData();
     // }
+    // 检查 page 是否为 null,并初始化为 1
+    page++;
+
     getListData();
   }
-// 去新闻详情页
-  void goNewsDetail(String item) {
-    Log.d(item);
-    // PropertyPage.startInstance(context: context, item: item);
+
+  // 下拉刷新
+  Future onRefresh() async {
+    Log.d("----property_news_vm-----onRefresh ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+    page = 1;
+    getListData();
+  }
+
+  // 重试请求
+  Future retryRequest() async {
+    page = 1;
+    _needShowPlaceholder = true;
+    getListData();
   }
+
   // 获取list 列表数据
-  void getListData<T>() async {
-    Log.d("加载listData数据---------------start-----");
+  Future getListData<T>() async {
+    // if (_needShowPlaceholder) {
+    //   changeLoadingState(LoadState.State_Loading, null);
+    // }
+
+    Log.d("加载listData数据---------------start--${page}---");
     try {
       //请求网络
       Map<String, dynamic> params = {
-        "curPage": state.curPage,
-        "pageSize": state.pageSize,
+        "page": page,
+        "limit": limit,
       };
       Log.d("请求参数------$params");
-      final result = await announRepository.fetchPropertyNewsList(params);
-      Log.d("请求完成结果------${result.data}");
+      final result = await announRepository.fetchList(params);
       //校验成功失败
       if (result.isSuccess) {
-        // state = state.copyWith(serverTime: result.data);
-        state = state;
-        ToastEngine.show("获取数据成功");
+        handlerResultList((result.data as NoticeBoardAnnounEntity)
+            .list
+            .cast<NoticeBoardAnnounEntity>());
       } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
         ToastEngine.show(result.errorMsg ?? "Network Load Error");
       }
     } catch (e) {
@@ -98,15 +113,39 @@ class AnnounVm extends _$AnnounVm {
     }
   }
 
-  // 下拉刷新
-  Future refreshListData() async {
-    Log.d("----property_news_vm-----refreshListData ");
-
-    // await Future.delayed(const Duration(seconds: 2));
+  void handlerResultList(List<NoticeBoardAnnounEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
 
-    state = state.copyWith(curPage: 1, pageSize: 10);
-    // ref.invalidateSelf();
-    // ref.invalidate(propertyNewsVmProvider);
-    getListData();
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+        // update();
+      }
+    } else {
+      if (page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        if (state.list!.length == 0) {
+          changeLoadingState(LoadState.State_Empty, null);
+        } else {
+          changeLoadingState(LoadState.State_Success, null);
+        }
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
   }
 }

+ 45 - 22
packages/cpt_notice_board/lib/modules/documents/page/documents_page.dart

@@ -1,11 +1,13 @@
 import 'package:cpt_notice_board/modules/notice_board/page/notice_board_page.dart';
 import 'package:flutter/material.dart';
 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/log_utils.dart';
 import 'package:shared/utils/color_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/widget_export.dart';
 import 'package:cs_resources/generated/assets.dart';
@@ -31,7 +33,7 @@ class DocumentsPage extends HookConsumerWidget {
     return Container(
       // color: Colors.blue,
       child: Text(
-        item['title'],
+        item['name'],
         maxLines: 1, // 设置最大行数为2
         overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
         style: const TextStyle(
@@ -62,8 +64,11 @@ class DocumentsPage extends HookConsumerWidget {
             ), // 边框
           ),
         ),
-        child: const Text('Open Folder',
-          style: const TextStyle(color: Colors.white,),
+        child: const Text(
+          'Open Folder',
+          style: const TextStyle(
+            color: Colors.white,
+          ),
         ),
       ),
     );
@@ -98,7 +103,7 @@ class DocumentsPage extends HookConsumerWidget {
                   // child: TextButton(onPressed: (){}, child: Text("fdsfds")),
                 ),
               ],
-            ).paddingOnly(left: 20,right: 20),
+            ).paddingOnly(left: 20, right: 20),
           ).constrained(
             minHeight: 70,
           ),
@@ -124,27 +129,45 @@ class DocumentsPage extends HookConsumerWidget {
 
   @override
   Widget build(BuildContext context, WidgetRef ref) {
-    final _vm = ref.read(documentsVmProvider.notifier);
-
+    final vm = ref.read(documentsVmProvider.notifier);
+    final state = ref.watch(documentsVmProvider);
+    useEffect(() {
+      // 组件挂载时执行 - 执行接口请求
+      Future.microtask(() => vm.initPageData());
+      return () {
+        // 组件卸载时执行
+        Log.d("property_news_page 组件卸载时执行");
+      };
+    }, []);
     return Scaffold(
       // appBar: AppBar(title: Text("资产")),
-      body: Container(
+      body: SizedBox(
+          width: double.infinity,
+          height: double.infinity,
           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)),
-      )),
+              controller: vm.refreshController,
+              // 上拉加载
+              onLoad: () async {
+                Log.d("----onLoad");
+                vm.loadMore();
+              },
+              // 下拉刷新
+              onRefresh: () async {
+                Log.d("----onRefresh");
+                vm.onRefresh();
+              },
+              child: Container(
+                color: ColorUtils.string2Color('#F2F3F6'),
+                padding: const EdgeInsets.only(top: 15),
+                child: LoadStateLayout(
+                  state: state.loadingState,
+                  errorMessage: state.errorMessage,
+                  errorRetry: () {
+                    vm.retryRequest();
+                  },
+                  successSliverWidget: [_buildSaleList(context, ref, vm)],
+                ),
+              ))),
     );
   }
 }

+ 43 - 31
packages/cpt_notice_board/lib/modules/documents/page/documents_state.dart

@@ -2,48 +2,60 @@
 
 import 'dart:convert';
 
-DocumentsState documentsStateFromJson(String str) => DocumentsState.fromJson(json.decode(str));
-
-String documentsStateToJson(DocumentsState data) => json.encode(data.toJson());
+import 'package:widgets/load_state_layout.dart';
 
 class DocumentsState {
+  //页面 LoadView 状态的展示
+  LoadState loadingState;
+  String? errorMessage;
+
+  int? page;
+  int? limit = 10;
+  int? count = 1;
+  List<Map<String, dynamic>>? list;
+
   DocumentsState({
-    required this.curPage,
-    required this.pageSize,
+    this.loadingState = LoadState.State_Loading,
+    String? errorMessage,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 1,
     required this.list,
-    required this.filterCount,
   });
 
-  int curPage;
-  int pageSize;
-  List<Map<String, dynamic>> list;
-  int filterCount;
-
-  factory DocumentsState.fromJson(Map<dynamic, dynamic> json) => DocumentsState(
-    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,
-  };
-
   DocumentsState copyWith({
-    int? curPage,
-    int? pageSize,
+    LoadState? loadingState,
+    String? errorMessage,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
-    int? filterCount,
   }) {
     return DocumentsState(
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
+      loadingState: loadingState ?? this.loadingState,
+      errorMessage: errorMessage ?? this.errorMessage,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
-      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+
+  Map<String, dynamic> toMap() {
+    return {
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
+      'list': this.list,
+    };
+  }
+
+  factory DocumentsState.fromMap(Map<String, dynamic> map) {
+    return DocumentsState(
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
+      list: map['list'] as List<Map<String, dynamic>>,
     );
   }
 }

+ 13 - 16
packages/cpt_notice_board/lib/modules/documents/repository/documents_repository.dart

@@ -1,9 +1,11 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/notice_board_documents_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';
@@ -14,7 +16,7 @@ part 'documents_repository.g.dart';
 
 @Riverpod(keepAlive: true)
 DocumentsRepository documentsRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
+  final dioEngine = ref.watch(dioEngineProvider); 
   return DocumentsRepository(dioEngine: dioEngine);
 }
 
@@ -25,20 +27,14 @@ class DocumentsRepository {
   DioEngine dioEngine;
 
   DocumentsRepository({required this.dioEngine});
-
-  Future<HttpResult<Object>> fetchPropertyNewsList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+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";
@@ -46,22 +42,23 @@ class DocumentsRepository {
 
     final result = await dioEngine.requestNetResult(
       // ApiConstants.apiServerTime, // api 地址
-      '/index.php/api/employee/extra/time', // api 地址
+      '/api/v1/user/notice/document/index', // api 地址
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false, //是否展示默认的Loading弹窗
+      networkDebounce: true, //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
+    Log.d("------请求返回的result--$result--------");
     //根据返回的结果,封装原始数据为Bean/Entity对象
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = DocumentsState.fromJson(json!);
+      var data = NoticeBoardDocumentsEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert<DocumentsState>(data: data);
+      return result.convert<NoticeBoardDocumentsEntity>(data: data);
     }
     return result.convert();
   }

+ 97 - 49
packages/cpt_notice_board/lib/modules/documents/vm/documents_vm.dart

@@ -1,7 +1,10 @@
+import 'package:domain/entity/notice_board_documents_entity.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/load_state_layout.dart';
+import 'package:widgets/widget_export.dart';
 import '../page/documents_state.dart';
 import '../repository/documents_repository.dart';
 part 'documents_vm.g.dart';
@@ -9,23 +12,21 @@ part 'documents_vm.g.dart';
 @riverpod
 class DocumentsVm extends _$DocumentsVm {
   late DocumentsRepository documentsRepository;
+  var page = 1;
+  var limit = 10;
+
+  bool _needShowPlaceholder = false; //是否展示LoadingView
+
+  // Refresh 控制器
+  final EasyRefreshController refreshController = EasyRefreshController(
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
+  );
+
   DocumentsState initState() {
+    // 初始化页面数据&0
     return DocumentsState(
-      curPage: 1,
-      pageSize: 10,
-      list: [
-        {
-          "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",
-        },
-      ],
-      filterCount: 2,
+      list: [],
     );
   }
 
@@ -39,48 +40,74 @@ class DocumentsVm extends _$DocumentsVm {
     return state;
   }
 
-  // 初始化页面数据
+//刷新页面状态
+  void changeLoadingState(LoadState loadState, String? errorMsg) {
+    state = state.copyWith(loadingState: loadState, errorMessage: errorMsg);
+  }
+
+  // 初始化页面数据&0
   initPageData() {
     Log.d("----property_news_vm-----initPageData");
-    refreshListData();
+    onRefresh();
   }
 
-  // 上拉加载
-  Future onLoadData() async {
-    Log.d("----property_news_vm-----initListData");
+  // 上拉加载 更多
+  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 = page + 1;
+    //   state = state.copyWith(page: page,);
     //   getListData();
     // }
+    // 检查 page 是否为 null,并初始化为 1
+    page++;
+
     getListData();
   }
-// 去新闻详情页
-  void goNewsDetail(String item) {
-    Log.d(item);
-    // PropertyPage.startInstance(context: context, item: item);
+
+  // 下拉刷新
+  Future onRefresh() async {
+    Log.d("----property_news_vm-----onRefresh ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+    page = 1;
+    getListData();
   }
+
+  // 重试请求
+  Future retryRequest() async {
+    page = 1;
+    _needShowPlaceholder = true;
+    getListData();
+  }
+
   // 获取list 列表数据
-  void getListData<T>() async {
-    Log.d("加载listData数据---------------start-----");
+  Future getListData<T>() async {
+    // if (_needShowPlaceholder) {
+    //   changeLoadingState(LoadState.State_Loading, null);
+    // }
+
+    Log.d("加载listData数据---------------start--${page}---");
     try {
       //请求网络
-      Map<String, dynamic>  params = {
-        "curPage": state.curPage,
-        "pageSize": state.pageSize,
+      Map<String, dynamic> params = {
+        "page": page,
+        "limit": limit,
+        "parent_id":0
       };
       Log.d("请求参数------$params");
-      final result = await documentsRepository.fetchPropertyNewsList(params);
-      Log.d("请求完成结果------${result.data}");
+      final result = await documentsRepository.fetchList(params);
       //校验成功失败
       if (result.isSuccess) {
-        // state = state.copyWith(serverTime: result.data);
-        state = state;
-        ToastEngine.show("获取数据成功");
+        handlerResultList((result.data as NoticeBoardDocumentsEntity)
+            .list
+            .cast<NoticeBoardDocumentsEntity>());
       } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
         ToastEngine.show(result.errorMsg ?? "Network Load Error");
       }
     } catch (e) {
@@ -88,18 +115,39 @@ class DocumentsVm extends _$DocumentsVm {
     }
   }
 
+  void handlerResultList(List<NoticeBoardDocumentsEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
 
-  // 下拉刷新
-  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();
-
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+        // update();
+      }
+    } else {
+      if (page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        if (state.list!.length == 0) {
+          changeLoadingState(LoadState.State_Empty, null);
+        } else {
+          changeLoadingState(LoadState.State_Success, null);
+        }
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
   }
-
 }

+ 33 - 12
packages/cpt_notice_board/lib/modules/event/page/event_page.dart

@@ -2,11 +2,13 @@ import 'package:cpt_notice_board/modules/event_detail/page/event_detail_page.dar
 import 'package:cpt_notice_board/modules/notice_board/page/notice_board_page.dart';
 import 'package:flutter/material.dart';
 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/log_utils.dart';
 import 'package:shared/utils/color_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/widget_export.dart';
 import 'package:cs_resources/generated/assets.dart';
@@ -44,7 +46,7 @@ class EventPage extends HookConsumerWidget {
     return Container(
       // color: Colors.green,
       child: Text(
-        item['price'],
+        item['created_at'],
         style: const TextStyle(
             fontSize: 14.0,
             color: Colors.black,
@@ -106,26 +108,45 @@ class EventPage extends HookConsumerWidget {
 
   @override
   Widget build(BuildContext context, WidgetRef ref) {
-    final _vm = ref.read(eventVmProvider.notifier);
-
+    final vm = ref.read(eventVmProvider.notifier);
+    final state = ref.watch(eventVmProvider);
+    useEffect(() {
+      // 组件挂载时执行 - 执行接口请求
+      Future.microtask(() => vm.initPageData());
+      return () {
+        // 组件卸载时执行
+        Log.d("property_news_page 组件卸载时执行");
+      };
+    }, []);
     return Scaffold(
       // appBar: AppBar(title: Text("资产")),
-      body: EasyRefresh(
+      body: SizedBox(
+          width: double.infinity,
+          height: double.infinity,
+          child: EasyRefresh(
+              controller: vm.refreshController,
               // 上拉加载
               onLoad: () async {
-      Log.d("----onLoad");
-      _vm.onLoadData();
+                Log.d("----onLoad");
+                vm.loadMore();
               },
               // 下拉刷新
               onRefresh: () async {
-      Log.d("----onRefresh");
-      _vm.refreshListData();
+                Log.d("----onRefresh");
+                vm.onRefresh();
               },
               child: Container(
-        color: ColorUtils.string2Color('#F2F3F6'),
-        padding: const EdgeInsets.only(top: 15),
-        child: _buildSaleList(context, ref, _vm)),
-            ),
+                color: ColorUtils.string2Color('#F2F3F6'),
+                padding: const EdgeInsets.only(top: 15),
+                child: LoadStateLayout(
+                  state: state.loadingState,
+                  errorMessage: state.errorMessage,
+                  errorRetry: () {
+                    vm.retryRequest();
+                  },
+                  successSliverWidget: [_buildSaleList(context, ref, vm)],
+                ),
+              ))),
     );
   }
 }

+ 43 - 31
packages/cpt_notice_board/lib/modules/event/page/event_state.dart

@@ -2,48 +2,60 @@
 
 import 'dart:convert';
 
-EventState eventStateFromJson(String str) => EventState.fromJson(json.decode(str));
-
-String eventStateToJson(EventState data) => json.encode(data.toJson());
+import 'package:widgets/load_state_layout.dart';
 
 class EventState {
+  //页面 LoadView 状态的展示
+  LoadState loadingState;
+  String? errorMessage;
+
+  int? page;
+  int? limit = 10;
+  int? count = 1;
+  List<Map<String, dynamic>>? list;
+
   EventState({
-    required this.curPage,
-    required this.pageSize,
+    this.loadingState = LoadState.State_Loading,
+    String? errorMessage,
+    this.page = 1,
+    this.limit = 10,
+    this.count = 1,
     required this.list,
-    required this.filterCount,
   });
 
-  int curPage;
-  int pageSize;
-  List<Map<String, dynamic>> list;
-  int filterCount;
-
-  factory EventState.fromJson(Map<dynamic, dynamic> json) => EventState(
-    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,
-  };
-
   EventState copyWith({
-    int? curPage,
-    int? pageSize,
+    LoadState? loadingState,
+    String? errorMessage,
+    int? page,
+    int? limit,
+    int? count,
     List<Map<String, dynamic>>? list,
-    int? filterCount,
   }) {
     return EventState(
-      curPage: curPage ?? this.curPage,
-      pageSize: pageSize ?? this.pageSize,
+      loadingState: loadingState ?? this.loadingState,
+      errorMessage: errorMessage ?? this.errorMessage,
+      page: page ?? this.page,
+      limit: limit ?? this.limit,
+      count: count ?? this.count,
       list: list ?? this.list,
-      filterCount: filterCount ?? this.filterCount,
+    );
+  }
+
+  Map<String, dynamic> toMap() {
+    return {
+      'page': this.page,
+      'limit': this.limit,
+      'count': this.count,
+      'list': this.list,
+    };
+  }
+
+  factory EventState.fromMap(Map<String, dynamic> map) {
+    return EventState(
+      page: map['page'] as int,
+      limit: map['limit'] as int,
+      count: map['count'] as int,
+      list: map['list'] as List<Map<String, dynamic>>,
     );
   }
 }

+ 12 - 16
packages/cpt_notice_board/lib/modules/event/repository/event_repository.dart

@@ -1,9 +1,11 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/notice_board_event_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';
@@ -26,19 +28,14 @@ class EventRepository {
 
   EventRepository({required this.dioEngine});
 
-  Future<HttpResult<Object>> fetchPropertyNewsList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+  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";
@@ -46,25 +43,24 @@ class EventRepository {
 
     final result = await dioEngine.requestNetResult(
       // ApiConstants.apiServerTime, // api 地址
-      '/index.php/api/employee/extra/time', // api 地址
+      '/api/v1/user/notice/event/index', // api 地址
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false, //是否展示默认的Loading弹窗
+      networkDebounce: true, //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
+    Log.d("------请求返回的result--$result--------");
     //根据返回的结果,封装原始数据为Bean/Entity对象
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = EventState.fromJson(json!);
+      var data = NoticeBoardEventEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert<EventState>(data: data);
+      return result.convert<NoticeBoardEventEntity>(data: data);
     }
     return result.convert();
   }
-
-
 }

+ 93 - 46
packages/cpt_notice_board/lib/modules/event/vm/event_vm.dart

@@ -1,7 +1,10 @@
 import 'package:plugin_platform/http/http_result.dart';
+import 'package:domain/entity/notice_board_event_entity.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 '../page/event_state.dart';
 import '../repository/event_repository.dart';
 part 'event_vm.g.dart';
@@ -9,24 +12,21 @@ part 'event_vm.g.dart';
 @riverpod
 class EventVm extends _$EventVm {
   late EventRepository eventRepository;
+  var page = 1;
+  var limit = 10;
+
+  bool _needShowPlaceholder = false; //是否展示LoadingView
+
+  // Refresh 控制器
+  final EasyRefreshController refreshController = EasyRefreshController(
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
+  );
+
   EventState initState() {
+  // 初始化页面数据&0
     return EventState(
-      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,
+      list: [],
     );
   }
 
@@ -40,50 +40,73 @@ class EventVm extends _$EventVm {
     return state;
   }
 
-  // 初始化页面数据
+//刷新页面状态
+  void changeLoadingState(LoadState loadState, String? errorMsg) {
+    state = state.copyWith(loadingState: loadState, errorMessage: errorMsg);
+  }
+
+  // 初始化页面数据&0
   initPageData() {
     Log.d("----property_news_vm-----initPageData");
-    refreshListData();
+    onRefresh();
   }
 
-  // 上拉加载
-  Future onLoadData() async {
-    Log.d("----property_news_vm-----initListData");
+  // 上拉加载 更多
+  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 = page + 1;
+    //   state = state.copyWith(page: page,);
     //   getListData();
     // }
+    // 检查 page 是否为 null,并初始化为 1
+    page++;
+
+    getListData();
+  }
+
+  // 下拉刷新
+  Future onRefresh() async {
+    Log.d("----property_news_vm-----onRefresh ");
+
+    // await Future.delayed(const Duration(seconds: 2));
+    page = 1;
     getListData();
   }
 
-// 去新闻详情页
-  void goNewsDetail(String item) {
-    Log.d(item);
-    // PropertyPage.startInstance(context: context, item: item);
+  // 重试请求
+  Future retryRequest() async {
+    page = 1;
+    _needShowPlaceholder = true;
+    getListData();
   }
 
   // 获取list 列表数据
-  void getListData<T>() async {
-    Log.d("加载listData数据---------------start-----");
+  Future getListData<T>() async {
+    // if (_needShowPlaceholder) {
+    //   changeLoadingState(LoadState.State_Loading, null);
+    // }
+
+    Log.d("加载listData数据---------------start--${page}---");
     try {
       //请求网络
       Map<String, dynamic> params = {
-        "curPage": state.curPage,
-        "pageSize": state.pageSize,
+        "page": page,
+        "limit": limit,
       };
       Log.d("请求参数------$params");
-      final result = await eventRepository.fetchPropertyNewsList(params);
-      Log.d("请求完成结果------${result.data}");
+      final result = await eventRepository.fetchList(params);
       //校验成功失败
       if (result.isSuccess) {
-        // state = state.copyWith(serverTime: result.data);
-        state = state;
-        ToastEngine.show("获取数据成功");
+        handlerResultList((result.data as NoticeBoardEventEntity)
+            .list
+            .cast<NoticeBoardEventEntity>());
       } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
         ToastEngine.show(result.errorMsg ?? "Network Load Error");
       }
     } catch (e) {
@@ -91,15 +114,39 @@ class EventVm extends _$EventVm {
     }
   }
 
-  // 下拉刷新
-  Future refreshListData() async {
-    Log.d("----property_news_vm-----refreshListData ");
-
-    // await Future.delayed(const Duration(seconds: 2));
+  void handlerResultList(List<NoticeBoardEventEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
 
-    state = state.copyWith(curPage: 1, pageSize: 10);
-    // ref.invalidateSelf();
-    // ref.invalidate(propertyNewsVmProvider);
-    getListData();
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+        // update();
+      }
+    } else {
+      if (page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        if (state.list!.length == 0) {
+          changeLoadingState(LoadState.State_Empty, null);
+        } else {
+          changeLoadingState(LoadState.State_Success, null);
+        }
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
   }
 }

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

@@ -44,53 +44,53 @@ class NoticeBoardPage extends HookConsumerWidget {
           children: List.generate(topSectionsData.length, (index) {
             final item = topSectionsData[index];
             return Column(
-                children: [
-                  Container(
-                    width: MediaQuery.of(context).size.width /
-                            topSectionsData.length -
-                        36,
-                    height: 70,
-                    decoration: BoxDecoration(
-                      // color: currentTabIdx == index ? ColorUtils.string2Color('#E6F2FF') : Colors.white,
-                      shape: BoxShape.circle, // 设置为圆形
-                      boxShadow: tabsRouter.activeIndex == index
-                          ? [
-                              BoxShadow(
-                                color: context
-                                    .appColors.tabLightBlueShadow, // 设置阴影颜色
-                                blurRadius: 5, // 设置模糊半径
-                                spreadRadius: 0.05, // 控制阴影扩散
-                                offset: const Offset(0, 4), // 设置阴影偏移量
-                              ),
-                            ]
-                          : [], // 未选中时无阴影,
-                    ),
-                    child: MyAssetImage(
-                      item['icon'],
-                      width: MediaQuery.of(context).size.width /
-                              topSectionsData.length -
-                          36,
-                      height: 70,
-                    ).onTap(
-                      () {
-                        tabsRouter.setActiveIndex(index);
-                      },
-                      type: ClickType.throttle,
-                    ),
+              children: [
+                Container(
+                  width: MediaQuery.of(context).size.width /
+                          topSectionsData.length -
+                      36,
+                  height: 70,
+                  padding: const EdgeInsets.only(
+                      top: 18, left: 15, right: 15, bottom: 15),
+                  decoration: BoxDecoration(
+                    color:  ColorUtils.string2Color('#E6F2FF'),
+                    shape: BoxShape.circle, // 设置为圆形
+                    boxShadow: tabsRouter.activeIndex == index
+                        ? [
+                            BoxShadow(
+                              color: context
+                                  .appColors.tabLightBlueShadow, // 设置阴影颜色
+                              blurRadius: 5, // 设置模糊半径
+                              spreadRadius: 0.05, // 控制阴影扩散
+                              offset: const Offset(0, 4), // 设置阴影偏移量
+                            ),
+                          ]
+                        : [], // 未选中时无阴影,
                   ),
-                  SizedBox.fromSize(size: const Size(0, 9)),
-                  MyTextView(
-                    item['title'],
-                    maxLines: 1, // 设置最大行数为2
-                    isTextEllipsis: true, // 超出部分用省略号表示
-                    fontSize: 13,
-                    textColor: currentTabIdx == index
-                        ? ColorUtils.string2Color('#4161D0')
-                        : Colors.black,
-                    isFontMedium: true,
+                  child: MyAssetImage(
+                    item['icon'],
+                    width: 39,
+                    height: 36,
+                  ).onTap(
+                    () {
+                      tabsRouter.setActiveIndex(index);
+                    },
+                    type: ClickType.throttle,
                   ),
-                ],
-              ).marginOnly(left: 18, right: 18, top: 10, bottom: 10);
+                ),
+                SizedBox.fromSize(size: const Size(0, 9)),
+                MyTextView(
+                  item['title'],
+                  maxLines: 1, // 设置最大行数为2
+                  isTextEllipsis: true, // 超出部分用省略号表示
+                  fontSize: 13,
+                  textColor: currentTabIdx == index
+                      ? ColorUtils.string2Color('#4161D0')
+                      : Colors.black,
+                  isFontMedium: true,
+                ),
+              ],
+            ).marginOnly(left: 18, right: 18, top: 10, bottom: 10);
           }),
         ),
       ),

+ 4 - 1
packages/cpt_rewards/lib/modules/rewards/rewards_page.dart

@@ -53,7 +53,10 @@ class RewardsPage extends HookConsumerWidget {
               Assets.rewardsRewardsBack,
               width: 44,
               height: 44,
-            ),
+            ).onTap(() {
+              // backCallback
+              Navigator.pop(context);
+            }),
             // const Text(
             //   '1526 Available Points',
             //   style: TextStyle(

+ 4 - 1
packages/cpt_rewards/lib/modules/rewards_home/rewards_home_page.dart

@@ -53,7 +53,10 @@ class RewardsHomePage extends HookConsumerWidget {
               Assets.rewardsRewardsBack,
               width: 44,
               height: 44,
-            ),
+            ).onTap(() {
+              // backCallback
+              Navigator.pop(context);
+            }),
             const Text(
               '1526 Available Points',
               style: TextStyle(

+ 4 - 0
packages/cs_domain/lib/constants/api_constants.dart

@@ -119,6 +119,10 @@ class ApiConstants {
   //当前已预定的历史记录
   static const apiFacilityHistoryList = "/api/v1/user/facility/history/index";
 
+  //获取预约Booking的详情
+  static const apiFacilityBookingDetail = "/api/v1/user/facility/booking/detail";
+
+
   // =========================== 其他 ↓=========================================
 
   //服务器时间

+ 8 - 5
packages/cs_domain/lib/entity/facility_page_entity.dart

@@ -13,7 +13,7 @@ class FacilityPageEntity {
 	@JSONField(name: "total_deposit")
 	String? totalDeposit;
 
-	List<FacilityPageList>? list = [];
+	List<FacilityDetail>? list = [];
 
 	FacilityPageEntity();
 
@@ -28,18 +28,18 @@ class FacilityPageEntity {
 }
 
 @JsonSerializable()
-class FacilityPageList {
+class FacilityDetail {
 	FacilityPageListBooking? booking;
 	FacilityPageListFacility? facility;
 	@JSONField(name: "time_period")
 	FacilityPageListTimePeriod? timePeriod;
 	FacilityPageListAccount? account;
 
-	FacilityPageList();
+	FacilityDetail();
 
-	factory FacilityPageList.fromJson(Map<String, dynamic> json) => $FacilityPageListFromJson(json);
+	factory FacilityDetail.fromJson(Map<String, dynamic> json) => $FacilityDetailFromJson(json);
 
-	Map<String, dynamic> toJson() => $FacilityPageListToJson(this);
+	Map<String, dynamic> toJson() => $FacilityDetailToJson(this);
 
 	@override
 	String toString() {
@@ -49,6 +49,7 @@ class FacilityPageList {
 
 @JsonSerializable()
 class FacilityPageListBooking {
+	String? id;
 	String? date;
 	String? start;
 	String? end;
@@ -56,6 +57,8 @@ class FacilityPageListBooking {
 	String? depositPaid;
 	@JSONField(name: "deposit_refund")
 	String? depositRefund;
+	@JSONField(name: "deposit_refund_at")
+	String? depositRefundAt;
 
 	FacilityPageListBooking();
 

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

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

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

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

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

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

+ 23 - 4
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -27,6 +27,9 @@ import 'package:domain/entity/newsfeed_detail_entity.dart';
 import 'package:domain/entity/newsfeed_following_entity.dart';
 import 'package:domain/entity/newsfeed_foryou_entity.dart';
 import 'package:domain/entity/newsfeed_news_entity.dart';
+import 'package:domain/entity/notice_board_announ_entity.dart';
+import 'package:domain/entity/notice_board_documents_entity.dart';
+import 'package:domain/entity/notice_board_event_entity.dart';
 import 'package:domain/entity/property_news_entity.dart';
 import 'package:domain/entity/property_sale_rent_entity.dart';
 import 'package:domain/entity/server_time.dart';
@@ -196,9 +199,9 @@ class JsonConvert {
       return data.map<FacilityPageEntity>((Map<String, dynamic> e) =>
           FacilityPageEntity.fromJson(e)).toList() as M;
     }
-    if (<FacilityPageList>[] is M) {
-      return data.map<FacilityPageList>((Map<String, dynamic> e) =>
-          FacilityPageList.fromJson(e)).toList() as M;
+    if (<FacilityDetail>[] is M) {
+      return data.map<FacilityDetail>((Map<String, dynamic> e) =>
+          FacilityDetail.fromJson(e)).toList() as M;
     }
     if (<FacilityPageListBooking>[] is M) {
       return data.map<FacilityPageListBooking>((Map<String, dynamic> e) =>
@@ -365,6 +368,18 @@ class JsonConvert {
       return data.map<NewsfeedNewsListAccount>((Map<String, dynamic> e) =>
           NewsfeedNewsListAccount.fromJson(e)).toList() as M;
     }
+    if (<NoticeBoardAnnounEntity>[] is M) {
+      return data.map<NoticeBoardAnnounEntity>((Map<String, dynamic> e) =>
+          NoticeBoardAnnounEntity.fromJson(e)).toList() as M;
+    }
+    if (<NoticeBoardDocumentsEntity>[] is M) {
+      return data.map<NoticeBoardDocumentsEntity>((Map<String, dynamic> e) =>
+          NoticeBoardDocumentsEntity.fromJson(e)).toList() as M;
+    }
+    if (<NoticeBoardEventEntity>[] is M) {
+      return data.map<NoticeBoardEventEntity>((Map<String, dynamic> e) =>
+          NoticeBoardEventEntity.fromJson(e)).toList() as M;
+    }
     if (<PropertyNewsEntity>[] is M) {
       return data.map<PropertyNewsEntity>((Map<String, dynamic> e) =>
           PropertyNewsEntity.fromJson(e)).toList() as M;
@@ -442,7 +457,7 @@ class JsonConvertClassCollection {
     (FacilityBookFacilitiesPeriods).toString(): FacilityBookFacilitiesPeriods
         .fromJson,
     (FacilityPageEntity).toString(): FacilityPageEntity.fromJson,
-    (FacilityPageList).toString(): FacilityPageList.fromJson,
+    (FacilityDetail).toString(): FacilityDetail.fromJson,
     (FacilityPageListBooking).toString(): FacilityPageListBooking.fromJson,
     (FacilityPageListFacility).toString(): FacilityPageListFacility.fromJson,
     (FacilityPageListFacilityType).toString(): FacilityPageListFacilityType
@@ -494,6 +509,10 @@ class JsonConvertClassCollection {
     (NewsfeedNewsEntity).toString(): NewsfeedNewsEntity.fromJson,
     (NewsfeedNewsList).toString(): NewsfeedNewsList.fromJson,
     (NewsfeedNewsListAccount).toString(): NewsfeedNewsListAccount.fromJson,
+    (NoticeBoardAnnounEntity).toString(): NoticeBoardAnnounEntity.fromJson,
+    (NoticeBoardDocumentsEntity).toString(): NoticeBoardDocumentsEntity
+        .fromJson,
+    (NoticeBoardEventEntity).toString(): NoticeBoardEventEntity.fromJson,
     (PropertyNewsEntity).toString(): PropertyNewsEntity.fromJson,
     (PropertyNewsList).toString(): PropertyNewsList.fromJson,
     (PropertySaleRentEntity).toString(): PropertySaleRentEntity.fromJson,

+ 30 - 15
packages/cs_domain/lib/generated/json/facility_page_entity.g.dart

@@ -24,9 +24,9 @@ FacilityPageEntity $FacilityPageEntityFromJson(Map<String, dynamic> json) {
   if (totalDeposit != null) {
     facilityPageEntity.totalDeposit = totalDeposit;
   }
-  final List<FacilityPageList>? list = (json['list'] as List<dynamic>?)
+  final List<FacilityDetail>? list = (json['list'] as List<dynamic>?)
       ?.map(
-          (e) => jsonConvert.convert<FacilityPageList>(e) as FacilityPageList)
+          (e) => jsonConvert.convert<FacilityDetail>(e) as FacilityDetail)
       .toList();
   if (list != null) {
     facilityPageEntity.list = list;
@@ -52,7 +52,7 @@ extension FacilityPageEntityExtension on FacilityPageEntity {
     int? limit,
     int? countPage,
     String? totalDeposit,
-    List<FacilityPageList>? list,
+    List<FacilityDetail>? list,
   }) {
     return FacilityPageEntity()
       ..count = count ?? this.count
@@ -64,32 +64,32 @@ extension FacilityPageEntityExtension on FacilityPageEntity {
   }
 }
 
-FacilityPageList $FacilityPageListFromJson(Map<String, dynamic> json) {
-  final FacilityPageList facilityPageList = FacilityPageList();
+FacilityDetail $FacilityDetailFromJson(Map<String, dynamic> json) {
+  final FacilityDetail facilityDetail = FacilityDetail();
   final FacilityPageListBooking? booking = jsonConvert.convert<
       FacilityPageListBooking>(json['booking']);
   if (booking != null) {
-    facilityPageList.booking = booking;
+    facilityDetail.booking = booking;
   }
   final FacilityPageListFacility? facility = jsonConvert.convert<
       FacilityPageListFacility>(json['facility']);
   if (facility != null) {
-    facilityPageList.facility = facility;
+    facilityDetail.facility = facility;
   }
   final FacilityPageListTimePeriod? timePeriod = jsonConvert.convert<
       FacilityPageListTimePeriod>(json['time_period']);
   if (timePeriod != null) {
-    facilityPageList.timePeriod = timePeriod;
+    facilityDetail.timePeriod = timePeriod;
   }
   final FacilityPageListAccount? account = jsonConvert.convert<
       FacilityPageListAccount>(json['account']);
   if (account != null) {
-    facilityPageList.account = account;
+    facilityDetail.account = account;
   }
-  return facilityPageList;
+  return facilityDetail;
 }
 
-Map<String, dynamic> $FacilityPageListToJson(FacilityPageList entity) {
+Map<String, dynamic> $FacilityDetailToJson(FacilityDetail entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['booking'] = entity.booking?.toJson();
   data['facility'] = entity.facility?.toJson();
@@ -98,14 +98,14 @@ Map<String, dynamic> $FacilityPageListToJson(FacilityPageList entity) {
   return data;
 }
 
-extension FacilityPageListExtension on FacilityPageList {
-  FacilityPageList copyWith({
+extension FacilityDetailExtension on FacilityDetail {
+  FacilityDetail copyWith({
     FacilityPageListBooking? booking,
     FacilityPageListFacility? facility,
     FacilityPageListTimePeriod? timePeriod,
     FacilityPageListAccount? account,
   }) {
-    return FacilityPageList()
+    return FacilityDetail()
       ..booking = booking ?? this.booking
       ..facility = facility ?? this.facility
       ..timePeriod = timePeriod ?? this.timePeriod
@@ -116,6 +116,10 @@ extension FacilityPageListExtension on FacilityPageList {
 FacilityPageListBooking $FacilityPageListBookingFromJson(
     Map<String, dynamic> json) {
   final FacilityPageListBooking facilityPageListBooking = FacilityPageListBooking();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    facilityPageListBooking.id = id;
+  }
   final String? date = jsonConvert.convert<String>(json['date']);
   if (date != null) {
     facilityPageListBooking.date = date;
@@ -137,34 +141,45 @@ FacilityPageListBooking $FacilityPageListBookingFromJson(
   if (depositRefund != null) {
     facilityPageListBooking.depositRefund = depositRefund;
   }
+  final String? depositRefundAt = jsonConvert.convert<String>(
+      json['deposit_refund_at']);
+  if (depositRefundAt != null) {
+    facilityPageListBooking.depositRefundAt = depositRefundAt;
+  }
   return facilityPageListBooking;
 }
 
 Map<String, dynamic> $FacilityPageListBookingToJson(
     FacilityPageListBooking entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
   data['date'] = entity.date;
   data['start'] = entity.start;
   data['end'] = entity.end;
   data['deposit_paid'] = entity.depositPaid;
   data['deposit_refund'] = entity.depositRefund;
+  data['deposit_refund_at'] = entity.depositRefundAt;
   return data;
 }
 
 extension FacilityPageListBookingExtension on FacilityPageListBooking {
   FacilityPageListBooking copyWith({
+    String? id,
     String? date,
     String? start,
     String? end,
     String? depositPaid,
     String? depositRefund,
+    String? depositRefundAt,
   }) {
     return FacilityPageListBooking()
+      ..id = id ?? this.id
       ..date = date ?? this.date
       ..start = start ?? this.start
       ..end = end ?? this.end
       ..depositPaid = depositPaid ?? this.depositPaid
-      ..depositRefund = depositRefund ?? this.depositRefund;
+      ..depositRefund = depositRefund ?? this.depositRefund
+      ..depositRefundAt = depositRefundAt ?? this.depositRefundAt;
   }
 }
 

+ 57 - 0
packages/cs_domain/lib/generated/json/notice_board_announ_entity.g.dart

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

+ 57 - 0
packages/cs_domain/lib/generated/json/notice_board_documents_entity.g.dart

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

+ 57 - 0
packages/cs_domain/lib/generated/json/notice_board_event_entity.g.dart

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

+ 35 - 8
packages/cs_domain/lib/repository/facility_repository.dart

@@ -54,12 +54,12 @@ class FacilityRepository {
       //获取List数据 需要转换一次
       var list = jsonList
           ?.map((value) {
-            if (value is Map<String, dynamic>) {
-              return IdNameEntity.fromJson(value);
-            } else {
-              return null;
-            }
-          })
+        if (value is Map<String, dynamic>) {
+          return IdNameEntity.fromJson(value);
+        } else {
+          return null;
+        }
+      })
           .where((item) => item != null)
           .cast<IdNameEntity>()
           .toList();
@@ -97,7 +97,7 @@ class FacilityRepository {
   }
 
   /// 预约设施
-  Future<HttpResult> submitBooking({
+  Future<HttpResult<FacilityDetail>> submitBooking({
     required String? periodId,
     required DateTime date,
     CancelToken? cancelToken,
@@ -117,7 +117,9 @@ class FacilityRepository {
     );
 
     if (result.isSuccess) {
-      return result.convert();
+      final json = result.getDataJson();
+      var data = FacilityDetail.fromJson(json!);
+      return result.convert<FacilityDetail>(data: data);
     }
     return result.convert();
   }
@@ -194,4 +196,29 @@ class FacilityRepository {
     return result.convert();
   }
 
+  /// 获取预约Booking的详情
+  Future<HttpResult<FacilityDetail>> fetchFacilityBookingDetail({
+    required String? id,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params['id'] = id ?? "";
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiFacilityBookingDetail,
+      params: params,
+      isShowLoadingDialog: true,
+      networkDebounce: true,
+      method: HttpMethod.GET,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = FacilityDetail.fromJson(json!);
+      return result.convert<FacilityDetail>(data: data);
+    }
+    return result.convert();
+  }
+
 }

BIN
packages/cs_resources/assets/notice_board/announcement_icon.png


BIN
packages/cs_resources/assets/notice_board/documents_icon.png


BIN
packages/cs_resources/assets/notice_board/event_icon.png


+ 3 - 0
packages/cs_resources/lib/generated/intl/messages_en.dart

@@ -193,6 +193,8 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("HACKING START DATE"),
         "have_fun": MessageLookupByLibrary.simpleMessage("Have Fun!"),
         "history": MessageLookupByLibrary.simpleMessage("History"),
+        "hold_started_on":
+            MessageLookupByLibrary.simpleMessage("hold started on"),
         "home": MessageLookupByLibrary.simpleMessage("Home"),
         "household": MessageLookupByLibrary.simpleMessage("Household"),
         "household_members":
@@ -336,6 +338,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "registration_of_2_vehicle":
             MessageLookupByLibrary.simpleMessage("Registration of 2nd Vehicle"),
         "rejected": MessageLookupByLibrary.simpleMessage("Rejected"),
+        "released_on": MessageLookupByLibrary.simpleMessage("released on"),
         "remove": MessageLookupByLibrary.simpleMessage("Remove"),
         "remove_account":
             MessageLookupByLibrary.simpleMessage("Remove Account"),

+ 20 - 0
packages/cs_resources/lib/generated/l10n.dart

@@ -2820,6 +2820,26 @@ class S {
     );
   }
 
+  /// `hold started on`
+  String get hold_started_on {
+    return Intl.message(
+      'hold started on',
+      name: 'hold_started_on',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `released on`
+  String get released_on {
+    return Intl.message(
+      'released on',
+      name: 'released_on',
+      desc: '',
+      args: [],
+    );
+  }
+
   /// `Other`
   String get other {
     return Intl.message(

+ 2 - 0
packages/cs_resources/lib/l10n/intl_en.arb

@@ -276,5 +276,7 @@
   "media_room": "Media Room",
   "pet_pavilion": "Pet Pavilion",
   "tennis_court": "Tennis Court",
+  "hold_started_on": "hold started on",
+  "released_on": "released on",
   "other": "Other"
 }

+ 2 - 0
packages/cs_resources/lib/l10n/intl_zh_CN.arb

@@ -276,5 +276,7 @@
   "media_room": "多媒体室",
   "pet_pavilion": "宠物亭",
   "tennis_court": "网球场",
+  "hold_started_on": "押金付款于",
+  "released_on": "押金退款于",
   "other": "其他"
 }

+ 2 - 0
packages/cs_resources/lib/l10n/intl_zh_HK.arb

@@ -262,5 +262,7 @@
   "media_room": "多媒体室",
   "pet_pavilion": "宠物亭",
   "tennis_court": "网球场",
+  "hold_started_on": "押金付款于",
+  "released_on": "押金退款于",
   "other": "其他"
 }