Browse Source

1.调整公告板的文件预览的方式。
2.设施模块的book与支付相关逻辑
3. Book页面的预定日期限制相关修改
4. 列表的相关状态展示与详情页面状态与支付逻辑

liukai 2 weeks ago
parent
commit
8ff93152d0
48 changed files with 919 additions and 350 deletions
  1. 0 3
      packages/cpt_auth/lib/modules/tenant_doc/tenant_doc_view_model.dart
  2. 1 1
      packages/cpt_facility/lib/modules/book_confirm/book_confirm_page.dart
  3. 3 3
      packages/cpt_facility/lib/modules/booking/facility_booking_page.dart
  4. 4 0
      packages/cpt_facility/lib/modules/booking/facility_booking_state.dart
  5. 19 2
      packages/cpt_facility/lib/modules/booking/facility_booking_view_model.dart
  6. 101 80
      packages/cpt_facility/lib/modules/detail/facility_detail_page.dart
  7. 20 0
      packages/cpt_facility/lib/modules/detail/facility_detail_view_model.dart
  8. 22 1
      packages/cpt_facility/lib/modules/facility/active/facility_active_view_model.dart
  9. 22 8
      packages/cpt_facility/lib/modules/facility/active/item_facility_active.dart
  10. 2 3
      packages/cpt_facility/lib/modules/facility/deposit/item_facility_deposit.dart
  11. 21 20
      packages/cpt_facility/lib/modules/facility/history/item_facility_history.dart
  12. 16 16
      packages/cpt_form/lib/modules/apply/form_payment_page.dart
  13. 2 0
      packages/cpt_form/lib/modules/apply/vm/apply_view_model.dart
  14. 61 26
      packages/cpt_form/lib/modules/detail/detail_processing_fragment.dart
  15. 20 0
      packages/cpt_form/lib/modules/detail/form_detail_view_model.dart
  16. 21 8
      packages/cpt_form/lib/modules/form/approve/item_form_approve.dart
  17. 21 8
      packages/cpt_form/lib/modules/form/not_approve/item_form_not_approve.dart
  18. 23 2
      packages/cpt_form/lib/modules/form/submit/form_submit_view_model.dart
  19. 21 8
      packages/cpt_form/lib/modules/form/submit/item_form_submit.dart
  20. 28 4
      packages/cpt_notice_board/lib/modules/documents/page/documents_page.dart
  21. 46 20
      packages/cpt_notice_board/lib/modules/documents_list/page/documents_list_page.dart
  22. 13 13
      packages/cpt_payment/lib/modules/payment/payment_page.dart
  23. 4 0
      packages/cpt_payment/lib/provider/stripe_service.dart
  24. 1 2
      packages/cpt_payment/lib/router/component/payment_component_service.dart
  25. 22 29
      packages/cs_domain/lib/entity/facility_page_entity.dart
  26. 27 0
      packages/cs_domain/lib/entity/form_detail_entity.dart
  27. 28 2
      packages/cs_domain/lib/entity/form_submitted_entity.dart
  28. 11 7
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  29. 62 56
      packages/cs_domain/lib/generated/json/facility_page_entity.g.dart
  30. 67 1
      packages/cs_domain/lib/generated/json/form_detail_entity.g.dart
  31. 67 10
      packages/cs_domain/lib/generated/json/form_submitted_entity.g.dart
  32. 0 1
      packages/cs_domain/lib/repository/facility_repository.dart
  33. 1 0
      packages/cs_plugin_basic/lib/constants/app_constant.dart
  34. 3 0
      packages/cs_resources/lib/generated/intl/messages_en.dart
  35. 3 0
      packages/cs_resources/lib/generated/intl/messages_zh_CN.dart
  36. 3 0
      packages/cs_resources/lib/generated/intl/messages_zh_HK.dart
  37. 30 0
      packages/cs_resources/lib/generated/l10n.dart
  38. 3 0
      packages/cs_resources/lib/l10n/intl_en.arb
  39. 3 0
      packages/cs_resources/lib/l10n/intl_zh_CN.arb
  40. 3 0
      packages/cs_resources/lib/l10n/intl_zh_HK.arb
  41. 6 0
      packages/cs_resources/lib/theme/app_colors_theme.dart
  42. 60 0
      packages/cs_shared/lib/utils/file_utils.dart
  43. 3 0
      packages/cs_widgets/lib/shatter/select_calendar/calendar_bottom_sheet.dart
  44. 4 9
      packages/cs_widgets/lib/shatter/select_calendar/full_calendar.dart
  45. 8 0
      packages/cs_widgets/lib/shatter/weekly_calendar/calendar_utils.dart
  46. 4 5
      packages/cs_widgets/lib/shatter/weekly_calendar/day_cell.dart
  47. 6 2
      packages/cs_widgets/lib/shatter/weekly_calendar/day_table_view.dart
  48. 3 0
      packages/cs_widgets/lib/shatter/weekly_calendar/weekly_calendar.dart

+ 0 - 3
packages/cpt_auth/lib/modules/tenant_doc/tenant_doc_view_model.dart

@@ -1,11 +1,8 @@
-import 'package:cs_resources/generated/l10n.dart';
 import 'package:domain/repository/profile_repository.dart';
 import 'package:plugin_basic/constants/app_constant.dart';
 import 'package:plugin_basic/provider/user_config/user_config_service.dart';
-import 'package:plugin_platform/engine/notify/notify_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:router/componentRouter/component_service_manager.dart';
 import 'package:shared/utils/event_bus.dart';
 import 'package:shared/utils/log_utils.dart';
 

+ 1 - 1
packages/cpt_facility/lib/modules/book_confirm/book_confirm_page.dart

@@ -118,7 +118,7 @@ class BookConfirmPage extends HookConsumerWidget {
           ),
 
           // 显示支付信息
-          _paymentInfo(context, ref),
+          // _paymentInfo(context, ref),
 
           // 底部按钮
           MyButton(

+ 3 - 3
packages/cpt_facility/lib/modules/booking/facility_booking_page.dart

@@ -12,7 +12,6 @@ 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/date_time_utils.dart';
-import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/my_appbar.dart';
@@ -107,9 +106,10 @@ class FacilityBookingPage extends HookConsumerWidget {
             ],
           ),
 
