瀏覽代碼

修改了int serviceTypeCode 变为 String cleanServiceType

glglove 1 月之前
父節點
當前提交
12be05b8aa
共有 49 個文件被更改,包括 2463 次插入1582 次删除
  1. 3 3
      packages/cpt_services/lib/components/repair_status_card_item.dart
  2. 150 165
      packages/cpt_services/lib/components/status_card_item.dart
  3. 4 4
      packages/cpt_services/lib/components/status_card_item_vm.dart
  4. 1 1
      packages/cpt_services/lib/components/status_card_item_vm.g.dart
  5. 1 1
      packages/cpt_services/lib/modules/services/clean_order_cancel_success/clean_order_cancel_success_page.dart
  6. 58 57
      packages/cpt_services/lib/modules/services/clean_order_detail/cancelOrderDialogContent.dart
  7. 124 125
      packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_page.dart
  8. 4 2
      packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_state.dart
  9. 80 226
      packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_vm.dart
  10. 1 1
      packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_vm.g.dart
  11. 21 27
      packages/cpt_services/lib/modules/services/history/history_page.dart
  12. 3 2
      packages/cpt_services/lib/modules/services/history/history_state.dart
  13. 36 160
      packages/cpt_services/lib/modules/services/history/history_vm.dart
  14. 1 1
      packages/cpt_services/lib/modules/services/history/history_vm.g.dart
  15. 1 1
      packages/cpt_services/lib/modules/services/homeService/home_service_vm.g.dart
  16. 22 33
      packages/cpt_services/lib/modules/services/inProgress/in_progress_page.dart
  17. 3 2
      packages/cpt_services/lib/modules/services/inProgress/in_progress_state.dart
  18. 36 162
      packages/cpt_services/lib/modules/services/inProgress/in_progress_vm.dart
  19. 1 1
      packages/cpt_services/lib/modules/services/inProgress/in_progress_vm.g.dart
  20. 5 5
      packages/cpt_services/lib/modules/services/repair_history/history_page.dart
  21. 2 2
      packages/cpt_services/lib/modules/services/repair_history/history_vm.dart
  22. 1 1
      packages/cpt_services/lib/modules/services/repair_history/history_vm.g.dart
  23. 5 5
      packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_page.dart
  24. 2 2
      packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_vm.dart
  25. 1 1
      packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_vm.g.dart
  26. 7 6
      packages/cpt_services/lib/modules/services/service_evaluate_create/service_evaluate_create_page.dart
  27. 36 8
      packages/cpt_services/lib/modules/services/service_evaluate_create/service_evaluate_create_vm.dart
  28. 1 1
      packages/cpt_services/lib/modules/services/service_evaluate_create/service_evaluate_create_vm.g.dart
  29. 7 7
      packages/cpt_services/lib/modules/services/service_evaluate_list/service_evaluate_list_page.dart
  30. 111 125
      packages/cpt_services/lib/modules/services/service_evaluate_list/service_evaluate_list_vm.dart
  31. 1 1
      packages/cpt_services/lib/modules/services/service_evaluate_list/service_evaluate_list_vm.g.dart
  32. 159 144
      packages/cpt_services/lib/modules/services/service_repair_detail/service_repair_detail_page.dart
  33. 3 2
      packages/cpt_services/lib/modules/services/service_repair_detail/service_repair_detail_state.dart
  34. 76 66
      packages/cpt_services/lib/modules/services/service_repair_detail/service_repair_detail_vm.dart
  35. 1 1
      packages/cpt_services/lib/modules/services/service_repair_detail/service_repair_detail_vm.g.dart
  36. 1 1
      packages/cpt_services/lib/modules/services/services_main_vm.g.dart
  37. 1 1
      packages/cpt_services/lib/modules/services/services_vm.g.dart
  38. 154 168
      packages/cpt_services/lib/respository/services_respository.dart
  39. 14 14
      packages/cpt_services/lib/router/page/services_page_router.gr.dart
  40. 75 0
      packages/cs_domain/lib/entity/garage_sale_history_entity.dart
  41. 47 47
      packages/cs_domain/lib/entity/garage_sale_rent_detail_entity.dart
  42. 65 0
      packages/cs_domain/lib/entity/service_evaluate_list_entity.dart
  43. 141 0
      packages/cs_domain/lib/entity/service_order_detail_entity.dart
  44. 62 0
      packages/cs_domain/lib/entity/service_repair_detail_entity.dart
  45. 90 0
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  46. 192 0
      packages/cs_domain/lib/generated/json/garage_sale_history_entity.g.dart
  47. 164 0
      packages/cs_domain/lib/generated/json/service_evaluate_list_entity.g.dart
  48. 358 0
      packages/cs_domain/lib/generated/json/service_order_detail_entity.g.dart
  49. 131 0
      packages/cs_domain/lib/generated/json/service_repair_detail_entity.g.dart

+ 3 - 3
packages/cpt_services/lib/components/repair_status_card_item.dart

@@ -16,7 +16,7 @@ import '../constants_services.dart';
 
 class RepairStausCardItem extends HookConsumerWidget {
   int serviceId;
-  int serviceTypeCode;
+  String cleanServiceType;
   int serviceStatusCode;
   Map<String, dynamic> itemObj;
   double? cardHeight ;
@@ -25,7 +25,7 @@ class RepairStausCardItem extends HookConsumerWidget {
   RepairStausCardItem({
     Key? key,
     required this.serviceId,
-    required this.serviceTypeCode,
+    required this.cleanServiceType,
     required this.serviceStatusCode,
     required this.itemObj,
     this.onClickCard,
@@ -52,7 +52,7 @@ class RepairStausCardItem extends HookConsumerWidget {
     // Log.d("actionBtnList   $actionBtnList");
 
     useEffect((){
-      vm.setInitData(context, serviceId, serviceTypeCode, serviceStatusCode);
+      vm.setInitData(context, serviceId, cleanServiceType, serviceStatusCode);
       return () {
       };
     },[]);

+ 150 - 165
packages/cpt_services/lib/components/status_card_item.dart

@@ -1,6 +1,7 @@
 import 'package:cpt_services/components/status_card_item_vm.dart';
 import 'package:cpt_services/modules/services/homeService/home_service_page.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_hooks/flutter_hooks.dart';
@@ -15,49 +16,33 @@ import 'package:widgets/my_text_view.dart';
 import '../constants_services.dart';
 
 class StausCardItem extends HookConsumerWidget {
-  int serviceId;
-  int serviceTypeCode;
-  int serviceStatusCode;
-  Map<String, dynamic> itemObj;
-  double? cardHeight ;
+  GarageSaleHistoryList? item;
+  double? cardHeight;
+
   final Function(dynamic)? onClickCard;
 
   StausCardItem({
     Key? key,
-    required this.serviceId,
-    required this.serviceTypeCode,
-    required this.serviceStatusCode,
-    required this.itemObj,
+    required this.item,
     this.onClickCard,
     cardHeight,
-  }): super(key: key) {
+  }) : super(key: key) {
     this.cardHeight = cardHeight ?? 180.0;
   }
 
   @override
   Widget build(BuildContext context, WidgetRef ref) {
-    final vm = ref.read(statusCardItemVmProvider.notifier);
-
-    final title = itemObj.getValue("title", "House Cleaning Services");
-    final companyName = itemObj.getValue("company_name", "HONG YE GROUP PTE LTD");
-    final duration = itemObj.getValue("duration", "Daily cleaning for 2 hours");
-    final totalPrice = itemObj.getValue("totalPrice", '40');
-    final visit_time = itemObj.getValue("visit_time", '14 0ct 2024 15:00');
-    final order_time = itemObj.getValue("order_time", '13 0ct 2024 12:00');
-
-    Log.d("serviceStatusCode $serviceStatusCode");
-    String status_text = servicesConstants.servicesStatus['$serviceStatusCode']['text'];
-
-    // final status_text = itemObj.getValue("status_text", "");
+    // final vm = ref.read(statusCardItemVmProvider.notifier);
 
-    List<Map<String, dynamic>>? actionBtnList = servicesConstants.servicesStatusActionBtnList[serviceStatusCode];
+    // List<Map<String, dynamic>>? actionBtnList = servicesConstants.servicesStatusActionBtnList[serviceStatusCode];
     // Log.d("actionBtnList   $actionBtnList");
 
-    useEffect((){
-      vm.setInitData(context, serviceId, serviceTypeCode, serviceStatusCode);
-      return () {
-      };
-    },[]);
+    // useEffect((){
+    //   vm.setInitData(context, serviceId, serviceTypeCode, serviceStatusCode);
+    //   return () {
+    //   };
+    // },[]);
+
     return Container(
       width: double.infinity,
       height: cardHeight!,
@@ -67,116 +52,119 @@ class StausCardItem extends HookConsumerWidget {
           crossAxisAlignment: CrossAxisAlignment.start,
           children: [
             Expanded(
-              child: Column(
-                crossAxisAlignment: CrossAxisAlignment.start,
-                children: [
-                  // 标题 和状态
-                  Row(
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                    children: [
-                      // 标题
-                      Expanded(
-                        child: MyTextView(
-                          title,
-                          fontSize: 16,
-                          maxLines: 1,
-                          isFontMedium: true,
-                          textAlign: TextAlign.left,
-                        ),
-                      ),
-                      // 状态
-                      MyTextView(
-                        status_text,
-                        fontSize: 14,
+                child: Column(
+              crossAxisAlignment: CrossAxisAlignment.start,
+              children: [
+                // 标题 和状态
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    // 标题
+                    Expanded(
+                      child: MyTextView(
+                        item?.service?.name ?? "-",
+                        fontSize: 16,
                         maxLines: 1,
-                        isFontRegular: true,
+                        isFontMedium: true,
                         textAlign: TextAlign.left,
-                        textColor: context.appColors.textPrimary,
                       ),
-                    ],
-                  ),
-                  // 公司名称
-                  MyTextView(
-                    companyName,
-                    fontSize: 14,
-                    maxLines: 1,
-                    isFontRegular: true,
-                    textAlign: TextAlign.left,
-                    marginTop: 6,
-                  ),
-                  // 价格
-                  Row(
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                    children: [
-                      // 公司名称
-                      MyTextView(
-                        duration,
-                        fontSize: 14,
-                        maxLines: 1,
-                        isFontRegular: true,
-                        textAlign: TextAlign.left,
-                      ),
-                      // 公司名称
-                      MyTextView(
-                        '\$$totalPrice',
-                        fontSize: 17,
-                        maxLines: 1,
-                        isFontBold: true,
-                        textAlign: TextAlign.left,
-                        textColor: context.appColors.textPrimary,
-                      ),
-                    ],
-                  ),
-                  SizedBox(height: 7.5,),
-                  // visit time
-                  Row(
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                    children: [
-                      MyTextView(
-                        'Visit Time',
-                        fontSize: 14,
-                        maxLines: 1,
-                        isFontRegular: true,
-                        textAlign: TextAlign.left,
-                      ),
-                      MyTextView(
-                        visit_time,
-                        fontSize: 14,
-                        maxLines: 1,
-                        isFontRegular: true,
-                        textAlign: TextAlign.left,
-                        textColor: context.appColors.textBlack,
-                      ),
-                    ],
-                  ),
-                  SizedBox(height: 7.5,),
-                  // order time
-                  Row(
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                    children: [
-                      MyTextView(
-                        'Order Time',
-                        fontSize: 14,
-                        maxLines: 1,
-                        isFontRegular: true,
-                        textAlign: TextAlign.left,
-                      ),
-                      MyTextView(
-                        order_time,
-                        fontSize: 14,
-                        maxLines: 1,
-                        isFontRegular: true,
-                        textAlign: TextAlign.left,
-                        textColor: context.appColors.textBlack,
-                      ),
-                    ],
-                  ),
-                ],
-              )
-            ),
+                    ),
+                    // 状态
+                    MyTextView(
+                      item?.orderStatus??"-",
+                      fontSize: 14,
+                      maxLines: 1,
+                      isFontRegular: true,
+                      textAlign: TextAlign.left,
+                      textColor: context.appColors.textPrimary,
+                    ),
+                  ],
+                ),
+                // 公司名称
+                MyTextView(
+                  item?.merchant?.name ?? "-",
+                  fontSize: 14,
+                  maxLines: 1,
+                  isFontRegular: true,
+                  textAlign: TextAlign.left,
+                  marginTop: 6,
+                ),
+                // 价格
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    // 商品/服务名称
+                    MyTextView(
+                      item?.orderProducts[0].productName ?? "-",
+                      fontSize: 14,
+                      maxLines: 1,
+                      isFontRegular: true,
+                      textAlign: TextAlign.left,
+                    ),
+                    // 公司名称
+                    MyTextView(
+                      '\$${item?.orderProducts[0].totalAmount ?? "-"}',
+                      fontSize: 17,
+                      maxLines: 1,
+                      isFontBold: true,
+                      textAlign: TextAlign.left,
+                      textColor: context.appColors.textPrimary,
+                    ),
+                  ],
+                ),
+                const SizedBox(
+                  height: 7.5,
+                ),
+                // visit time
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    MyTextView(
+                      'Visit Time',
+                      fontSize: 14,
+                      maxLines: 1,
+                      isFontRegular: true,
+                      textAlign: TextAlign.left,
+                    ),
+                    MyTextView(
+                      item?.orderProducts[0].plannedServiceAt ?? "-",
+                      fontSize: 14,
+                      maxLines: 1,
+                      isFontRegular: true,
+                      textAlign: TextAlign.left,
+                      textColor: context.appColors.textBlack,
+                    ),
+                  ],
+                ),
+                const SizedBox(
+                  height: 7.5,
+                ),
+                // order time
+                Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: [
+                    MyTextView(
+                      'Order Time',
+                      fontSize: 14,
+                      maxLines: 1,
+                      isFontRegular: true,
+                      textAlign: TextAlign.left,
+                    ),
+                    MyTextView(
+                      item?.createdAt ?? "-",
+                      fontSize: 14,
+                      maxLines: 1,
+                      isFontRegular: true,
+                      textAlign: TextAlign.left,
+                      textColor: context.appColors.textBlack,
+                    ),
+                  ],
+                ),
+              ],
+            )),
             // Container(
-              // margin: EdgeInsets.only(top: 15),
-              // child: _buildActionSection(context,actionBtnList!, vm, ref),
+            // margin: EdgeInsets.only(top: 15),
+            // child: _buildActionSection(context,actionBtnList!, vm, ref),
             // ),
           ],
         ),
@@ -184,40 +172,37 @@ class StausCardItem extends HookConsumerWidget {
     );
   }
 
-  Widget _buildActionSection(BuildContext context,List<Map<String, dynamic>> actionBtnList, StatusCardItemVm vm, WidgetRef ref ) {
-    return LayoutBuilder(
-        builder: (BuildContext context, BoxConstraints constraints) {
-          final maxHeight = constraints.maxHeight;
-          final minHeight = constraints.minHeight;
-          final maxWidth = constraints.maxWidth;
-          // Log.d("---maxHeight-----$maxHeight-- $minHeight  $maxWidth--");
-          return Container(
-            height: 50,
-            // color: Colors.red,
-            width: maxWidth,
-            child: Row(
-              mainAxisAlignment: MainAxisAlignment.end,
-              mainAxisSize: MainAxisSize.max,
-              children: List.generate(actionBtnList.length, (index){
-                var item = actionBtnList[index];
-                // return Expanded(
-                //   child: _buildBtn(context, item),
-                // );
-                return _buildBtn(context, item, vm, ref);
-              })
-            ),
-          ).scrollable(
-            scrollDirection: Axis.horizontal,
-            physics: BouncingScrollPhysics(),
-          );
-      }
-    );
+  Widget _buildActionSection(BuildContext context, List<Map<String, dynamic>> actionBtnList, StatusCardItemVm vm, WidgetRef ref) {
+    return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
+      final maxHeight = constraints.maxHeight;
+      final minHeight = constraints.minHeight;
+      final maxWidth = constraints.maxWidth;
+      // Log.d("---maxHeight-----$maxHeight-- $minHeight  $maxWidth--");
+      return Container(
+        height: 50,
+        // color: Colors.red,
+        width: maxWidth,
+        child: Row(
+            mainAxisAlignment: MainAxisAlignment.end,
+            mainAxisSize: MainAxisSize.max,
+            children: List.generate(actionBtnList.length, (index) {
+              var item = actionBtnList[index];
+              // return Expanded(
+              //   child: _buildBtn(context, item),
+              // );
+              return _buildBtn(context, item, vm, ref);
+            })),
+      ).scrollable(
+        scrollDirection: Axis.horizontal,
+        physics: BouncingScrollPhysics(),
+      );
+    });
   }
 
   Widget _buildBtn(BuildContext context, Map<String, dynamic> btnItem, StatusCardItemVm vm, WidgetRef ref) {
     // final btnCode = btnItem['code'];
     return MyButton(
-      onPressed: (){
+      onPressed: () {
         vm.handlerClickActionBtn(context, btnItem);
       },
       text: btnItem['text'],
@@ -230,4 +215,4 @@ class StausCardItem extends HookConsumerWidget {
       minHeight: btnItem['btnHeight']?.toDouble() + 5,
     ).marginOnly(left: 5);
   }
-}
+}

+ 4 - 4
packages/cpt_services/lib/components/status_card_item_vm.dart