-          //二周的日期选择
+          //二周的日期选择 (自定义控件)
           WeeklyCalendar(
             selectedDate: state.selectedDate,
+            maxDate: DateTime.now().add(Duration(days: state.bookAdvanceDays)),
             onChangedSelectedDate: (dateTime) {
               viewModel.changeSelectedDate(dateTime);
             },
@@ -175,7 +175,7 @@ class FacilityBookingPage extends HookConsumerWidget {
       builder: (BuildContext context) {
         return CustomCalendarBottomSheet(
           firstDate: DateTime.now(),
-          lastDate: DateTime.now().add(const Duration(days: 365)),
+          lastDate: DateTime.now().add(Duration(days: state.bookAdvanceDays)),
           selectedDate: state.selectedDate,
           locale: "en",
           onDateChange: (dateTime) {

+ 4 - 0
packages/cpt_facility/lib/modules/booking/facility_booking_state.dart

@@ -11,6 +11,7 @@ class FacilityBookingState {
 
   //网络请求数据
   FacilityBookEntity? data;
+  int bookAdvanceDays = 0; //最大可以提前多少天预定
 
   String? facilityId;
   String? facilityName;
@@ -24,6 +25,7 @@ class FacilityBookingState {
     required this.selectedDate,
     this.loadingState = LoadState.State_Loading,
     this.data,
+    this.bookAdvanceDays = 0,
     this.errorMessage,
     this.facilityId,
     this.facilityName,
@@ -40,6 +42,7 @@ class FacilityBookingState {
     FacilityBookEntity? data,
     int? index,
     int? innerIndex,
+    int? bookAdvanceDays,
   }) {
     return FacilityBookingState(
       selectedDate: selectedDate ?? this.selectedDate,
@@ -50,6 +53,7 @@ class FacilityBookingState {
       facilityName: facilityName ?? this.facilityName,
       index: index ?? this.index,
       innerIndex: innerIndex ?? this.innerIndex,
+      bookAdvanceDays: this.bookAdvanceDays > 0 ? this.bookAdvanceDays : bookAdvanceDays ?? this.bookAdvanceDays,
     );
   }
 }

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

@@ -1,5 +1,6 @@
 import 'package:domain/entity/facility_book_entity.dart';
 import 'package:domain/repository/facility_repository.dart';
+import 'package:plugin_platform/engine/loading/loading_engine.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';
@@ -63,7 +64,7 @@ class FacilityBookingViewModel extends _$FacilityBookingViewModel with DioCancel
     if (result.isSuccess) {
       if (result.data != null) {
         //有数据
-        state = state.copyWith(data: result.data, loadingState: LoadState.State_Success);
+        state = state.copyWith(data: result.data, bookAdvanceDays: result.data?.facilityType?.bookAdvanceDays ?? 0, loadingState: LoadState.State_Success);
       } else {
         //展示无数据的布局
         state = state.copyWith(data: null, loadingState: LoadState.State_Empty, errorMessage: null);
@@ -142,6 +143,9 @@ class FacilityBookingViewModel extends _$FacilityBookingViewModel with DioCancel
 
   //确认页面执行支付
   void doPayment() async {
+    //支付流程 Loading 开始
+    LoadingEngine.show();
+
     final result = await _facilityRepository.submitBooking(
       periodId: state.data?.facilities?[state.index].periods?[state.innerIndex].id,
       date: state.selectedDate,
@@ -150,7 +154,20 @@ class FacilityBookingViewModel extends _$FacilityBookingViewModel with DioCancel
 
     if (result.isSuccess) {
       final bookingId = result.data?.booking?.id;
-      FacilityDetailPage.startWithPop2Main(bookingId: bookingId);
+      String orderId = result.data?.order?.id ?? "";
+
+      Log.d("当前 Facility 生成的订单ID:$orderId");
+
+      //调用支付服务
+      bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
+
+      //支付流程 Loading 结束
+      LoadingEngine.dismiss();
+
+      //如果成功,走下一步流程
+      if (success) {
+        FacilityDetailPage.startWithPop2Main(bookingId: bookingId);
+      }
     } else {
       ToastEngine.show(result.errorMsg ?? "UnKnow Error");
     }

+ 101 - 80
packages/cpt_facility/lib/modules/detail/facility_detail_page.dart

@@ -8,6 +8,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_appbar.dart';
+import 'package:widgets/my_button.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 import 'package:widgets/utils/dark_theme_util.dart';
@@ -55,74 +56,94 @@ class FacilityDetailPage extends HookConsumerWidget {
     return Scaffold(
       appBar: MyAppBar.appBar(context, state.detail?.facility?.type?.name ?? "", backgroundColor: context.appColors.backgroundWhite),
       backgroundColor: context.appColors.backgroundDark,
-      body: SingleChildScrollView(
-        scrollDirection: Axis.vertical,
-        physics: const BouncingScrollPhysics(),
-        child: Column(
-          mainAxisSize: MainAxisSize.max,
-          crossAxisAlignment: CrossAxisAlignment.center,
-          children: [
-            //顶部的信息展示
-            _buildHeaderWidget(context, ref),
+      body: Column(children: [
+        SingleChildScrollView(
+          scrollDirection: Axis.vertical,
+          physics: const BouncingScrollPhysics(),
+          child: Column(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              //顶部的信息展示
+              state.detail?.order?.paymentStatus == 1 ? _buildHeaderWidget(context, ref) : const SizedBox.shrink(),
 
-            //预定
-            _buildDetailItem(
-              context,
-              ref,
-              S.current.book,
-              Assets.facilityConfirmDateIcon,
-              28.5,
-              29,
-              state.detail?.booking?.date ?? "",
-              null,
-              "${state.detail?.booking?.start ?? ""}-${state.detail?.booking?.end ?? ""}",
-              null,
-            ),
+              //预定
+              _buildDetailItem(
+                context,
+                ref,
+                S.current.book,
+                Assets.facilityConfirmDateIcon,
+                28.5,
+                29,
+                state.detail?.booking?.date ?? "",
+                null,
+                "${state.detail?.booking?.start ?? ""}-${state.detail?.booking?.end ?? ""}",
+                null,
+              ),
 
-            //设施
-            _buildDetailItem(
-              context,
-              ref,
-              S.current.facility,
-              Assets.facilityConfirmFacilityIcon,
-              25.0,
-              30.5,
-              state.detail?.facility?.type?.name ?? "",
-              null,
-              state.detail?.facility?.name ?? "",
-              null,
-            ),
+              //设施
+              _buildDetailItem(
+                context,
+                ref,
+                S.current.facility,
+                Assets.facilityConfirmFacilityIcon,
+                25.0,
+                30.5,
+                state.detail?.facility?.type?.name ?? "",
+                null,
+                state.detail?.facility?.name ?? "",
+                null,
+              ),
 
-            //付款
-            _buildDetailItem(
-              context,
-              ref,
-              S.current.payment,
-              Assets.facilityConfirmPaymentIcon,
-              27.0,
-              22.0,
-              S.current.booking_fee,
-              state.detail?.timePeriod?.price ?? "",
-              S.current.total,
-              "\$${state.detail?.timePeriod?.price ?? ""}",
-            ),
+              //付款
+              _buildDetailItem(
+                context,
+                ref,
+                S.current.payment,
+                Assets.facilityConfirmPaymentIcon,
+                27.0,
+                22.0,
+                S.current.booking_fee,
+                state.detail?.timePeriod?.price ?? "",
+                S.current.total,
+                "\$${state.detail?.timePeriod?.price ?? ""}",
+              ),
 
-            // 押金
-            _buildDetailItem(
-              context,
-              ref,
-              S.current.deposit,
-              Assets.facilityConfirmDepositIcon,
-              28.0,
-              26.5,
-              S.current.on_hold,
-              "\$${state.detail?.timePeriod?.deposit ?? ""}",
-              null,
-              null,
-            ),
-          ],
+              // 押金
+              _buildDetailItem(
+                context,
+                ref,
+                S.current.deposit,
+                Assets.facilityConfirmDepositIcon,
+                28.0,
+                26.5,
+                S.current.on_hold,
+                "\$${state.detail?.timePeriod?.deposit ?? ""}",
+                null,
+                null,
+              ),
+            ],
+          ),
+        ).expanded(),
+
+        // 底部按钮
+        Visibility(
+          visible: state.detail?.order?.paymentStatus != 1,
+          child: MyButton(
+            onPressed: () {
+              viewModel.doPaymentOrder(state.detail?.order?.id ?? "");
+            },
+            text: S.current.proceed_with_payment,
+            textColor: Colors.white,
+            backgroundColor: context.appColors.btnBgDefault,
+            fontWeight: FontWeight.w500,
+            type: ClickType.throttle,
+            fontSize: 16,
+            minHeight: 50,
+            radius: 0,
+          ).marginOnly(top: 15),
         ),
-      ),
+      ]),
     );
   }
 
@@ -173,23 +194,23 @@ class FacilityDetailPage extends HookConsumerWidget {
           ),
 
           //付款类型与时间
-          Row(
-            mainAxisSize: MainAxisSize.min,
-            children: [
-              MyTextView(
-                "Master card ending",
-                fontSize: 15,
-                isFontRegular: true,
-                textColor: context.appColors.textBlack,
-              ),
-              MyTextView(
-                "9423",
-                fontSize: 15,
-                isFontMedium: true,
-                textColor: context.appColors.textBlack,
-              ),
-            ],
-          ).marginOnly(top: 12),
+          // Row(
+          //   mainAxisSize: MainAxisSize.min,
+          //   children: [
+          //     MyTextView(
+          //       "Master card ending",
+          //       fontSize: 15,
+          //       isFontRegular: true,
+          //       textColor: context.appColors.textBlack,
+          //     ),
+          //     MyTextView(
+          //       "9423",
+          //       fontSize: 15,
+          //       isFontMedium: true,
+          //       textColor: context.appColors.textBlack,
+          //     ),
+          //   ],
+          // ).marginOnly(top: 12),
 
           Row(
             mainAxisSize: MainAxisSize.min,

+ 20 - 0
packages/cpt_facility/lib/modules/detail/facility_detail_view_model.dart

@@ -1,7 +1,10 @@
 import 'package:domain/repository/facility_repository.dart';
+import 'package:plugin_platform/engine/loading/loading_engine.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 'package:router/componentRouter/component_service_manager.dart';
+import 'package:router/ext/auto_router_extensions.dart';
 
 import 'facility_detail_state.dart';
 
@@ -30,4 +33,21 @@ class FacilityDetailViewModel extends _$FacilityDetailViewModel with DioCancelab
     }
   }
 
+  //根据OrderId继续支付订单
+  void doPaymentOrder(String orderId) async {
+    //支付流程 Loading 开始
+    LoadingEngine.show();
+
+    //调用支付服务
+    bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
+
+    //支付流程 Loading 结束
+    LoadingEngine.dismiss();
+
+    //如果成功,返回页面
+    if (success) {
+      appRouter.maybePop();
+    }
+  }
+
 }

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

@@ -1,7 +1,9 @@
 import 'package:domain/entity/facility_page_entity.dart';
 import 'package:domain/repository/facility_repository.dart';
+import 'package:plugin_basic/constants/app_constant.dart';
 import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/event_bus.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
@@ -26,7 +28,12 @@ class FacilityActiveViewModel extends _$FacilityActiveViewModel with DioCancelab
   FacilityActiveState build() {
     _facilityRepository = ref.read(facilityRepositoryProvider);
     final state = FacilityActiveState(datas: []);
-    registerCancellation();
+
+    registerEventBus();
+    registerCancellation(callback: () {
+      unregisterEventBus();
+    });
+
     return state;
   }
 
@@ -105,4 +112,18 @@ class FacilityActiveViewModel extends _$FacilityActiveViewModel with DioCancelab
       }
     }
   }
+
+  // EventBus 的事件接收
+  Subscription? subscribe;
+
+  void registerEventBus() {
+    subscribe = bus.on(AppConstant.eventStripePaymentSuccess, (arg) {
+      //用户支付成功的通知
+      refreshController.callRefresh();
+    });
+  }
+
+  void unregisterEventBus() {
+    bus.off(AppConstant.eventStripePaymentSuccess, subscribe);
+  }
 }

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

@@ -119,15 +119,29 @@ class FacilityActiveItem extends StatelessWidget {
             children: [
               //查看按钮
               MyTextView(
-                S.current.view,
-                textColor: Colors.white,
-                backgroundColor: context.appColors.btnBgDefault,
-                cornerRadius: 7,
-                paddingTop: 9,
-                paddingBottom: 9,
+                item.order?.refundStatus != 0
+                    ? S.current.refunded
+                    : item.order?.paymentStatus == 1
+                    ? S.current.paid
+                    : S.current.unpaid,
+                textColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                    ? context.appColors.textPrimary
+                    : context.appColors.deleteRed,
+                cornerRadius: 3,
+                borderWidth: 0.5,
+                borderColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                    ? context.appColors.textPrimary
+                    : context.appColors.deleteRed,
+                paddingTop: 3,
+                paddingBottom: 3,
+                paddingLeft: 15,
+                paddingRight: 15,
                 textAlign: TextAlign.center,
-                boxWidth: 60,
-              )
+              ),
             ],
           )
         ],

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

@@ -3,7 +3,6 @@ import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:domain/entity/facility_page_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:widgets/ext/ex_widget.dart';
-import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 
 ///  设施的Deposit的Item
@@ -42,7 +41,7 @@ class FacilityDepositItem extends StatelessWidget {
               ),
               const Spacer(),
               MyTextView(
-                "\$${item.booking?.depositPaid??""}",
+                "\$${item.booking?.deposit ?? ""}",
                 fontSize: 14.5,
                 textColor: context.appColors.textBlack,
                 isFontMedium: true,
@@ -50,7 +49,7 @@ class FacilityDepositItem extends StatelessWidget {
             ],
           ).marginOnly(top: 10),
         ],
-      ).expanded(),
+      ),
     );
   }
 }

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

@@ -117,29 +117,30 @@ class FacilityHistoryItem extends StatelessWidget {
             mainAxisAlignment:MainAxisAlignment.start,
             crossAxisAlignment: CrossAxisAlignment.start,
             children: [
-              //查看按钮
               MyTextView(
-                S.current.view,
-                textColor: Colors.white,
-                backgroundColor: context.appColors.btnBgDefault,
-                cornerRadius: 7,
-                paddingTop: 9,
-                paddingBottom: 9,
+                item.order?.refundStatus != 0
+                    ? S.current.refunded
+                    : item.order?.paymentStatus == 1
+                    ? S.current.paid
+                    : S.current.unpaid,
+                textColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                    ? context.appColors.textPrimary
+                    : context.appColors.deleteRed,
+                cornerRadius: 3,
+                borderWidth: 0.5,
+                borderColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                    ? context.appColors.textPrimary
+                    : context.appColors.deleteRed,
+                paddingTop: 3,
+                paddingBottom: 3,
+                paddingLeft: 15,
+                paddingRight: 15,
                 textAlign: TextAlign.center,
-                boxWidth: 60,
               ),
-
-              // MyTextView(
-              //   S.current.delete,
-              //   textColor: Colors.white,
-              //   backgroundColor: context.appColors.orangeBG,
-              //   cornerRadius: 7,
-              //   paddingTop: 9,
-              //   marginTop: 15,
-              //   paddingBottom: 9,
-              //   textAlign: TextAlign.center,
-              //   boxWidth: 60,
-              // )
             ],
           )
         ],

+ 16 - 16
packages/cpt_form/lib/modules/apply/form_payment_page.dart

@@ -186,21 +186,21 @@ class FormPaymentPage extends HookConsumerWidget {
                         ),
 
                         //银行卡
-                        Row(
-                          children: [
-                            const MyAssetImage(Assets.paymentCardIcon, width: 27, height: 27),
-                            MyTextView(
-                              S.current.card,
-                              textColor: context.appColors.textBlack,
-                              fontSize: 17,
-                              marginLeft: 14,
-                              isFontMedium: true,
-                            ).expanded(),
-                          ],
-                        ).marginOnly(top: 14, left: 15, right: 15, bottom: 14),
-
-                        //选择支付卡
-                        _paymentInfo(context, ref),
+                        // Row(
+                        //   children: [
+                        //     const MyAssetImage(Assets.paymentCardIcon, width: 27, height: 27),
+                        //     MyTextView(
+                        //       S.current.card,
+                        //       textColor: context.appColors.textBlack,
+                        //       fontSize: 17,
+                        //       marginLeft: 14,
+                        //       isFontMedium: true,
+                        //     ).expanded(),
+                        //   ],
+                        // ).marginOnly(top: 14, left: 15, right: 15, bottom: 14),
+                        //
+                        // //选择支付卡
+                        // _paymentInfo(context, ref),
 
                         //签名
                         MyTextView(
@@ -322,7 +322,7 @@ class FormPaymentPage extends HookConsumerWidget {
 
                     viewModel.submitForm();
                   },
-                  text: S.current.next,
+                  text: S.current.payment,
                   textColor: Colors.white,
                   backgroundColor: context.appColors.btnBgDefault,
                   fontWeight: FontWeight.w500,

+ 2 - 0
packages/cpt_form/lib/modules/apply/vm/apply_view_model.dart

@@ -177,6 +177,8 @@ class ApplyViewModel extends _$ApplyViewModel with DioCancelableMixin {
 
       //支付流程 Loading 结束
       LoadingEngine.dismiss();
+
+      //如果成功,走下一步流程
       if (success){
         gotoNextPage();
       }

+ 61 - 26
packages/cpt_form/lib/modules/detail/detail_processing_fragment.dart

@@ -19,6 +19,7 @@ class DetailProcessingFragment extends HookConsumerWidget {
   @override
   Widget build(BuildContext context, WidgetRef ref) {
     final state = ref.watch(formDetailViewModelProvider);
+    final viewModel = ref.read(formDetailViewModelProvider.notifier);
 
     return SizedBox(
       width: double.infinity,
@@ -37,9 +38,17 @@ class DetailProcessingFragment extends HookConsumerWidget {
                 children: [
                   //状态
                   MyTextView(
-                    S.current.processing,
+                    state.forDetail?.order?.refundStatus != 0
+                        ? S.current.refunded //已退款
+                        : state.forDetail?.order?.paymentStatus != 1
+                            ? S.current.unpaid //未支付
+                            : S.current.processing,
                     marginTop: 17,
-                    textColor: context.appColors.textPrimary,
+                    textColor: state.forDetail?.order?.refundStatus != 0
+                        ? context.appColors.textDisEnableGray //已退款
+                        : state.forDetail?.order?.paymentStatus != 1
+                            ? context.appColors.deleteRed //未支付
+                            : context.appColors.textPrimary,
                     fontSize: 24,
                     isFontMedium: true,
                   ),
@@ -51,6 +60,18 @@ class DetailProcessingFragment extends HookConsumerWidget {
                     isFontRegular: true,
                   ),
 
+                  //退款的金额和待支付的金额展示
+                  Visibility(
+                    visible: state.forDetail?.order?.refundStatus != 0 || state.forDetail?.order?.paymentStatus != 1,
+                    child: MyTextView(
+                      "\$${state.forDetail?.order?.totalAmount ?? "-"}",
+                      marginTop: 15,
+                      textColor: context.appColors.textPrimary,
+                      fontSize: 24,
+                      isFontMedium: true,
+                    ),
+                  ),
+
                   //Send On时间
                   RichText(
                     text: TextSpan(
@@ -68,25 +89,31 @@ class DetailProcessingFragment extends HookConsumerWidget {
                   ).marginOnly(top: 12, bottom: 28),
 
                   //图片
-                  const MyAssetImage(
-                    Assets.formDetailProcessingImg,
-                    width: 40,
-                    height: 51.5,
-                  ),
+                  Visibility(
+                      visible: state.forDetail?.order?.refundStatus == 0 && state.forDetail?.order?.paymentStatus == 1,
+                      child: const MyAssetImage(
+                        Assets.formDetailProcessingImg,
+                        width: 40,
+                        height: 51.5,
+                      )),
 
                   //提示文本
-                  MyTextView(
-                    S.current.processing_in_progress,
-                    marginTop: 15,
-                    marginBottom: 34,
-                    marginLeft: 50,
-                    marginRight: 50,
-                    textAlign: TextAlign.center,
-                    textColor: context.appColors.textBlack,
-                    fontSize: 15,
-                    isFontRegular: true,
+                  Visibility(
+                    visible: state.forDetail?.order?.refundStatus == 0 && state.forDetail?.order?.paymentStatus == 1,
+                    child: MyTextView(
+                      S.current.processing_in_progress,
+                      marginTop: 15,
+                      marginBottom: 34,
+                      marginLeft: 50,
+                      marginRight: 50,
+                      textAlign: TextAlign.center,
+                      textColor: context.appColors.textBlack,
+                      fontSize: 15,
+                      isFontRegular: true,
+                    ),
                   ),
 
+                  //分割线
                   Container(
                     color: context.appColors.backgroundDark,
                     height: 10,
@@ -120,6 +147,7 @@ class DetailProcessingFragment extends HookConsumerWidget {
               ),
             ),
           ).expanded(),
+
           Row(
             children: [
               MyButton(
@@ -153,15 +181,22 @@ class DetailProcessingFragment extends HookConsumerWidget {
               ).expanded(),
             ],
           ).marginOnly(left: 15, right: 15),
-          MyButton(
-            onPressed: () {},
-            text: S.current.remove,
-            textColor: Colors.white,
-            fontSize: 15,
-            fontWeight: FontWeight.w400,
-            radius: 7,
-            backgroundColor: context.appColors.orangeBG,
-          ).marginOnly(top: 6, left: 15, right: 15, bottom: 17.5),
+
+          Visibility(
+            visible: state.forDetail?.order?.refundStatus != 0 || state.forDetail?.order?.paymentStatus != 1,
+            child: MyButton(
+              onPressed: () {
+                viewModel.doPaymentOrder(state.forDetail?.order?.id??"");
+              },
+              text: S.current.payment,
+              textColor: Colors.white,
+              fontSize: 15,
+              fontWeight: FontWeight.w400,
+              radius: 7,
+              backgroundColor: context.appColors.orangeBG,
+            ).marginOnly(top: 6, left: 15, right: 15),
+          ),
+          const SizedBox(height: 17.5),
         ],
       ),
     );

+ 20 - 0
packages/cpt_form/lib/modules/detail/form_detail_view_model.dart

@@ -1,6 +1,9 @@
 import 'package:domain/repository/form_repository.dart';
+import 'package:plugin_platform/engine/loading/loading_engine.dart';
 import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:router/componentRouter/component_service_manager.dart';
+import 'package:router/ext/auto_router_extensions.dart';
 import 'package:widgets/load_state_layout.dart';
 
 import 'form_detail_state.dart';
@@ -41,4 +44,21 @@ class FormDetailViewModel extends _$FormDetailViewModel with DioCancelableMixin
       state = state.copyWith(loadingState: LoadState.State_Error, errorMessage: result.errorMsg);
     }
   }
+
+  //根据OrderId继续支付订单
+  void doPaymentOrder(String orderId) async {
+    //支付流程 Loading 开始
+    LoadingEngine.show();
+
+    //调用支付服务
+    bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
+
+    //支付流程 Loading 结束
+    LoadingEngine.dismiss();
+
+    //如果成功,返回页面
+    if (success) {
+      appRouter.maybePop();
+    }
+  }
 }

+ 21 - 8
packages/cpt_form/lib/modules/form/approve/item_form_approve.dart

@@ -63,16 +63,29 @@ class FormApproveItem extends StatelessWidget {
                 ],
               ).marginOnly(left: 11, right: 11).expanded(),
 
-              //查看按钮
               MyTextView(
-                S.current.view,
-                textColor: Colors.white,
-                backgroundColor: context.appColors.btnBgDefault,
-                cornerRadius: 7,
-                paddingTop: 9,
-                paddingBottom: 9,
+                item.order?.refundStatus != 0
+                    ? S.current.refunded
+                    : item.order?.paymentStatus == 1
+                    ? S.current.paid
+                    : S.current.unpaid,
+                textColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                    ? context.appColors.textPrimary
+                    : context.appColors.deleteRed,
+                cornerRadius: 3,
+                borderWidth: 0.5,
+                borderColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                    ? context.appColors.textPrimary
+                    : context.appColors.deleteRed,
+                paddingTop: 3,
+                paddingBottom: 3,
+                paddingLeft: 15,
+                paddingRight: 15,
                 textAlign: TextAlign.center,
-                boxWidth: 60,
               ),
             ],
           ),

+ 21 - 8
packages/cpt_form/lib/modules/form/not_approve/item_form_not_approve.dart

@@ -64,16 +64,29 @@ class FormNotApproveItem extends StatelessWidget {
                 ],
               ).marginOnly(left: 11, right: 11).expanded(),
 
-              //查看按钮
               MyTextView(
-                S.current.view,
-                textColor: Colors.white,
-                backgroundColor: context.appColors.btnBgDefault,
-                cornerRadius: 7,
-                paddingTop: 9,
-                paddingBottom: 9,
+                item.order?.refundStatus != 0
+                    ? S.current.refunded
+                    : item.order?.paymentStatus == 1
+                    ? S.current.paid
+                    : S.current.unpaid,
+                textColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                    ? context.appColors.textPrimary
+                    : context.appColors.deleteRed,
+                cornerRadius: 3,
+                borderWidth: 0.5,
+                borderColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                    ? context.appColors.textPrimary
+                    : context.appColors.deleteRed,
+                paddingTop: 3,
+                paddingBottom: 3,
+                paddingLeft: 15,
+                paddingRight: 15,
                 textAlign: TextAlign.center,
-                boxWidth: 60,
               ),
             ],
           ),

+ 23 - 2
packages/cpt_form/lib/modules/form/submit/form_submit_view_model.dart

@@ -1,11 +1,12 @@
 import 'package:domain/entity/form_submitted_entity.dart';
 import 'package:domain/repository/form_repository.dart';
+import 'package:plugin_basic/constants/app_constant.dart';
 import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
-
+import 'package:shared/utils/event_bus.dart';
 import 'form_submit_state.dart';
 
 part 'form_submit_view_model.g.dart';
@@ -26,7 +27,12 @@ class FormSubmitViewModel extends _$FormSubmitViewModel with DioCancelableMixin{
   FormSubmitState build() {
     _formRepository = ref.read(formRepositoryProvider);
     final state = FormSubmitState(datas: []);
-    registerCancellation();
+
+    registerEventBus();
+    registerCancellation(callback: () {
+      unregisterEventBus();
+    });
+
     return state;
   }
 
@@ -105,4 +111,19 @@ class FormSubmitViewModel extends _$FormSubmitViewModel with DioCancelableMixin{
       }
     }
   }
+
+  // EventBus 的事件接收
+  Subscription? subscribe;
+
+  void registerEventBus() {
+    subscribe = bus.on(AppConstant.eventStripePaymentSuccess, (arg) {
+      //用户支付成功的通知
+      refreshController.callRefresh();
+    });
+  }
+
+  void unregisterEventBus() {
+    bus.off(AppConstant.eventStripePaymentSuccess, subscribe);
+  }
+
 }

+ 21 - 8
packages/cpt_form/lib/modules/form/submit/item_form_submit.dart

@@ -63,16 +63,29 @@ class FormSubmitItem extends StatelessWidget {
                 ],
               ).marginOnly(left: 11, right: 11).expanded(),
 
-              //查看按钮
               MyTextView(
-                S.current.view,
-                textColor: Colors.white,
-                backgroundColor: context.appColors.btnBgDefault,
-                cornerRadius: 7,
-                paddingTop: 9,
-                paddingBottom: 9,
+                item.order?.refundStatus != 0
+                    ? S.current.refunded
+                    : item.order?.paymentStatus == 1
+                        ? S.current.paid
+                        : S.current.unpaid,
+                textColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                        ? context.appColors.textPrimary
+                        : context.appColors.deleteRed,
+                cornerRadius: 3,
+                borderWidth: 0.5,
+                borderColor: item.order?.refundStatus != 0
+                    ? context.appColors.textDisEnableGray
+                    : item.order?.paymentStatus == 1
+                        ? context.appColors.textPrimary
+                        : context.appColors.deleteRed,
+                paddingTop: 3,
+                paddingBottom: 3,
+                paddingLeft: 15,
+                paddingRight: 15,
                 textAlign: TextAlign.center,
-                boxWidth: 60,
               ),
             ],
           ),