@@ -18,7 +18,7 @@ class StatusCardItemVm extends _$StatusCardItemVm {
   late ServicesRespository serviceRespositoryInstance;
 
   late int _serviceId;
-  late int _serviceTypeCode;
+  late String _cleanServiceType;
   late int _serviceStatusCode;
 
 
@@ -44,9 +44,9 @@ class StatusCardItemVm extends _$StatusCardItemVm {
   //   );
   // }
 
-  setInitData(BuildContext context,int serviceId, int serviceTypeCode, int serviceStatusCode){
+  setInitData(BuildContext context,int serviceId, String cleanServiceType, int serviceStatusCode){
     _serviceId = serviceId;
-    _serviceTypeCode = serviceTypeCode;
+    _cleanServiceType = cleanServiceType;
     _serviceStatusCode = serviceStatusCode;
   }
 
@@ -68,7 +68,7 @@ class StatusCardItemVm extends _$StatusCardItemVm {
       case '4':
         // 去评价
         // context.router.pushNamed('/detail');
-        ServiceEvaluateCreatePage.startInstance(id: _serviceId, serviceTypeCode: _serviceTypeCode,);
+        ServiceEvaluateCreatePage.startInstance(id: _serviceId, cleanServiceType: _cleanServiceType,);
         break;
       default:
         break;

+ 1 - 1
packages/cpt_services/lib/components/status_card_item_vm.g.dart

@@ -6,7 +6,7 @@ part of 'status_card_item_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$statusCardItemVmHash() => r'41c489c1bdf10cb0588de229c4d4bf2b5440d204';
+String _$statusCardItemVmHash() => r'b4fb97b72135c637c44971bb6be4f2adad536023';
 
 /// See also [StatusCardItemVm].
 @ProviderFor(StatusCardItemVm)

+ 1 - 1
packages/cpt_services/lib/modules/services/clean_order_cancel_success/clean_order_cancel_success_page.dart

@@ -82,7 +82,7 @@ class CleanOrderCancelSuccessPage extends HookConsumerWidget {
                   text: "Back Home",
                   onPressed: (){
                     // 回到首页
-                    ComponentServiceManager().mainService.startMainPage();
+                    context.router.maybePop();
                   },
                   fontSize: 15,
                   fontWeight: FontWeight.w500,

+ 58 - 57
packages/cpt_services/lib/modules/services/clean_order_detail/cancelOrderDialogContent.dart

@@ -9,13 +9,16 @@ import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/util.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_button.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 
 class CancelOrderDialogContent extends HookConsumerWidget {
+
   const CancelOrderDialogContent({
     Key? key,
   }) : super(key: key);
@@ -28,6 +31,7 @@ class CancelOrderDialogContent extends HookConsumerWidget {
       width: double.infinity,
       child: Column(
         mainAxisAlignment: MainAxisAlignment.start,
+        crossAxisAlignment: CrossAxisAlignment.start,
         children: [
           MyTextView(
             "Reason for canceling the order:",
@@ -60,66 +64,63 @@ class CancelOrderDialogContent extends HookConsumerWidget {
     );
   }
 
-
   /// 多行输入框
-  Widget _buildTextAreaLayout(BuildContext context, CleanOrderDetailVm vm, WidgetRef ref,String key){
+  Widget _buildTextAreaLayout(BuildContext context, CleanOrderDetailVm vm, WidgetRef ref, String key) {
     final state = ref.watch(cleanOrderDetailVmProvider);
     final noteCount = useState(0);
-    return Stack(
-        children: [
-          Container(
-            color: ColorUtils.string2Color("#F2F3F6"),
-            margin: const EdgeInsets.only(top: 15, bottom: 28.5),
-            padding: const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
-            child: TextField(
-              cursorColor: context.appColors.authFiledText,
-              cursorWidth: 1.5,
-              autofocus: false,
-              enabled: true,
-              maxLines: null,
-              focusNode: state.cancelFormData![key]!['focusNode'],
-              controller: state.cancelFormData![key]!['controller'],
-              decoration: InputDecoration(
-                isDense: true,
-                isCollapsed: true,
-                border: InputBorder.none,
-                hintText: state.cancelFormData![key]!['hintText'],
-                hintStyle: TextStyle(
-                  color: context.appColors.authFiledHint,
-                  fontSize: 16.0,
-                  fontWeight: FontWeight.w400,
-                ),
-              ),
-              style: TextStyle(
-                color: context.appColors.authFiledText,
-                fontSize: 16.0,
-                fontWeight: FontWeight.w400,
-              ),
-              textInputAction: TextInputAction.done,
-              onSubmitted: (value) {
-                FocusScope.of(context).unfocus();
-              },
-              expands: true,
-              onChanged: (text) {
-                // 当文本改变时,更新字符数量
-                noteCount.value = text.length;
-                final cleanOrderDetailVm = ref.read(cleanOrderDetailVmProvider.notifier);
-                cleanOrderDetailVm.changeCancelFormData(context, text);
-              },
+    return Stack(children: [
+      Container(
+        color: ColorUtils.string2Color("#F2F3F6"),
+        margin: const EdgeInsets.only(top: 15, bottom: 28.5),
+        padding: const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
+        child: TextField(
+          cursorColor: context.appColors.authFiledText,
+          cursorWidth: 1.5,
+          autofocus: false,
+          enabled: true,
+          maxLines: null,
+          focusNode: state.cancelFormData![key]!['focusNode'],
+          controller: state.cancelFormData![key]!['controller'],
+          decoration: InputDecoration(
+            isDense: true,
+            isCollapsed: true,
+            border: InputBorder.none,
+            hintText: state.cancelFormData![key]!['hintText'],
+            hintStyle: TextStyle(
+              color: context.appColors.authFiledHint,
+              fontSize: 16.0,
+              fontWeight: FontWeight.w400,
             ),
           ),
-          // Positioned(
-          //   bottom: 0.0,
-          //   right: 0.0,
-          //   child: Text(
-          //     S.current.characters(noteCount.value),
-          //     style: TextStyle(
-          //       color: context.appColors.textBlack,
-          //       fontSize: 15.0,
-          //     ),
-          //   ),
-          // ),
-        ]
-    );
+          style: TextStyle(
+            color: context.appColors.authFiledText,
+            fontSize: 16.0,
+            fontWeight: FontWeight.w400,
+          ),
+          textInputAction: TextInputAction.done,
+          onSubmitted: (value) {
+            FocusScope.of(context).unfocus();
+          },
+          expands: true,
+          onChanged: (text) {
+            // 当文本改变时,更新字符数量
+            noteCount.value = text.length;
+            final cleanOrderDetailVm = ref.read(cleanOrderDetailVmProvider.notifier);
+            cleanOrderDetailVm.changeCancelFormData(context, text);
+          },
+        ),
+      ),
+      // Positioned(
+      //   bottom: 0.0,
+      //   right: 0.0,
+      //   child: Text(
+      //     S.current.characters(noteCount.value),
+      //     style: TextStyle(
+      //       color: context.appColors.textBlack,
+      //       fontSize: 15.0,
+      //     ),
+      //   ),
+      // ),
+    ]);
   }
-}
+}

+ 124 - 125
packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_page.dart

@@ -3,6 +3,7 @@ import 'package:cpt_services/components/chooseAirConditionContent_vm.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
+import 'package:domain/entity/service_order_detail_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:flutter/rendering.dart';
@@ -35,25 +36,25 @@ import '../../../components/status_card_item.dart';
 @RoutePage()
 class CleanOrderDetailPage extends HookConsumerWidget {
   final int id; // 订单id
-  final int serviceTypeCode;  // 订单类型
+  final String cleanServiceType; // 订单类型
   final int serviesStatusCode; // 订单状态
+
   const CleanOrderDetailPage({
     Key? key,
     @PathParam('id') required this.id,
-    @PathParam('serviceTypeCode') required this.serviceTypeCode,
+    @PathParam('cleanServiceType') required this.cleanServiceType,
     @PathParam('serviesStatusCode') required this.serviesStatusCode,
   }) : super(key: key);
 
   //启动当前页面
-  static void startInstance({BuildContext? context, required int id, required int serviceTypeCode, required int serviesStatusCode}) {
+  static void startInstance({BuildContext? context, required int id, required String cleanServiceType, required int serviesStatusCode}) {
     if (context != null) {
-      context.router.push(CleanOrderDetailPageRoute(id: id, serviceTypeCode: serviceTypeCode, serviesStatusCode: serviesStatusCode));
+      context.router.push(CleanOrderDetailPageRoute(id: id, cleanServiceType: cleanServiceType, serviesStatusCode: serviesStatusCode));
     } else {
-      appRouter.push(CleanOrderDetailPageRoute(id:id, serviceTypeCode: serviceTypeCode, serviesStatusCode: serviesStatusCode));
+      appRouter.push(CleanOrderDetailPageRoute(id: id, cleanServiceType: cleanServiceType, serviesStatusCode: serviesStatusCode));
     }
   }
 
-
   @override
   Widget build(BuildContext context, WidgetRef ref) {
     final vm = ref.read(cleanOrderDetailVmProvider.notifier);
@@ -64,9 +65,9 @@ class CleanOrderDetailPage extends HookConsumerWidget {
     Log.d("actionBtnList   $actionBtnList");
 
     useEffect(() {
-      vm.setInitPageData(id: id, serviceTypeCode: serviceTypeCode, serviceStatusCode: serviesStatusCode);
+      vm.setInitPageData(id: id, cleanServiceType: cleanServiceType, serviceStatusCode: serviesStatusCode);
       // 组件挂载时执行 - 执行接口请求
-      Future.microtask(() => vm.initPageData());
+      Future.microtask(() => vm.fetchOrderDetailData(id));
       return () {
         // 组件卸载时执行
       };
@@ -93,27 +94,26 @@ class CleanOrderDetailPage extends HookConsumerWidget {
               state: state.loadingState,
               errorMessage: state.errorMessage,
               errorRetry: () {
-                vm.retryRequest();
+                vm.retryRequest(id);
               },
               successWidget: Column(
                 children: [
                   Expanded(
                     child: Padding(
                       padding: const EdgeInsets.only(bottom: 10),
-                      child: _buildBody(state, vm, context,ref),
+                      child: _buildBody(state, vm, context, ref),
                     ),
                   ),
                   // 底部联系信息
                   Visibility(
                     visible: state.loadingState == LoadState.State_Success,
-                    child: state.datas !=null ? _buildActionSection(context, state, vm, ref, id, serviceTypeCode,serviesStatusCode, actionBtnList): Container(),
+                    child:
+                        state.datas != null ? _buildActionSection(context, state, vm, ref, id, cleanServiceType, serviesStatusCode, actionBtnList) : Container(),
                   )
-
                 ],
               ),
             ),
-          ).marginOnly(left: 0,right: 0,top: 0,bottom: 0)
-      ),
+          ).marginOnly(left: 0, right: 0, top: 0, bottom: 0)),
     );
   }
 
@@ -193,7 +193,6 @@ class CleanOrderDetailPage extends HookConsumerWidget {
   }
 
   Widget _buildOrderScore(CleanOrderDetailState state, CleanOrderDetailVm vm, BuildContext context) {
-    double score = 5.0;
     //  评分
     return Column(
       children: [
@@ -204,7 +203,7 @@ class CleanOrderDetailPage extends HookConsumerWidget {
             crossAxisAlignment: CrossAxisAlignment.start,
             children: [
               MyTextView(
-                "House Cleaning Services",
+                state.datas?.orderService?.name ?? "-",
                 textColor: context.appColors.textBlack,
                 fontSize: 18,
                 isFontBold: true,
@@ -215,12 +214,13 @@ class CleanOrderDetailPage extends HookConsumerWidget {
                 crossAxisAlignment: CrossAxisAlignment.center,
                 children: [
                   AnimatedRatingStars(
-                    initialRating: score,
-                    onChanged: (rating) {
-                    },
+                    initialRating: state.datas?.orderService?.evaluationsAvgScore ?? 0.0,
+                    onChanged: (rating) {},
                     readOnly: true,
-                    displayRatingValue: true, // Display the rating value
-                    interactiveTooltips: true, // Allow toggling half-star state
+                    displayRatingValue: true,
+                    // Display the rating value
+                    interactiveTooltips: true,
+                    // Allow toggling half-star state
                     customFilledIcon: Icons.star,
                     customHalfFilledIcon: Icons.star_half,
                     customEmptyIcon: Icons.star_border,
@@ -230,7 +230,7 @@ class CleanOrderDetailPage extends HookConsumerWidget {
                     animationCurve: Curves.easeInOut,
                   ),
                   MyTextView(
-                    "${score}",
+                    "${state.datas?.orderService?.evaluationsAvgScore ?? 0.0}",
                     textColor: context.appColors.textBlack,
                     fontSize: 16,
                     isFontMedium: true,
@@ -239,7 +239,7 @@ class CleanOrderDetailPage extends HookConsumerWidget {
                 ],
               ),
               MyTextView(
-                "HONG YE GROUP PTE LTD",
+                state.datas?.merchant?.name ?? "-",
                 textColor: context.appColors.textDarkGray999,
                 fontSize: 12,
                 isFontRegular: true,
@@ -272,7 +272,7 @@ class CleanOrderDetailPage extends HookConsumerWidget {
               crossAxisAlignment: CrossAxisAlignment.start,
               children: [
                 MyTextView(
-                  '705 Qiming Huijin Building',
+                  state.datas?.estateUnit?.address ?? "-",
                   fontSize: 17,
                   isFontBold: true,
                   textColor: context.appColors.textBlack,
@@ -282,13 +282,13 @@ class CleanOrderDetailPage extends HookConsumerWidget {
                   mainAxisAlignment: MainAxisAlignment.start,
                   children: [
                     MyTextView(
-                      'Sundy',
+                      state.datas?.account?.name ?? "-",
                       fontSize: 14,
                       textColor: context.appColors.textDarkGray999,
                       isFontRegular: true,
                     ),
                     MyTextView(
-                      '+6588991122',
+                      "+${state.datas?.account?.phone ?? "-"}",
                       fontSize: 14,
                       textColor: context.appColors.textDarkGray999,
                       isFontRegular: true,
@@ -328,26 +328,36 @@ class CleanOrderDetailPage extends HookConsumerWidget {
             ),
           ],
         ),
-        if (serviceTypeCode == servicesConstants.servicesType['houseCleaning']!['code'])
-        // 室内清理
-          _buildCleanContent(context, state)
-        else if (serviceTypeCode == servicesConstants.servicesType['airConditioner']!['code'])
-        // 空调清理
-          _buildCleanContent(context, state)
+        
+        // if (cleanServiceType == servicesConstants.servicesType['houseCleaning']!['code'])
+        //   // 室内清理
+        //   _buildCleanContent(context, state)
+        // else if (cleanServiceType == servicesConstants.servicesType['airConditioner']!['code'])
+        //   // 空调清理
+        //   _buildCleanContent(context, state)
+        // else
+        //   const SizedBox.shrink()
+
+        // 根据 orderProducts 数组生成对应的 Widgets
+        if (state.datas?.orderProducts != null && state.datas!.orderProducts!.isNotEmpty)
+          ...state.datas!.orderProducts!.map((product) {
+            return _buildCleanContent(product, context);
+          }).toList()
         else
-          const SizedBox.shrink()
+          const SizedBox.shrink(), //空
+        
       ],
     );
   }
 
-  Widget _buildCleanContent(BuildContext context, state) {
-    final title = 'House Cleaning Services';
-    final areaSizeRange = '1 Bedroom';
-    final num =  1;
-    final price = 0;
-    bool isChecked = false;
-    bool disabled = true;
-    final isDisable = useState<bool>(disabled);
+  Widget _buildCleanContent(ServiceOrderDetailOrderProducts item ,BuildContext context) {
+    // final title = 'House Cleaning Services';
+    // final areaSizeRange = '1 Bedroom';
+    // final num = 1;
+    // final price = 0;
+    // bool isChecked = false;
+    // bool disabled = true;
+    // final isDisable = useState<bool>(disabled);
 
     return Container(
       padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
@@ -364,13 +374,13 @@ class CleanOrderDetailPage extends HookConsumerWidget {
                   crossAxisAlignment: CrossAxisAlignment.start,
                   children: [
                     MyTextView(
-                      title,
+                      item.productName?? '-',
                       fontSize: 16,
                       isFontMedium: true,
                       textColor: context.appColors.textBlack,
                     ),
                     MyTextView(
-                      areaSizeRange,
+                      "x${item.quantity}",
                       fontSize: 15,
                       isFontRegular: true,
                       textColor: context.appColors.textDarkGray999,
@@ -392,14 +402,14 @@ class CleanOrderDetailPage extends HookConsumerWidget {
               // )
               Container(
                 child: MyButton(
-                  text: '\$$price',
+                  text: '\$${item.totalAmount??""}',
                   onPressed: null,
                   minWidth: 80,
                   minHeight: 40,
                   fontSize: 19,
                   fontWeight: FontWeight.w500,
                   // enable: !isDisable.value,
-                  textColor:  context.appColors.textPrimary,
+                  textColor: context.appColors.textPrimary,
                   backgroundColor: context.appColors.textWhite,
                   disabledBackgroundColor: context.appColors.disEnableGray,
                   disabledTextColor: context.appColors.textWhite,
@@ -413,41 +423,33 @@ class CleanOrderDetailPage extends HookConsumerWidget {
     );
   }
 
-
   Widget _buildOrderTotalAmount(CleanOrderDetailState state, CleanOrderDetailVm vm, BuildContext context) {
-    return Column(
-      children: [
-        Row(
-          mainAxisAlignment: MainAxisAlignment.start,
-          crossAxisAlignment: CrossAxisAlignment.start,
-          children: [
-            const MyAssetImage(
-              Assets.serviceMoneyIcon,
-              width: 15,
-              height: 17.5,
-            ),
-            const SizedBox(
-             width: 10,
-            ),
-            MyTextView(
-              'Total Amount',
-              fontSize: 17,
-              isFontBold: true,
-              textColor: context.appColors.textBlack,
-            ),
-
-            MyTextView(
-              '\$200',
-              fontSize: 15,
-              textColor: context.appColors.textBlack,
-              isFontBold: true,
-              textAlign: TextAlign.end,
-              marginRight: 17,
-            ).expanded(),
-          ]
-        )
-      ]
-    );
+    return Column(children: [
+      Row(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
+        const MyAssetImage(
+          Assets.serviceMoneyIcon,
+          width: 15,
+          height: 17.5,
+        ),
+        const SizedBox(
+          width: 10,
+        ),
+        MyTextView(
+          'Total Amount',
+          fontSize: 17,
+          isFontBold: true,
+          textColor: context.appColors.textBlack,
+        ),
+        MyTextView(
+          '\$${state.datas?.totalAmount ?? 0}',
+          fontSize: 15,
+          textColor: context.appColors.textBlack,
+          isFontBold: true,
+          textAlign: TextAlign.end,
+          marginRight: 17,
+        ).expanded(),
+      ])
+    ]);
   }
 
   Widget _buildOrderVisitTime(CleanOrderDetailState state, CleanOrderDetailVm vm, BuildContext context) {
@@ -481,7 +483,7 @@ class CleanOrderDetailPage extends HookConsumerWidget {
             mainAxisAlignment: MainAxisAlignment.end,
             children: [
               MyTextView(
-                '2021-01-01 12:00',
+                state.datas?.orderProducts?[0].plannedServiceAt ?? '',
                 fontSize: 15,
                 textColor: context.appColors.textDarkGray999,
                 isFontRegular: true,
@@ -537,7 +539,7 @@ class CleanOrderDetailPage extends HookConsumerWidget {
                 ],
               ),
               MyButton(
-                onPressed: (){
+                onPressed: () {
                   ComponentServiceManager().paymentService.startChooseCardPage();
                 },
                 text: 'Change',
@@ -582,23 +584,23 @@ class CleanOrderDetailPage extends HookConsumerWidget {
           ],
         ),
         Container(
-          margin: const EdgeInsets.only(left:10, right:10,top: 0),
+          margin: const EdgeInsets.only(left: 10, right: 10, top: 0),
           width: double.infinity,
           padding: const EdgeInsets.all(15),
           decoration: BoxDecoration(
-              color: ColorUtils.string2Color("#F8F8F8"),
-              borderRadius: BorderRadius.circular(5),
-              // boxShadow: [
-              //   BoxShadow(
-              //     color: Colors.grey.withOpacity(0.2),
-              //     spreadRadius:1,
-              //     blurRadius: 2,
-              //     offset: const Offset(0.5, 0.5), // changes position of shadow
-              //   ),
-              // ]
+            color: ColorUtils.string2Color("#F8F8F8"),
+            borderRadius: BorderRadius.circular(5),
+            // boxShadow: [
+            //   BoxShadow(
+            //     color: Colors.grey.withOpacity(0.2),
+            //     spreadRadius:1,
+            //     blurRadius: 2,
+            //     offset: const Offset(0.5, 0.5), // changes position of shadow
+            //   ),
+            // ]
           ),
           child: MyTextView(
-            'Hope to arrive as soon as possible',
+            state.datas?.notes ?? "",
             fontSize: 16,
             isFontRegular: true,
             textColor: context.appColors.textBlack,
@@ -609,7 +611,6 @@ class CleanOrderDetailPage extends HookConsumerWidget {
     );
   }
 
-
   Widget _buildOrderRules(CleanOrderDetailState state, CleanOrderDetailVm vm, BuildContext context) {
     return Column(
       crossAxisAlignment: CrossAxisAlignment.start,
@@ -643,41 +644,39 @@ class CleanOrderDetailPage extends HookConsumerWidget {
   }
 
   // 底部操作区域
-  Widget _buildActionSection(BuildContext context,state, vm ,WidgetRef ref, int id, int serviceTypeCode, int serviesStatusCode, List<Map<String, dynamic>> actionBtnList) {
-    return LayoutBuilder(
-        builder: (BuildContext context, BoxConstraints constraints) {
-          final maxHeight = constraints.maxHeight;
-          final minHeight = constraints.minHeight;
-          final maxWidth = constraints.maxWidth;
-          // Log.d("---maxHeight-----$maxHeight-- $minHeight  $maxWidth--");
-          return Container(
-            height: 71.5,
-            color: context.appColors.whiteBG,
-            width: maxWidth,
-            padding: const EdgeInsets.only(left: 10, right: 10),
-            child: Row(
-                mainAxisAlignment: MainAxisAlignment.center,
-                mainAxisSize: MainAxisSize.max,
-                children: List.generate(actionBtnList.length, (index){
-                  var item = actionBtnList[index];
-                  return Expanded(
-                    child: _buildBtn(context, item, vm, ref),
-                  );
-                  // return _buildBtn(context, item, vm, ref);
-                })
-            ),
-          ).scrollable(
-            scrollDirection: Axis.horizontal,
-            physics: BouncingScrollPhysics(),
-          );
-        }
-    );
+  Widget _buildActionSection(
+      BuildContext context, state, vm, WidgetRef ref, int id, String cleanServiceType, int serviesStatusCode, List<Map<String, dynamic>> actionBtnList) {
+    return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
+      final maxHeight = constraints.maxHeight;
+      final minHeight = constraints.minHeight;
+      final maxWidth = constraints.maxWidth;
+      // Log.d("---maxHeight-----$maxHeight-- $minHeight  $maxWidth--");
+      return Container(
+        height: 71.5,
+        color: context.appColors.whiteBG,
+        width: maxWidth,
+        padding: const EdgeInsets.only(left: 10, right: 10),
+        child: Row(
+            mainAxisAlignment: MainAxisAlignment.center,
+            mainAxisSize: MainAxisSize.max,
+            children: List.generate(actionBtnList.length, (index) {
+              var item = actionBtnList[index];
+              return Expanded(
+                child: _buildBtn(context, item, vm, ref),
+              );
+              // return _buildBtn(context, item, vm, ref);
+            })),
+      ).scrollable(
+        scrollDirection: Axis.horizontal,
+        physics: const BouncingScrollPhysics(),
+      );
+    });
   }
 
   Widget _buildBtn(BuildContext context, Map<String, dynamic> btnItem, vm, WidgetRef ref) {
     // final btnCode = btnItem['code'];
     return MyButton(
-      onPressed: (){
+      onPressed: () {
         vm.handlerClickActionBtn(context, btnItem);
       },
       text: btnItem['text'],
@@ -690,4 +689,4 @@ class CleanOrderDetailPage extends HookConsumerWidget {
       minHeight: btnItem['btnHeight']?.toDouble() + 5,
     ).marginOnly(left: 5);
   }
-}
+}

+ 4 - 2
packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_state.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/service_order_detail_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:widgets/load_state_layout.dart';
 
@@ -6,7 +7,8 @@ class CleanOrderDetailState {
   LoadState loadingState;
   String? errorMessage;
   double? totalPrice;
-  Map<String, dynamic>? datas;
+
+  ServiceOrderDetailEntity? datas;
 
   String? cancelReason;  // 取消的文字
 
@@ -36,7 +38,7 @@ class CleanOrderDetailState {
     double? totalPrice,
     String? cancelReason,
     Map<String, Map<String, dynamic>>? cancelFormData,
-    Map<String, dynamic>? datas,
+    ServiceOrderDetailEntity? datas,
   }) {
     return CleanOrderDetailState(
       loadingState: loadingState ?? this.loadingState,

+ 80 - 226
packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_vm.dart

@@ -1,4 +1,3 @@
-
 import 'package:cpt_services/components/chooseAirConditionContent_vm.dart';
 import 'package:cpt_services/components/chooseHouseCleanContent_vm.dart';
 import 'package:cpt_services/components/chooseVisitTimeContent.dart';
@@ -12,10 +11,12 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:plugin_platform/engine/dialog/dialog_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/ext/auto_router_extensions.dart';
 import 'package:shared/utils/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/util.dart';
 import 'package:widgets/dialog/app_custom_dialog.dart';
 import 'package:widgets/dialog/app_default_dialog.dart';
 import 'package:widgets/dialog/dialog_content_wrap.dart';
@@ -36,40 +37,33 @@ import 'clean_order_detail_state.dart';
 
 part 'clean_order_detail_vm.g.dart';
 
-
-final _chooseVisitTimeDialogGlobalKey = GlobalKey<DialogContentWrapState>();
-
 @riverpod
-class CleanOrderDetailVm extends _$CleanOrderDetailVm {
+class CleanOrderDetailVm extends _$CleanOrderDetailVm with DioCancelableMixin {
   late ServicesRespository servicesRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
-  int _page = 1;  // 当前页
-  int _limit = 10; // 每页数量
-  int _count = 0; // 总条数
 
   late int _detailId;
-  late int _detailServiceTypeCode;
+  late String _cleanServiceType;
   late int _detailServiceStatusCode;
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
-    controlFinishRefresh: true,  //允许刷新
-    controlFinishLoad: true,   //允许加载
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
   );
 
   CleanOrderDetailState initState() {
     return CleanOrderDetailState(
-        datas: {}
+      datas: null,
     );
   }
 
   @override
-  CleanOrderDetailState build(){
-    // 引入数据仓库
-    // servicesRespositoryInstance = ref.read(commonGarageRespositoryProvider);
+  CleanOrderDetailState build() {
+    servicesRespositoryInstance = ref.read(servicesRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
-    // 处理 remarkInfo 数据的回显
+    registerCancellation();
     this.onInit();
     return state;
   }
@@ -80,198 +74,31 @@ class CleanOrderDetailVm extends _$CleanOrderDetailVm {
 
   //刷新页面状态
   void changeLoadingState(LoadState loadState, String? errorMsg) {
-    state = state.copyWith(
-        loadingState: loadState,
-        errorMessage: errorMsg
-    );
+    state = state.copyWith(loadingState: loadState, errorMessage: errorMsg);
   }
 
-  setInitPageData({required int id, required int serviceTypeCode, required int serviceStatusCode}){
+  setInitPageData({required int id, required String cleanServiceType, required int serviceStatusCode}) {
     _detailId = id;
-    _detailServiceTypeCode = serviceTypeCode;
+    _cleanServiceType = cleanServiceType;
     _detailServiceStatusCode = serviceStatusCode;
   }
 
   // 初始化页面数据
-  initPageData({detailId, detailServiceTypeCode, detailServiceStatusCode}) {
-    _detailId = detailId??_detailId;
-    _detailServiceTypeCode = detailServiceTypeCode??_detailServiceTypeCode;
-    _detailServiceStatusCode = detailServiceStatusCode??_detailServiceStatusCode;
-    Log.d("--------------------------initPageData---------------------");
-    changeLoadingState(LoadState.State_Success, null);
-  }
-
-  // 上拉加载 更多
-  Future loadMore() async {
-    Log.d("----home_service_vm-----loadMore");
-    _page++;
-    getListData();
-  }
-
-  // 下拉刷新
-  Future onRefresh() async {
-    // 当前pageView 页面正处于显示状态
-    Log.d("----forsale_vm-----onRefresh ");
-    // await Future.delayed(const Duration(seconds: 2));
-    _page = 1;
-    getListData();
-  }
-
-
-  // 手动进行刷新
-  Future triggerRefresh() async {
-    Log.d("trggerRefresh");
-    refreshController.callRefresh();
-  }
-
-  // 手动进行刷新
-  Future directRefresh() async {
-    state = state.copyWith(datas:null);
-    // 注意:由于 nestedscrollview 嵌套easyfresh 组件  refreshController.callRefresh() 自动刷新只能滚动顶部但是不会触发下拉刷新,这里调用是 用到了将其滚动到顶部的作用,进而刷新操作主动掉接口
-    // https://github.com/xuelongqy/flutter_easy_refresh/issues/692
-    refreshController.callRefresh();
-    refreshController.resetFooter();
-    _page = 1;
-    _needShowPlaceholder = true;
-    getListData();
-  }
-
+  // initPageData({detailId, detailcleanServiceType, detailServiceStatusCode}) {
+  //   _detailId = detailId??_detailId;
+  //   _cleanServiceType = detailcleanServiceType??_cleanServiceType;
+  //   _detailServiceStatusCode = detailServiceStatusCode??_detailServiceStatusCode;
+  //   Log.d("--------------------------initPageData---------------------");
+  //   changeLoadingState(LoadState.State_Success, null);
+  // }
 
   // 重试请求
-  Future retryRequest() async {
-    _page = 1;
+  Future retryRequest(int id) async {
     _needShowPlaceholder = true;
-    getListData();
-  }
-
-
-  // 获取list 列表数据
-  Future getListData<T>({bool? isLoadMore}) async {
-    if (_needShowPlaceholder) {
-      changeLoadingState(LoadState.State_Loading, null);
-    }
-
-    List<Map<String, dynamic>> list = [
-      {
-        'id':1,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 0,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-      {
-        'id':2,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 1,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-      {
-        'id':3,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 1,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-    ];
-    handlerResultData(true, list:list);
-
-    // try {
-    //   //请求网络
-    //   Map<String, dynamic>  params = {
-    //     "type": 1,  // 类型(1=Sale,2=Rent)
-    //     "category_id": _queryParams['category_id'],
-    //     "keyword": _queryParams['keyword'],
-    //     "page": _page,
-    //     "limit": _limit,
-    //   };
-    //   Log.d("请求参数------$params");
-    //   final result = await servicesRespositoryInstance.fetchGarageDataList(params);
-    //   //校验成功失败
-    //   if (result.isSuccess) {
-    //     // handlerResultList((result.data as GarageSaleRentEntity).list as List<GarageSaleRentList>, isLoadMore ?? false);
-    //   } else {
-    //     String errorMessage = result.errorMsg!;
-    //     changeLoadingState(LoadState.State_Error, errorMessage);
-    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //   }
-    // } catch (e) {
-    //   ToastEngine.show("Error: $e");
-    // }
-
-    // 最后赋值
-    _needShowPlaceholder = false;
-
+    fetchOrderDetailData(id);
   }
 
-  handlerResultData(bool isList, {List<Map<String, dynamic>>? list, dynamic? data}){
-    Future.delayed(const Duration(seconds: 1)).then((value) {
-      if(isList){
-        // list 数据模式
-        // if(list != null && list.isNotEmpty){
-        //   if(_page == 1){
-        //     state.list.clear();
-        //     state.list!.addAll(list);
-        //     refreshController.finishRefresh();
-        //     changeLoadingState(LoadState.State_Success, null);
-        //   }else {
-        //     final allList = state.list;
-        //     allList!.addAll(list);
-        //     state = state.copyWith(list: allList);
-        //     refreshController.finishLoad();
-        //   }
-        // }else {
-        //   if(_page == 1){
-        //     state.list.clear();
-        //     changeLoadingState(LoadState.State_Empty, null);
-        //     refreshController.finishRefresh();
-        //   }else {
-        //     refreshController.finishLoad(IndicatorResult.noMore);
-        //   }
-        // }
-      }else {
-        // 单个数据模式
-        if(data!=null){
-          if(_page == 1){
-            refreshController.finishRefresh();
-          }else{
-            refreshController.finishLoad();
-          }
-          changeLoadingState(LoadState.State_Success, null);
-        }else {
-          if(_page == 1){
-            refreshController.finishRefresh();
-          }else{
-            refreshController.finishLoad();
-          }
-          changeLoadingState(LoadState.State_Empty, null);
-        }
-      }
-    });
-  }
-
-  handlerClickActionBtn(BuildContext context, Map<String, dynamic> actionBtn){
+  handlerClickActionBtn(BuildContext context, Map<String, dynamic> actionBtn) {
     final actionBtnCode = actionBtn['code']!.toString();
     switch (actionBtnCode) {
       case '0':
@@ -292,25 +119,26 @@ class CleanOrderDetailVm extends _$CleanOrderDetailVm {
         break;
       case '4':
         // Evaluate 去评价
-        ServiceEvaluateCreatePage.startInstance(id: _detailId, serviceTypeCode: _detailServiceTypeCode,);
+        ServiceEvaluateCreatePage.startInstance(
+          id: _detailId,
+          cleanServiceType: _cleanServiceType,
+        );
         break;
       default:
         break;
     }
   }
 
-  handlerDeleteOrder(BuildContext context){
+  handlerDeleteOrder(BuildContext context) {
     DialogEngine.show(
-      widget: AppCustomDialog(
-        message: "Are you sure you want to delete?",
-        confirmAction: () {
-        },
-      )
-    );
+        widget: AppCustomDialog(
+      message: "Are you sure you want to delete?",
+      confirmAction: () {},
+    ));
   }
 
   // 取消订单
-  handlerCancelOrder(BuildContext context){
+  handlerCancelOrder(BuildContext context) {
     DialogEngine.show(
         tag: "cancelOrder",
         position: DialogPosition.center,
@@ -328,13 +156,13 @@ class CleanOrderDetailVm extends _$CleanOrderDetailVm {
             color: context.appColors.textWhite,
           ),
           messageBuilder: (context) {
-            return CancelOrderDialogContent();
+            return const CancelOrderDialogContent();
           },
-          bottomFooterBuilder: (context){
+          bottomFooterBuilder: (context) {
             return Padding(
-              padding: const EdgeInsets.only( bottom: 40),
+              padding: const EdgeInsets.only(bottom: 40),
               child: MyButton(
-                onPressed: (){
+                onPressed: () {
                   // 提交取消订单
                   submitCancelOrder(context);
                 },
@@ -354,8 +182,8 @@ class CleanOrderDetailVm extends _$CleanOrderDetailVm {
           topRightRadius: 10.0,
           bottomLeftRadius: 10.0,
           bottomRightRadius: 10.0,
-          contentPadding: const EdgeInsets.only(left: 20, right: 20, bottom: 20,top: 20),
-          bottomBtnSectionPadding: const EdgeInsets.only(left: 20, right: 20, bottom: 20,top: 20),
+          contentPadding: const EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 20),
+          bottomBtnSectionPadding: const EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 20),
           cancelAction: () {
             DialogEngine.dismiss(tag: 'cancelOrder');
             clearReasonInput();
@@ -363,27 +191,53 @@ class CleanOrderDetailVm extends _$CleanOrderDetailVm {
           confirmAction: () {
             clearReasonInput();
           },
-        )
-    );
+        ));
   }
 
-  changeCancelFormData(BuildContext context,String cancelReason){
-    state.cancelReason = cancelReason;
-    // state = state.copyWith(
-    //   cancelReason: cancelReason
-    // );
+  changeCancelFormData(BuildContext context, String cancelReason) {
+    // state.cancelReason = cancelReason;
+    state = state.copyWith(cancelReason: cancelReason);
   }
 
-  submitCancelOrder(BuildContext context){
-    Log.d("cancelReason:  ${state.cancelReason}");
-    clearReasonInput();
-    DialogEngine.dismiss(tag: 'cancelOrder');
-    // 去成功页面
-    CleanOrderCancelSuccessPage.startInstance();
+  submitCancelOrder(BuildContext context) async {
+    Log.d("cancelReason: ${state.cancelReason}");
+
+    if (Utils.isNotEmpty(state.cancelReason)) {
+      //调用接口取消订单
+      DialogEngine.dismiss(tag: 'cancelOrder');
+
+      final result = await servicesRespositoryInstance.fetchCancelPaidServiceOrder(id: _detailId.toString(), reason: state.cancelReason);
+
+      if (result.isSuccess) {
+        clearReasonInput();
+        //去成功页面
+        CleanOrderCancelSuccessPage.startInstance();
+      } else {
+        ToastEngine.show(result.errorMsg ?? "UnKnow Error");
+      }
+    } else {
+      ToastEngine.show("Please enter the reason for cancellation");
+    }
   }
 
-  clearReasonInput(){
+  clearReasonInput() {
     state.cancelReason = "";
     state.cancelFormData!['reason']!["controller"].text = "";
   }
-}
+
+  //获取详情数据
+  fetchOrderDetailData(int id) async {
+    if (_needShowPlaceholder) {
+      changeLoadingState(LoadState.State_Loading, null);
+    }
+
+    final result = await servicesRespositoryInstance.fetchPaidServiceCleanOrderDetail(id: id.toString(), cancelToken: cancelToken);
+
+    if (result.isSuccess) {
+      state = state.copyWith(datas: result.data);
+      changeLoadingState(LoadState.State_Success, null);
+    } else {
+      changeLoadingState(LoadState.State_Error, result.errorMsg ?? "UnKnow Error");
+    }
+  }
+}

+ 1 - 1
packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_vm.g.dart

@@ -7,7 +7,7 @@ part of 'clean_order_detail_vm.dart';
 // **************************************************************************
 
 String _$cleanOrderDetailVmHash() =>
-    r'068199d62a6545c1f8edff8736a13854a79042ab';
+    r'fcfa75c5fcdae98cdcc58d6b872100967a9a3c16';
 
 /// See also [CleanOrderDetailVm].
 @ProviderFor(CleanOrderDetailVm)

+ 21 - 27
packages/cpt_services/lib/modules/services/history/history_page.dart

@@ -1,4 +1,5 @@
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
@@ -38,17 +39,15 @@ class HistoryPage extends HookConsumerWidget {
     }
   }
 
-
   @override
   Widget build(BuildContext context, WidgetRef ref) {
     final vm = ref.read(historyVmProvider.notifier);
     final state = ref.watch(historyVmProvider);
     // final appConfigState = ref.watch(appConfigServiceProvider)
 
-    int serviceTypeCode = servicesConstants.servicesType['houseCleaning']?['code'];
+    String cleanServiceType = servicesConstants.servicesType['houseCleaning']?['code'];
     int serviceStatusCode = servicesConstants.servicesStatus['2']?['code'];
 
-
     useEffect(() {
       // 组件挂载时执行 - 执行接口请求
       Future.microtask(() => vm.initPageData());
@@ -72,12 +71,12 @@ class HistoryPage extends HookConsumerWidget {
             key: ValueKey('history'),
             controller: vm.refreshController,
             // 上拉加载
-            onLoad: () async{
+            onLoad: () async {
               Log.d("----onLoad");
               vm.loadMore();
             },
             // 下拉刷新
-            onRefresh: () async{
+            onRefresh: () async {
               Log.d("----onRefresh");
               vm.onRefresh();
             },
@@ -87,22 +86,22 @@ class HistoryPage extends HookConsumerWidget {
               errorRetry: () {
                 vm.retryRequest();
               },
-              successSliverWidget:[
+              successSliverWidget: [
                 SliverList(
                   delegate: SliverChildBuilderDelegate(
-                        (context, index) {
-                      return  _buildHistoryItem(
-                          context,
-                          ref,
-                          state.list[index],
-                          vm,
-                          serviceTypeCode,
-                          serviceStatusCode,
-                      ).onTap((){
+                    (context, index) {
+                      return _buildHistoryItem(
+                        context,
+                        ref,
+                        state.list[index],
+                        vm,
+                        cleanServiceType,
+                        serviceStatusCode,
+                      ).onTap(() {
                         vm.gotoCleanOrderDetailPage(
                           context,
-                          state.list?[index]['id'],
-                          serviceTypeCode,
+                          state.list[index].id != null ? int.tryParse(state.list[index].id!) ?? 0 : 0,
+                          cleanServiceType,
                           serviceStatusCode,
                         );
                       });
@@ -112,12 +111,11 @@ class HistoryPage extends HookConsumerWidget {
                 )
               ],
             ),
-          ).marginOnly(left: 15,right: 15,top: 0,bottom: 15)
-      ),
+          ).marginOnly(left: 15, right: 15, top: 0, bottom: 15)),
     );
   }
 
-  Widget _buildHistoryItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int serviceTypeCode, int serviceStatusCode){
+  Widget _buildHistoryItem(BuildContext context, WidgetRef ref, GarageSaleHistoryList item, vm, String cleanServiceType, int serviceStatusCode) {
     return Container(
       margin: const EdgeInsets.only(top: 9),
       width: double.infinity,
@@ -135,13 +133,9 @@ class HistoryPage extends HookConsumerWidget {
       child: StausCardItem(
         key: UniqueKey(),
         cardHeight: 175.0,
-        serviceId: item['id'],
-        serviceTypeCode: serviceTypeCode,
-        serviceStatusCode: serviceStatusCode,
-        itemObj: item.cast<String, dynamic>(),
-        onClickCard: (dynamic value) async {
-        },
+        item: item,
+        onClickCard: (dynamic value) async {},
       ),
     );
   }
-}
+}

+ 3 - 2
packages/cpt_services/lib/modules/services/history/history_state.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:widgets/load_state_layout.dart';
 
 class HistoryState {
@@ -7,7 +8,7 @@ class HistoryState {
 
   String? keyword;
   bool? isLiked;
-  List<Map<String, dynamic>> list;
+  List<GarageSaleHistoryList> list;
 
 
   HistoryState({
@@ -25,7 +26,7 @@ class HistoryState {
     bool? isLiked,
     Map<String, dynamic>? activeSortMap,
     List<Map<String, dynamic>>? activeCateGoryList,
-    List<Map<String, dynamic>>? list,
+    List<GarageSaleHistoryList>? list,
   }) {
     return HistoryState(
       loadingState: loadingState ?? this.loadingState,

+ 36 - 160
packages/cpt_services/lib/modules/services/history/history_vm.dart

@@ -1,9 +1,11 @@
 
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
 import 'package:domain/entity/newsfeed_detail_entity.dart';
 import 'package:flutter/cupertino.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/ext/auto_router_extensions.dart';
 import 'package:shared/utils/log_utils.dart';
@@ -18,10 +20,10 @@ import 'history_state.dart';
 part 'history_vm.g.dart';
 
 @riverpod
-class HistoryVm extends _$HistoryVm {
+class HistoryVm extends _$HistoryVm with DioCancelableMixin{
   late ServicesRespository servicesRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
-  int _page = 1;  // 当前页
+  int _page = 1; // 当前页
   int _limit = 10; // 每页数量
   int _count = 0; // 总条数
 
@@ -33,8 +35,8 @@ class HistoryVm extends _$HistoryVm {
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
-    controlFinishRefresh: true,  //允许刷新
-    controlFinishLoad: true,   //允许加载
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
   );
 
   HistoryState initState() {
@@ -44,22 +46,20 @@ class HistoryVm extends _$HistoryVm {
   }
 
   @override
-  HistoryState build(){
+  HistoryState build() {
+    servicesRespositoryInstance = ref.read(servicesRespositoryProvider);
     // 引入数据仓库
     // servicesRespositoryInstance = ref.read(commonGarageRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
+    registerCancellation();
 
     return state;
   }
 
-
   //刷新页面状态
   void changeLoadingState(LoadState loadState, String? errorMsg) {
-    state = state.copyWith(
-        loadingState: loadState,
-        errorMessage: errorMsg
-    );
+    state = state.copyWith(loadingState: loadState, errorMessage: errorMsg);
   }
 
   // 初始化页面数据
@@ -75,7 +75,6 @@ class HistoryVm extends _$HistoryVm {
     getListData();
   }
 
-
   // 下拉刷新
   Future onRefresh() async {
     // 当前pageView 页面正处于显示状态
@@ -85,7 +84,6 @@ class HistoryVm extends _$HistoryVm {
     getListData();
   }
 
-
   // 手动进行刷新
   Future triggerRefresh() async {
     Log.d("trggerRefresh");
@@ -94,7 +92,7 @@ class HistoryVm extends _$HistoryVm {
 
   // 手动进行刷新
   Future directRefresh() async {
-    state = state.copyWith(list:[]);
+    state = state.copyWith(list: []);
     // 注意:由于 nestedscrollview 嵌套easyfresh 组件  refreshController.callRefresh() 自动刷新只能滚动顶部但是不会触发下拉刷新,这里调用是 用到了将其滚动到顶部的作用,进而刷新操作主动掉接口
     // https://github.com/xuelongqy/flutter_easy_refresh/issues/692
     refreshController.callRefresh();
@@ -104,7 +102,6 @@ class HistoryVm extends _$HistoryVm {
     getListData();
   }
 
-
   // 重试请求
   Future retryRequest() async {
     _page = 1;
@@ -112,195 +109,74 @@ class HistoryVm extends _$HistoryVm {
     getListData();
   }
 
-
   // 获取list 列表数据
   Future getListData<T>({bool? isLoadMore}) async {
     if (_needShowPlaceholder) {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    List<Map<String, dynamic>> list = [
-      {
-        'id':1,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 2,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-      {
-        'id':2,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 2,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-      {
-        'id':3,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 3,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-    ];
-    handlerResultData(true, list:list);
+    // 获取列表
+    var listResult = await servicesRespositoryInstance.fetchPaidServiceOrderList(
+      type: "history",
+      curPage: _page,
+      cancelToken: cancelToken,
+    );
 
-    // try {
-    //   //请求网络
-    //   Map<String, dynamic>  params = {
-    //     "type": 1,  // 类型(1=Sale,2=Rent)
-    //     "category_id": _queryParams['category_id'],
-    //     "keyword": _queryParams['keyword'],
-    //     "page": _page,
-    //     "limit": _limit,
-    //   };
-    //   Log.d("请求参数------$params");
-    //   final result = await servicesRespositoryInstance.fetchGarageDataList(params);
-    //   //校验成功失败
-    //   if (result.isSuccess) {
-    //     // handlerResultList((result.data as GarageSaleRentEntity).list as List<GarageSaleRentList>, isLoadMore ?? false);
-    //   } else {
-    //     String errorMessage = result.errorMsg!;
-    //     changeLoadingState(LoadState.State_Error, errorMessage);
-    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //   }
-    // } catch (e) {
-    //   ToastEngine.show("Error: $e");
-    // }
+    // 处理数据
+    if (listResult.isSuccess) {
+      handleList(listResult.data?.list);
+    } else {
+      changeLoadingState(LoadState.State_Error, listResult.errorMsg);
+    }
 
     // 最后赋值
     _needShowPlaceholder = false;
-
   }
 
-  handlerResultData(bool isList, {List<Map<String, dynamic>>? list, dynamic? data}){
-    Future.delayed(const Duration(seconds: 1)).then((value) {
-      if(isList){
-        // list 数据模式
-        if(list != null && list.isNotEmpty){
-          if(_page == 1){
-            state.list.clear();
-            state.list!.addAll(list);
-            refreshController.finishRefresh();
-            changeLoadingState(LoadState.State_Success, null);
-          }else {
-            final allList = state.list;
-            allList!.addAll(list);
-            state = state.copyWith(list: allList);
-            refreshController.finishLoad();
-          }
-        }else {
-          if(_page == 1){
-            state.list.clear();
-            changeLoadingState(LoadState.State_Empty, null);
-            refreshController.finishRefresh();
-          }else {
-            refreshController.finishLoad(IndicatorResult.noMore);
-          }
-        }
-      }else {
-        // 单个数据模式
-        if(data!=null){
-          if(_page == 1){
-            refreshController.finishRefresh();
-          }else{
-            refreshController.finishLoad();
-          }
-          changeLoadingState(LoadState.State_Success, null);
-        }else {
-          if(_page == 1){
-            refreshController.finishRefresh();
-          }else{
-            refreshController.finishLoad();
-          }
-          changeLoadingState(LoadState.State_Empty, null);
-        }
-      }
-    });
-  }
-
-  void handlerResultList(List<GarageSaleRentList>? list, bool isLoadMore) {
+  // 处理数据与展示的逻辑
+  void handleList(List<GarageSaleHistoryList>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (_page == 1) {
         //刷新的方式
-        state.list!.clear();
-        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        state = state.copyWith(list: list);
         refreshController.finishRefresh();
+
         //更新展示的状态
         changeLoadingState(LoadState.State_Success, null);
       } else {
         //加载更多
-        final allList = state.list;
-        allList!.addAll(list.map((item) => item.toJson()).toList());
-        state = state.copyWith(list: allList);
+        state.list.addAll(List<GarageSaleHistoryList>.from(state.list)..addAll(list));
         refreshController.finishLoad();
       }
     } else {
       if (_page == 1) {
         //展示无数据的布局
-        state.list!.clear();
+        state = state.copyWith(list: []);
         changeLoadingState(LoadState.State_Empty, null);
         refreshController.finishRefresh();
       } else {
         //展示加载完成,没有更多数据了
-        if (_page == 1) {
-          //展示无数据的布局
-          state.list!.clear();
-          changeLoadingState(LoadState.State_Empty, null);
-          refreshController.finishRefresh();
-        } else {
-          //展示加载完成,没有更多数据了
-          if(state.list!.length == 0){
-            changeLoadingState(LoadState.State_Empty, null);
-            refreshController.finishLoad();
-          }else {
-            if(_needShowPlaceholder){
-              changeLoadingState(LoadState.State_Success, null);
-            }
-          }
-          //更新展示的状态
-          refreshController.finishLoad(IndicatorResult.noMore);
-        }
+        refreshController.finishLoad(IndicatorResult.noMore);
       }
     }
   }
 
   // 设置当前的 _queryParams
-  setCurrentQueryParams(Map<String, dynamic> params){
+  setCurrentQueryParams(Map<String, dynamic> params) {
     _queryParams.addAll(params);
   }
 
   // 获取当前的 _queryParams
-  Map<String, dynamic> getCurrentQueryParams(String? key){
-    if(key!=null && key!.isNotEmpty){
+  Map<String, dynamic> getCurrentQueryParams(String? key) {
+    if (key != null && key!.isNotEmpty) {
       return _queryParams[key];
     }
     return _queryParams;
   }
 
-  // 去详情页面
-  gotoCleanOrderDetailPage(BuildContext context, int id, int serviceTypeCode, int serviesStatusCode){
-    CleanOrderDetailPage.startInstance(id: id, serviceTypeCode: serviceTypeCode, serviesStatusCode: serviesStatusCode);
+  //  去详情页面
+  gotoCleanOrderDetailPage(BuildContext context, int id, String cleanServiceType, int serviesStatusCode) {
+    CleanOrderDetailPage.startInstance(id: id, cleanServiceType: cleanServiceType, serviesStatusCode: serviesStatusCode);
   }
 }

+ 1 - 1
packages/cpt_services/lib/modules/services/history/history_vm.g.dart

@@ -6,7 +6,7 @@ part of 'history_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$historyVmHash() => r'7daa21f3939306d2fe0acd77338034567a104051';
+String _$historyVmHash() => r'89aa7cc56fe2bb8cf7a7a2d7087f3ca431417819';
 
 /// See also [HistoryVm].
 @ProviderFor(HistoryVm)

+ 1 - 1
packages/cpt_services/lib/modules/services/homeService/home_service_vm.g.dart

@@ -6,7 +6,7 @@ part of 'home_service_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$homeServiceVmHash() => r'ca30118e19c13cf4e1a38dd84d145f33321fb316';
+String _$homeServiceVmHash() => r'186dde40ced6727523baa7bce046d5ff436bd6c9';
 
 /// See also [HomeServiceVm].
 @ProviderFor(HomeServiceVm)

+ 22 - 33
packages/cpt_services/lib/modules/services/inProgress/in_progress_page.dart

@@ -1,4 +1,5 @@
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
@@ -38,14 +39,13 @@ class InProgressPage extends HookConsumerWidget {
     }
   }
 
-
   @override
   Widget build(BuildContext context, WidgetRef ref) {
     final vm = ref.read(inProgressVmProvider.notifier);
     final state = ref.watch(inProgressVmProvider);
     // final appConfigState = ref.watch(appConfigServiceProvider)
 
-    int serviceTypeCode = servicesConstants.servicesType['houseCleaning']?['code'];
+    String cleanServiceType = servicesConstants.servicesType['houseCleaning']?['code'];
     int serviceStatusCode = servicesConstants.servicesStatus['1']?['code'];
 
     useEffect(() {
@@ -71,12 +71,12 @@ class InProgressPage extends HookConsumerWidget {
             key: ValueKey('inProgress'),
             controller: vm.refreshController,
             // 上拉加载
-            onLoad: () async{
+            onLoad: () async {
               Log.d("----onLoad");
               vm.loadMore();
             },
             // 下拉刷新
-            onRefresh: () async{
+            onRefresh: () async {
               Log.d("----onRefresh");
               vm.onRefresh();
             },
@@ -86,23 +86,16 @@ class InProgressPage extends HookConsumerWidget {
               errorRetry: () {
                 vm.retryRequest();
               },
-              successSliverWidget:[
+              successSliverWidget: [
                 SliverList(
                   delegate: SliverChildBuilderDelegate(
-                        (context, index) {
-                      return  _buildInProgressItem(
-                          context,
-                          ref,
-                          state.list[index],
-                          vm,
-                          serviceTypeCode,
-                          serviceStatusCode
-                      ).onTap((){
+                    (context, index) {
+                      return _buildInProgressItem(context, ref, state.list[index], vm,  cleanServiceType, serviceStatusCode).onTap(() {
                         vm.gotoCleanOrderDetailPage(
-                            context,
-                            state.list?[index]['id'],
-                            serviceTypeCode,
-                            serviceStatusCode
+                          context,
+                          state.list[index].id != null ? int.tryParse(state.list[index].id!) ?? 0 : 0,
+                          cleanServiceType,
+                          serviceStatusCode,
                         );
                       });
                     },
@@ -111,12 +104,11 @@ class InProgressPage extends HookConsumerWidget {
                 )
               ],
             ),
-          ).marginOnly(left: 15,right: 15,top: 0,bottom: 15)
-      ),
+          ).marginOnly(left: 15, right: 15, top: 0, bottom: 15)),
     );
   }
 
-  Widget _buildInProgressItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int serviceTypeCode, int serviceStatusCode){
+  Widget _buildInProgressItem(BuildContext context, WidgetRef ref, GarageSaleHistoryList item, vm, String cleanServiceType, int serviceStatusCode) {
     return Container(
       margin: const EdgeInsets.only(top: 9),
       width: double.infinity,
@@ -132,18 +124,15 @@ class InProgressPage extends HookConsumerWidget {
         ],
       ),
       child: StausCardItem(
-          key: UniqueKey(),
-          cardHeight: 175.0,
-          serviceId: item['id'],
-          serviceTypeCode: serviceTypeCode,
-          serviceStatusCode: serviceStatusCode,
-          itemObj: item.cast<String, dynamic>(),
-          onClickCard: (dynamic value) async {
-            // Log.d("点击了喜欢按钮  --id:${item['id']}- $collectionValue");
-            // int id = item['id'];
-            // return await vm.handlerClickCollection(id, collectionValue);
-          },
+        key: UniqueKey(),
+        cardHeight: 175.0,
+        item: item,
+        onClickCard: (dynamic value) async {
+          // Log.d("点击了喜欢按钮  --id:${item['id']}- $collectionValue");
+          // int id = item['id'];
+          // return await vm.handlerClickCollection(id, collectionValue);
+        },
       ),
     );
   }
-}
+}

+ 3 - 2
packages/cpt_services/lib/modules/services/inProgress/in_progress_state.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:widgets/load_state_layout.dart';
 
 class InProgressState {
@@ -7,7 +8,7 @@ class InProgressState {
 
   String? keyword;
   bool? isLiked;
-  List<Map<String, dynamic>> list;
+  List<GarageSaleHistoryList> list;
 
 
   InProgressState({
@@ -25,7 +26,7 @@ class InProgressState {
     bool? isLiked,
     Map<String, dynamic>? activeSortMap,
     List<Map<String, dynamic>>? activeCateGoryList,
-    List<Map<String, dynamic>>? list,
+    List<GarageSaleHistoryList>? list,
   }) {
     return InProgressState(
       loadingState: loadingState ?? this.loadingState,

+ 36 - 162
packages/cpt_services/lib/modules/services/inProgress/in_progress_vm.dart

@@ -1,9 +1,10 @@
-
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
 import 'package:domain/entity/newsfeed_detail_entity.dart';
 import 'package:flutter/cupertino.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/ext/auto_router_extensions.dart';
 import 'package:shared/utils/log_utils.dart';
@@ -18,10 +19,10 @@ import 'in_progress_state.dart';
 part 'in_progress_vm.g.dart';
 
 @riverpod
-class InProgressVm extends _$InProgressVm {
+class InProgressVm extends _$InProgressVm with DioCancelableMixin {
   late ServicesRespository servicesRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
-  int _page = 1;  // 当前页
+  int _page = 1; // 当前页
   int _limit = 10; // 每页数量
   int _count = 0; // 总条数
 
@@ -33,8 +34,8 @@ class InProgressVm extends _$InProgressVm {
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
-    controlFinishRefresh: true,  //允许刷新
-    controlFinishLoad: true,   //允许加载
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
   );
 
   InProgressState initState() {
@@ -44,22 +45,19 @@ class InProgressVm extends _$InProgressVm {
   }
 
   @override
-  InProgressState build(){
+  InProgressState build() {
+    servicesRespositoryInstance = ref.read(servicesRespositoryProvider);
     // 引入数据仓库
     // servicesRespositoryInstance = ref.read(commonGarageRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
-
+    registerCancellation();
     return state;
   }
 
-
   //刷新页面状态
   void changeLoadingState(LoadState loadState, String? errorMsg) {
-    state = state.copyWith(
-        loadingState: loadState,
-        errorMessage: errorMsg
-    );
+    state = state.copyWith(loadingState: loadState, errorMessage: errorMsg);
   }
 
   // 初始化页面数据
@@ -75,7 +73,6 @@ class InProgressVm extends _$InProgressVm {
     getListData();
   }
 
-
   // 下拉刷新
   Future onRefresh() async {
     // 当前pageView 页面正处于显示状态
@@ -85,7 +82,6 @@ class InProgressVm extends _$InProgressVm {
     getListData();
   }
 
-
   // 手动进行刷新
   Future triggerRefresh() async {
     Log.d("trggerRefresh");
@@ -94,7 +90,7 @@ class InProgressVm extends _$InProgressVm {
 
   // 手动进行刷新
   Future directRefresh() async {
-    state = state.copyWith(list:[]);
+    state = state.copyWith(list: []);
     // 注意:由于 nestedscrollview 嵌套easyfresh 组件  refreshController.callRefresh() 自动刷新只能滚动顶部但是不会触发下拉刷新,这里调用是 用到了将其滚动到顶部的作用,进而刷新操作主动掉接口
     // https://github.com/xuelongqy/flutter_easy_refresh/issues/692
     refreshController.callRefresh();
@@ -104,7 +100,6 @@ class InProgressVm extends _$InProgressVm {
     getListData();
   }
 
-
   // 重试请求
   Future retryRequest() async {
     _page = 1;
@@ -112,195 +107,74 @@ class InProgressVm extends _$InProgressVm {
     getListData();
   }
 
-
   // 获取list 列表数据
   Future getListData<T>({bool? isLoadMore}) async {
     if (_needShowPlaceholder) {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    List<Map<String, dynamic>> list = [
-      {
-        'id':1,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 0,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-      {
-        'id':2,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 1,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-      {
-        'id':3,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 1,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-    ];
-    handlerResultData(true, list:list);
+    // 获取列表
+    var listResult = await servicesRespositoryInstance.fetchPaidServiceOrderList(
+      type: "in_progress",
+      curPage: _page,
+      cancelToken: cancelToken,
+    );
 
-    // try {
-    //   //请求网络
-    //   Map<String, dynamic>  params = {
-    //     "type": 1,  // 类型(1=Sale,2=Rent)
-    //     "category_id": _queryParams['category_id'],
-    //     "keyword": _queryParams['keyword'],
-    //     "page": _page,
-    //     "limit": _limit,
-    //   };
-    //   Log.d("请求参数------$params");
-    //   final result = await servicesRespositoryInstance.fetchGarageDataList(params);
-    //   //校验成功失败
-    //   if (result.isSuccess) {
-    //     // handlerResultList((result.data as GarageSaleRentEntity).list as List<GarageSaleRentList>, isLoadMore ?? false);
-    //   } else {
-    //     String errorMessage = result.errorMsg!;
-    //     changeLoadingState(LoadState.State_Error, errorMessage);
-    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //   }
-    // } catch (e) {
-    //   ToastEngine.show("Error: $e");
-    // }
+    // 处理数据
+    if (listResult.isSuccess) {
+      handleList(listResult.data?.list);
+    } else {
+      changeLoadingState(LoadState.State_Error, listResult.errorMsg);
+    }
 
     // 最后赋值
     _needShowPlaceholder = false;
-
   }
 
-  handlerResultData(bool isList, {List<Map<String, dynamic>>? list, dynamic? data}){
-    Future.delayed(const Duration(seconds: 1)).then((value) {
-      if(isList){
-        // list 数据模式
-        if(list != null && list.isNotEmpty){
-          if(_page == 1){
-            state.list.clear();
-            state.list!.addAll(list);
-            refreshController.finishRefresh();
-            changeLoadingState(LoadState.State_Success, null);
-          }else {
-            final allList = state.list;
-            allList!.addAll(list);
-            state = state.copyWith(list: allList);
-            refreshController.finishLoad();
-          }
-        }else {
-          if(_page == 1){
-            state.list.clear();
-            changeLoadingState(LoadState.State_Empty, null);
-            refreshController.finishRefresh();
-          }else {
-            refreshController.finishLoad(IndicatorResult.noMore);
-          }
-        }
-      }else {
-        // 单个数据模式
-        if(data!=null){
-          if(_page == 1){
-            refreshController.finishRefresh();
-          }else{
-            refreshController.finishLoad();
-          }
-          changeLoadingState(LoadState.State_Success, null);
-        }else {
-          if(_page == 1){
-            refreshController.finishRefresh();
-          }else{
-            refreshController.finishLoad();
-          }
-          changeLoadingState(LoadState.State_Empty, null);
-        }
-      }
-    });
-  }
-
-  void handlerResultList(List<GarageSaleRentList>? list, bool isLoadMore) {
+  // 处理数据与展示的逻辑
+  void handleList(List<GarageSaleHistoryList>? list) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (_page == 1) {
         //刷新的方式
-        state.list!.clear();
-        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        state = state.copyWith(list: list);
         refreshController.finishRefresh();
+
         //更新展示的状态
         changeLoadingState(LoadState.State_Success, null);
       } else {
         //加载更多
-        final allList = state.list;
-        allList!.addAll(list.map((item) => item.toJson()).toList());
-        state = state.copyWith(list: allList);
+        state.list.addAll(List<GarageSaleHistoryList>.from(state.list)..addAll(list));
         refreshController.finishLoad();
       }
     } else {
       if (_page == 1) {
         //展示无数据的布局
-        state.list!.clear();
+        state = state.copyWith(list: []);
         changeLoadingState(LoadState.State_Empty, null);
         refreshController.finishRefresh();
       } else {
         //展示加载完成,没有更多数据了
-        if (_page == 1) {
-          //展示无数据的布局
-          state.list!.clear();
-          changeLoadingState(LoadState.State_Empty, null);
-          refreshController.finishRefresh();
-        } else {
-          //展示加载完成,没有更多数据了
-          if(state.list!.length == 0){
-            changeLoadingState(LoadState.State_Empty, null);
-            refreshController.finishLoad();
-          }else {
-            if(_needShowPlaceholder){
-              changeLoadingState(LoadState.State_Success, null);
-            }
-          }
-          //更新展示的状态
-          refreshController.finishLoad(IndicatorResult.noMore);
-        }
+        refreshController.finishLoad(IndicatorResult.noMore);
       }
     }
   }
 
   // 设置当前的 _queryParams
-  setCurrentQueryParams(Map<String, dynamic> params){
+  setCurrentQueryParams(Map<String, dynamic> params) {
     _queryParams.addAll(params);
   }
 
   // 获取当前的 _queryParams
-  Map<String, dynamic> getCurrentQueryParams(String? key){
-    if(key!=null && key!.isNotEmpty){
+  Map<String, dynamic> getCurrentQueryParams(String? key) {
+    if (key != null && key!.isNotEmpty) {
       return _queryParams[key];
     }
     return _queryParams;
   }
 
   //  去详情页面
-  gotoCleanOrderDetailPage(BuildContext context, int id, int serviceTypeCode, int serviesStatusCode){
-    CleanOrderDetailPage.startInstance(id: id, serviceTypeCode: serviceTypeCode, serviesStatusCode: serviesStatusCode);
+  gotoCleanOrderDetailPage(BuildContext context, int id, String cleanServiceType, int serviesStatusCode) {
+    CleanOrderDetailPage.startInstance(id: id, cleanServiceType: cleanServiceType, serviesStatusCode: serviesStatusCode);
   }
-}
+}

+ 1 - 1
packages/cpt_services/lib/modules/services/inProgress/in_progress_vm.g.dart

@@ -6,7 +6,7 @@ part of 'in_progress_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$inProgressVmHash() => r'5d50f2614c4d5b64b5f713892202df78c5201fbb';
+String _$inProgressVmHash() => r'a68e56ab4116a9868f38b5389e1527bfc2453975';
 
 /// See also [InProgressVm].
 @ProviderFor(InProgressVm)

+ 5 - 5
packages/cpt_services/lib/modules/services/repair_history/history_page.dart

@@ -46,7 +46,7 @@ class RepairHistoryPage extends HookConsumerWidget {
     final state = ref.watch(repairHistoryVmProvider);
     // final appConfigState = ref.watch(appConfigServiceProvider)
 
-    int serviceTypeCode = servicesConstants.servicesType['houseCleaning']?['code'];
+    String cleanServiceType = servicesConstants.servicesType['houseCleaning']?['code'];
     int serviceStatusCode = servicesConstants.servicesStatus['2']?['code'];
 
 
@@ -97,13 +97,13 @@ class RepairHistoryPage extends HookConsumerWidget {
                           ref,
                           state.list[index],
                           vm,
-                          serviceTypeCode,
+                          cleanServiceType,
                           serviceStatusCode,
                       ).onTap((){
                         // vm.gotoCleanOrderDetailPage(
                         //   context,
                         //   state.list?[index]['id'],
-                        //   serviceTypeCode,
+                        //   cleanServiceType,
                         //   serviceStatusCode,
                         // );
                       });
@@ -118,7 +118,7 @@ class RepairHistoryPage extends HookConsumerWidget {
     );
   }
 
-  Widget _buildRepairHistoryItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int serviceTypeCode, int serviceStatusCode){
+  Widget _buildRepairHistoryItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, String cleanServiceType, int serviceStatusCode){
     return Container(
       margin: const EdgeInsets.only(top: 9),
       width: double.infinity,
@@ -137,7 +137,7 @@ class RepairHistoryPage extends HookConsumerWidget {
         key: UniqueKey(),
         cardHeight: 150.0,
         serviceId: item['id'],
-        serviceTypeCode: serviceTypeCode,
+        cleanServiceType: cleanServiceType,
         serviceStatusCode: serviceStatusCode,
         itemObj: item.cast<String, dynamic>(),
         onClickCard: (dynamic value) async {

+ 2 - 2
packages/cpt_services/lib/modules/services/repair_history/history_vm.dart

@@ -300,7 +300,7 @@ class RepairHistoryVm extends _$RepairHistoryVm {
   }
 
   // 去详情页面
-  gotoCleanOrderDetailPage(BuildContext context, int id, int serviceTypeCode, int serviesStatusCode){
-    CleanOrderDetailPage.startInstance(id: id, serviceTypeCode: serviceTypeCode, serviesStatusCode: serviesStatusCode);
+  gotoCleanOrderDetailPage(BuildContext context, int id, String cleanServiceType, int serviesStatusCode){
+    CleanOrderDetailPage.startInstance(id: id, cleanServiceType: cleanServiceType, serviesStatusCode: serviesStatusCode);
   }
 }

+ 1 - 1
packages/cpt_services/lib/modules/services/repair_history/history_vm.g.dart

@@ -6,7 +6,7 @@ part of 'history_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$repairHistoryVmHash() => r'7fb8210db1b83da486f20091c58452a3c9e3d7a2';
+String _$repairHistoryVmHash() => r'0efc4fce87cd9f6fd4a3946d43b3cacef966aa00';
 
 /// See also [RepairHistoryVm].
 @ProviderFor(RepairHistoryVm)

+ 5 - 5
packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_page.dart

@@ -46,7 +46,7 @@ class RepairInProgressPage extends HookConsumerWidget {
     final state = ref.watch(repairInProgressVmProvider);
     // final appConfigState = ref.watch(appConfigServiceProvider)
 
-    int serviceTypeCode = servicesConstants.servicesType['houseCleaning']?['code'];
+    String cleanServiceType = servicesConstants.servicesType['houseCleaning']?['code'];
     int serviceStatusCode = servicesConstants.servicesStatus['1']?['code'];
 
     useEffect(() {
@@ -96,13 +96,13 @@ class RepairInProgressPage extends HookConsumerWidget {
                           ref,
                           state.list[index],
                           vm,
-                          serviceTypeCode,
+                          cleanServiceType,
                           serviceStatusCode
                       ).onTap((){
                         // vm.gotoCleanOrderDetailPage(
                         //     context,
                         //     state.list?[index]['id'],
-                        //     serviceTypeCode,
+                        //     cleanServiceType,
                         //     serviceStatusCode
                         // );
                       });
@@ -117,7 +117,7 @@ class RepairInProgressPage extends HookConsumerWidget {
     );
   }
 
-  Widget _buildRepairInProgressItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int serviceTypeCode, int serviceStatusCode){
+  Widget _buildRepairInProgressItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, String cleanServiceType, int serviceStatusCode){
     return Container(
       margin: const EdgeInsets.only(top: 9),
       width: double.infinity,
@@ -136,7 +136,7 @@ class RepairInProgressPage extends HookConsumerWidget {
           key: UniqueKey(),
           cardHeight: 120.0,
           serviceId: item['id'],
-          serviceTypeCode: serviceTypeCode,
+          cleanServiceType: cleanServiceType,
           serviceStatusCode: serviceStatusCode,
           itemObj: item.cast<String, dynamic>(),
           onClickCard: (dynamic value) async {

+ 2 - 2
packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_vm.dart

@@ -300,7 +300,7 @@ class RepairInProgressVm extends _$RepairInProgressVm {
   }
 
   //  去详情页面
-  gotoCleanOrderDetailPage(BuildContext context, int id, int serviceTypeCode, int serviesStatusCode){
-    CleanOrderDetailPage.startInstance(id: id, serviceTypeCode: serviceTypeCode, serviesStatusCode: serviesStatusCode);
+  gotoCleanOrderDetailPage(BuildContext context, int id, String cleanServiceType, int serviesStatusCode){
+    CleanOrderDetailPage.startInstance(id: id, cleanServiceType: cleanServiceType, serviesStatusCode: serviesStatusCode);
   }
 }

+ 1 - 1
packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_vm.g.dart

@@ -7,7 +7,7 @@ part of 'in_progress_vm.dart';
 // **************************************************************************
 
 String _$repairInProgressVmHash() =>
-    r'1b61f6edc843e3f96e1125ef2f82a7e1c64e8bef';
+    r'a35790c3e5285086a1bf7792c6c7d3c704e4bfa9';
 
 /// See also [RepairInProgressVm].
 @ProviderFor(RepairInProgressVm)

+ 7 - 6
packages/cpt_services/lib/modules/services/service_evaluate_create/service_evaluate_create_page.dart

@@ -31,19 +31,19 @@ import 'service_evaluate_create_vm.dart';
 @RoutePage()
 class ServiceEvaluateCreatePage extends HookConsumerWidget {
   final int id;
-  final int serviceTypeCode;
+  final String cleanServiceType;
   const ServiceEvaluateCreatePage({
     Key? key,
     required this.id,
-    required this.serviceTypeCode,
+    required this.cleanServiceType,
   }) : super(key: key);
 
   //启动当前页面
-  static void startInstance({BuildContext? context, required int id, required int serviceTypeCode}) {
+  static void startInstance({BuildContext? context, required int id, required String cleanServiceType}) {
     if (context != null) {
-      context.router.push(ServiceEvaluateCreatePageRoute(id: id, serviceTypeCode: serviceTypeCode));
+      context.router.push(ServiceEvaluateCreatePageRoute(id: id, cleanServiceType: cleanServiceType));
     } else {
-      appRouter.push(ServiceEvaluateCreatePageRoute(id:id, serviceTypeCode: serviceTypeCode));
+      appRouter.push(ServiceEvaluateCreatePageRoute(id:id, cleanServiceType: cleanServiceType));
     }
   }
 
@@ -58,7 +58,7 @@ class ServiceEvaluateCreatePage extends HookConsumerWidget {
 
     useEffect(() {
       // 组件挂载时执行 - 执行接口请求
-      Future.microtask(() => vm.initPageData());
+      Future.microtask(() => vm.initPageData(id: id));
       return () {
         // 组件卸载时执行
       };
@@ -302,6 +302,7 @@ class ServiceEvaluateCreatePage extends HookConsumerWidget {
             expands: true,
             onChanged: (text) {
               // 当文本改变时,更新字符数量
+              vm.setNotes(context, text);
               noteCount.value = text.length;
             },
           ),

+ 36 - 8
packages/cpt_services/lib/modules/services/service_evaluate_create/service_evaluate_create_vm.dart

@@ -58,6 +58,7 @@ class ServiceEvaluateCreateVm extends _$ServiceEvaluateCreateVm {
   @override
   ServiceEvaluateCreateState build() {
     // 初始化状态
+    servicesRespositoryInstance = ref.read(servicesRespositoryProvider);
     ServiceEvaluateCreateState state = initState();
 
     // 当前渲染完成后执行一次
@@ -85,7 +86,8 @@ class ServiceEvaluateCreateVm extends _$ServiceEvaluateCreateVm {
     _serviceTypeCode = serviceTypeCode;
   }
   // 初始化页面数据
-  initPageData() {
+  initPageData({int? id,}) {
+    _id = id;
     // changeLoadingState(LoadState.State_Success, null);
 
     // onRefresh();
@@ -468,12 +470,38 @@ class ServiceEvaluateCreateVm extends _$ServiceEvaluateCreateVm {
   setScore(BuildContext context, double score){
     state = state.copyWith(score: score);
   }
-
-  handlerEvaluateSubmit(BuildContext context,){
-    Log.d("handlerEvaluateSubmit");
-    context.appRouter.pushAndPopUntil(const EvaluateCreateSuccessPageRoute(), predicate: (Route<dynamic> route) {       // 根据具体条件返回 true 或 false
-      // Log.d("888 ${route.settings}");
-      return route.settings.name != 'ServiceEvaluateCreatePageRoute';
-    });
+  setNotes(BuildContext context, String notes){
+    state = state.copyWith(notes: notes);
+  }
+  handlerEvaluateSubmit(BuildContext context,) async {
+     try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "order_id": _id,
+        "score": state.score??5.0,
+        "comment":state.notes,
+        "resources": state.imgList,
+      };
+      Log.d("请求参数------$params");
+      final result = await servicesRespositoryInstance.fetchPublishEvaluation(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        Log.d("handlerEvaluateSubmit");
+        context.appRouter
+            .pushAndPopUntil(const EvaluateCreateSuccessPageRoute(),
+                predicate: (Route<dynamic> route) {
+          // 根据具体条件返回 true 或 false
+          // Log.d("888 ${route.settings}");
+          return route.settings.name != 'ServiceEvaluateCreatePageRoute';
+        });
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+    
   }
 }

+ 1 - 1
packages/cpt_services/lib/modules/services/service_evaluate_create/service_evaluate_create_vm.g.dart

@@ -7,7 +7,7 @@ part of 'service_evaluate_create_vm.dart';
 // **************************************************************************
 
 String _$serviceEvaluateCreateVmHash() =>
-    r'e3dcc7851836ad14ed970e2f4d5cc0482c71efcb';
+    r'4076871c4476ccd72aa607ef8e83e3925d25a789';
 
 /// See also [ServiceEvaluateCreateVm].
 @ProviderFor(ServiceEvaluateCreateVm)

+ 7 - 7
packages/cpt_services/lib/modules/services/service_evaluate_list/service_evaluate_list_page.dart

@@ -54,7 +54,7 @@ class ServiceEvaluateListPage extends HookConsumerWidget {
 
     useEffect(() {
       // 组件挂载时执行 - 执行接口请求
-      Future.microtask(() => vm.initPageData());
+      Future.microtask(() => vm.initPageData(id: id));
       return () {
         // 组件卸载时执行
         Log.d("serviceEvaluateList_page 组件卸载时执行");
@@ -107,11 +107,11 @@ class ServiceEvaluateListPage extends HookConsumerWidget {
   }
 
   Widget _buildserviceEvaluateListItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm){
-    String card_name = item?['name']?? "User Sandy";
-    String card_avatar = item?['avatar']?? "";
-    double card_score = item?['score']?? 5.0;
-    String card_created_at = item?['card_created_at']?? "14 Oct 2024 15:00";
-    String card_content = item.getValue("content", "This aunt is very careful because I haven't been home for three or four months. The house is");
+    String card_name = item?['account']['name']?? "User Sandy";
+    String card_avatar = item?['account']['avatar']?? "";
+    int card_score = item?['score']?? 5.0;
+    String card_created_at = item?['created_at']?? "14 Oct 2024 15:00";
+    String card_content = item?['comment']??"";
     List? card_resources = item.getValue<List>("resources", [])?? [];
     return Container(
       margin: const EdgeInsets.only(top: 10),
@@ -133,7 +133,7 @@ class ServiceEvaluateListPage extends HookConsumerWidget {
           key: UniqueKey(),
           name: card_name,
           avator: card_avatar,
-          score: card_score,
+          score: card_score.toDouble(),
           time: card_created_at,
           content: card_content,
           contentTextMaxLines: 9999,

+ 111 - 125
packages/cpt_services/lib/modules/services/service_evaluate_list/service_evaluate_list_vm.dart

@@ -1,7 +1,7 @@
-
 import 'package:cs_resources/generated/assets.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
 import 'package:domain/entity/newsfeed_detail_entity.dart';
+import 'package:domain/entity/service_evaluate_list_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -20,50 +20,40 @@ part 'service_evaluate_list_vm.g.dart';
 class ServiceEvaluateListVm extends _$ServiceEvaluateListVm {
   late ServicesRespository servicesRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
-  int _page = 1;  // 当前页
+  int _page = 1; // 当前页
   int _limit = 10; // 每页数量
   int _count = 0; // 总条数
-
-  Map<String, dynamic> _queryParams = {
-    'category_id': null,
-    'keyword': null,
-    'is_liked': null,
-  };
+  int serviceId = 0;
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
-    controlFinishRefresh: true,  //允许刷新
-    controlFinishLoad: true,   //允许加载
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
   );
 
   ServiceEvaluateListState initState() {
-    return ServiceEvaluateListState(
-        list: []
-    );
+    return ServiceEvaluateListState(list: []);
   }
 
   @override
-  ServiceEvaluateListState build(){
+  ServiceEvaluateListState build() {
     // 引入数据仓库
-    // servicesRespositoryInstance = ref.read(commonGarageRespositoryProvider);
+    servicesRespositoryInstance = ref.read(servicesRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
     return state;
   }
 
-
   //刷新页面状态
   void changeLoadingState(LoadState loadState, String? errorMsg) {
-    state = state.copyWith(
-        loadingState: loadState,
-        errorMessage: errorMsg
-    );
+    state = state.copyWith(loadingState: loadState, errorMessage: errorMsg);
   }
 
   // 初始化页面数据
-  initPageData() {
+  initPageData({int? id}) {
     Log.d("----home_service_vm-----initPageData   ${state.loadingState}");
+    serviceId = id!;
     onRefresh();
   }
 
@@ -74,7 +64,6 @@ class ServiceEvaluateListVm extends _$ServiceEvaluateListVm {
     getListData();
   }
 
-
   // 下拉刷新
   Future onRefresh() async {
     // 当前pageView 页面正处于显示状态
@@ -84,7 +73,6 @@ class ServiceEvaluateListVm extends _$ServiceEvaluateListVm {
     getListData();
   }
 
-
   // 手动进行刷新
   Future triggerRefresh() async {
     Log.d("trggerRefresh");
@@ -93,7 +81,7 @@ class ServiceEvaluateListVm extends _$ServiceEvaluateListVm {
 
   // 手动进行刷新
   Future directRefresh() async {
-    state = state.copyWith(list:[]);
+    state = state.copyWith(list: []);
     // 注意:由于 nestedscrollview 嵌套easyfresh 组件  refreshController.callRefresh() 自动刷新只能滚动顶部但是不会触发下拉刷新,这里调用是 用到了将其滚动到顶部的作用,进而刷新操作主动掉接口
     // https://github.com/xuelongqy/flutter_easy_refresh/issues/692
     refreshController.callRefresh();
@@ -103,7 +91,6 @@ class ServiceEvaluateListVm extends _$ServiceEvaluateListVm {
     getListData();
   }
 
-
   // 重试请求
   Future retryRequest() async {
     _page = 1;
@@ -111,125 +98,123 @@ class ServiceEvaluateListVm extends _$ServiceEvaluateListVm {
     getListData();
   }
 
-
   // 获取list 列表数据
   Future getListData<T>({bool? isLoadMore}) async {
     if (_needShowPlaceholder) {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    List<Map<String, dynamic>> list = [
-      {
-        'id':1,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 2,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-      {
-        'id':2,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 2,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-      {
-        'id':3,
-        'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
-        'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-        'title': 'House Cleaning Services',
-        'duration': 'Daily cleaning for 2 hours',
-        'totalPrice': 66,
-        'visit_time': '14 0ct 2024 15:00',
-        'order_time': '13 0ct 2024 12:00',
-        'status_text': 'In Progress',
-        'status_code': 3,
-        'company_name': 'HONG YE GROUP PTE LTD',
-      },
-    ];
-    handlerResultData(true, list:list);
+    // List<Map<String, dynamic>> list = [
+    //   {
+    //     'id':1,
+    //     'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
+    //     'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
+    //     'title': 'House Cleaning Services',
+    //     'duration': 'Daily cleaning for 2 hours',
+    //     'totalPrice': 66,
+    //     'visit_time': '14 0ct 2024 15:00',
+    //     'order_time': '13 0ct 2024 12:00',
+    //     'status_text': 'In Progress',
+    //     'status_code': 2,
+    //     'company_name': 'HONG YE GROUP PTE LTD',
+    //   },
+    //   {
+    //     'id':2,
+    //     'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
+    //     'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
+    //     'title': 'House Cleaning Services',
+    //     'duration': 'Daily cleaning for 2 hours',
+    //     'totalPrice': 66,
+    //     'visit_time': '14 0ct 2024 15:00',
+    //     'order_time': '13 0ct 2024 12:00',
+    //     'status_text': 'In Progress',
+    //     'status_code': 2,
+    //     'company_name': 'HONG YE GROUP PTE LTD',
+    //   },
+    //   {
+    //     'id':3,
+    //     'service_type': 0,  // 0 房屋保洁 1 空调保洁  2 维修
+    //     'cover_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'resources': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
+    //     'title': 'House Cleaning Services',
+    //     'duration': 'Daily cleaning for 2 hours',
+    //     'totalPrice': 66,
+    //     'visit_time': '14 0ct 2024 15:00',
+    //     'order_time': '13 0ct 2024 12:00',
+    //     'status_text': 'In Progress',
+    //     'status_code': 3,
+    //     'company_name': 'HONG YE GROUP PTE LTD',
+    //   },
+    // ];
+    // handlerResultData(true, list:list);
 
-    // try {
-    //   //请求网络
-    //   Map<String, dynamic>  params = {
-    //     "type": 1,  // 类型(1=Sale,2=Rent)
-    //     "category_id": _queryParams['category_id'],
-    //     "keyword": _queryParams['keyword'],
-    //     "page": _page,
-    //     "limit": _limit,
-    //   };
-    //   Log.d("请求参数------$params");
-    //   final result = await servicesRespositoryInstance.fetchGarageDataList(params);
-    //   //校验成功失败
-    //   if (result.isSuccess) {
-    //     // handlerResultList((result.data as GarageSaleRentEntity).list as List<GarageSaleRentList>, isLoadMore ?? false);
-    //   } else {
-    //     String errorMessage = result.errorMsg!;
-    //     changeLoadingState(LoadState.State_Error, errorMessage);
-    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //   }
-    // } catch (e) {
-    //   ToastEngine.show("Error: $e");
-    // }
+    try {
+      //请求网络
+      Map<String, dynamic> params = {
+        "service_id":serviceId,
+        "page": _page,
+        "limit": _limit,
+      };
+      Log.d("请求参数------$params");
+      final result =
+          await servicesRespositoryInstance.fetchEvaluationDataList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList((result.data as ServiceEvaluateListEntity).list, isLoadMore ?? false);
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
 
     // 最后赋值
     _needShowPlaceholder = false;
-
   }
 
-  handlerResultData(bool isList, {List<Map<String, dynamic>>? list, dynamic? data}){
+  handlerResultData(bool isList,
+      {List<Map<String, dynamic>>? list, dynamic? data}) {
     Future.delayed(const Duration(seconds: 1)).then((value) {
-      if(isList){
+      if (isList) {
         // list 数据模式
-        if(list != null && list.isNotEmpty){
-          if(_page == 1){
+        if (list != null && list.isNotEmpty) {
+          if (_page == 1) {
             state.list.clear();
             state.list!.addAll(list);
             refreshController.finishRefresh();
             changeLoadingState(LoadState.State_Success, null);
-          }else {
+          } else {
             final allList = state.list;
             allList!.addAll(list);
             state = state.copyWith(list: allList);
             refreshController.finishLoad();
           }
-        }else {
-          if(_page == 1){
+        } else {
+          if (_page == 1) {
             state.list.clear();
             changeLoadingState(LoadState.State_Empty, null);
             refreshController.finishRefresh();
-          }else {
+          } else {
             refreshController.finishLoad(IndicatorResult.noMore);
           }
         }
-      }else {
+      } else {
         // 单个数据模式
-        if(data!=null){
-          if(_page == 1){
+        if (data != null) {
+          if (_page == 1) {
             refreshController.finishRefresh();
-          }else{
+          } else {
             refreshController.finishLoad();
           }
           changeLoadingState(LoadState.State_Success, null);
-        }else {
-          if(_page == 1){
+        } else {
+          if (_page == 1) {
             refreshController.finishRefresh();
-          }else{
+          } else {
             refreshController.finishLoad();
           }
           changeLoadingState(LoadState.State_Empty, null);
@@ -238,7 +223,7 @@ class ServiceEvaluateListVm extends _$ServiceEvaluateListVm {
     });
   }
 
-  void handlerResultList(List<GarageSaleRentList>? list, bool isLoadMore) {
+  void handlerResultList(List<ServiceEvaluateListList>? list, bool isLoadMore) {
     if (list != null && list.isNotEmpty) {
       //有数据,判断是刷新还是加载更多的数据
       if (_page == 1) {
@@ -270,11 +255,11 @@ class ServiceEvaluateListVm extends _$ServiceEvaluateListVm {
           refreshController.finishRefresh();
         } else {
           //展示加载完成,没有更多数据了
-          if(state.list!.length == 0){
+          if (state.list!.length == 0) {
             changeLoadingState(LoadState.State_Empty, null);
             refreshController.finishLoad();
-          }else {
-            if(_needShowPlaceholder){
+          } else {
+            if (_needShowPlaceholder) {
               changeLoadingState(LoadState.State_Success, null);
             }
           }
@@ -286,21 +271,22 @@ class ServiceEvaluateListVm extends _$ServiceEvaluateListVm {
   }
 
   // 设置当前的 _queryParams
-  setCurrentQueryParams(Map<String, dynamic> params){
-    _queryParams.addAll(params);
-  }
+  // setCurrentQueryParams(Map<String, dynamic> params) {
+  //   _queryParams.addAll(params);
+  // }
 
-  // 获取当前的 _queryParams
-  Map<String, dynamic> getCurrentQueryParams(String? key){
-    if(key!=null && key!.isNotEmpty){
-      return _queryParams[key];
-    }
-    return _queryParams;
-  }
+  // // 获取当前的 _queryParams
+  // Map<String, dynamic> getCurrentQueryParams(String? key) {
+  //   if (key != null && key!.isNotEmpty) {
+  //     return _queryParams[key];
+  //   }
+  //   return _queryParams;
+  // }
 
   // 去详情页面
-  void handlerGotoDetail({BuildContext? context, required int id, String type='forSale'}){
+  void handlerGotoDetail(
+      {BuildContext? context, required int id, String type = 'forSale'}) {
     Log.d("去详情页面");
     // appRouter.push(GaragesaleDetailPageRoute(id: id, type: 'forSale'));
   }
-}
+}

+ 1 - 1
packages/cpt_services/lib/modules/services/service_evaluate_list/service_evaluate_list_vm.g.dart

@@ -7,7 +7,7 @@ part of 'service_evaluate_list_vm.dart';
 // **************************************************************************
 
 String _$serviceEvaluateListVmHash() =>
-    r'4831a4f18812eba560c1d2c008a8c8c1766f93b3';
+    r'ca4e3fa5efaf52a15ee7505769b887eba5f465b4';
 
 /// See also [ServiceEvaluateListVm].
 @ProviderFor(ServiceEvaluateListVm)

+ 159 - 144
packages/cpt_services/lib/modules/services/service_repair_detail/service_repair_detail_page.dart

@@ -3,6 +3,7 @@ import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
+import 'package:domain/entity/service_repair_detail_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:flutter_hooks/flutter_hooks.dart';
@@ -33,37 +34,47 @@ class ServiceRepairDetailPage extends HookConsumerWidget {
   final int id;
   final int serviceTypeCode;
 
-  const ServiceRepairDetailPage({Key? key,@PathParam('id') required this.id, @PathParam('serviceTypeCode') required this.serviceTypeCode}) : super(key: key);
+  const ServiceRepairDetailPage(
+      {Key? key,
+      @PathParam('id') required this.id,
+      @PathParam('serviceTypeCode') required this.serviceTypeCode})
+      : super(key: key);
   // 启动当前页面
-  static void startInstance({BuildContext? context, int? id, int? serviceTypeCode = 0}) {
+  static void startInstance(
+      {BuildContext? context, int? id, int? serviceTypeCode = 0}) {
     if (context != null) {
-      context.router.push(ServiceRepairDetailPageRoute(id: id!, serviceTypeCode: serviceTypeCode!));
+      context.router.push(ServiceRepairDetailPageRoute(
+          id: id!, serviceTypeCode: serviceTypeCode!));
     } else {
-      appRouter.push(ServiceRepairDetailPageRoute(id: id!, serviceTypeCode: serviceTypeCode!));
+      appRouter.push(ServiceRepairDetailPageRoute(
+          id: id!, serviceTypeCode: serviceTypeCode!));
     }
   }
 
-
   @override
   Widget build(BuildContext context, WidgetRef ref) {
     final state = ref.watch(serviceRepairDetailVmProvider);
     final vm = ref.read(serviceRepairDetailVmProvider.notifier);
     final String pageTitle = 'Repair Details';
 
-    Map<String, dynamic>? detailInfo = state.datas?? {};
+    ServiceRepairDetailEntity? detailInfo =
+        (state.datas ?? {}) as ServiceRepairDetailEntity?;
 
-    String contactType =  detailInfo?['contact']??'';
+    // String contactType =  detailInfo?['contact']??'';
 
     String description = '';
 
-    useEffect((){
-      vm.setInitPageData(id: id, serviceTypeCode: serviceTypeCode,);
+    useEffect(() {
+      vm.setInitPageData(
+        id: id,
+        serviceTypeCode: serviceTypeCode,
+      );
       // 组件挂载时执行 - 执行接口请求
       Future.microtask(() => vm.initPageData());
       return () {
         // 组件卸载时执行
       };
-    },[]);
+    }, []);
 
     return Scaffold(
       appBar: MyAppBar.appBar(
@@ -80,38 +91,34 @@ class ServiceRepairDetailPage extends HookConsumerWidget {
               // 上拉加载
               onLoad: null,
               // 下拉刷新
-              onRefresh: () async{
+              onRefresh: () async {
                 Log.d("----onRefresh");
                 vm.onRefresh();
               },
               // header: MaterialHeader(),
-              child: Stack(
-                  children:[
-                    LoadStateLayout(
-                      state: state.loadingState,
-                      errorMessage: state.errorMessage,
-                      errorRetry: () {
-                        vm.retryRequest();
-                      },
-                      // successWidget: SingleChildScrollView(
-                      //   scrollDirection: Axis.vertical,
-                      //   physics: const BouncingScrollPhysics(),
-                      //   clipBehavior: Clip.none,
-                      //   child: _buildContentBox(context, ref, detailInfo,),
-                      // ),
-                      successSliverWidget: [
-                        SliverList(
-                          delegate: SliverChildBuilderDelegate(
-                                  (context, index){
-                                return _buildContentBox(context, ref, detailInfo!, state, vm);
-                              },
-                              childCount: 1
-                          ),
-                        )
-                      ],
-                    ),
-                  ]
-              ),
+              child: Stack(children: [
+                LoadStateLayout(
+                  state: state.loadingState,
+                  errorMessage: state.errorMessage,
+                  errorRetry: () {
+                    vm.retryRequest();
+                  },
+                  // successWidget: SingleChildScrollView(
+                  //   scrollDirection: Axis.vertical,
+                  //   physics: const BouncingScrollPhysics(),
+                  //   clipBehavior: Clip.none,
+                  //   child: _buildContentBox(context, ref, detailInfo,),
+                  // ),
+                  successSliverWidget: [
+                    SliverList(
+                      delegate: SliverChildBuilderDelegate((context, index) {
+                        return _buildContentBox(
+                            context, ref, detailInfo, state, vm);
+                      }, childCount: 1),
+                    )
+                  ],
+                ),
+              ]),
             ),
           ),
         ],
@@ -119,93 +126,99 @@ class ServiceRepairDetailPage extends HookConsumerWidget {
     );
   }
 
-
-  Widget _buildContentBox(BuildContext context, WidgetRef ref, Map<String, dynamic>? detailInfo, ServiceRepairDetailState state, ServiceRepairDetailVm vm) {
+  Widget _buildContentBox(
+      BuildContext context,
+      WidgetRef ref,
+      ServiceRepairDetailEntity? detailInfo,
+      ServiceRepairDetailState state,
+      ServiceRepairDetailVm vm) {
     // List<String> resources = detailInfo?['resources'].cast<String>()??[];
-    // String title =  detailInfo?['title']??'';
-    double score = detailInfo?['score']?? 5.0;
+    String title = detailInfo?.name ?? '';
+    double score = 5.0;
     // String description = detailInfo?['description']??'';
 
-    return Column(
+    return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
+      Column(
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
+          //  评分
           Column(
-            crossAxisAlignment: CrossAxisAlignment.start,
             children: [
-              //  评分
-              Column(
-                children: [
-                  Container(
-                    width: double.infinity,
-                    padding: const EdgeInsets.only(left: 16, right: 16, top: 16,bottom: 16),
-                    color: context.appColors.whiteBG,
-                    child: Column(
-                      crossAxisAlignment: CrossAxisAlignment.start,
-                      children: [
-                        MyTextView(
-                          "House Cleaning Services",
-                          textColor: context.appColors.textBlack,
-                          fontSize: 18,
-                          isFontBold: true,
-                          marginBottom: 5,
-                        ),
-                        Row(
-                          mainAxisAlignment: MainAxisAlignment.start,
-                          crossAxisAlignment: CrossAxisAlignment.center,
-                          children: [
-                            AnimatedRatingStars(
-                              initialRating: score,
-                              onChanged: (rating) {
-                              },
-                              readOnly: true,
-                              displayRatingValue: true, // Display the rating value
-                              interactiveTooltips: true, // Allow toggling half-star state
-                              customFilledIcon: Icons.star,
-                              customHalfFilledIcon: Icons.star_half,
-                              customEmptyIcon: Icons.star_border,
-                              filledColor: ColorUtils.string2Color("#FF0000"),
-                              starSize: 16.5,
-                              animationDuration: const Duration(milliseconds: 0),
-                              animationCurve: Curves.easeInOut,
-                            ),
-                            MyTextView(
-                              "${score}",
-                              textColor: context.appColors.textBlack,
-                              fontSize: 16,
-                              isFontMedium: true,
-                              marginLeft: 15,
-                            ),
-                          ],
-                        ),
-                        MyTextView(
-                          "HONG YE GROUP PTE LTD",
-                          textColor: context.appColors.textDarkGray999,
-                          fontSize: 12,
-                          isFontRegular: true,
-                          marginTop: 10,
-                          marginBottom: 5,
-                        ),
-                      ],
-                    ),
-                  ),
-                ],
-              ),
-              // profile信息
               Container(
                 width: double.infinity,
-                margin: const EdgeInsets.only(left: 0, right: 0, top: 5, bottom: 0),
-                padding: const EdgeInsets.only(left: 10, right: 10, top: 18.5, bottom: 18.5),
-                decoration: BoxDecoration(
-                  color: context.appColors.whiteBG,
+                padding: const EdgeInsets.only(
+                    left: 16, right: 16, top: 16, bottom: 16),
+                color: context.appColors.whiteBG,
+                child: Column(
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  children: [
+                    MyTextView(
+                      title,
+                      textColor: context.appColors.textBlack,
+                      fontSize: 18,
+                      isFontBold: true,
+                      marginBottom: 5,
+                    ),
+                    // Row(
+                    //   mainAxisAlignment: MainAxisAlignment.start,
+                    //   crossAxisAlignment: CrossAxisAlignment.center,
+                    //   children: [
+                    //     AnimatedRatingStars(
+                    //       initialRating: score,
+                    //       onChanged: (rating) {
+                    //       },
+                    //       readOnly: true,
+                    //       displayRatingValue: true, // Display the rating value
+                    //       interactiveTooltips: true, // Allow toggling half-star state
+                    //       customFilledIcon: Icons.star,
+                    //       customHalfFilledIcon: Icons.star_half,
+                    //       customEmptyIcon: Icons.star_border,
+                    //       filledColor: ColorUtils.string2Color("#FF0000"),
+                    //       starSize: 16.5,
+                    //       animationDuration: const Duration(milliseconds: 0),
+                    //       animationCurve: Curves.easeInOut,
+                    //     ),
+                    //     MyTextView(
+                    //       "${score}",
+                    //       textColor: context.appColors.textBlack,
+                    //       fontSize: 16,
+                    //       isFontMedium: true,
+                    //       marginLeft: 15,
+                    //     ),
+                    //   ],
+                    // ),
+                    detailInfo?.name != ''
+                        ? MyTextView(
+                            detailInfo?.merchant.name ?? '',
+                            textColor: context.appColors.textDarkGray999,
+                            fontSize: 12,
+                            isFontRegular: true,
+                            marginTop: 10,
+                            marginBottom: 5,
+                          )
+                        : Container(),
+                  ],
                 ),
-                child: _buildOrderProfile(context, state, vm),
               ),
-              // quote 按钮
-              Container(
-                width: double.infinity,
-                padding: const EdgeInsets.only(left: 16, right: 16, top: 20,bottom: 20),
-                color: Colors.transparent,
-                child: Column(
+            ],
+          ),
+          // profile信息
+          // Container(
+          //   width: double.infinity,
+          //   margin: const EdgeInsets.only(left: 0, right: 0, top: 5, bottom: 0),
+          //   padding: const EdgeInsets.only(left: 10, right: 10, top: 18.5, bottom: 18.5),
+          //   decoration: BoxDecoration(
+          //     color: context.appColors.whiteBG,
+          //   ),
+          //   child: _buildOrderProfile(context, state, vm),
+          // ),
+          // quote 按钮
+          Container(
+              width: double.infinity,
+              padding: const EdgeInsets.only(
+                  left: 16, right: 16, top: 20, bottom: 20),
+              color: Colors.transparent,
+              child: Column(
                   crossAxisAlignment: CrossAxisAlignment.start,
                   children: [
                     Center(
@@ -218,7 +231,7 @@ class ServiceRepairDetailPage extends HookConsumerWidget {
                         minHeight: 44.5,
                         fontWeight: FontWeight.w400,
                         onPressed: () {
-                          vm.handlerClickQuoteBtn(context, id, serviceTypeCode);
+                          vm.RepairServiceSubmit(context, id, serviceTypeCode);
                         },
                       ),
                     ),
@@ -235,36 +248,39 @@ class ServiceRepairDetailPage extends HookConsumerWidget {
                         textAlign: TextAlign.center,
                       ),
                     )
-                  ]
-                )
-              ),
-              // 介绍图
-              Padding(
-                  padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
-                  child: Column(
-                    children: List.generate(2, (index) {
-                      // 创建一个映射来关联字符串和资源
-                      final Map<String, String> assetMap = {
-                        'serviceDetail01': Assets.serviceRepairDetail01,
-                        'serviceDetail02': Assets.serviceRepairDetail02,
-                      };
-                      String curDetailStr = 'serviceDetail0${(index + 1)}';
-                      Log.d("curDetailStr   $curDetailStr");
-                      return MyAssetImage(
-                        assetMap[curDetailStr]!,
-                        width: SizeConfig().screenWidth,
-                        fit: BoxFit.cover,
-                      );
-                    }).toList(),
-                  )
-              ),
-            ],
-          ),
-        ]
-    );
+                  ])),
+          // 介绍图
+          Padding(
+              padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
+              child: Column(
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  children: [Html(data: detailInfo?.description)]
+                  // List.generate(2, (index) {
+                  //   // 创建一个映射来关联字符串和资源
+                  //   final Map<String, String> assetMap = {
+                  //     'serviceDetail01': Assets.serviceRepairDetail01,
+                  //     'serviceDetail02': Assets.serviceRepairDetail02,
+                  //   };
+                  //   String curDetailStr = 'serviceDetail0${(index + 1)}';
+                  //   Log.d("curDetailStr   $curDetailStr");
+                  //   return MyAssetImage(
+                  //     assetMap[curDetailStr]!,
+                  //     width: SizeConfig().screenWidth,
+                  //     fit: BoxFit.cover,
+                  //   );
+                  // }).toList(),
+                  )),
+        ],
+      ),
+    ]);
   }
 
-  Widget _buildOrderProfile(BuildContext context, ServiceRepairDetailState state, ServiceRepairDetailVm vm,) {
+  Widget _buildOrderProfile(
+    BuildContext context,
+    ServiceRepairDetailState state,
+    ServiceRepairDetailVm vm,
+  ) {
     return Column(
       children: [
         Row(
@@ -314,5 +330,4 @@ class ServiceRepairDetailPage extends HookConsumerWidget {
       ],
     );
   }
-
 }

+ 3 - 2
packages/cpt_services/lib/modules/services/service_repair_detail/service_repair_detail_state.dart

@@ -1,4 +1,5 @@
 import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
+import 'package:domain/entity/service_repair_detail_entity.dart';
 import 'package:widgets/load_state_layout.dart';
 
 class ServiceRepairDetailState {
@@ -9,7 +10,7 @@ class ServiceRepairDetailState {
   final int? id;
   final String? type;
 
-  Map<String, dynamic>? datas;
+  ServiceRepairDetailEntity? datas;
 
   ServiceRepairDetailState({
     this.loadingState = LoadState.State_Loading,
@@ -20,7 +21,7 @@ class ServiceRepairDetailState {
   });
 
   ServiceRepairDetailState copyWith({
-    Map<String, dynamic>? datas,
+    ServiceRepairDetailEntity? datas,
     LoadState? loadingState,
     String? errorMessage,
     int? id,

+ 76 - 66
packages/cpt_services/lib/modules/services/service_repair_detail/service_repair_detail_vm.dart

@@ -1,7 +1,7 @@
-
 import 'package:cpt_services/components/chooseAirConditionContent.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
+import 'package:domain/entity/service_repair_detail_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_basic/basic_export.dart';
 import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
@@ -30,24 +30,24 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
   int _detailServiceTypeCode = 0;
 
   bool _needShowPlaceholder = false; //是否展示LoadingView
-  int _page = 1;  // 当前页
+  int _page = 1; // 当前页
   int _limit = 10; // 每页数量
   int _count = 0; // 总条数
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
-    controlFinishRefresh: true,  //允许刷新
-    controlFinishLoad: true,   //允许加载
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
   );
 
   ServiceRepairDetailState initState() {
     return ServiceRepairDetailState(
-      datas: null,
+      datas: ServiceRepairDetailEntity(),
     );
   }
 
   @override
-  ServiceRepairDetailState build(){
+  ServiceRepairDetailState build() {
     // 引入数据仓库
     serviceRespositoryInstance = ref.read(servicesRespositoryProvider);
     final state = initState();
@@ -56,19 +56,15 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
     return state;
   }
 
-
   //刷新页面状态
   void changeLoadingState(LoadState loadState, String? errorMsg) {
-    state = state.copyWith(
-        loadingState: loadState,
-        errorMessage: errorMsg
-    );
+    state = state.copyWith(loadingState: loadState, errorMessage: errorMsg);
   }
 
   // 初始化页面数据
   initPageData() {
     Log.d("----for_sale_vm-----initPageData   ${state.loadingState}");
-    // onRefresh();
+    onRefresh();
     changeLoadingState(LoadState.State_Success, null);
   }
 
@@ -78,14 +74,12 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
     getDetailData();
   }
 
-
   // 下拉刷新
   Future onRefresh() async {
     _page = 1;
     getDetailData();
   }
 
-
   // 手动进行刷新
   Future triggerRefresh() async {
     Log.d("trggerRefresh");
@@ -94,7 +88,7 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
 
   // 手动进行刷新
   Future directRefresh() async {
-    state = state.copyWith(datas:null);
+    state = state.copyWith(datas: null);
     // 注意:由于 nestedscrollview 嵌套easyfresh 组件  refreshController.callRefresh() 自动刷新只能滚动顶部但是不会触发下拉刷新,这里调用是 用到了将其滚动到顶部的作用,进而刷新操作主动掉接口
     // https://github.com/xuelongqy/flutter_easy_refresh/issues/692
     refreshController.callRefresh();
@@ -104,7 +98,6 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
     getDetailData();
   }
 
-
   // 重试请求
   Future retryRequest() async {
     _page = 1;
@@ -112,8 +105,7 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
     getDetailData();
   }
 
-
-  setInitPageData({required int id, required int serviceTypeCode}){
+  setInitPageData({required int id, required int serviceTypeCode}) {
     _detailId = id;
     _detailServiceTypeCode = serviceTypeCode;
   }
@@ -123,7 +115,6 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-
     // await Future.delayed(const Duration(milliseconds: 1500));
     //
     // final Map<String, dynamic> detailData = {
@@ -151,32 +142,32 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
     // // 最后赋值
     // _needShowPlaceholder = false;
 
+    try {
+      Map<String, dynamic> params = {
+        "id": _detailId,
+      };
+      final result =
+          await serviceRespositoryInstance.fetchServiceRepairDetailInfo(params);
+      if (result.isSuccess) {
+        state = state.copyWith(datas: result.data as ServiceRepairDetailEntity);
+        changeLoadingState(LoadState.State_Success, null);
+        refreshController.finishRefresh();
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
 
-    // try {
-    //   Map<String, dynamic> params = {
-    //     "id": _detailId,
-    //   };
-    //   final result = await serviceRespositoryInstance.fetchServiceRepairDetailInfo(params);
-    //   if(result.isSuccess){
-    //     state = state.copyWith(datas: result.data as GarageSaleRentDetailEntity);
-    //     changeLoadingState(LoadState.State_Success, null);
-    //     refreshController.finishRefresh();
-    //   } else {
-    //     String errorMessage = result.errorMsg!;
-    //     changeLoadingState(LoadState.State_Error, errorMessage);
-    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //   }
-    // } catch (e) {
-    //   ToastEngine.show("Error: $e");
-    // }
-    //
-    // // 最后赋值
-    // _needShowPlaceholder = false;
+    // 最后赋值
+    _needShowPlaceholder = false;
   }
 
-
   // 点击了底部的收藏按钮
-  Future<bool?> handlerClickCollection(BuildContext? context, int id, bool isCollection) async{
+  Future<bool?> handlerClickCollection(
+      BuildContext? context, int id, bool isCollection) async {
     // var vm;
     // if(_detailServiceTypeCode == "forSale"){
     //   // vm = ref.read(forsaleVmProvider.notifier);
@@ -192,30 +183,34 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
   }
 
   // 判断是whatsapp 还是 mobile  (通过 contact: whatsapp:+8617671757687)
-  String getContactType(String contactType){
+  String getContactType(String contactType) {
     // whatsapp:+8617671757687  截取:前面的字符串
     String type = contactType.split(":")[0];
     return type;
   }
 
-  isContactWhatsApp(String contactType){
+  isContactWhatsApp(String contactType) {
     return contactType.contains("whatsapp");
   }
 
-  isContactMobile(String contactType){
+  isContactMobile(String contactType) {
     return contactType.contains("mobile");
   }
-  String getContactNumber(String contactType){
+
+  String getContactNumber(String contactType) {
     // whatsapp:+8617671757687     mobile:+8617671757687  截取:后面的字符串
     String number = contactType.split(":")[1];
     return number;
   }
+
   // 点击 whatsapp
-  handlerClickWhatsapp(BuildContext? context,String contactType, String title, int price){
-    // 获取 WhatsApp 号码
-    String whatsappNumber = getContactNumber(contactType); 
+  handlerClickWhatsapp(
+      BuildContext? context, String contactType, String title, int price) {
+    // 假设你有一个获取 WhatsApp 号码的方法
+    String whatsappNumber = getContactNumber(contactType); // 你需要实现这个方法
     // 构建消息并进行编码
-    String message = Uri.encodeComponent("Hello, I am interested in your listing: $title for $price.");
+    String message = Uri.encodeComponent(
+        "Hello, I am interested in your listing: $title for $price.");
     // 打开WhatsApp
     openWhatsApp(whatsappNumber, message);
   }
@@ -223,7 +218,7 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
   // 打开whatsapp
   openWhatsApp(String phoneNumber, String message) async {
     final url = "https://wa.me/$phoneNumber/?text=${Uri.parse(message)}";
-    if (await  canLaunchUrl(Uri.parse(url))) {
+    if (await canLaunchUrl(Uri.parse(url))) {
       await launchUrl(Uri.parse(url));
     } else {
       ToastEngine.show("Could not launch $url");
@@ -232,7 +227,7 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
   }
 
   // 点击 电话
-  handlerClickMobile(BuildContext? context,String contactType){
+  handlerClickMobile(BuildContext? context, String contactType) {
     String mobileNumber = getContactNumber(contactType);
     // 拨打电话
     makePhoneCall(mobileNumber);
@@ -253,7 +248,24 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
     }
   }
 
-  handlerClickQuoteBtn(BuildContext context, int id, int serviceTypeCode) async{
+  Future RepairServiceSubmit<T>(
+      BuildContext context, int id, int serviceTypeCode) async {
+    try {
+      Map<String, dynamic> params = {"service_id": id, "user_notes": ""};
+      final result =
+          await serviceRespositoryInstance.fetchRepairServiceSubmit(params);
+      if (result.isSuccess) {
+        handlerClickQuoteBtn(context, id, serviceTypeCode);
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  handlerClickQuoteBtn(
+      BuildContext context, int id, int serviceTypeCode) async {
     await DialogEngine.show(
         tag: "gotoQuote",
         position: DialogPosition.center,
@@ -265,20 +277,21 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
           // contentBoxMinHeight: 300,
           isShowConfirmBtn: true,
           confirmTxt: "Confirm",
-          isShowCancelBtn:false,
-          messageBuilder: (BuildContext context){
+          isShowCancelBtn: false,
+          messageBuilder: (BuildContext context) {
             return Container(
-              padding: EdgeInsets.symmetric(horizontal: 30),
-              child: Column(
-                children: [
+                padding: EdgeInsets.symmetric(horizontal: 30),
+                child: Column(children: [
                   MyTextView(
-                    "Please select the category of the service you want to quote:",
+                    "We have received your quotation inquiry",
                     fontSize: 16,
                     isFontMedium: true,
                     textAlign: TextAlign.center,
                     textColor: ColorUtils.string2Color("#4161D0"),
                   ),
-                  SizedBox(height: 20,),
+                  const SizedBox(
+                    height: 20,
+                  ),
                   MyTextView(
                     "We will contact you as soon as possible. Please keep your phone open",
                     fontSize: 16,
@@ -287,15 +300,12 @@ class ServiceRepairDetailVm extends _$ServiceRepairDetailVm {
                     textColor: ColorUtils.string2Color("#000000"),
                     // textColor: context.appColors.textPrimary,
                   ),
-                ]
-              )
-            );
+                ]));
           },
-          confirmAction: (){
+          confirmAction: () {
             // 点击了确定
             Log.d("----点击了确定按钮");
           },
-        )
-    );
+        ));
   }
-}
+}

+ 1 - 1
packages/cpt_services/lib/modules/services/service_repair_detail/service_repair_detail_vm.g.dart

@@ -7,7 +7,7 @@ part of 'service_repair_detail_vm.dart';
 // **************************************************************************
 
 String _$serviceRepairDetailVmHash() =>
-    r'26e25c4041436aaefa8c3eb25a2921a7c3daeb7a';
+    r'9113465692ae1a7b14627b090fa06e7696f61ddf';
 
 /// See also [ServiceRepairDetailVm].
 @ProviderFor(ServiceRepairDetailVm)

+ 1 - 1
packages/cpt_services/lib/modules/services/services_main_vm.g.dart

@@ -6,7 +6,7 @@ part of 'services_main_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$serviceMainVmHash() => r'fa196fc8101e1dd1dd82b4475ea873e3f439ac6f';
+String _$serviceMainVmHash() => r'c23e9cdb4f2f2b504eb42420d8863f94ce105105';
 
 /// See also [ServiceMainVm].
 @ProviderFor(ServiceMainVm)

+ 1 - 1
packages/cpt_services/lib/modules/services/services_vm.g.dart

@@ -6,7 +6,7 @@ part of 'services_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$servicesVmHash() => r'7805f3c3765a93ec9b488e6e288a5baa346ba2ed';
+String _$servicesVmHash() => r'960eacf01f767979f64ce3c1e026549f5cfda0f4';
 
 /// See also [ServicesVm].
 @ProviderFor(ServicesVm)

+ 154 - 168
packages/cpt_services/lib/respository/services_respository.dart

@@ -1,4 +1,5 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
 import 'package:domain/entity/myposts_sale_rent_entity.dart';
@@ -10,6 +11,9 @@ import 'package:domain/entity/paid_service_pay_success_info_entity.dart';
 import 'package:domain/entity/server_time.dart';
 import 'package:domain/entity/service_category_entity.dart';
 import 'package:domain/entity/service_time_period_entity.dart';
+import 'package:domain/entity/service_order_detail_entity.dart';
+import 'package:domain/entity/service_evaluate_list_entity.dart';
+import 'package:domain/entity/service_repair_detail_entity.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/platform_export.dart';
 import 'package:plugin_platform/http/dio_engine.dart';
@@ -21,7 +25,6 @@ import 'package:shared/utils/util.dart';
 import 'package:flutter_riverpod/flutter_riverpod.dart';
 import 'package:plugin_basic/provider/http_provider/http_provider.dart';
 
-
 part 'services_respository.g.dart';
 
 @Riverpod(keepAlive: true)
@@ -40,9 +43,9 @@ class ServicesRespository {
 
   //服务 获取 分类 字典
   Future<HttpResult<Object>> fetchServiceCateGoryList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -55,8 +58,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: false,   //是否防抖防止重复请求
+      isShowLoadingDialog: true,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
@@ -67,8 +72,8 @@ class ServicesRespository {
       var listData = listJson!.map((e) => ServiceCategoryEntity.fromJson(e!)).toList();
       //重新赋值data或list
       return result.convert(list: listData);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    }else  {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
@@ -77,9 +82,9 @@ class ServicesRespository {
 
   // 付费服务 获取 列表
   Future<HttpResult<Object>> fetchPaidServiceDataList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -91,8 +96,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
@@ -103,20 +110,19 @@ class ServicesRespository {
       var data = PaidServiceEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: data);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
     return result.convert();
   }
 
-
   // 付费/维修 服务 列表 点赞/取消点赞
   Future<HttpResult<Object>> fetchServiceLiked(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -129,8 +135,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: true,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
     //根据返回的结果,封装原始数据为Bean/Entity对象
@@ -140,20 +148,19 @@ class ServicesRespository {
       // var data = NewsfeedForyouEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: json);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
     return result.convert();
   }
 
-
   // 提交评价
   Future<HttpResult<Object>> fetchPublishEvaluation(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -178,8 +185,10 @@ class ServicesRespository {
       paths: files,
       headers: headers,
       method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: true,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
     //根据返回的结果,封装原始数据为Bean/Entity对象
@@ -189,20 +198,19 @@ class ServicesRespository {
       // var data = NewsfeedForyouEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: json);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
     return result.convert();
   }
 
-
   // 评价列表
   Future<HttpResult<Object>> fetchEvaluationDataList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -215,8 +223,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
@@ -224,11 +234,11 @@ class ServicesRespository {
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = GarageSaleRentEntity.fromJson(json!);
+      var data = ServiceEvaluateListEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: data);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
@@ -237,9 +247,9 @@ class ServicesRespository {
 
   // 获取 付费服务 详情信息
   Future<HttpResult<Object>> fetchPaidServiceCleanDetailInfo(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -251,8 +261,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
@@ -309,9 +321,9 @@ class ServicesRespository {
 
   // 付费服务 下单
   Future<HttpResult<Object>> fetchPaidServiceBook(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -324,8 +336,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: true,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
     //根据返回的结果,封装原始数据为Bean/Entity对象
@@ -334,97 +348,77 @@ class ServicesRespository {
       final json = result.getDataJson();
       var data = PaidServicePaySuccessInfoEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert(data: data);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+      return result.convert(data: json);
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
     return result.convert();
   }
 
-
   // 付费服务  订单列表
-  Future<HttpResult<Object>> fetchPaidServiceOrderList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+  Future<HttpResult<GarageSaleHistoryEntity>> fetchPaidServiceOrderList({
+    required String type,
+    required int curPage,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params['type'] = type;
+    params['page'] = curPage.toString();
+    params['limit'] = "10";
 
     final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/service/paid-service-order/index', // api 地址
+      '/api/v1/user/service/paid-service-order/index',
       params: params,
-      headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
-    //根据返回的结果,封装原始数据为Bean/Entity对象
     if (result.isSuccess) {
-      //重新赋值data或list
       final json = result.getDataJson();
-      var data = GarageSaleRentEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: data);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
-        ToastEngine.show("${result.errorMsg}");
-      }
+      var data = GarageSaleHistoryEntity.fromJson(json!);
+      return result.convert<GarageSaleHistoryEntity>(data: data);
     }
     return result.convert();
   }
 
-
   // 获取 付费服务 订单详情
-  Future<HttpResult<Object>> fetchPaidServiceCleanOrderDetailInfo(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+  Future<HttpResult<ServiceOrderDetailEntity>> fetchPaidServiceCleanOrderDetail({
+    required String id,
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    // headers["Content-Type"] = "application/x-www-form-urlencoded";
-    // headers["Accept"] = "application/x.yyjobs-api.v1+json";
+    params['id'] = id;
 
     final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/service/paid-service-order/detail', // api 地址
+      '/api/v1/user/service/paid-service-order/detail',
       params: params,
-      headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
-    //根据返回的结果,封装原始数据为Bean/Entity对象
     if (result.isSuccess) {
-      //重新赋值data或list
       final json = result.getDataJson();
-      // var data = GarageSaleRentDetailEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: json);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
-        ToastEngine.show("${result.errorMsg}");
-      }
+      var data = ServiceOrderDetailEntity.fromJson(json!);
+      return result.convert<ServiceOrderDetailEntity>(data: data);
     }
     return result.convert();
   }
 
-
   // 获取 付费订单实际需要支付的价格
   Future<HttpResult<Object>> fetchPaidServiceCleanOrderPrice(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -437,8 +431,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
@@ -449,60 +445,46 @@ class ServicesRespository {
       // var data = GarageSaleRentDetailEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: json);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
     return result.convert();
   }
 
-
   // 付费服务 取消订单
-  Future<HttpResult<Object>> fetchCancelPaidServiceOrder(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+  Future<HttpResult> fetchCancelPaidServiceOrder({
+    required String? id,
+    required String? reason,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params['id'] = id ?? "";
+    params['cancel_reason'] = reason ?? "";
 
     final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/service/paid-service-order/cancel', // api 地址
+      '/api/v1/user/service/paid-service-order/cancel',
       params: params,
-      headers: headers,
       method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: true,
+      networkDebounce: true,
       cancelToken: cancelToken,
     );
-    //根据返回的结果,封装原始数据为Bean/Entity对象
+
     if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      // var data = NewsfeedForyouEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: json);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
-        ToastEngine.show("${result.errorMsg}");
-      }
+      return result.convert();
     }
     return result.convert();
   }
 
-
   ///-------------------咨询类---------------------------------
 
-
   // 维修服务  列表
   Future<HttpResult<Object>> fetchRepairServiceList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -515,8 +497,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
@@ -527,8 +511,8 @@ class ServicesRespository {
       var data = GarageSaleRentEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: data);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
@@ -537,9 +521,9 @@ class ServicesRespository {
 
   // 获取 repair 详情信息
   Future<HttpResult<Object>> fetchServiceRepairDetailInfo(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -552,8 +536,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
@@ -561,23 +547,22 @@ class ServicesRespository {
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      var data = GarageSaleRentDetailEntity.fromJson(json!);
+      var data = ServiceRepairDetailEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: data);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
     return result.convert();
   }
 
-
   // 维修服务 提交咨询
   Future<HttpResult<Object>> fetchRepairServiceSubmit(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -590,8 +575,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: true,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
     //根据返回的结果,封装原始数据为Bean/Entity对象
@@ -601,20 +588,19 @@ class ServicesRespository {
       // var data = NewsfeedForyouEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: json);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
     return result.convert();
   }
 
-
   // 维修服务  订单列表
   Future<HttpResult<Object>> fetchRepairServiceOrderList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
+    Map<String, dynamic>? data, {
+    CancelToken? cancelToken,
+  }) async {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
@@ -627,8 +613,10 @@ class ServicesRespository {
       params: params,
       headers: headers,
       method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
+      isShowLoadingDialog: false,
+      //是否展示默认的Loading弹窗
+      networkDebounce: true,
+      //是否防抖防止重复请求
       cancelToken: cancelToken,
     );
 
@@ -639,13 +627,11 @@ class ServicesRespository {
       var data = GarageSaleRentEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: data);
-    }else {
-      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+    } else {
+      if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
         ToastEngine.show("${result.errorMsg}");
       }
     }
     return result.convert();
   }
-
-
 }

+ 14 - 14
packages/cpt_services/lib/router/page/services_page_router.gr.dart

@@ -26,7 +26,7 @@ abstract class _$ServicesPageRouter extends RootStackRouter {
       final args = routeData.argsAs<CleanOrderDetailPageRouteArgs>(
           orElse: () => CleanOrderDetailPageRouteArgs(
                 id: pathParams.getInt('id'),
-                serviceTypeCode: pathParams.getInt('serviceTypeCode'),
+                cleanServiceType: pathParams.getString('cleanServiceType'),
                 serviesStatusCode: pathParams.getInt('serviesStatusCode'),
               ));
       return AutoRoutePage<dynamic>(
@@ -34,7 +34,7 @@ abstract class _$ServicesPageRouter extends RootStackRouter {
         child: CleanOrderDetailPage(
           key: args.key,
           id: args.id,
-          serviceTypeCode: args.serviceTypeCode,
+          cleanServiceType: args.cleanServiceType,
           serviesStatusCode: args.serviesStatusCode,
         ),
       );
@@ -114,7 +114,7 @@ abstract class _$ServicesPageRouter extends RootStackRouter {
         child: ServiceEvaluateCreatePage(
           key: args.key,
           id: args.id,
-          serviceTypeCode: args.serviceTypeCode,
+          cleanServiceType: args.cleanServiceType,
         ),
       );
     },
@@ -204,7 +204,7 @@ class CleanOrderDetailPageRoute
   CleanOrderDetailPageRoute({
     Key? key,
     required int id,
-    required int serviceTypeCode,
+    required String cleanServiceType,
     required int serviesStatusCode,
     List<PageRouteInfo>? children,
   }) : super(
@@ -212,12 +212,12 @@ class CleanOrderDetailPageRoute
           args: CleanOrderDetailPageRouteArgs(
             key: key,
             id: id,
-            serviceTypeCode: serviceTypeCode,
+            cleanServiceType: cleanServiceType,
             serviesStatusCode: serviesStatusCode,
           ),
           rawPathParams: {
             'id': id,
-            'serviceTypeCode': serviceTypeCode,
+            'cleanServiceType': cleanServiceType,
             'serviesStatusCode': serviesStatusCode,
           },
           initialChildren: children,
@@ -233,7 +233,7 @@ class CleanOrderDetailPageRouteArgs {
   const CleanOrderDetailPageRouteArgs({
     this.key,
     required this.id,
-    required this.serviceTypeCode,
+    required this.cleanServiceType,
     required this.serviesStatusCode,
   });
 
@@ -241,13 +241,13 @@ class CleanOrderDetailPageRouteArgs {
 
   final int id;
 
-  final int serviceTypeCode;
+  final String cleanServiceType;
 
   final int serviesStatusCode;
 
   @override
   String toString() {
-    return 'CleanOrderDetailPageRouteArgs{key: $key, id: $id, serviceTypeCode: $serviceTypeCode, serviesStatusCode: $serviesStatusCode}';
+    return 'CleanOrderDetailPageRouteArgs{key: $key, id: $id, cleanServiceType: $cleanServiceType, serviesStatusCode: $serviesStatusCode}';
   }
 }
 
@@ -442,14 +442,14 @@ class ServiceEvaluateCreatePageRoute
   ServiceEvaluateCreatePageRoute({
     Key? key,
     required int id,
-    required int serviceTypeCode,
+    required String cleanServiceType,
     List<PageRouteInfo>? children,
   }) : super(
           ServiceEvaluateCreatePageRoute.name,
           args: ServiceEvaluateCreatePageRouteArgs(
             key: key,
             id: id,
-            serviceTypeCode: serviceTypeCode,
+            cleanServiceType: cleanServiceType,
           ),
           initialChildren: children,
         );
@@ -464,18 +464,18 @@ class ServiceEvaluateCreatePageRouteArgs {
   const ServiceEvaluateCreatePageRouteArgs({
     this.key,
     required this.id,
-    required this.serviceTypeCode,
+    required this.cleanServiceType,
   });
 
   final Key? key;
 
   final int id;
 
-  final int serviceTypeCode;
+  final String cleanServiceType;
 
   @override
   String toString() {
-    return 'ServiceEvaluateCreatePageRouteArgs{key: $key, id: $id, serviceTypeCode: $serviceTypeCode}';
+    return 'ServiceEvaluateCreatePageRouteArgs{key: $key, id: $id, cleanServiceType: $cleanServiceType}';
   }
 }
 

+ 75 - 0
packages/cs_domain/lib/entity/garage_sale_history_entity.dart

@@ -0,0 +1,75 @@
+import 'package:domain/entity/id_name_entity.dart';
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/garage_sale_history_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/garage_sale_history_entity.g.dart';
+
+@JsonSerializable()
+class GarageSaleHistoryEntity {
+	int count = 0;
+	int page = 0;
+	int limit = 0;
+	@JSONField(name: "count_page")
+	int countPage = 0;
+	List<GarageSaleHistoryList> list = [];
+
+	GarageSaleHistoryEntity();
+
+	factory GarageSaleHistoryEntity.fromJson(Map<String, dynamic> json) => $GarageSaleHistoryEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $GarageSaleHistoryEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class GarageSaleHistoryList {
+	String? id;
+	String? sn;
+	@JSONField(name: "order_status")
+	String? orderStatus;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	IdNameEntity? service;
+	IdNameEntity? merchant;
+	@JSONField(name: "order_products")
+	List<GarageSaleHistoryListOrderProducts> orderProducts = [];
+
+	GarageSaleHistoryList();
+
+	factory GarageSaleHistoryList.fromJson(Map<String, dynamic> json) => $GarageSaleHistoryListFromJson(json);
+
+	Map<String, dynamic> toJson() => $GarageSaleHistoryListToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+
+@JsonSerializable()
+class GarageSaleHistoryListOrderProducts {
+	String? id;
+	@JSONField(name: "product_name")
+	String? productName;
+	int quantity = 0;
+	@JSONField(name: "total_amount")
+	String? totalAmount;
+	@JSONField(name: "planned_service_at")
+	String? plannedServiceAt;
+
+	GarageSaleHistoryListOrderProducts();
+
+	factory GarageSaleHistoryListOrderProducts.fromJson(Map<String, dynamic> json) => $GarageSaleHistoryListOrderProductsFromJson(json);
+
+	Map<String, dynamic> toJson() => $GarageSaleHistoryListOrderProductsToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 47 - 47
packages/cs_domain/lib/entity/garage_sale_rent_detail_entity.dart

@@ -1,48 +1,48 @@
-import 'package:domain/generated/json/base/json_field.dart';
-import 'package:domain/generated/json/garage_sale_rent_detail_entity.g.dart';
-import 'dart:convert';
-export 'package:domain/generated/json/garage_sale_rent_detail_entity.g.dart';
-
-@JsonSerializable()
-class GarageSaleRentDetailEntity {
-	int? id;
-	String? title;
-	int? price;
-	String? description;
-	List<String>? resources;
-	@JSONField(name: "created_at")
-	String? createdAt;
-	@JSONField(name: "likes_count")
-	int? likesCount;
-	String? contact;
-	GarageSaleRentDetailAccount? account;
-
-	GarageSaleRentDetailEntity();
-
-	factory GarageSaleRentDetailEntity.fromJson(Map<String, dynamic> json) => $GarageSaleRentDetailEntityFromJson(json);
-
-	Map<String, dynamic> toJson() => $GarageSaleRentDetailEntityToJson(this);
-
-	@override
-	String toString() {
-		return jsonEncode(this);
-	}
-}
-
-@JsonSerializable()
-class GarageSaleRentDetailAccount {
-	int? id;
-	String? name;
-	String? avatar;
-
-	GarageSaleRentDetailAccount();
-
-	factory GarageSaleRentDetailAccount.fromJson(Map<String, dynamic> json) => $GarageSaleRentDetailAccountFromJson(json);
-
-	Map<String, dynamic> toJson() => $GarageSaleRentDetailAccountToJson(this);
-
-	@override
-	String toString() {
-		return jsonEncode(this);
-	}
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/garage_sale_rent_detail_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/garage_sale_rent_detail_entity.g.dart';
+
+@JsonSerializable()
+class GarageSaleRentDetailEntity {
+	int? id;
+	String? title;
+	int? price;
+	String? description;
+	List<String>? resources;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	@JSONField(name: "likes_count")
+	int? likesCount;
+	String? contact;
+	GarageSaleRentDetailAccount? account;
+
+	GarageSaleRentDetailEntity();
+
+	factory GarageSaleRentDetailEntity.fromJson(Map<String, dynamic> json) => $GarageSaleRentDetailEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $GarageSaleRentDetailEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class GarageSaleRentDetailAccount {
+	int? id;
+	String? name;
+	String? avatar;
+
+	GarageSaleRentDetailAccount();
+
+	factory GarageSaleRentDetailAccount.fromJson(Map<String, dynamic> json) => $GarageSaleRentDetailAccountFromJson(json);
+
+	Map<String, dynamic> toJson() => $GarageSaleRentDetailAccountToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
 }

+ 65 - 0
packages/cs_domain/lib/entity/service_evaluate_list_entity.dart

@@ -0,0 +1,65 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/service_evaluate_list_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/service_evaluate_list_entity.g.dart';
+
+@JsonSerializable()
+class ServiceEvaluateListEntity {
+	late int count = 0;
+	late int page = 0;
+	late int limit = 0;
+	@JSONField(name: "count_page")
+	late int countPage = 0;
+	late List<ServiceEvaluateListList> list = [];
+
+	ServiceEvaluateListEntity();
+
+	factory ServiceEvaluateListEntity.fromJson(Map<String, dynamic> json) => $ServiceEvaluateListEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $ServiceEvaluateListEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class ServiceEvaluateListList {
+	late int id = 0;
+	late ServiceEvaluateListListAccount account;
+	late int score = 0;
+	late String comment = '';
+	late List<dynamic> resources = [];
+	@JSONField(name: "created_at")
+	late String createdAt = '';
+
+	ServiceEvaluateListList();
+
+	factory ServiceEvaluateListList.fromJson(Map<String, dynamic> json) => $ServiceEvaluateListListFromJson(json);
+
+	Map<String, dynamic> toJson() => $ServiceEvaluateListListToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class ServiceEvaluateListListAccount {
+	late int id = 0;
+	late String name = '';
+	late String avatar = '';
+
+	ServiceEvaluateListListAccount();
+
+	factory ServiceEvaluateListListAccount.fromJson(Map<String, dynamic> json) => $ServiceEvaluateListListAccountFromJson(json);
+
+	Map<String, dynamic> toJson() => $ServiceEvaluateListListAccountToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 141 - 0
packages/cs_domain/lib/entity/service_order_detail_entity.dart

@@ -0,0 +1,141 @@
+import 'package:domain/entity/id_name_entity.dart';
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/service_order_detail_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/service_order_detail_entity.g.dart';
+
+@JsonSerializable()
+class ServiceOrderDetailEntity {
+	String? id;
+	String? sn;
+	@JSONField(name: "total_amount")
+	String? totalAmount;
+	@JSONField(name: "paid_at")
+	String? paidAt;
+	String? notes;
+	ServiceOrderDetailAccount? account;
+	@JSONField(name: "order_service")
+	ServiceOrderDetailOrderService? orderService;
+	IdNameEntity? merchant;
+	@JSONField(name: "order_products")
+	List<ServiceOrderDetailOrderProducts>? orderProducts = [];
+	ServiceOrderDetailEstate? estate;
+	@JSONField(name: "estate_unit")
+	ServiceOrderDetailEstateUnit? estateUnit;
+
+	ServiceOrderDetailEntity();
+
+	factory ServiceOrderDetailEntity.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $ServiceOrderDetailEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class ServiceOrderDetailAccount {
+	String? id;
+	String? name;
+	String? avatar;
+	String? phone;
+
+	ServiceOrderDetailAccount();
+
+	factory ServiceOrderDetailAccount.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailAccountFromJson(json);
+
+	Map<String, dynamic> toJson() => $ServiceOrderDetailAccountToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class ServiceOrderDetailOrderService {
+	String? id;
+	String? name;
+	@JSONField(name: "evaluations_avg_score")
+	double evaluationsAvgScore = 0.0;
+
+	ServiceOrderDetailOrderService();
+
+	factory ServiceOrderDetailOrderService.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailOrderServiceFromJson(json);
+
+	Map<String, dynamic> toJson() => $ServiceOrderDetailOrderServiceToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+
+@JsonSerializable()
+class ServiceOrderDetailOrderProducts {
+	String? id;
+	@JSONField(name: "product_name")
+	String? productName;
+	@JSONField(name: "product_amount")
+	String? productAmount;
+	@JSONField(name: "urgent_amount")
+	String? urgentAmount;
+	@JSONField(name: "holiday_amount")
+	String? holidayAmount;
+	@JSONField(name: "night_amount")
+	String? nightAmount;
+	int quantity = 0;
+	@JSONField(name: "total_amount")
+	String? totalAmount;
+	@JSONField(name: "planned_service_at")
+	String? plannedServiceAt;
+
+	ServiceOrderDetailOrderProducts();
+
+	factory ServiceOrderDetailOrderProducts.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailOrderProductsFromJson(json);
+
+	Map<String, dynamic> toJson() => $ServiceOrderDetailOrderProductsToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class ServiceOrderDetailEstate {
+	String? id;
+	String? name;
+
+	ServiceOrderDetailEstate();
+
+	factory ServiceOrderDetailEstate.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailEstateFromJson(json);
+
+	Map<String, dynamic> toJson() => $ServiceOrderDetailEstateToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class ServiceOrderDetailEstateUnit {
+	String? id;
+	String? unit;
+	String? address;
+
+	ServiceOrderDetailEstateUnit();
+
+	factory ServiceOrderDetailEstateUnit.fromJson(Map<String, dynamic> json) => $ServiceOrderDetailEstateUnitFromJson(json);
+
+	Map<String, dynamic> toJson() => $ServiceOrderDetailEstateUnitToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 62 - 0
packages/cs_domain/lib/entity/service_repair_detail_entity.dart

@@ -0,0 +1,62 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/service_repair_detail_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/service_repair_detail_entity.g.dart';
+
+@JsonSerializable()
+class ServiceRepairDetailEntity {
+  late int id = 0;
+  late String name = '';
+  late String description = '';
+  late ServiceRepairDetailMerchant merchant;
+  late ServiceRepairDetailCategory category;
+
+  ServiceRepairDetailEntity();
+
+  factory ServiceRepairDetailEntity.fromJson(Map<String, dynamic> json) =>
+      $ServiceRepairDetailEntityFromJson(json);
+
+  Map<String, dynamic> toJson() => $ServiceRepairDetailEntityToJson(this);
+
+  @override
+  String toString() {
+    return jsonEncode(this);
+  }
+}
+
+@JsonSerializable()
+class ServiceRepairDetailMerchant {
+  late int id = 0;
+  late String name = '';
+
+  ServiceRepairDetailMerchant();
+
+  factory ServiceRepairDetailMerchant.fromJson(Map<String, dynamic> json) =>
+      $ServiceRepairDetailMerchantFromJson(json);
+
+  Map<String, dynamic> toJson() => $ServiceRepairDetailMerchantToJson(this);
+
+  @override
+  String toString() {
+    return jsonEncode(this);
+  }
+}
+
+@JsonSerializable()
+class ServiceRepairDetailCategory {
+  late int id = 0;
+  late String name = '';
+  late String type = '';
+
+  ServiceRepairDetailCategory();
+
+  factory ServiceRepairDetailCategory.fromJson(Map<String, dynamic> json) =>
+      $ServiceRepairDetailCategoryFromJson(json);
+
+  Map<String, dynamic> toJson() => $ServiceRepairDetailCategoryToJson(this);
+
+  @override
+  String toString() {
+    return jsonEncode(this);
+  }
+}

+ 90 - 0
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -17,6 +17,7 @@ import 'package:domain/entity/form_list_entity.dart';
 import 'package:domain/entity/form_option_entity.dart';
 import 'package:domain/entity/form_submitted_entity.dart';
 import 'package:domain/entity/form_submitted_page_entity.dart';
+import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
 import 'package:domain/entity/home_list_entity.dart';
@@ -59,6 +60,9 @@ import 'package:domain/entity/rewards_my_entity.dart';
 import 'package:domain/entity/rewards_search_entity.dart';
 import 'package:domain/entity/server_time.dart';
 import 'package:domain/entity/service_category_entity.dart';
+import 'package:domain/entity/service_evaluate_list_entity.dart';
+import 'package:domain/entity/service_order_detail_entity.dart';
+import 'package:domain/entity/service_repair_detail_entity.dart';
 import 'package:domain/entity/service_time_period_entity.dart';
 import 'package:domain/entity/text_kon_entity.dart';
 import 'package:domain/entity/user_me_entity.dart';
@@ -300,6 +304,19 @@ class JsonConvert {
       return data.map<FormSubmittedPageEntity>((Map<String, dynamic> e) =>
           FormSubmittedPageEntity.fromJson(e)).toList() as M;
     }
+    if (<GarageSaleHistoryEntity>[] is M) {
+      return data.map<GarageSaleHistoryEntity>((Map<String, dynamic> e) =>
+          GarageSaleHistoryEntity.fromJson(e)).toList() as M;
+    }
+    if (<GarageSaleHistoryList>[] is M) {
+      return data.map<GarageSaleHistoryList>((Map<String, dynamic> e) =>
+          GarageSaleHistoryList.fromJson(e)).toList() as M;
+    }
+    if (<GarageSaleHistoryListOrderProducts>[] is M) {
+      return data.map<GarageSaleHistoryListOrderProducts>((
+          Map<String, dynamic> e) =>
+          GarageSaleHistoryListOrderProducts.fromJson(e)).toList() as M;
+    }
     if (<GarageSaleRentDetailEntity>[] is M) {
       return data.map<GarageSaleRentDetailEntity>((Map<String, dynamic> e) =>
           GarageSaleRentDetailEntity.fromJson(e)).toList() as M;
@@ -715,6 +732,57 @@ class JsonConvert {
       return data.map<ServiceCategoryEntity>((Map<String, dynamic> e) =>
           ServiceCategoryEntity.fromJson(e)).toList() as M;
     }
+    if (<ServiceEvaluateListEntity>[] is M) {
+      return data.map<ServiceEvaluateListEntity>((Map<String, dynamic> e) =>
+          ServiceEvaluateListEntity.fromJson(e)).toList() as M;
+    }
+    if (<ServiceEvaluateListList>[] is M) {
+      return data.map<ServiceEvaluateListList>((Map<String, dynamic> e) =>
+          ServiceEvaluateListList.fromJson(e)).toList() as M;
+    }
+    if (<ServiceEvaluateListListAccount>[] is M) {
+      return data.map<ServiceEvaluateListListAccount>((
+          Map<String, dynamic> e) => ServiceEvaluateListListAccount.fromJson(e))
+          .toList() as M;
+    }
+    if (<ServiceOrderDetailEntity>[] is M) {
+      return data.map<ServiceOrderDetailEntity>((Map<String, dynamic> e) =>
+          ServiceOrderDetailEntity.fromJson(e)).toList() as M;
+    }
+    if (<ServiceOrderDetailAccount>[] is M) {
+      return data.map<ServiceOrderDetailAccount>((Map<String, dynamic> e) =>
+          ServiceOrderDetailAccount.fromJson(e)).toList() as M;
+    }
+    if (<ServiceOrderDetailOrderService>[] is M) {
+      return data.map<ServiceOrderDetailOrderService>((
+          Map<String, dynamic> e) => ServiceOrderDetailOrderService.fromJson(e))
+          .toList() as M;
+    }
+    if (<ServiceOrderDetailOrderProducts>[] is M) {
+      return data.map<ServiceOrderDetailOrderProducts>((
+          Map<String, dynamic> e) =>
+          ServiceOrderDetailOrderProducts.fromJson(e)).toList() as M;
+    }
+    if (<ServiceOrderDetailEstate>[] is M) {
+      return data.map<ServiceOrderDetailEstate>((Map<String, dynamic> e) =>
+          ServiceOrderDetailEstate.fromJson(e)).toList() as M;
+    }
+    if (<ServiceOrderDetailEstateUnit>[] is M) {
+      return data.map<ServiceOrderDetailEstateUnit>((Map<String, dynamic> e) =>
+          ServiceOrderDetailEstateUnit.fromJson(e)).toList() as M;
+    }
+    if (<ServiceRepairDetailEntity>[] is M) {
+      return data.map<ServiceRepairDetailEntity>((Map<String, dynamic> e) =>
+          ServiceRepairDetailEntity.fromJson(e)).toList() as M;
+    }
+    if (<ServiceRepairDetailMerchant>[] is M) {
+      return data.map<ServiceRepairDetailMerchant>((Map<String, dynamic> e) =>
+          ServiceRepairDetailMerchant.fromJson(e)).toList() as M;
+    }
+    if (<ServiceRepairDetailCategory>[] is M) {
+      return data.map<ServiceRepairDetailCategory>((Map<String, dynamic> e) =>
+          ServiceRepairDetailCategory.fromJson(e)).toList() as M;
+    }
     if (<ServiceTimePeriodEntity>[] is M) {
       return data.map<ServiceTimePeriodEntity>((Map<String, dynamic> e) =>
           ServiceTimePeriodEntity.fromJson(e)).toList() as M;
@@ -809,6 +877,10 @@ class JsonConvertClassCollection {
     (FormSubmittedEstateOnlineForm).toString(): FormSubmittedEstateOnlineForm
         .fromJson,
     (FormSubmittedPageEntity).toString(): FormSubmittedPageEntity.fromJson,
+    (GarageSaleHistoryEntity).toString(): GarageSaleHistoryEntity.fromJson,
+    (GarageSaleHistoryList).toString(): GarageSaleHistoryList.fromJson,
+    (GarageSaleHistoryListOrderProducts)
+        .toString(): GarageSaleHistoryListOrderProducts.fromJson,
     (GarageSaleRentDetailEntity).toString(): GarageSaleRentDetailEntity
         .fromJson,
     (GarageSaleRentDetailAccount).toString(): GarageSaleRentDetailAccount
@@ -935,6 +1007,24 @@ class JsonConvertClassCollection {
     (RewardsSearchRewards).toString(): RewardsSearchRewards.fromJson,
     (ServerTime).toString(): ServerTime.fromJson,
     (ServiceCategoryEntity).toString(): ServiceCategoryEntity.fromJson,
+    (ServiceEvaluateListEntity).toString(): ServiceEvaluateListEntity.fromJson,
+    (ServiceEvaluateListList).toString(): ServiceEvaluateListList.fromJson,
+    (ServiceEvaluateListListAccount).toString(): ServiceEvaluateListListAccount
+        .fromJson,
+    (ServiceOrderDetailEntity).toString(): ServiceOrderDetailEntity.fromJson,
+    (ServiceOrderDetailAccount).toString(): ServiceOrderDetailAccount.fromJson,
+    (ServiceOrderDetailOrderService).toString(): ServiceOrderDetailOrderService
+        .fromJson,
+    (ServiceOrderDetailOrderProducts)
+        .toString(): ServiceOrderDetailOrderProducts.fromJson,
+    (ServiceOrderDetailEstate).toString(): ServiceOrderDetailEstate.fromJson,
+    (ServiceOrderDetailEstateUnit).toString(): ServiceOrderDetailEstateUnit
+        .fromJson,
+    (ServiceRepairDetailEntity).toString(): ServiceRepairDetailEntity.fromJson,
+    (ServiceRepairDetailMerchant).toString(): ServiceRepairDetailMerchant
+        .fromJson,
+    (ServiceRepairDetailCategory).toString(): ServiceRepairDetailCategory
+        .fromJson,
     (ServiceTimePeriodEntity).toString(): ServiceTimePeriodEntity.fromJson,
     (TextKonEntity).toString(): TextKonEntity.fromJson,
     (UserMeEntity).toString(): UserMeEntity.fromJson,

+ 192 - 0
packages/cs_domain/lib/generated/json/garage_sale_history_entity.g.dart

@@ -0,0 +1,192 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/garage_sale_history_entity.dart';
+import 'package:domain/entity/id_name_entity.dart';
+
+
+GarageSaleHistoryEntity $GarageSaleHistoryEntityFromJson(
+    Map<String, dynamic> json) {
+  final GarageSaleHistoryEntity garageSaleHistoryEntity = GarageSaleHistoryEntity();
+  final int? count = jsonConvert.convert<int>(json['count']);
+  if (count != null) {
+    garageSaleHistoryEntity.count = count;
+  }
+  final int? page = jsonConvert.convert<int>(json['page']);
+  if (page != null) {
+    garageSaleHistoryEntity.page = page;
+  }
+  final int? limit = jsonConvert.convert<int>(json['limit']);
+  if (limit != null) {
+    garageSaleHistoryEntity.limit = limit;
+  }
+  final int? countPage = jsonConvert.convert<int>(json['count_page']);
+  if (countPage != null) {
+    garageSaleHistoryEntity.countPage = countPage;
+  }
+  final List<GarageSaleHistoryList>? list = (json['list'] as List<dynamic>?)
+      ?.map(
+          (e) =>
+      jsonConvert.convert<GarageSaleHistoryList>(e) as GarageSaleHistoryList)
+      .toList();
+  if (list != null) {
+    garageSaleHistoryEntity.list = list;
+  }
+  return garageSaleHistoryEntity;
+}
+
+Map<String, dynamic> $GarageSaleHistoryEntityToJson(
+    GarageSaleHistoryEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['count'] = entity.count;
+  data['page'] = entity.page;
+  data['limit'] = entity.limit;
+  data['count_page'] = entity.countPage;
+  data['list'] = entity.list.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension GarageSaleHistoryEntityExtension on GarageSaleHistoryEntity {
+  GarageSaleHistoryEntity copyWith({
+    int? count,
+    int? page,
+    int? limit,
+    int? countPage,
+    List<GarageSaleHistoryList>? list,
+  }) {
+    return GarageSaleHistoryEntity()
+      ..count = count ?? this.count
+      ..page = page ?? this.page
+      ..limit = limit ?? this.limit
+      ..countPage = countPage ?? this.countPage
+      ..list = list ?? this.list;
+  }
+}
+
+GarageSaleHistoryList $GarageSaleHistoryListFromJson(
+    Map<String, dynamic> json) {
+  final GarageSaleHistoryList garageSaleHistoryList = GarageSaleHistoryList();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    garageSaleHistoryList.id = id;
+  }
+  final String? sn = jsonConvert.convert<String>(json['sn']);
+  if (sn != null) {
+    garageSaleHistoryList.sn = sn;
+  }
+  final String? orderStatus = jsonConvert.convert<String>(json['order_status']);
+  if (orderStatus != null) {
+    garageSaleHistoryList.orderStatus = orderStatus;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    garageSaleHistoryList.createdAt = createdAt;
+  }
+  final IdNameEntity? service = jsonConvert.convert<IdNameEntity>(
+      json['service']);
+  if (service != null) {
+    garageSaleHistoryList.service = service;
+  }
+  final IdNameEntity? merchant = jsonConvert.convert<IdNameEntity>(
+      json['merchant']);
+  if (merchant != null) {
+    garageSaleHistoryList.merchant = merchant;
+  }
+  final List<
+      GarageSaleHistoryListOrderProducts>? orderProducts = (json['order_products'] as List<
+      dynamic>?)?.map(
+          (e) =>
+      jsonConvert.convert<GarageSaleHistoryListOrderProducts>(
+          e) as GarageSaleHistoryListOrderProducts).toList();
+  if (orderProducts != null) {
+    garageSaleHistoryList.orderProducts = orderProducts;
+  }
+  return garageSaleHistoryList;
+}
+
+Map<String, dynamic> $GarageSaleHistoryListToJson(
+    GarageSaleHistoryList entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['sn'] = entity.sn;
+  data['order_status'] = entity.orderStatus;
+  data['created_at'] = entity.createdAt;
+  data['service'] = entity.service?.toJson();
+  data['merchant'] = entity.merchant?.toJson();
+  data['order_products'] = entity.orderProducts.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension GarageSaleHistoryListExtension on GarageSaleHistoryList {
+  GarageSaleHistoryList copyWith({
+    String? id,
+    String? sn,
+    String? orderStatus,
+    String? createdAt,
+    IdNameEntity? service,
+    IdNameEntity? merchant,
+    List<GarageSaleHistoryListOrderProducts>? orderProducts,
+  }) {
+    return GarageSaleHistoryList()
+      ..id = id ?? this.id
+      ..sn = sn ?? this.sn
+      ..orderStatus = orderStatus ?? this.orderStatus
+      ..createdAt = createdAt ?? this.createdAt
+      ..service = service ?? this.service
+      ..merchant = merchant ?? this.merchant
+      ..orderProducts = orderProducts ?? this.orderProducts;
+  }
+}
+
+GarageSaleHistoryListOrderProducts $GarageSaleHistoryListOrderProductsFromJson(
+    Map<String, dynamic> json) {
+  final GarageSaleHistoryListOrderProducts garageSaleHistoryListOrderProducts = GarageSaleHistoryListOrderProducts();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    garageSaleHistoryListOrderProducts.id = id;
+  }
+  final String? productName = jsonConvert.convert<String>(json['product_name']);
+  if (productName != null) {
+    garageSaleHistoryListOrderProducts.productName = productName;
+  }
+  final int? quantity = jsonConvert.convert<int>(json['quantity']);
+  if (quantity != null) {
+    garageSaleHistoryListOrderProducts.quantity = quantity;
+  }
+  final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
+  if (totalAmount != null) {
+    garageSaleHistoryListOrderProducts.totalAmount = totalAmount;
+  }
+  final String? plannedServiceAt = jsonConvert.convert<String>(
+      json['planned_service_at']);
+  if (plannedServiceAt != null) {
+    garageSaleHistoryListOrderProducts.plannedServiceAt = plannedServiceAt;
+  }
+  return garageSaleHistoryListOrderProducts;
+}
+
+Map<String, dynamic> $GarageSaleHistoryListOrderProductsToJson(
+    GarageSaleHistoryListOrderProducts entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['product_name'] = entity.productName;
+  data['quantity'] = entity.quantity;
+  data['total_amount'] = entity.totalAmount;
+  data['planned_service_at'] = entity.plannedServiceAt;
+  return data;
+}
+
+extension GarageSaleHistoryListOrderProductsExtension on GarageSaleHistoryListOrderProducts {
+  GarageSaleHistoryListOrderProducts copyWith({
+    String? id,
+    String? productName,
+    int? quantity,
+    String? totalAmount,
+    String? plannedServiceAt,
+  }) {
+    return GarageSaleHistoryListOrderProducts()
+      ..id = id ?? this.id
+      ..productName = productName ?? this.productName
+      ..quantity = quantity ?? this.quantity
+      ..totalAmount = totalAmount ?? this.totalAmount
+      ..plannedServiceAt = plannedServiceAt ?? this.plannedServiceAt;
+  }
+}

+ 164 - 0
packages/cs_domain/lib/generated/json/service_evaluate_list_entity.g.dart

@@ -0,0 +1,164 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/service_evaluate_list_entity.dart';
+
+ServiceEvaluateListEntity $ServiceEvaluateListEntityFromJson(
+    Map<String, dynamic> json) {
+  final ServiceEvaluateListEntity serviceEvaluateListEntity = ServiceEvaluateListEntity();
+  final int? count = jsonConvert.convert<int>(json['count']);
+  if (count != null) {
+    serviceEvaluateListEntity.count = count;
+  }
+  final int? page = jsonConvert.convert<int>(json['page']);
+  if (page != null) {
+    serviceEvaluateListEntity.page = page;
+  }
+  final int? limit = jsonConvert.convert<int>(json['limit']);
+  if (limit != null) {
+    serviceEvaluateListEntity.limit = limit;
+  }
+  final int? countPage = jsonConvert.convert<int>(json['count_page']);
+  if (countPage != null) {
+    serviceEvaluateListEntity.countPage = countPage;
+  }
+  final List<ServiceEvaluateListList>? list = (json['list'] as List<dynamic>?)
+      ?.map(
+          (e) =>
+      jsonConvert.convert<ServiceEvaluateListList>(
+          e) as ServiceEvaluateListList)
+      .toList();
+  if (list != null) {
+    serviceEvaluateListEntity.list = list;
+  }
+  return serviceEvaluateListEntity;
+}
+
+Map<String, dynamic> $ServiceEvaluateListEntityToJson(
+    ServiceEvaluateListEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['count'] = entity.count;
+  data['page'] = entity.page;
+  data['limit'] = entity.limit;
+  data['count_page'] = entity.countPage;
+  data['list'] = entity.list.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension ServiceEvaluateListEntityExtension on ServiceEvaluateListEntity {
+  ServiceEvaluateListEntity copyWith({
+    int? count,
+    int? page,
+    int? limit,
+    int? countPage,
+    List<ServiceEvaluateListList>? list,
+  }) {
+    return ServiceEvaluateListEntity()
+      ..count = count ?? this.count
+      ..page = page ?? this.page
+      ..limit = limit ?? this.limit
+      ..countPage = countPage ?? this.countPage
+      ..list = list ?? this.list;
+  }
+}
+
+ServiceEvaluateListList $ServiceEvaluateListListFromJson(
+    Map<String, dynamic> json) {
+  final ServiceEvaluateListList serviceEvaluateListList = ServiceEvaluateListList();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    serviceEvaluateListList.id = id;
+  }
+  final ServiceEvaluateListListAccount? account = jsonConvert.convert<
+      ServiceEvaluateListListAccount>(json['account']);
+  if (account != null) {
+    serviceEvaluateListList.account = account;
+  }
+  final int? score = jsonConvert.convert<int>(json['score']);
+  if (score != null) {
+    serviceEvaluateListList.score = score;
+  }
+  final String? comment = jsonConvert.convert<String>(json['comment']);
+  if (comment != null) {
+    serviceEvaluateListList.comment = comment;
+  }
+  final List<dynamic>? resources = (json['resources'] as List<dynamic>?)?.map(
+          (e) => e).toList();
+  if (resources != null) {
+    serviceEvaluateListList.resources = resources;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    serviceEvaluateListList.createdAt = createdAt;
+  }
+  return serviceEvaluateListList;
+}
+
+Map<String, dynamic> $ServiceEvaluateListListToJson(
+    ServiceEvaluateListList entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['account'] = entity.account.toJson();
+  data['score'] = entity.score;
+  data['comment'] = entity.comment;
+  data['resources'] = entity.resources;
+  data['created_at'] = entity.createdAt;
+  return data;
+}
+
+extension ServiceEvaluateListListExtension on ServiceEvaluateListList {
+  ServiceEvaluateListList copyWith({
+    int? id,
+    ServiceEvaluateListListAccount? account,
+    int? score,
+    String? comment,
+    List<dynamic>? resources,
+    String? createdAt,
+  }) {
+    return ServiceEvaluateListList()
+      ..id = id ?? this.id
+      ..account = account ?? this.account
+      ..score = score ?? this.score
+      ..comment = comment ?? this.comment
+      ..resources = resources ?? this.resources
+      ..createdAt = createdAt ?? this.createdAt;
+  }
+}
+
+ServiceEvaluateListListAccount $ServiceEvaluateListListAccountFromJson(
+    Map<String, dynamic> json) {
+  final ServiceEvaluateListListAccount serviceEvaluateListListAccount = ServiceEvaluateListListAccount();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    serviceEvaluateListListAccount.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    serviceEvaluateListListAccount.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    serviceEvaluateListListAccount.avatar = avatar;
+  }
+  return serviceEvaluateListListAccount;
+}
+
+Map<String, dynamic> $ServiceEvaluateListListAccountToJson(
+    ServiceEvaluateListListAccount entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  return data;
+}
+
+extension ServiceEvaluateListListAccountExtension on ServiceEvaluateListListAccount {
+  ServiceEvaluateListListAccount copyWith({
+    int? id,
+    String? name,
+    String? avatar,
+  }) {
+    return ServiceEvaluateListListAccount()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar;
+  }
+}

+ 358 - 0
packages/cs_domain/lib/generated/json/service_order_detail_entity.g.dart

@@ -0,0 +1,358 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/service_order_detail_entity.dart';
+import 'package:domain/entity/id_name_entity.dart';
+
+
+ServiceOrderDetailEntity $ServiceOrderDetailEntityFromJson(
+    Map<String, dynamic> json) {
+  final ServiceOrderDetailEntity serviceOrderDetailEntity = ServiceOrderDetailEntity();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    serviceOrderDetailEntity.id = id;
+  }
+  final String? sn = jsonConvert.convert<String>(json['sn']);
+  if (sn != null) {
+    serviceOrderDetailEntity.sn = sn;
+  }
+  final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
+  if (totalAmount != null) {
+    serviceOrderDetailEntity.totalAmount = totalAmount;
+  }
+  final String? paidAt = jsonConvert.convert<String>(json['paid_at']);
+  if (paidAt != null) {
+    serviceOrderDetailEntity.paidAt = paidAt;
+  }
+  final String? notes = jsonConvert.convert<String>(json['notes']);
+  if (notes != null) {
+    serviceOrderDetailEntity.notes = notes;
+  }
+  final ServiceOrderDetailAccount? account = jsonConvert.convert<
+      ServiceOrderDetailAccount>(json['account']);
+  if (account != null) {
+    serviceOrderDetailEntity.account = account;
+  }
+  final ServiceOrderDetailOrderService? orderService = jsonConvert.convert<
+      ServiceOrderDetailOrderService>(json['order_service']);
+  if (orderService != null) {
+    serviceOrderDetailEntity.orderService = orderService;
+  }
+  final IdNameEntity? merchant = jsonConvert.convert<IdNameEntity>(
+      json['merchant']);
+  if (merchant != null) {
+    serviceOrderDetailEntity.merchant = merchant;
+  }
+  final List<
+      ServiceOrderDetailOrderProducts>? orderProducts = (json['order_products'] as List<
+      dynamic>?)?.map(
+          (e) =>
+      jsonConvert.convert<ServiceOrderDetailOrderProducts>(
+          e) as ServiceOrderDetailOrderProducts).toList();
+  if (orderProducts != null) {
+    serviceOrderDetailEntity.orderProducts = orderProducts;
+  }
+  final ServiceOrderDetailEstate? estate = jsonConvert.convert<
+      ServiceOrderDetailEstate>(json['estate']);
+  if (estate != null) {
+    serviceOrderDetailEntity.estate = estate;
+  }
+  final ServiceOrderDetailEstateUnit? estateUnit = jsonConvert.convert<
+      ServiceOrderDetailEstateUnit>(json['estate_unit']);
+  if (estateUnit != null) {
+    serviceOrderDetailEntity.estateUnit = estateUnit;
+  }
+  return serviceOrderDetailEntity;
+}
+
+Map<String, dynamic> $ServiceOrderDetailEntityToJson(
+    ServiceOrderDetailEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['sn'] = entity.sn;
+  data['total_amount'] = entity.totalAmount;
+  data['paid_at'] = entity.paidAt;
+  data['notes'] = entity.notes;
+  data['account'] = entity.account?.toJson();
+  data['order_service'] = entity.orderService?.toJson();
+  data['merchant'] = entity.merchant?.toJson();
+  data['order_products'] =
+      entity.orderProducts?.map((v) => v.toJson()).toList();
+  data['estate'] = entity.estate?.toJson();
+  data['estate_unit'] = entity.estateUnit?.toJson();
+  return data;
+}
+
+extension ServiceOrderDetailEntityExtension on ServiceOrderDetailEntity {
+  ServiceOrderDetailEntity copyWith({
+    String? id,
+    String? sn,
+    String? totalAmount,
+    String? paidAt,
+    String? notes,
+    ServiceOrderDetailAccount? account,
+    ServiceOrderDetailOrderService? orderService,
+    IdNameEntity? merchant,
+    List<ServiceOrderDetailOrderProducts>? orderProducts,
+    ServiceOrderDetailEstate? estate,
+    ServiceOrderDetailEstateUnit? estateUnit,
+  }) {
+    return ServiceOrderDetailEntity()
+      ..id = id ?? this.id
+      ..sn = sn ?? this.sn
+      ..totalAmount = totalAmount ?? this.totalAmount
+      ..paidAt = paidAt ?? this.paidAt
+      ..notes = notes ?? this.notes
+      ..account = account ?? this.account
+      ..orderService = orderService ?? this.orderService
+      ..merchant = merchant ?? this.merchant
+      ..orderProducts = orderProducts ?? this.orderProducts
+      ..estate = estate ?? this.estate
+      ..estateUnit = estateUnit ?? this.estateUnit;
+  }
+}
+
+ServiceOrderDetailAccount $ServiceOrderDetailAccountFromJson(
+    Map<String, dynamic> json) {
+  final ServiceOrderDetailAccount serviceOrderDetailAccount = ServiceOrderDetailAccount();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    serviceOrderDetailAccount.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    serviceOrderDetailAccount.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    serviceOrderDetailAccount.avatar = avatar;
+  }
+  final String? phone = jsonConvert.convert<String>(json['phone']);
+  if (phone != null) {
+    serviceOrderDetailAccount.phone = phone;
+  }
+  return serviceOrderDetailAccount;
+}
+
+Map<String, dynamic> $ServiceOrderDetailAccountToJson(
+    ServiceOrderDetailAccount entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  data['phone'] = entity.phone;
+  return data;
+}
+
+extension ServiceOrderDetailAccountExtension on ServiceOrderDetailAccount {
+  ServiceOrderDetailAccount copyWith({
+    String? id,
+    String? name,
+    String? avatar,
+    String? phone,
+  }) {
+    return ServiceOrderDetailAccount()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar
+      ..phone = phone ?? this.phone;
+  }
+}
+
+ServiceOrderDetailOrderService $ServiceOrderDetailOrderServiceFromJson(
+    Map<String, dynamic> json) {
+  final ServiceOrderDetailOrderService serviceOrderDetailOrderService = ServiceOrderDetailOrderService();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    serviceOrderDetailOrderService.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    serviceOrderDetailOrderService.name = name;
+  }
+  final double? evaluationsAvgScore = jsonConvert.convert<double>(
+      json['evaluations_avg_score']);
+  if (evaluationsAvgScore != null) {
+    serviceOrderDetailOrderService.evaluationsAvgScore = evaluationsAvgScore;
+  }
+  return serviceOrderDetailOrderService;
+}
+
+Map<String, dynamic> $ServiceOrderDetailOrderServiceToJson(
+    ServiceOrderDetailOrderService entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['evaluations_avg_score'] = entity.evaluationsAvgScore;
+  return data;
+}
+
+extension ServiceOrderDetailOrderServiceExtension on ServiceOrderDetailOrderService {
+  ServiceOrderDetailOrderService copyWith({
+    String? id,
+    String? name,
+    double? evaluationsAvgScore,
+  }) {
+    return ServiceOrderDetailOrderService()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..evaluationsAvgScore = evaluationsAvgScore ?? this.evaluationsAvgScore;
+  }
+}
+
+ServiceOrderDetailOrderProducts $ServiceOrderDetailOrderProductsFromJson(
+    Map<String, dynamic> json) {
+  final ServiceOrderDetailOrderProducts serviceOrderDetailOrderProducts = ServiceOrderDetailOrderProducts();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    serviceOrderDetailOrderProducts.id = id;
+  }
+  final String? productName = jsonConvert.convert<String>(json['product_name']);
+  if (productName != null) {
+    serviceOrderDetailOrderProducts.productName = productName;
+  }
+  final String? productAmount = jsonConvert.convert<String>(
+      json['product_amount']);
+  if (productAmount != null) {
+    serviceOrderDetailOrderProducts.productAmount = productAmount;
+  }
+  final String? urgentAmount = jsonConvert.convert<String>(
+      json['urgent_amount']);
+  if (urgentAmount != null) {
+    serviceOrderDetailOrderProducts.urgentAmount = urgentAmount;
+  }
+  final String? holidayAmount = jsonConvert.convert<String>(
+      json['holiday_amount']);
+  if (holidayAmount != null) {
+    serviceOrderDetailOrderProducts.holidayAmount = holidayAmount;
+  }
+  final String? nightAmount = jsonConvert.convert<String>(json['night_amount']);
+  if (nightAmount != null) {
+    serviceOrderDetailOrderProducts.nightAmount = nightAmount;
+  }
+  final int? quantity = jsonConvert.convert<int>(json['quantity']);
+  if (quantity != null) {
+    serviceOrderDetailOrderProducts.quantity = quantity;
+  }
+  final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
+  if (totalAmount != null) {
+    serviceOrderDetailOrderProducts.totalAmount = totalAmount;
+  }
+  final String? plannedServiceAt = jsonConvert.convert<String>(
+      json['planned_service_at']);
+  if (plannedServiceAt != null) {
+    serviceOrderDetailOrderProducts.plannedServiceAt = plannedServiceAt;
+  }
+  return serviceOrderDetailOrderProducts;
+}
+
+Map<String, dynamic> $ServiceOrderDetailOrderProductsToJson(
+    ServiceOrderDetailOrderProducts entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['product_name'] = entity.productName;
+  data['product_amount'] = entity.productAmount;
+  data['urgent_amount'] = entity.urgentAmount;
+  data['holiday_amount'] = entity.holidayAmount;
+  data['night_amount'] = entity.nightAmount;
+  data['quantity'] = entity.quantity;
+  data['total_amount'] = entity.totalAmount;
+  data['planned_service_at'] = entity.plannedServiceAt;
+  return data;
+}
+
+extension ServiceOrderDetailOrderProductsExtension on ServiceOrderDetailOrderProducts {
+  ServiceOrderDetailOrderProducts copyWith({
+    String? id,
+    String? productName,
+    String? productAmount,
+    String? urgentAmount,
+    String? holidayAmount,
+    String? nightAmount,
+    int? quantity,
+    String? totalAmount,
+    String? plannedServiceAt,
+  }) {
+    return ServiceOrderDetailOrderProducts()
+      ..id = id ?? this.id
+      ..productName = productName ?? this.productName
+      ..productAmount = productAmount ?? this.productAmount
+      ..urgentAmount = urgentAmount ?? this.urgentAmount
+      ..holidayAmount = holidayAmount ?? this.holidayAmount
+      ..nightAmount = nightAmount ?? this.nightAmount
+      ..quantity = quantity ?? this.quantity
+      ..totalAmount = totalAmount ?? this.totalAmount
+      ..plannedServiceAt = plannedServiceAt ?? this.plannedServiceAt;
+  }
+}
+
+ServiceOrderDetailEstate $ServiceOrderDetailEstateFromJson(
+    Map<String, dynamic> json) {
+  final ServiceOrderDetailEstate serviceOrderDetailEstate = ServiceOrderDetailEstate();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    serviceOrderDetailEstate.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    serviceOrderDetailEstate.name = name;
+  }
+  return serviceOrderDetailEstate;
+}
+
+Map<String, dynamic> $ServiceOrderDetailEstateToJson(
+    ServiceOrderDetailEstate entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  return data;
+}
+
+extension ServiceOrderDetailEstateExtension on ServiceOrderDetailEstate {
+  ServiceOrderDetailEstate copyWith({
+    String? id,
+    String? name,
+  }) {
+    return ServiceOrderDetailEstate()
+      ..id = id ?? this.id
+      ..name = name ?? this.name;
+  }
+}
+
+ServiceOrderDetailEstateUnit $ServiceOrderDetailEstateUnitFromJson(
+    Map<String, dynamic> json) {
+  final ServiceOrderDetailEstateUnit serviceOrderDetailEstateUnit = ServiceOrderDetailEstateUnit();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    serviceOrderDetailEstateUnit.id = id;
+  }
+  final String? unit = jsonConvert.convert<String>(json['unit']);
+  if (unit != null) {
+    serviceOrderDetailEstateUnit.unit = unit;
+  }
+  final String? address = jsonConvert.convert<String>(json['address']);
+  if (address != null) {
+    serviceOrderDetailEstateUnit.address = address;
+  }
+  return serviceOrderDetailEstateUnit;
+}
+
+Map<String, dynamic> $ServiceOrderDetailEstateUnitToJson(
+    ServiceOrderDetailEstateUnit entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['unit'] = entity.unit;
+  data['address'] = entity.address;
+  return data;
+}
+
+extension ServiceOrderDetailEstateUnitExtension on ServiceOrderDetailEstateUnit {
+  ServiceOrderDetailEstateUnit copyWith({
+    String? id,
+    String? unit,
+    String? address,
+  }) {
+    return ServiceOrderDetailEstateUnit()
+      ..id = id ?? this.id
+      ..unit = unit ?? this.unit
+      ..address = address ?? this.address;
+  }
+}

+ 131 - 0
packages/cs_domain/lib/generated/json/service_repair_detail_entity.g.dart

@@ -0,0 +1,131 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/service_repair_detail_entity.dart';
+
+ServiceRepairDetailEntity $ServiceRepairDetailEntityFromJson(
+    Map<String, dynamic> json) {
+  final ServiceRepairDetailEntity serviceRepairDetailEntity = ServiceRepairDetailEntity();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    serviceRepairDetailEntity.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    serviceRepairDetailEntity.name = name;
+  }
+  final String? description = jsonConvert.convert<String>(json['description']);
+  if (description != null) {
+    serviceRepairDetailEntity.description = description;
+  }
+  final ServiceRepairDetailMerchant? merchant = jsonConvert.convert<
+      ServiceRepairDetailMerchant>(json['merchant']);
+  if (merchant != null) {
+    serviceRepairDetailEntity.merchant = merchant;
+  }
+  final ServiceRepairDetailCategory? category = jsonConvert.convert<
+      ServiceRepairDetailCategory>(json['category']);
+  if (category != null) {
+    serviceRepairDetailEntity.category = category;
+  }
+  return serviceRepairDetailEntity;
+}
+
+Map<String, dynamic> $ServiceRepairDetailEntityToJson(
+    ServiceRepairDetailEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['description'] = entity.description;
+  data['merchant'] = entity.merchant.toJson();
+  data['category'] = entity.category.toJson();
+  return data;
+}
+
+extension ServiceRepairDetailEntityExtension on ServiceRepairDetailEntity {
+  ServiceRepairDetailEntity copyWith({
+    int? id,
+    String? name,
+    String? description,
+    ServiceRepairDetailMerchant? merchant,
+    ServiceRepairDetailCategory? category,
+  }) {
+    return ServiceRepairDetailEntity()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..description = description ?? this.description
+      ..merchant = merchant ?? this.merchant
+      ..category = category ?? this.category;
+  }
+}
+
+ServiceRepairDetailMerchant $ServiceRepairDetailMerchantFromJson(
+    Map<String, dynamic> json) {
+  final ServiceRepairDetailMerchant serviceRepairDetailMerchant = ServiceRepairDetailMerchant();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    serviceRepairDetailMerchant.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    serviceRepairDetailMerchant.name = name;
+  }
+  return serviceRepairDetailMerchant;
+}
+
+Map<String, dynamic> $ServiceRepairDetailMerchantToJson(
+    ServiceRepairDetailMerchant entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  return data;
+}
+
+extension ServiceRepairDetailMerchantExtension on ServiceRepairDetailMerchant {
+  ServiceRepairDetailMerchant copyWith({
+    int? id,
+    String? name,
+  }) {
+    return ServiceRepairDetailMerchant()
+      ..id = id ?? this.id
+      ..name = name ?? this.name;
+  }
+}
+
+ServiceRepairDetailCategory $ServiceRepairDetailCategoryFromJson(
+    Map<String, dynamic> json) {
+  final ServiceRepairDetailCategory serviceRepairDetailCategory = ServiceRepairDetailCategory();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    serviceRepairDetailCategory.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    serviceRepairDetailCategory.name = name;
+  }
+  final String? type = jsonConvert.convert<String>(json['type']);
+  if (type != null) {
+    serviceRepairDetailCategory.type = type;
+  }
+  return serviceRepairDetailCategory;
+}
+
+Map<String, dynamic> $ServiceRepairDetailCategoryToJson(
+    ServiceRepairDetailCategory entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['type'] = entity.type;
+  return data;
+}
+
+extension ServiceRepairDetailCategoryExtension on ServiceRepairDetailCategory {
+  ServiceRepairDetailCategory copyWith({
+    int? id,
+    String? name,
+    String? type,
+  }) {
+    return ServiceRepairDetailCategory()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..type = type ?? this.type;
+  }
+}