+ 28 - 4
packages/cpt_notice_board/lib/modules/documents/page/documents_page.dart

@@ -5,15 +5,16 @@ 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:plugin_basic/basic_export.dart';
 import 'package:plugin_basic/modules/global_web_page.dart';
+import 'package:plugin_platform/engine/image/image_preview.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.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:shared/utils/file_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';
 
 import '../../../router/page/notice_board_page_router.dart';
 import '../../documents_list/page/documents_list_page.dart';
@@ -121,13 +122,36 @@ class DocumentsPage extends HookConsumerWidget {
         // 去详情
         if (url != '') {
           // _vm.launchURL(url);
-          GlobalWebPage.startInstance(context: context, title: item['name'], url: url);
+          _previewFile(context, item['name'], url);
         }
         // DocumentsListPage.startInstance(context: context);
       }),
     ).marginOnly(left: 15, bottom: 15, right: 15);
   }
 
+  //预览Url
+  void _previewFile(BuildContext context, String title, String url) async {
+    final fileType = FileUtils.getFileType(url);
+
+    switch (fileType) {
+      case FileType.image:
+        ImagePreviewEngine.singleImagePreview(context, url);
+        break;
+      case FileType.document:
+        GlobalWebPage.startInstance(context: context, title: title, url: "https://docs.google.com/gview?embedded=true&url=$url");
+        break;
+      case FileType.unknown:
+      default:
+        // 处理未知类型,比如直接打开链接
+        if (await canLaunchUrl(Uri.parse(url))) {
+          await launchUrl(Uri.parse(url));
+        } else {
+          ToastEngine.show("Could not launch $url");
+        }
+        break;
+    }
+  }
+
   // list
   Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
     final state = ref.watch(documentsVmProvider);

+ 46 - 20
packages/cpt_notice_board/lib/modules/documents_list/page/documents_list_page.dart

@@ -5,8 +5,12 @@ 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:plugin_basic/basic_export.dart';
 import 'package:plugin_basic/modules/global_web_page.dart';
+import 'package:plugin_platform/engine/image/image_preview.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/file_utils.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:shared/utils/color_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
@@ -22,8 +26,8 @@ import '../vm/documents_list_vm.dart';
 @RoutePage()
 class DocumentsListPage extends HookConsumerWidget {
   final int? id;
-  const DocumentsListPage({Key? key, @PathParam('id') required this.id})
-      : super(key: key);
+
+  const DocumentsListPage({Key? key, @PathParam('id') required this.id}) : super(key: key);
 
   //启动当前页面
   static void startInstance({
@@ -44,29 +48,27 @@ class DocumentsListPage extends HookConsumerWidget {
         item['name'],
         maxLines: 2, // 设置最大行数为2
         overflow: TextOverflow.ellipsis, // 超出部分用省略号表示
-        style:  TextStyle(
-            fontSize: 16.0,
-            color: context.appColors.textBlack,
-            fontWeight: FontWeight.w700), // 设置字体大小
+        style: TextStyle(fontSize: 16.0, color: context.appColors.textBlack, fontWeight: FontWeight.w700), // 设置字体大小
       ),
     ).marginOnly(right: 17.5);
   }
 
-  Widget _buildItemRightSection(
-      BuildContext context, WidgetRef ref, item, _vm) {
+  Widget _buildItemRightSection(BuildContext context, WidgetRef ref, item, _vm) {
     return Container(
       color: Colors.white,
       child: TextButton(
         onPressed: () {},
         style: TextButton.styleFrom(
           foregroundColor: context.appColors.textBlack,
-          backgroundColor: context.appColors.tabBgSelectedPrimary, // 背景颜色
-          minimumSize: const Size(91.5, 30), // 最小宽度和高度
-          padding:
-              const EdgeInsets.symmetric(horizontal: 11.0, vertical: 9), // 内边距
+          backgroundColor: context.appColors.tabBgSelectedPrimary,
+          // 背景颜色
+          minimumSize: const Size(91.5, 30),
+          // 最小宽度和高度
+          padding: const EdgeInsets.symmetric(horizontal: 11.0, vertical: 9),
+          // 内边距
           shape: RoundedRectangleBorder(
             borderRadius: BorderRadius.circular(5), // 圆角
-            side: BorderSide(
+            side: const BorderSide(
               color: AppColorsTheme.colorPrimary,
               width: 1.0,
             ), // 边框
@@ -74,7 +76,7 @@ class DocumentsListPage extends HookConsumerWidget {
         ),
         child: Text(
           S.current.open_folder,
-          style:  TextStyle(
+          style: TextStyle(
             color: context.appColors.textWhite,
           ),
         ),
@@ -82,15 +84,17 @@ class DocumentsListPage extends HookConsumerWidget {
     );
   }
 
-  // listitem
+  // list item
   Widget _buildSaleItem(BuildContext context, WidgetRef ref, item, _vm) {
     String url = item['url'];
     return Container(
-      decoration:  BoxDecoration(
+      decoration: BoxDecoration(
         color: context.appColors.whiteBG,
         borderRadius: const BorderRadius.all(Radius.circular(6.0)),
         boxShadow: [
-          BoxShadow( color: context.appColors.itemBGShadow,)
+          BoxShadow(
+            color: context.appColors.itemBGShadow,
+          )
         ],
       ),
       child: Row(
@@ -120,12 +124,34 @@ class DocumentsListPage extends HookConsumerWidget {
       ).onTap(() {
         // 去详情
         // _vm.launchURL(url);
-        GlobalWebPage.startInstance(
-            context: context, title: item['name'], url: url);
+        _previewFile(context, item['name'], url);
       }),
     ).marginOnly(left: 15, bottom: 15, right: 15);
   }
 
+  //预览Url
+  void _previewFile(BuildContext context, String title, String url) async {
+    final fileType = FileUtils.getFileType(url);
+
+    switch (fileType) {
+      case FileType.image:
+        ImagePreviewEngine.singleImagePreview(context, url);
+        break;
+      case FileType.document:
+        GlobalWebPage.startInstance(context: context, title: title, url: "https://docs.google.com/gview?embedded=true&url=$url");
+        break;
+      case FileType.unknown:
+      default:
+        // 处理未知类型,比如直接打开链接
+        if (await canLaunchUrl(Uri.parse(url))) {
+          await launchUrl(Uri.parse(url));
+        } else {
+          ToastEngine.show("Could not launch $url");
+        }
+        break;
+    }
+  }
+
   // list
   Widget _buildSaleList(BuildContext context, WidgetRef ref, _vm) {
     final state = ref.watch(documentsListVmProvider);
@@ -144,7 +170,7 @@ class DocumentsListPage extends HookConsumerWidget {
       Future.microtask(() => vm.initPageData(id: id));
       return () {
         // 组件卸载时执行
-        Log.d("property_news_page 组件卸载时执行");
+        Log.d("DocumentsListPage 组件卸载时执行");
       };
     }, []);
     return Scaffold(

+ 13 - 13
packages/cpt_payment/lib/modules/payment/payment_page.dart

@@ -43,7 +43,7 @@ class PaymentPage extends HookConsumerWidget {
           InfoPageRoute(),
           PaymentListPageRoute(),
           HistoryListPageRoute(),
-          ManagePageRoute(),
+          // ManagePageRoute(),
         ],
         builder: (context, child, pageController) {
           final tabsRouter = AutoTabsRouter.of(context);
@@ -92,18 +92,18 @@ class PaymentPage extends HookConsumerWidget {
                         tabsRouter.setActiveIndex(2);
                       },
                     ),
-                    _buildTopCategory(
-                      context,
-                      Assets.paymentManageIcon,
-                      42.0,
-                      32.0,
-                      S.current.manage,
-                      tabsRouter.activeIndex == 3,
-                    ).onTap(
-                      () {
-                        tabsRouter.setActiveIndex(3);
-                      },
-                    ),
+                    // _buildTopCategory(
+                    //   context,
+                    //   Assets.paymentManageIcon,
+                    //   42.0,
+                    //   32.0,
+                    //   S.current.manage,
+                    //   tabsRouter.activeIndex == 3,
+                    // ).onTap(
+                    //   () {
+                    //     tabsRouter.setActiveIndex(3);
+                    //   },
+                    // ),
                   ],
                 ),
               ),

+ 4 - 0
packages/cpt_payment/lib/provider/stripe_service.dart

@@ -1,5 +1,6 @@
 import 'package:domain/repository/payment_repository.dart';
 import 'package:flutter/material.dart';
+import 'package:plugin_basic/constants/app_constant.dart';
 import 'package:plugin_platform/engine/notify/notify_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/platform_export.dart';
@@ -7,6 +8,7 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:shared/utils/util.dart';
+import 'package:shared/utils/event_bus.dart';
 
 part 'stripe_service.g.dart';
 
@@ -98,6 +100,8 @@ class StripeService {
     switch (paymentIntent.status) {
       case PaymentIntentsStatus.Succeeded:
         NotifyEngine.showSuccess('支付成功');
+        //发送 EventBus 事件
+        bus.emit(AppConstant.eventStripePaymentSuccess, true);
         return true;
       case PaymentIntentsStatus.RequiresPaymentMethod:
         NotifyEngine.showFailure('支付方式无效');

+ 1 - 2
packages/cpt_payment/lib/router/component/payment_component_service.dart

@@ -2,7 +2,6 @@
  * Community 组件的组件路由
  */
 import 'package:cpt_payment/modules/add_card/add_card_page.dart';
-import 'package:cpt_payment/modules/choose_card/choose_card_page.dart';
 import 'package:cpt_payment/provider/stripe_service.dart';
 import 'package:plugin_basic/provider/global_provider_container.dart';
 import 'package:router/componentRouter/payment_service.dart';
@@ -31,7 +30,7 @@ class PaymentComponentService extends PaymentService {
 
   @override
   void startChooseCardPage() {
-    ChooseCardPage.startInstance();
+
   }
 
   @override

+ 22 - 29
packages/cs_domain/lib/entity/facility_page_entity.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/id_name_entity.dart';
 import 'package:domain/generated/json/base/json_field.dart';
 import 'package:domain/generated/json/facility_page_entity.g.dart';
 import 'dart:convert';
@@ -33,7 +34,8 @@ class FacilityDetail {
 	FacilityPageListFacility? facility;
 	@JSONField(name: "time_period")
 	FacilityPageListTimePeriod? timePeriod;
-	FacilityPageListAccount? account;
+	IdNameEntity? account;
+	FacilityOrder? order;
 
 	FacilityDetail();
 
@@ -53,8 +55,7 @@ class FacilityPageListBooking {
 	String? date;
 	String? start;
 	String? end;
-	@JSONField(name: "deposit_paid")
-	String? depositPaid;
+	String? deposit;
 	@JSONField(name: "deposit_refund")
 	String? depositRefund;
 	@JSONField(name: "deposit_refund_at")
@@ -76,7 +77,7 @@ class FacilityPageListBooking {
 class FacilityPageListFacility {
 	String? id;
 	String? name;
-	FacilityPageListFacilityType? type;
+	IdNameEntity? type;
 
 	FacilityPageListFacility();
 
@@ -91,23 +92,6 @@ class FacilityPageListFacility {
 }
 
 @JsonSerializable()
-class FacilityPageListFacilityType {
-	String? id;
-	String? name;
-
-	FacilityPageListFacilityType();
-
-	factory FacilityPageListFacilityType.fromJson(Map<String, dynamic> json) => $FacilityPageListFacilityTypeFromJson(json);
-
-	Map<String, dynamic> toJson() => $FacilityPageListFacilityTypeToJson(this);
-
-	@override
-	String toString() {
-		return jsonEncode(this);
-	}
-}
-
-@JsonSerializable()
 class FacilityPageListTimePeriod {
 	String? price;
 	String? deposit;
@@ -125,15 +109,24 @@ class FacilityPageListTimePeriod {
 }
 
 @JsonSerializable()
-class FacilityPageListAccount {
+class FacilityOrder {
 	String? id;
-	String? name;
-
-	FacilityPageListAccount();
-
-	factory FacilityPageListAccount.fromJson(Map<String, dynamic> json) => $FacilityPageListAccountFromJson(json);
-
-	Map<String, dynamic> toJson() => $FacilityPageListAccountToJson(this);
+	@JSONField(name: "total_amount")
+	String? totalAmount;
+	@JSONField(name: "order_amount")
+	String? orderAmount;
+	@JSONField(name: "deposit_amount")
+	String? depositAmount;
+	@JSONField(name: "payment_status")
+	int paymentStatus = 0;  //0=未支付,1=已支付,2=支付失败
+	@JSONField(name: "refund_status")
+	int refundStatus = 0;   //0=末退歌,1=部分退歌,2=己退款
+
+	FacilityOrder();
+
+	factory FacilityOrder.fromJson(Map<String, dynamic> json) => $FacilityOrderFromJson(json);
+
+	Map<String, dynamic> toJson() => $FacilityOrderToJson(this);
 
 	@override
 	String toString() {

+ 27 - 0
packages/cs_domain/lib/entity/form_detail_entity.dart

@@ -17,6 +17,7 @@ class FormDetailEntity {
 	String? rejectedOn;
 	@JSONField(name: "approved_on")
 	String? approvedOn;
+	FormOrder? order;
 
 	FormDetailEntity();
 
@@ -29,3 +30,29 @@ class FormDetailEntity {
 		return jsonEncode(this);
 	}
 }
+
+@JsonSerializable()
+class FormOrder {
+	String? id;
+	@JSONField(name: "total_amount")
+	String? totalAmount;
+	@JSONField(name: "order_amount")
+	String? orderAmount;
+	@JSONField(name: "deposit_amount")
+	String? depositAmount;
+	@JSONField(name: "payment_status")
+	int paymentStatus = 0;  //0=未支付,1=已支付,2=支付失败
+	@JSONField(name: "refund_status")
+	int refundStatus = 0;   //0=末退歌,1=部分退歌,2=己退款
+
+	FormOrder();
+
+	factory FormOrder.fromJson(Map<String, dynamic> json) => $FormOrderFromJson(json);
+
+	Map<String, dynamic> toJson() => $FormOrderToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 28 - 2
packages/cs_domain/lib/entity/form_submitted_entity.dart

@@ -1,4 +1,3 @@
-import 'package:domain/entity/form_content_entity.dart';
 import 'package:domain/entity/id_name_entity.dart';
 import 'package:domain/generated/json/base/json_field.dart';
 import 'package:domain/generated/json/form_submitted_entity.g.dart';
@@ -12,7 +11,6 @@ class FormSubmittedEntity {
 	String? userId;
 	@JSONField(name: "estate_online_form_id")
 	String? estateOnlineFormId;
-	FormContentEntity? content;
 	@JSONField(name: "sent_on")
 	String? sentOn;
 	@JSONField(name: "rejected_on")
@@ -22,6 +20,7 @@ class FormSubmittedEntity {
 	@JSONField(name: "estate_online_form")
 	FormSubmittedEstateOnlineForm? estateOnlineForm;
 	IdNameEntity? account;
+	FormSubmittedOrder? order;
 
 	FormSubmittedEntity();
 
@@ -53,4 +52,31 @@ class FormSubmittedEstateOnlineForm {
 	String toString() {
 		return jsonEncode(this);
 	}
+}
+
+
+@JsonSerializable()
+class FormSubmittedOrder {
+	String? id;
+	@JSONField(name: "total_amount")
+	String? totalAmount;
+	@JSONField(name: "order_amount")
+	String? orderAmount;
+	@JSONField(name: "deposit_amount")
+	String? depositAmount;
+	@JSONField(name: "payment_status")
+	int paymentStatus = 0;  //0=未支付,1=已支付,2=支付失败
+	@JSONField(name: "refund_status")
+	int refundStatus = 0;   //0=末退歌,1=部分退歌,2=己退款
+
+	FormSubmittedOrder();
+
+	factory FormSubmittedOrder.fromJson(Map<String, dynamic> json) => $FormSubmittedOrderFromJson(json);
+
+	Map<String, dynamic> toJson() => $FormSubmittedOrderToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
 }

+ 11 - 7
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -236,14 +236,11 @@ class JsonConvert {
     if (<FacilityPageListFacility>[] is M) {
       return data.map<FacilityPageListFacility>((Map<String, dynamic> e) => FacilityPageListFacility.fromJson(e)).toList() as M;
     }
-    if (<FacilityPageListFacilityType>[] is M) {
-      return data.map<FacilityPageListFacilityType>((Map<String, dynamic> e) => FacilityPageListFacilityType.fromJson(e)).toList() as M;
-    }
     if (<FacilityPageListTimePeriod>[] is M) {
       return data.map<FacilityPageListTimePeriod>((Map<String, dynamic> e) => FacilityPageListTimePeriod.fromJson(e)).toList() as M;
     }
-    if (<FacilityPageListAccount>[] is M) {
-      return data.map<FacilityPageListAccount>((Map<String, dynamic> e) => FacilityPageListAccount.fromJson(e)).toList() as M;
+    if (<FacilityOrder>[] is M) {
+      return data.map<FacilityOrder>((Map<String, dynamic> e) => FacilityOrder.fromJson(e)).toList() as M;
     }
     if (<FeedbackDetailEntity>[] is M) {
       return data.map<FeedbackDetailEntity>((Map<String, dynamic> e) => FeedbackDetailEntity.fromJson(e)).toList() as M;
@@ -263,6 +260,9 @@ class JsonConvert {
     if (<FormDetailEntity>[] is M) {
       return data.map<FormDetailEntity>((Map<String, dynamic> e) => FormDetailEntity.fromJson(e)).toList() as M;
     }
+    if (<FormOrder>[] is M) {
+      return data.map<FormOrder>((Map<String, dynamic> e) => FormOrder.fromJson(e)).toList() as M;
+    }
     if (<FormListEntity>[] is M) {
       return data.map<FormListEntity>((Map<String, dynamic> e) => FormListEntity.fromJson(e)).toList() as M;
     }
@@ -281,6 +281,9 @@ class JsonConvert {
     if (<FormSubmittedEstateOnlineForm>[] is M) {
       return data.map<FormSubmittedEstateOnlineForm>((Map<String, dynamic> e) => FormSubmittedEstateOnlineForm.fromJson(e)).toList() as M;
     }
+    if (<FormSubmittedOrder>[] is M) {
+      return data.map<FormSubmittedOrder>((Map<String, dynamic> e) => FormSubmittedOrder.fromJson(e)).toList() as M;
+    }
     if (<FormSubmittedPageEntity>[] is M) {
       return data.map<FormSubmittedPageEntity>((Map<String, dynamic> e) => FormSubmittedPageEntity.fromJson(e)).toList() as M;
     }
@@ -729,21 +732,22 @@ class JsonConvertClassCollection {
     (FacilityDetail).toString(): FacilityDetail.fromJson,
     (FacilityPageListBooking).toString(): FacilityPageListBooking.fromJson,
     (FacilityPageListFacility).toString(): FacilityPageListFacility.fromJson,
-    (FacilityPageListFacilityType).toString(): FacilityPageListFacilityType.fromJson,
     (FacilityPageListTimePeriod).toString(): FacilityPageListTimePeriod.fromJson,
-    (FacilityPageListAccount).toString(): FacilityPageListAccount.fromJson,
+    (FacilityOrder).toString(): FacilityOrder.fromJson,
     (FeedbackDetailEntity).toString(): FeedbackDetailEntity.fromJson,
     (FeedbackDetailReplies).toString(): FeedbackDetailReplies.fromJson,
     (FeedbackListEntity).toString(): FeedbackListEntity.fromJson,
     (FeedbackItemEntity).toString(): FeedbackItemEntity.fromJson,
     (FormContentEntity).toString(): FormContentEntity.fromJson,
     (FormDetailEntity).toString(): FormDetailEntity.fromJson,
+    (FormOrder).toString(): FormOrder.fromJson,
     (FormListEntity).toString(): FormListEntity.fromJson,
     (FormOptionEntity).toString(): FormOptionEntity.fromJson,
     (FormOrderEntity).toString(): FormOrderEntity.fromJson,
     (FormOrderOrder).toString(): FormOrderOrder.fromJson,
     (FormSubmittedEntity).toString(): FormSubmittedEntity.fromJson,
     (FormSubmittedEstateOnlineForm).toString(): FormSubmittedEstateOnlineForm.fromJson,
+    (FormSubmittedOrder).toString(): FormSubmittedOrder.fromJson,
     (FormSubmittedPageEntity).toString(): FormSubmittedPageEntity.fromJson,
     (GarageSaleHistoryEntity).toString(): GarageSaleHistoryEntity.fromJson,
     (GarageSaleHistoryList).toString(): GarageSaleHistoryList.fromJson,

+ 62 - 56
packages/cs_domain/lib/generated/json/facility_page_entity.g.dart

@@ -1,5 +1,7 @@
 import 'package:domain/generated/json/base/json_convert_content.dart';
 import 'package:domain/entity/facility_page_entity.dart';
+import 'package:domain/entity/id_name_entity.dart';
+
 
 FacilityPageEntity $FacilityPageEntityFromJson(Map<String, dynamic> json) {
   final FacilityPageEntity facilityPageEntity = FacilityPageEntity();
@@ -75,10 +77,14 @@ FacilityDetail $FacilityDetailFromJson(Map<String, dynamic> json) {
   if (timePeriod != null) {
     facilityDetail.timePeriod = timePeriod;
   }
-  final FacilityPageListAccount? account = jsonConvert.convert<FacilityPageListAccount>(json['account']);
+  final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(json['account']);
   if (account != null) {
     facilityDetail.account = account;
   }
+  final FacilityOrder? order = jsonConvert.convert<FacilityOrder>(json['order']);
+  if (order != null) {
+    facilityDetail.order = order;
+  }
   return facilityDetail;
 }
 
@@ -88,6 +94,7 @@ Map<String, dynamic> $FacilityDetailToJson(FacilityDetail entity) {
   data['facility'] = entity.facility?.toJson();
   data['time_period'] = entity.timePeriod?.toJson();
   data['account'] = entity.account?.toJson();
+  data['order'] = entity.order?.toJson();
   return data;
 }
 
@@ -96,13 +103,15 @@ extension FacilityDetailExtension on FacilityDetail {
     FacilityPageListBooking? booking,
     FacilityPageListFacility? facility,
     FacilityPageListTimePeriod? timePeriod,
-    FacilityPageListAccount? account,
+    IdNameEntity? account,
+    FacilityOrder? order,
   }) {
     return FacilityDetail()
       ..booking = booking ?? this.booking
       ..facility = facility ?? this.facility
       ..timePeriod = timePeriod ?? this.timePeriod
-      ..account = account ?? this.account;
+      ..account = account ?? this.account
+      ..order = order ?? this.order;
   }
 }
 
@@ -124,9 +133,9 @@ FacilityPageListBooking $FacilityPageListBookingFromJson(Map<String, dynamic> js
   if (end != null) {
     facilityPageListBooking.end = end;
   }
-  final String? depositPaid = jsonConvert.convert<String>(json['deposit_paid']);
-  if (depositPaid != null) {
-    facilityPageListBooking.depositPaid = depositPaid;
+  final String? deposit = jsonConvert.convert<String>(json['deposit']);
+  if (deposit != null) {
+    facilityPageListBooking.deposit = deposit;
   }
   final String? depositRefund = jsonConvert.convert<String>(json['deposit_refund']);
   if (depositRefund != null) {
@@ -145,7 +154,7 @@ Map<String, dynamic> $FacilityPageListBookingToJson(FacilityPageListBooking enti
   data['date'] = entity.date;
   data['start'] = entity.start;
   data['end'] = entity.end;
-  data['deposit_paid'] = entity.depositPaid;
+  data['deposit'] = entity.deposit;
   data['deposit_refund'] = entity.depositRefund;
   data['deposit_refund_at'] = entity.depositRefundAt;
   return data;
@@ -157,7 +166,7 @@ extension FacilityPageListBookingExtension on FacilityPageListBooking {
     String? date,
     String? start,
     String? end,
-    String? depositPaid,
+    String? deposit,
     String? depositRefund,
     String? depositRefundAt,
   }) {
@@ -166,7 +175,7 @@ extension FacilityPageListBookingExtension on FacilityPageListBooking {
       ..date = date ?? this.date
       ..start = start ?? this.start
       ..end = end ?? this.end
-      ..depositPaid = depositPaid ?? this.depositPaid
+      ..deposit = deposit ?? this.deposit
       ..depositRefund = depositRefund ?? this.depositRefund
       ..depositRefundAt = depositRefundAt ?? this.depositRefundAt;
   }
@@ -182,7 +191,7 @@ FacilityPageListFacility $FacilityPageListFacilityFromJson(Map<String, dynamic>
   if (name != null) {
     facilityPageListFacility.name = name;
   }
-  final FacilityPageListFacilityType? type = jsonConvert.convert<FacilityPageListFacilityType>(json['type']);
+  final IdNameEntity? type = jsonConvert.convert<IdNameEntity>(json['type']);
   if (type != null) {
     facilityPageListFacility.type = type;
   }
@@ -201,7 +210,7 @@ extension FacilityPageListFacilityExtension on FacilityPageListFacility {
   FacilityPageListFacility copyWith({
     String? id,
     String? name,
-    FacilityPageListFacilityType? type,
+    IdNameEntity? type,
   }) {
     return FacilityPageListFacility()
       ..id = id ?? this.id
@@ -210,37 +219,6 @@ extension FacilityPageListFacilityExtension on FacilityPageListFacility {
   }
 }
 
-FacilityPageListFacilityType $FacilityPageListFacilityTypeFromJson(Map<String, dynamic> json) {
-  final FacilityPageListFacilityType facilityPageListFacilityType = FacilityPageListFacilityType();
-  final String? id = jsonConvert.convert<String>(json['id']);
-  if (id != null) {
-    facilityPageListFacilityType.id = id;
-  }
-  final String? name = jsonConvert.convert<String>(json['name']);
-  if (name != null) {
-    facilityPageListFacilityType.name = name;
-  }
-  return facilityPageListFacilityType;
-}
-
-Map<String, dynamic> $FacilityPageListFacilityTypeToJson(FacilityPageListFacilityType entity) {
-  final Map<String, dynamic> data = <String, dynamic>{};
-  data['id'] = entity.id;
-  data['name'] = entity.name;
-  return data;
-}
-
-extension FacilityPageListFacilityTypeExtension on FacilityPageListFacilityType {
-  FacilityPageListFacilityType copyWith({
-    String? id,
-    String? name,
-  }) {
-    return FacilityPageListFacilityType()
-      ..id = id ?? this.id
-      ..name = name ?? this.name;
-  }
-}
-
 FacilityPageListTimePeriod $FacilityPageListTimePeriodFromJson(Map<String, dynamic> json) {
   final FacilityPageListTimePeriod facilityPageListTimePeriod = FacilityPageListTimePeriod();
   final String? price = jsonConvert.convert<String>(json['price']);
@@ -272,33 +250,61 @@ extension FacilityPageListTimePeriodExtension on FacilityPageListTimePeriod {
   }
 }
 
-FacilityPageListAccount $FacilityPageListAccountFromJson(Map<String, dynamic> json) {
-  final FacilityPageListAccount facilityPageListAccount = FacilityPageListAccount();
+FacilityOrder $FacilityOrderFromJson(Map<String, dynamic> json) {
+  final FacilityOrder facilityOrder = FacilityOrder();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
-    facilityPageListAccount.id = id;
+    facilityOrder.id = id;
   }
-  final String? name = jsonConvert.convert<String>(json['name']);
-  if (name != null) {
-    facilityPageListAccount.name = name;
+  final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
+  if (totalAmount != null) {
+    facilityOrder.totalAmount = totalAmount;
+  }
+  final String? orderAmount = jsonConvert.convert<String>(json['order_amount']);
+  if (orderAmount != null) {
+    facilityOrder.orderAmount = orderAmount;
+  }
+  final String? depositAmount = jsonConvert.convert<String>(json['deposit_amount']);
+  if (depositAmount != null) {
+    facilityOrder.depositAmount = depositAmount;
   }
-  return facilityPageListAccount;
+  final int? paymentStatus = jsonConvert.convert<int>(json['payment_status']);
+  if (paymentStatus != null) {
+    facilityOrder.paymentStatus = paymentStatus;
+  }
+  final int? refundStatus = jsonConvert.convert<int>(json['refund_status']);
+  if (refundStatus != null) {
+    facilityOrder.refundStatus = refundStatus;
+  }
+  return facilityOrder;
 }
 
-Map<String, dynamic> $FacilityPageListAccountToJson(FacilityPageListAccount entity) {
+Map<String, dynamic> $FacilityOrderToJson(FacilityOrder entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
-  data['name'] = entity.name;
+  data['total_amount'] = entity.totalAmount;
+  data['order_amount'] = entity.orderAmount;
+  data['deposit_amount'] = entity.depositAmount;
+  data['payment_status'] = entity.paymentStatus;
+  data['refund_status'] = entity.refundStatus;
   return data;
 }
 
-extension FacilityPageListAccountExtension on FacilityPageListAccount {
-  FacilityPageListAccount copyWith({
+extension FacilityOrderExtension on FacilityOrder {
+  FacilityOrder copyWith({
     String? id,
-    String? name,
+    String? totalAmount,
+    String? orderAmount,
+    String? depositAmount,
+    int? paymentStatus,
+    int? refundStatus,
   }) {
-    return FacilityPageListAccount()
+    return FacilityOrder()
       ..id = id ?? this.id
-      ..name = name ?? this.name;
+      ..totalAmount = totalAmount ?? this.totalAmount
+      ..orderAmount = orderAmount ?? this.orderAmount
+      ..depositAmount = depositAmount ?? this.depositAmount
+      ..paymentStatus = paymentStatus ?? this.paymentStatus
+      ..refundStatus = refundStatus ?? this.refundStatus;
   }
 }

+ 67 - 1
packages/cs_domain/lib/generated/json/form_detail_entity.g.dart

@@ -33,6 +33,10 @@ FormDetailEntity $FormDetailEntityFromJson(Map<String, dynamic> json) {
   if (approvedOn != null) {
     formDetailEntity.approvedOn = approvedOn;
   }
+  final FormOrder? order = jsonConvert.convert<FormOrder>(json['order']);
+  if (order != null) {
+    formDetailEntity.order = order;
+  }
   return formDetailEntity;
 }
 
@@ -45,6 +49,7 @@ Map<String, dynamic> $FormDetailEntityToJson(FormDetailEntity entity) {
   data['sent_on'] = entity.sentOn;
   data['rejected_on'] = entity.rejectedOn;
   data['approved_on'] = entity.approvedOn;
+  data['order'] = entity.order?.toJson();
   return data;
 }
 
@@ -57,6 +62,7 @@ extension FormDetailEntityExtension on FormDetailEntity {
     String? sentOn,
     String? rejectedOn,
     String? approvedOn,
+    FormOrder? order,
   }) {
     return FormDetailEntity()
       ..id = id ?? this.id
@@ -65,6 +71,66 @@ extension FormDetailEntityExtension on FormDetailEntity {
       ..status = status ?? this.status
       ..sentOn = sentOn ?? this.sentOn
       ..rejectedOn = rejectedOn ?? this.rejectedOn
-      ..approvedOn = approvedOn ?? this.approvedOn;
+      ..approvedOn = approvedOn ?? this.approvedOn
+      ..order = order ?? this.order;
+  }
+}
+
+FormOrder $FormOrderFromJson(Map<String, dynamic> json) {
+  final FormOrder formOrder = FormOrder();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    formOrder.id = id;
+  }
+  final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
+  if (totalAmount != null) {
+    formOrder.totalAmount = totalAmount;
+  }
+  final String? orderAmount = jsonConvert.convert<String>(json['order_amount']);
+  if (orderAmount != null) {
+    formOrder.orderAmount = orderAmount;
+  }
+  final String? depositAmount = jsonConvert.convert<String>(json['deposit_amount']);
+  if (depositAmount != null) {
+    formOrder.depositAmount = depositAmount;
+  }
+  final int? paymentStatus = jsonConvert.convert<int>(json['payment_status']);
+  if (paymentStatus != null) {
+    formOrder.paymentStatus = paymentStatus;
+  }
+  final int? refundStatus = jsonConvert.convert<int>(json['refund_status']);
+  if (refundStatus != null) {
+    formOrder.refundStatus = refundStatus;
+  }
+  return formOrder;
+}
+
+Map<String, dynamic> $FormOrderToJson(FormOrder entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['total_amount'] = entity.totalAmount;
+  data['order_amount'] = entity.orderAmount;
+  data['deposit_amount'] = entity.depositAmount;
+  data['payment_status'] = entity.paymentStatus;
+  data['refund_status'] = entity.refundStatus;
+  return data;
+}
+
+extension FormOrderExtension on FormOrder {
+  FormOrder copyWith({
+    String? id,
+    String? totalAmount,
+    String? orderAmount,
+    String? depositAmount,
+    int? paymentStatus,
+    int? refundStatus,
+  }) {
+    return FormOrder()
+      ..id = id ?? this.id
+      ..totalAmount = totalAmount ?? this.totalAmount
+      ..orderAmount = orderAmount ?? this.orderAmount
+      ..depositAmount = depositAmount ?? this.depositAmount
+      ..paymentStatus = paymentStatus ?? this.paymentStatus
+      ..refundStatus = refundStatus ?? this.refundStatus;
   }
 }

+ 67 - 10
packages/cs_domain/lib/generated/json/form_submitted_entity.g.dart

@@ -1,7 +1,5 @@
 import 'package:domain/generated/json/base/json_convert_content.dart';
 import 'package:domain/entity/form_submitted_entity.dart';
-import 'package:domain/entity/form_content_entity.dart';
-
 import 'package:domain/entity/id_name_entity.dart';
 
 
@@ -19,10 +17,6 @@ FormSubmittedEntity $FormSubmittedEntityFromJson(Map<String, dynamic> json) {
   if (estateOnlineFormId != null) {
     formSubmittedEntity.estateOnlineFormId = estateOnlineFormId;
   }
-  final FormContentEntity? content = jsonConvert.convert<FormContentEntity>(json['content']);
-  if (content != null) {
-    formSubmittedEntity.content = content;
-  }
   final String? sentOn = jsonConvert.convert<String>(json['sent_on']);
   if (sentOn != null) {
     formSubmittedEntity.sentOn = sentOn;
@@ -43,6 +37,10 @@ FormSubmittedEntity $FormSubmittedEntityFromJson(Map<String, dynamic> json) {
   if (account != null) {
     formSubmittedEntity.account = account;
   }
+  final FormSubmittedOrder? order = jsonConvert.convert<FormSubmittedOrder>(json['order']);
+  if (order != null) {
+    formSubmittedEntity.order = order;
+  }
   return formSubmittedEntity;
 }
 
@@ -51,12 +49,12 @@ Map<String, dynamic> $FormSubmittedEntityToJson(FormSubmittedEntity entity) {
   data['id'] = entity.id;
   data['user_id'] = entity.userId;
   data['estate_online_form_id'] = entity.estateOnlineFormId;
-  data['content'] = entity.content?.toJson();
   data['sent_on'] = entity.sentOn;
   data['rejected_on'] = entity.rejectedOn;
   data['approved_on'] = entity.approvedOn;
   data['estate_online_form'] = entity.estateOnlineForm?.toJson();
   data['account'] = entity.account?.toJson();
+  data['order'] = entity.order?.toJson();
   return data;
 }
 
@@ -65,23 +63,23 @@ extension FormSubmittedEntityExtension on FormSubmittedEntity {
     String? id,
     String? userId,
     String? estateOnlineFormId,
-    FormContentEntity? content,
     String? sentOn,
     String? rejectedOn,
     String? approvedOn,
     FormSubmittedEstateOnlineForm? estateOnlineForm,
     IdNameEntity? account,
+    FormSubmittedOrder? order,
   }) {
     return FormSubmittedEntity()
       ..id = id ?? this.id
       ..userId = userId ?? this.userId
       ..estateOnlineFormId = estateOnlineFormId ?? this.estateOnlineFormId
-      ..content = content ?? this.content
       ..sentOn = sentOn ?? this.sentOn
       ..rejectedOn = rejectedOn ?? this.rejectedOn
       ..approvedOn = approvedOn ?? this.approvedOn
       ..estateOnlineForm = estateOnlineForm ?? this.estateOnlineForm
-      ..account = account ?? this.account;
+      ..account = account ?? this.account
+      ..order = order ?? this.order;
   }
 }
 
@@ -128,4 +126,63 @@ extension FormSubmittedEstateOnlineFormExtension on FormSubmittedEstateOnlineFor
       ..name = name ?? this.name
       ..type = type ?? this.type;
   }
+}
+
+FormSubmittedOrder $FormSubmittedOrderFromJson(Map<String, dynamic> json) {
+  final FormSubmittedOrder formSubmittedOrder = FormSubmittedOrder();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    formSubmittedOrder.id = id;
+  }
+  final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
+  if (totalAmount != null) {
+    formSubmittedOrder.totalAmount = totalAmount;
+  }
+  final String? orderAmount = jsonConvert.convert<String>(json['order_amount']);
+  if (orderAmount != null) {
+    formSubmittedOrder.orderAmount = orderAmount;
+  }
+  final String? depositAmount = jsonConvert.convert<String>(json['deposit_amount']);
+  if (depositAmount != null) {
+    formSubmittedOrder.depositAmount = depositAmount;
+  }
+  final int? paymentStatus = jsonConvert.convert<int>(json['payment_status']);
+  if (paymentStatus != null) {
+    formSubmittedOrder.paymentStatus = paymentStatus;
+  }
+  final int? refundStatus = jsonConvert.convert<int>(json['refund_status']);
+  if (refundStatus != null) {
+    formSubmittedOrder.refundStatus = refundStatus;
+  }
+  return formSubmittedOrder;
+}
+
+Map<String, dynamic> $FormSubmittedOrderToJson(FormSubmittedOrder entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['total_amount'] = entity.totalAmount;
+  data['order_amount'] = entity.orderAmount;
+  data['deposit_amount'] = entity.depositAmount;
+  data['payment_status'] = entity.paymentStatus;
+  data['refund_status'] = entity.refundStatus;
+  return data;
+}
+
+extension FormSubmittedOrderExtension on FormSubmittedOrder {
+  FormSubmittedOrder copyWith({
+    String? id,
+    String? totalAmount,
+    String? orderAmount,
+    String? depositAmount,
+    int? paymentStatus,
+    int? refundStatus,
+  }) {
+    return FormSubmittedOrder()
+      ..id = id ?? this.id
+      ..totalAmount = totalAmount ?? this.totalAmount
+      ..orderAmount = orderAmount ?? this.orderAmount
+      ..depositAmount = depositAmount ?? this.depositAmount
+      ..paymentStatus = paymentStatus ?? this.paymentStatus
+      ..refundStatus = refundStatus ?? this.refundStatus;
+  }
 }

+ 0 - 1
packages/cs_domain/lib/repository/facility_repository.dart

@@ -112,7 +112,6 @@ class FacilityRepository {
       ApiConstants.apiFacilityBook,
       params: params,
       method: HttpMethod.POST,
-      isShowLoadingDialog: true,
       networkDebounce: true,
       cancelToken: cancelToken,
     );

+ 1 - 0
packages/cs_plugin_basic/lib/constants/app_constant.dart

@@ -25,5 +25,6 @@ class AppConstant {
   static const eventProfileRefresh = 'event_profile_refresh'; //通知用户信息需要刷新
   static const eventEstateRefresh = 'event_estate_refresh'; //通知用户的房产信息需要刷新
   static const eventServiceOrderRefresh = 'event_service_order_refresh'; //通知用户的服务订单
+  static const eventStripePaymentSuccess = 'event_stripe_payment_success'; //用户支付成功的同志
 
 }

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

@@ -455,6 +455,7 @@ class MessageLookup extends MessageLookupByLibrary {
             "The Management will verify your application accordingly"),
         "ownership_status":
             MessageLookupByLibrary.simpleMessage("OWNERSHIP STATUS"),
+        "paid": MessageLookupByLibrary.simpleMessage("Paid"),
         "paid_on": MessageLookupByLibrary.simpleMessage("paid on"),
         "parking_fee_payment":
             MessageLookupByLibrary.simpleMessage("Parking Fee Payment"),
@@ -539,6 +540,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "redemption_reservation_txt": MessageLookupByLibrary.simpleMessage(
             "Reservation not required.Present your YY Circle Voucher (it’s under “Me”tab)At the outlet."),
         "refinancing": MessageLookupByLibrary.simpleMessage("Refinancing"),
+        "refunded": MessageLookupByLibrary.simpleMessage("Refunded"),
         "registration_of_2_vehicle":
             MessageLookupByLibrary.simpleMessage("Registration of 2nd Vehicle"),
         "rejected": MessageLookupByLibrary.simpleMessage("Rejected"),
@@ -666,6 +668,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "type_of_application":
             MessageLookupByLibrary.simpleMessage("TYPE OF APPLICATION"),
         "unit_number": MessageLookupByLibrary.simpleMessage("Unit Number"),
+        "unpaid": MessageLookupByLibrary.simpleMessage("Unpaid"),
         "up_3_img": MessageLookupByLibrary.simpleMessage(
             "(Up to 3 images can be uploaded)"),
         "up_to_max_images": MessageLookupByLibrary.simpleMessage(

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

@@ -362,6 +362,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "owners_desc4": MessageLookupByLibrary.simpleMessage("我是拥有该单元的公司的股东"),
         "owners_desc5": MessageLookupByLibrary.simpleMessage("管理员将相应地验证您的申请"),
         "ownership_status": MessageLookupByLibrary.simpleMessage("所有权状态"),
+        "paid": MessageLookupByLibrary.simpleMessage("已支付"),
         "paid_on": MessageLookupByLibrary.simpleMessage("付款时间"),
         "parking_fee_payment": MessageLookupByLibrary.simpleMessage("停车费"),
         "password": MessageLookupByLibrary.simpleMessage("密码"),
@@ -424,6 +425,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "redemption_reservation_txt": MessageLookupByLibrary.simpleMessage(
             "无需预约。请在门店出示您的 YY Circle 优惠券(在“我”标签下)。"),
         "refinancing": MessageLookupByLibrary.simpleMessage("再融资"),
+        "refunded": MessageLookupByLibrary.simpleMessage("已退款"),
         "registration_of_2_vehicle":
             MessageLookupByLibrary.simpleMessage("第二辆车登记"),
         "rejected": MessageLookupByLibrary.simpleMessage("已拒绝"),
@@ -527,6 +529,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "type_here": MessageLookupByLibrary.simpleMessage("在此输入"),
         "type_of_application": MessageLookupByLibrary.simpleMessage("申请类型"),
         "unit_number": MessageLookupByLibrary.simpleMessage("单元"),
+        "unpaid": MessageLookupByLibrary.simpleMessage("待支付"),
         "up_3_img": MessageLookupByLibrary.simpleMessage("(最多可上传3张图片)"),
         "up_to_max_images":
             MessageLookupByLibrary.simpleMessage("(您最多可以上传10张图片)"),

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

@@ -354,6 +354,7 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("请提供过夜停车时间。"),
         "overseas_home_loan": MessageLookupByLibrary.simpleMessage("海外房贷"),
         "ownership_status": MessageLookupByLibrary.simpleMessage("所有权状态"),
+        "paid": MessageLookupByLibrary.simpleMessage("已支付"),
         "paid_on": MessageLookupByLibrary.simpleMessage("付款时间"),
         "parking_fee_payment": MessageLookupByLibrary.simpleMessage("停车费"),
         "password": MessageLookupByLibrary.simpleMessage("密码"),
@@ -416,6 +417,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "redemption_reservation_txt": MessageLookupByLibrary.simpleMessage(
             "无需预约。请在门店出示您的 YY Circle 优惠券(在“我”标签下)。"),
         "refinancing": MessageLookupByLibrary.simpleMessage("再融资"),
+        "refunded": MessageLookupByLibrary.simpleMessage("已退款"),
         "registration_of_2_vehicle":
             MessageLookupByLibrary.simpleMessage("第二辆车登记"),
         "rejected": MessageLookupByLibrary.simpleMessage("已拒绝"),
@@ -514,6 +516,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "type_here": MessageLookupByLibrary.simpleMessage("在此输入"),
         "type_of_application": MessageLookupByLibrary.simpleMessage("申请类型"),
         "unit_number": MessageLookupByLibrary.simpleMessage("单元"),
+        "unpaid": MessageLookupByLibrary.simpleMessage("待支付"),
         "up_3_img": MessageLookupByLibrary.simpleMessage("(最多可上传3张图片)"),
         "up_to_max_images":
             MessageLookupByLibrary.simpleMessage("(您最多可以上传10张图片)"),

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

@@ -4520,6 +4520,36 @@ class S {
     );
   }
 
+  /// `Paid`
+  String get paid {
+    return Intl.message(
+      'Paid',
+      name: 'paid',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Unpaid`
+  String get unpaid {
+    return Intl.message(
+      'Unpaid',
+      name: 'unpaid',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Refunded`
+  String get refunded {
+    return Intl.message(
+      'Refunded',
+      name: 'refunded',
+      desc: '',
+      args: [],
+    );
+  }
+
   /// `Other`
   String get other {
     return Intl.message(

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

@@ -447,5 +447,8 @@
   "congratulations": "Congratulations",
   "verification_code_cap": "VERIFICATION CODE",
   "show_verification_cap": "SHOW THE VERIFICATION CODE TO YOUR MERCHANT",
+  "paid": "Paid",
+  "unpaid": "Unpaid",
+  "refunded": "Refunded",
   "other": "Other"
 }

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

@@ -444,5 +444,8 @@
   "congratulations": "恭喜",
   "verification_code_cap": "验证码",
   "show_verification_cap": "向商家出示验证码",
+  "paid": "已支付",
+  "unpaid": "待支付",
+  "refunded": "已退款",
   "other": "其他"
 }

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

@@ -430,5 +430,8 @@
   "congratulations": "恭喜",
   "verification_code_cap": "验证码",
   "show_verification_cap": "向商家出示验证码",
+  "paid": "已支付",
+  "unpaid": "待支付",
+  "refunded": "已退款",
   "other": "其他"
 }

+ 6 - 0
packages/cs_resources/lib/theme/app_colors_theme.dart

@@ -38,6 +38,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
   static const _color05CC67= Color(0xFF05CC67);
   static const _colorB8BFD9= Color(0x4DB8BFD9);
   static const _color063148= Color(0XFF063148);
+  static const _color939393= Color(0XFF939393);
 
   //暗色主题的一些自定义颜色值
   static const _darkBlackBg = Color(0xFF0F0F0F);
@@ -61,6 +62,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
   final Color textBlack; //黑色文本
   final Color textWhite; // 白色文本
   final Color textDarkGray; //深灰色 666 文本
+  final Color textDisEnableGray; //深灰色 939393 文本
   final Color orangeBG; //按钮的橙色背景
   final Color tabBgSelectedPrimary; //Tab的选中主题色背景
   final Color tabBgUnSelectedPrimary; //Tab的未选中主题色背景
@@ -103,6 +105,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
     required this.textBlack,
     required this.textWhite,
     required this.textDarkGray,
+    required this.textDisEnableGray,
     required this.orangeBG,
     required this.tabBgSelectedPrimary,
     required this.tabBgUnSelectedPrimary,
@@ -173,6 +176,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
       textGreen: _color05CC67,
       imageDarkModelWhite: Colors.transparent,
       itemBGShadow: _colorB8BFD9,
+      textDisEnableGray: _color939393,
     );
   }
 
@@ -218,6 +222,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
       textGreen: Colors.white,
       imageDarkModelWhite: Colors.white,
       itemBGShadow: _darkBlackItemLight,
+      textDisEnableGray: Colors.white,
     );
   }
 
@@ -272,6 +277,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
       textGreen: Color.lerp(textGreen, other.textGreen, t)!,
       imageDarkModelWhite: Color.lerp(imageDarkModelWhite, other.imageDarkModelWhite, t)!,
       itemBGShadow: Color.lerp(itemBGShadow, other.itemBGShadow, t)!,
+      textDisEnableGray: Color.lerp(textDisEnableGray, other.textDisEnableGray, t)!,
     );
   }
 }

+ 60 - 0
packages/cs_shared/lib/utils/file_utils.dart

@@ -0,0 +1,60 @@
+class FileUtils {
+
+  // 支持的图片格式列表
+  static const imageExtensions = [
+    'jpg', 'jpeg', 'png', 'gif', 'webp',
+    'bmp', 'tiff', 'svg', 'heic', 'heif'
+  ];
+
+  // 支持的文档格式列表
+  static const documentExtensions = [
+    'pdf', 'doc', 'docx', 'xls', 'xlsx',
+    'ppt', 'pptx', 'txt', 'rtf', 'csv',
+    'odt', 'ods', 'odp'
+  ];
+
+
+  // 获取 URL 的文件扩展名(小写)
+  static String? _getFileExtension(String url) {
+    try {
+      // 处理带有查询参数的 URL
+      final uri = Uri.parse(url);
+      final pathSegments = uri.pathSegments;
+      if (pathSegments.isEmpty) return null;
+
+      final fileName = pathSegments.last;
+      final dotIndex = fileName.lastIndexOf('.');
+      if (dotIndex == -1) return null;
+
+      return fileName.substring(dotIndex + 1).toLowerCase();
+    } catch (e) {
+      return null;
+    }
+  }
+
+  // 判断是否是图片
+  static bool isImage(String url) {
+    final ext = _getFileExtension(url);
+    return ext != null && imageExtensions.contains(ext);
+  }
+
+  // 判断是否是文档
+  static bool isDocument(String url) {
+    final ext = _getFileExtension(url);
+    return ext != null && documentExtensions.contains(ext);
+  }
+
+  // 综合判断方法
+  static FileType getFileType(String url) {
+    final ext = _getFileExtension(url);
+    if (ext == null) return FileType.unknown;
+
+    if (imageExtensions.contains(ext)) return FileType.image;
+    if (documentExtensions.contains(ext)) return FileType.document;
+
+    return FileType.unknown;
+  }
+
+}
+
+enum FileType { image, document, unknown }

+ 3 - 0
packages/cs_widgets/lib/shatter/select_calendar/calendar_bottom_sheet.dart

@@ -2,6 +2,9 @@ import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';
 import 'full_calendar.dart';
 
+/*
+ *  自定义的日历选择 BottomSheet 弹框
+ */
 class CustomCalendarBottomSheet extends StatelessWidget {
   final DateTime firstDate;
   final DateTime? lastDate;

+ 4 - 9
packages/cs_widgets/lib/shatter/select_calendar/full_calendar.dart

@@ -8,7 +8,7 @@ import 'package:widgets/my_load_image.dart';
 
 import '../../utils/dark_theme_util.dart';
 
-//日历的具体展示
+//日历的具体控件展示
 class FullCalendar extends StatefulWidget {
   final DateTime startDate;
   final DateTime? endDate;
@@ -43,7 +43,6 @@ class FullCalendar extends StatefulWidget {
 
 class _FullCalendarState extends State<FullCalendar> {
   late DateTime endDate;
-
   late DateTime startDate;
   late int _initialPage;
 
@@ -55,7 +54,6 @@ class _FullCalendarState extends State<FullCalendar> {
   void initState() {
     setState(() {
       startDate = DateTime.parse("${widget.startDate.toString().split(" ").first} 00:00:00.000");
-
       endDate = DateTime.parse("${widget.endDate.toString().split(" ").first} 23:00:00.000");
 
       _events = widget.events;
@@ -149,7 +147,7 @@ class _FullCalendarState extends State<FullCalendar> {
               child: Row(
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 children: [
-                   MyAssetImage(
+                  MyAssetImage(
                     Assets.baseLibCalendarLeftIcon,
                     width: 44,
                     height: 44,
@@ -160,7 +158,7 @@ class _FullCalendarState extends State<FullCalendar> {
                       curve: Curves.ease,
                     );
                   }),
-                   MyAssetImage(
+                  MyAssetImage(
                     Assets.baseLibCalendarRightIcon,
                     width: 44,
                     height: 44,
@@ -303,9 +301,7 @@ class _FullCalendarState extends State<FullCalendar> {
         // 底部的每月的每一天
         Container(
           padding: const EdgeInsets.only(top: 10.0),
-          height: (fullDates.length > 28)
-              ? (fullDates.length > 35 ? 6.2 * width / 7 : 5.2 * width / 7)
-              : 4 * width / 7,
+          height: (fullDates.length > 28) ? (fullDates.length > 35 ? 6.2 * width / 7 : 5.2 * width / 7) : 4 * width / 7,
           width: MediaQuery.of(context).size.width - 2 * widget.padding!,
           child: GridView.builder(
             itemCount: fullDates.length,
@@ -337,5 +333,4 @@ class _FullCalendarState extends State<FullCalendar> {
       ],
     );
   }
-
 }

+ 8 - 0
packages/cs_widgets/lib/shatter/weekly_calendar/calendar_utils.dart

@@ -39,6 +39,14 @@ bool isPastDate(DateTime now, DateTime date) {
   return date.isBefore(todayMidnight);
 }
 
+//检查日期是否大于Max日期
+bool isAfterMaxDate(DateTime max, DateTime date) {
+  // 获取当前日期的凌晨时间
+  DateTime maxMidnight = DateTime(max.year, max.month, max.day);
+  // 判断给定日期是否大于指定日期的凌晨时间
+  return date.isAfter(maxMidnight);
+}
+
 // ===================================  获取一周的数据  ↓  ===================================
 
 List<DateTime> getWeekdays(DateTime date, int at) {

+ 4 - 5
packages/cs_widgets/lib/shatter/weekly_calendar/day_cell.dart

@@ -8,11 +8,13 @@ class DayCell extends StatelessWidget {
     super.key,
     required this.display,
     required this.selected,
+    required this.maxDate,
     required this.current,
   });
 
   final DateTime display;
   final DateTime selected;
+  final DateTime maxDate;
   final DateTime current;
 
   //显示的日期文本
@@ -27,8 +29,8 @@ class DayCell extends StatelessWidget {
       width: 40,
       height: 40,
       decoration: BoxDecoration(
-        color: isPastDate(current,display)
-            ? context.appColors.disEnableGray.withOpacity(0.6) // 小于今天的日期背景颜色,禁用
+        color: isPastDate(current, display) || isAfterMaxDate(maxDate, display)
+            ? context.appColors.disEnableGray.withOpacity(0.6) // 小于今天的日期背景颜色和大于Max日期变灰并禁用
             : _isSelected(display)
                 ? _isToday(display)
                     ? context.appColors.btnBgDefault // 今天的日期背景颜色
@@ -79,7 +81,4 @@ class DayCell extends StatelessWidget {
   bool _isToday(DateTime date) {
     return DateTimeUtils.formatDate(date, format: 'yyyyMMdd') == DateTimeUtils.formatDate(current, format: 'yyyyMMdd');
   }
-
-
-
 }

+ 6 - 2
packages/cs_widgets/lib/shatter/weekly_calendar/day_table_view.dart

@@ -9,12 +9,14 @@ class DayTableView extends StatelessWidget {
     required this.weekdays,
     required this.onSelect,
     required this.selectedDate,
+    required this.maxDate,
     required this.currentDate,
   });
 
   final List<DateTime> weekdays;
   final Function(DateTime)? onSelect;
   final DateTime selectedDate;
+  final DateTime maxDate;
   final DateTime currentDate;
 
   @override
@@ -27,13 +29,14 @@ class DayTableView extends StatelessWidget {
           children: weekdays.sublist(0, 7).map(
             (date) {
               return GestureDetector(
-                onTap: isPastDate(currentDate, date) ? null : () => onSelect?.call(date),
+                onTap: isPastDate(currentDate, date) || isAfterMaxDate(maxDate, date) ? null : () => onSelect?.call(date),
                 child: SizedBox(
                   width: 40,
                   height: 40,
                   child: DayCell(
                     display: date,
                     selected: selectedDate,
+                    maxDate: maxDate,
                     current: currentDate,
                   ),
                 ),
@@ -50,13 +53,14 @@ class DayTableView extends StatelessWidget {
           children: weekdays.sublist(7, 14).map(
             (date) {
               return GestureDetector(
-                onTap: isPastDate(currentDate, date) ? null : () => onSelect?.call(date),
+                onTap: isPastDate(currentDate, date) || isAfterMaxDate(maxDate, date) ? null : () => onSelect?.call(date),
                 child: SizedBox(
                   width: 40,
                   height: 40,
                   child: DayCell(
                     display: date,
                     selected: selectedDate,
+                    maxDate: maxDate,
                     current: currentDate,
                   ),
                 ),

+ 3 - 0
packages/cs_widgets/lib/shatter/weekly_calendar/weekly_calendar.dart

@@ -10,10 +10,12 @@ class WeeklyCalendar extends StatefulWidget {
   const WeeklyCalendar({
     super.key,
     this.onChangedSelectedDate,
+    required this.maxDate,
     this.selectedDate,
   });
 
   final DateTime? selectedDate; //当前选中的日期
+  final DateTime maxDate; //可选的最大日期
   final Function(DateTime)? onChangedSelectedDate; //选择日期的回调
 
   @override
@@ -74,6 +76,7 @@ class _WeeklyCalendarState extends State<WeeklyCalendar> {
             widget.onChangedSelectedDate?.call(date);
           },
           selectedDate: selectedDate ?? now,
+          maxDate: widget.maxDate,
           currentDate: now,
         )
       ],