glglove пре 1 месец
родитељ
комит
4476e15cd2
36 измењених фајлова са 2449 додато и 172 уклоњено
  1. 2 2
      packages/cpt_community/lib/respository/common_garage.dart
  2. 3 3
      packages/cpt_community/lib/respository/common_newsfeed.dart
  3. 1 1
      packages/cpt_services/lib/components/chooseHouseCleanContent_vm.g.dart
  4. 76 2
      packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_page.dart
  5. 1 1
      packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_vm.g.dart
  6. 27 26
      packages/cpt_services/lib/modules/services/homeService/home_service_page.dart
  7. 7 4
      packages/cpt_services/lib/modules/services/homeService/home_service_state.dart
  8. 26 29
      packages/cpt_services/lib/modules/services/homeService/home_service_vm.dart
  9. 1 1
      packages/cpt_services/lib/modules/services/homeService/home_service_vm.g.dart
  10. 3 3
      packages/cpt_services/lib/modules/services/repair/repair_page.dart
  11. 147 0
      packages/cpt_services/lib/modules/services/repair_history/history_page.dart
  12. 38 0
      packages/cpt_services/lib/modules/services/repair_history/history_state.dart
  13. 342 0
      packages/cpt_services/lib/modules/services/repair_history/history_vm.dart
  14. 26 0
      packages/cpt_services/lib/modules/services/repair_history/history_vm.g.dart
  15. 232 0
      packages/cpt_services/lib/modules/services/repair_homeService/home_service_page.dart
  16. 47 0
      packages/cpt_services/lib/modules/services/repair_homeService/home_service_state.dart
  17. 520 0
      packages/cpt_services/lib/modules/services/repair_homeService/home_service_vm.dart
  18. 27 0
      packages/cpt_services/lib/modules/services/repair_homeService/home_service_vm.g.dart
  19. 235 0
      packages/cpt_services/lib/modules/services/repair_homeService/service_card_item.dart
  20. 149 0
      packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_page.dart
  21. 38 0
      packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_state.dart
  22. 342 0
      packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_vm.dart
  23. 27 0
      packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_vm.g.dart
  24. 1 1
      packages/cpt_services/lib/modules/services/service_clean_detail/service_clean_detail_vm.g.dart
  25. 1 1
      packages/cpt_services/lib/modules/services/service_evaluate_create/service_evaluate_create_vm.g.dart
  26. 3 75
      packages/cpt_services/lib/modules/services/service_order_confirm/service_order_confirm_page.dart
  27. 1 1
      packages/cpt_services/lib/modules/services/service_order_confirm/service_order_confirm_vm.g.dart
  28. 1 1
      packages/cpt_services/lib/modules/services/service_pay_success/service_pay_success_vm.g.dart
  29. 36 3
      packages/cpt_services/lib/modules/services/services_main_page.dart
  30. 2 1
      packages/cpt_services/lib/router/component/services_component_service.dart
  31. 20 16
      packages/cpt_services/lib/router/page/services_page_router.dart
  32. 60 0
      packages/cpt_services/lib/router/page/services_page_router.gr.dart
  33. BIN
      packages/cs_resources/assets/service/home_services.webp
  34. BIN
      packages/cs_resources/assets/service/maintenance.webp
  35. 2 0
      packages/cs_resources/lib/generated/assets.dart
  36. 5 1
      packages/cs_router/lib/path/router_path.dart

+ 2 - 2
packages/cpt_community/lib/respository/common_garage.dart

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

+ 3 - 3
packages/cpt_community/lib/respository/common_newsfeed.dart

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

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

@@ -7,7 +7,7 @@ part of 'chooseHouseCleanContent_vm.dart';
 // **************************************************************************
 
 String _$chooseHouseCleanContentVmHash() =>
-    r'f54a57b948bef3c2386dbebec3f70e1f50ace01b';
+    r'2f810b6f7f58c4f52a4f0c97e23d837511d3d3e7';
 
 /// See also [ChooseHouseCleanContentVm].
 @ProviderFor(ChooseHouseCleanContentVm)

+ 76 - 2
packages/cpt_services/lib/modules/services/clean_order_detail/clean_order_detail_page.dart

@@ -330,16 +330,90 @@ class CleanOrderDetailPage extends HookConsumerWidget {
         ),
         if (serviceTypeCode == servicesConstants.servicesType['houseCleaning']!['code'])
         // 室内清理
-          ChooseHouseCleanContent(id: 0, serviceTypeCode: 0,)
+          _buildCleanContent(context, state)
         else if (serviceTypeCode == servicesConstants.servicesType['airConditioner']!['code'])
         // 空调清理
-          ChooseAirConditionContent(id: 0, serviceTypeCode: 0,)
+          _buildCleanContent(context, state)
         else
           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);
+
+    return Container(
+      padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
+      margin: EdgeInsets.only(left: 15, right: 15, top: 0, bottom: 0),
+      color: ColorUtils.string2Color('#F8F8F8'),
+      child: Column(
+        children: [
+          Row(
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            mainAxisSize: MainAxisSize.max,
+            children: [
+              Expanded(
+                child: Column(
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  children: [
+                    MyTextView(
+                      title,
+                      fontSize: 16,
+                      isFontMedium: true,
+                      textColor: context.appColors.textBlack,
+                    ),
+                    MyTextView(
+                      areaSizeRange,
+                      fontSize: 15,
+                      isFontRegular: true,
+                      textColor: context.appColors.textDarkGray999,
+                      marginTop: 5,
+                    ),
+                  ],
+                ),
+              ),
+              // MyCartNum(onChange: (value){
+              //   vm.handlerChangeNum(context, value, index);
+              // })
+              // MyButton(
+              //   text: '\$$price',
+              //   onPressed: (){
+              //       // vm.handlerChangeNum(context, value, index);
+              //   },
+              //   fontSize: 19,
+              //   fontWeight: FontWeight.w500,
+              // )
+              Container(
+                child: MyButton(
+                  text: '\$$price',
+                  onPressed: null,
+                  minWidth: 80,
+                  minHeight: 40,
+                  fontSize: 19,
+                  fontWeight: FontWeight.w500,
+                  // enable: !isDisable.value,
+                  textColor:  context.appColors.textPrimary,
+                  backgroundColor: context.appColors.textWhite,
+                  disabledBackgroundColor: context.appColors.disEnableGray,
+                  disabledTextColor: context.appColors.textWhite,
+                ),
+              ),
+            ],
+          ),
+          // Divider(),
+        ],
+      ),
+    );
+  }
+
+
   Widget _buildOrderTotalAmount(CleanOrderDetailState state, CleanOrderDetailVm vm, BuildContext context) {
     return Column(
       children: [

+ 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'de0d8af49280fe6a8d48d7f423e2b2ae47254acb';
+    r'068199d62a6545c1f8edff8736a13854a79042ab';
 
 /// See also [CleanOrderDetailVm].
 @ProviderFor(CleanOrderDetailVm)

+ 27 - 26
packages/cpt_services/lib/modules/services/homeService/home_service_page.dart

@@ -158,10 +158,7 @@ class HomeServicePage extends HookConsumerWidget {
   }
 
   Widget _buildSortAndFilter(BuildContext context, WidgetRef ref, vm, state) {
-    String dropdownValue = 'Item1';
-    List<String> items = ['Item1', 'Item2', 'Item3'];
-
-    final sortTitle = useState("Most Likes");
+    final sortTitle = ref.watch(homeServiceVmProvider.select((state) => state.sortBySelectedOption));
 
     final expandSortIcon = useState<bool>(false);
 
@@ -184,31 +181,35 @@ class HomeServicePage extends HookConsumerWidget {
               Wrap(
                 crossAxisAlignment: WrapCrossAlignment.center,
                 children: [
-                  MyTextView(
-                    "${sortTitle.value}",
-                    fontSize: 13,
-                    isFontRegular: true,
-                    textAlign: TextAlign.center,
-                    marginLeft: 15,
-                    textColor: context.appColors.textPrimary,
-                  ),
-                  IconButton(
-                    // padding: EdgeInsets.zero,
-                    constraints: const BoxConstraints(),
-                    onPressed: null,
-                    icon: Icon(
-                        expandSortIcon.value ? Icons.arrow_drop_up: Icons.arrow_drop_down
-                    ),
+                  Row(
+                    children: [
+                      sortTitle != null? MyTextView(
+                        "${sortTitle}",
+                        fontSize: 13,
+                        isFontRegular: true,
+                        textAlign: TextAlign.center,
+                        marginLeft: 15,
+                        textColor: context.appColors.textPrimary,
+                      ): const SizedBox(),
+                      IconButton(
+                        // padding: EdgeInsets.zero,
+                        constraints: const BoxConstraints(),
+                        onPressed: null,
+                        icon: Icon(
+                            expandSortIcon.value ? Icons.arrow_drop_up: Icons.arrow_drop_down
+                        ),
+                      ),
+                    ],
                   ),
                 ],
-              ).onTap((){
-                Log.d("点击了sort");
-                vm.handlerClickSortIcon(context);
-                expandSortIcon.value = !expandSortIcon.value;
-
-              }),
+              ),
             ],
-          ),
+          ).onTap((){
+            Log.d("点击了sort");
+            vm.handlerClickSortIcon(context);
+            expandSortIcon.value = !expandSortIcon.value;
+
+          }),
 
           // 排序
           const MyAssetImage(

+ 7 - 4
packages/cpt_services/lib/modules/services/homeService/home_service_state.dart

@@ -7,7 +7,10 @@ class HomeServiceState {
 
   String? keyword;
   bool? isLiked;
-  Map<String, dynamic> activeSortMap;
+  // contact type 类型选项
+  final List<String> sortByOptionsList = ["Most Likes", "Most bookmarked", "View at Most"];
+  String? sortBySelectedOption;
+
   List<Map<String, dynamic>> activeCateGoryList;
   List<Map<String, dynamic>> list;
 
@@ -17,7 +20,7 @@ class HomeServiceState {
     String? errorMessage,
     this.keyword,
     this.isLiked,
-    this.activeSortMap = const {},
+    this.sortBySelectedOption ,
     this.activeCateGoryList = const [],
     required this.list,
   });
@@ -27,7 +30,7 @@ class HomeServiceState {
     String? errorMessage,
     String? keyword,
     bool? isLiked,
-    Map<String, dynamic>? activeSortMap,
+    String? sortBySelectedOption,
     List<Map<String, dynamic>>? activeCateGoryList,
     List<Map<String, dynamic>>? list,
   }) {
@@ -36,7 +39,7 @@ class HomeServiceState {
       errorMessage: errorMessage ?? this.errorMessage,
       keyword: keyword ?? this.keyword,
       isLiked: isLiked ?? this.isLiked,
-      activeSortMap: activeSortMap ?? this.activeSortMap,
+      sortBySelectedOption: sortBySelectedOption ?? this.sortBySelectedOption,
       activeCateGoryList: activeCateGoryList ?? this.activeCateGoryList,
       list: list ?? this.list,
     );

+ 26 - 29
packages/cpt_services/lib/modules/services/homeService/home_service_vm.dart

@@ -13,6 +13,7 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/dialog/app_custom_dialog.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/my_checkbox_group.dart';
+import 'package:widgets/picker/option_pick_util.dart';
 import 'package:widgets/widget_export.dart';
 
 import '../../../respository/services_respository.dart';
@@ -290,29 +291,16 @@ class HomeServiceVm extends _$HomeServiceVm {
 
   // 获取 homeservice 的分类选项
   Future<List<Map<String, dynamic>>> getHomeServiceCategoryOptions() async{
-    ToastEngine.show("Loading...");
-    await Future.delayed(const Duration(seconds: 1));
+    await Future.delayed(const Duration(milliseconds: 300));
     ToastEngine.dismiss();
     List<Map<String, dynamic>> serviceCategoryList = [
       {
         'id': 1,
-        'name': 'Part-Time Cleaning',
+        'name': 'House Cleaning Serivces',
       },
       {
         'id': 2,
-        'name': 'Move in/Out Cleaning',
-      },
-      {
-        'id': 3,
-        'name': 'Laundry Anddry Cleaning',
-      },
-      {
-        'id': 4,
-        'name': 'Sofa Cleaning',
-      },
-      {
-        'id': 5,
-        'name': 'Find BBQ Essentials',
+        'name': 'Household Appliance Cleaning',
       },
     ];
 
@@ -469,19 +457,19 @@ class HomeServiceVm extends _$HomeServiceVm {
 
   // 点击 sort icon
   handlerClickSortIcon(BuildContext context) async{
-    await  SmartDialog.showAttach(
-      targetContext: context,
-      alignment: Alignment.bottomCenter,
-      highlightBuilder: (Offset targetOffset, Size targetSize) {
-        Log.d("666 ${targetOffset} ${targetSize}");
-        return Positioned(
-          right: 0,
-          top: 0,
-          child: Container(height: targetOffset.dy + 50, width: targetSize.width, color: Colors.white),
-        );
-      },
-      builder: (_) => _listDialog(),
-    );
+    // await  SmartDialog.showAttach(
+    //   targetContext: context,
+    //   alignment: Alignment.bottomCenter,
+    //   highlightBuilder: (Offset targetOffset, Size targetSize) {
+    //     Log.d("666 ${targetOffset} ${targetSize}");
+    //     return Positioned(
+    //       right: 0,
+    //       top: 0,
+    //       child: Container(height: targetOffset.dy + 50, width: targetSize.width, color: Colors.white),
+    //     );
+    //   },
+    //   builder: (_) => _listDialog(),
+    // );
     // DialogEngine.showAttach(
     //     targetContext: context,
     //     position: DialogPosition.top,
@@ -489,6 +477,15 @@ class HomeServiceVm extends _$HomeServiceVm {
     //     usePenetrate: true,
     //     widget: _listDialog()
     // );
+
+    OptionPickerUtil.showCupertinoOptionPicker(
+      items: state.sortByOptionsList,
+      initialSelectIndex: 0,
+      onPickerChanged: (_, index) {
+        state = state.copyWith(sortBySelectedOption: state.sortByOptionsList?[index]);
+        // 调用list 接口
+      },
+    );
   }
 
   Widget _listDialog() {

+ 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'93c5fc87d19bc58e3eae1ed469b3bf03732c9e9d';
+String _$homeServiceVmHash() => r'f797aaab5c87dfbcd175c7a68c483f501a518020';
 
 /// See also [HomeServiceVm].
 @ProviderFor(HomeServiceVm)

+ 3 - 3
packages/cpt_services/lib/modules/services/repair/repair_page.dart

@@ -161,9 +161,9 @@ class RepairPage extends HookConsumerWidget with WidgetsBindingObserver {
                       child: AutoTabsRouter.pageView(
                         key: tabsRouterKey,
                         routes: const [
-                          HomeServicePageRoute(),
-                          InProgressPageRoute(),
-                          HistoryPageRoute(),
+                          RepairHomeServicePageRoute(),
+                          RepairInProgressPageRoute(),
+                          RepairHistoryPageRoute(),
                         ],
                         builder: (context, child, pageController) {
                           final tabsRouter = AutoTabsRouter.of(context);

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

@@ -0,0 +1,147 @@
+import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/garage_sale_rent_entity.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter_hooks/flutter_hooks.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_basic/provider/app_config/app_config_service.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/ext_dart.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/screen_util.dart';
+import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/my_button.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/my_appbar.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:widgets/widget_export.dart';
+
+import '../../../constants_services.dart';
+import '../../../router/page/services_page_router.dart';
+import 'history_vm.dart';
+import '../../../components/status_card_item.dart';
+
+@RoutePage()
+class RepairHistoryPage extends HookConsumerWidget {
+  const RepairHistoryPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RepairHistoryPageRoute());
+    } else {
+      appRouter.push(const RepairHistoryPageRoute());
+    }
+  }
+
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final vm = ref.read(repairHistoryVmProvider.notifier);
+    final state = ref.watch(repairHistoryVmProvider);
+    // final appConfigState = ref.watch(appConfigServiceProvider)
+
+    int serviceTypeCode = servicesConstants.servicesType['houseCleaning']?['code'];
+    int serviceStatusCode = servicesConstants.servicesStatus['2']?['code'];
+
+
+    useEffect(() {
+      // 组件挂载时执行 - 执行接口请求
+      Future.microtask(() => vm.initPageData());
+      return () {
+        // 组件卸载时执行
+        Log.d("history_page 组件卸载时执行");
+      };
+    }, []);
+
+    return Scaffold(
+      // appBar: MyAppBar.appBar(
+      //   context,
+      //   "RepairHistory",
+      //   backgroundColor: context.appColors.whiteBG,
+      // ),
+      backgroundColor: ColorUtils.string2Color("#F2F3F6"),
+      body: SizedBox(
+          width: double.infinity,
+          height: double.infinity,
+          child: EasyRefresh(
+            key: ValueKey('history'),
+            controller: vm.refreshController,
+            // 上拉加载
+            onLoad: () async{
+              Log.d("----onLoad");
+              vm.loadMore();
+            },
+            // 下拉刷新
+            onRefresh: () async{
+              Log.d("----onRefresh");
+              vm.onRefresh();
+            },
+            child: LoadStateLayout(
+              state: state.loadingState,
+              errorMessage: state.errorMessage,
+              errorRetry: () {
+                vm.retryRequest();
+              },
+              successSliverWidget:[
+                SliverList(
+                  delegate: SliverChildBuilderDelegate(
+                        (context, index) {
+                      return  _buildRepairHistoryItem(
+                          context,
+                          ref,
+                          state.list[index],
+                          vm,
+                          serviceTypeCode,
+                          serviceStatusCode,
+                      ).onTap((){
+                        vm.gotoCleanOrderDetailPage(
+                          context,
+                          state.list?[index]['id'],
+                          serviceTypeCode,
+                          serviceStatusCode,
+                        );
+                      });
+                    },
+                    childCount: state.list.length,
+                  ),
+                )
+              ],
+            ),
+          ).marginOnly(left: 15,right: 15,top: 0,bottom: 15)
+      ),
+    );
+  }
+
+  Widget _buildRepairHistoryItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int serviceTypeCode, int serviceStatusCode){
+    return Container(
+      margin: const EdgeInsets.only(top: 9),
+      width: double.infinity,
+      decoration: BoxDecoration(
+        color: context.appColors.whiteBG,
+        borderRadius: BorderRadius.circular(8),
+        boxShadow: [
+          BoxShadow(
+            color: ColorUtils.string2Color('#E5E5E5'),
+            offset: const Offset(0, 2),
+            blurRadius: 8,
+          ),
+        ],
+      ),
+      child: StausCardItem(
+        key: UniqueKey(),
+        cardHeight: 175.0,
+        serviceId: item['id'],
+        serviceTypeCode: serviceTypeCode,
+        serviceStatusCode: serviceStatusCode,
+        itemObj: item.cast<String, dynamic>(),
+        onClickCard: (dynamic value) async {
+        },
+      ),
+    );
+  }
+}

+ 38 - 0
packages/cpt_services/lib/modules/services/repair_history/history_state.dart

@@ -0,0 +1,38 @@
+import 'package:widgets/load_state_layout.dart';
+
+class RepairHistoryState {
+  //页面 LoadView 状态的展示
+  LoadState loadingState;
+  String? errorMessage;
+
+  String? keyword;
+  bool? isLiked;
+  List<Map<String, dynamic>> list;
+
+
+  RepairHistoryState({
+    this.loadingState = LoadState.State_Loading,
+    String? errorMessage,
+    this.keyword,
+    this.isLiked,
+    required this.list,
+  });
+
+  RepairHistoryState copyWith({
+    LoadState? loadingState,
+    String? errorMessage,
+    String? keyword,
+    bool? isLiked,
+    Map<String, dynamic>? activeSortMap,
+    List<Map<String, dynamic>>? activeCateGoryList,
+    List<Map<String, dynamic>>? list,
+  }) {
+    return RepairHistoryState(
+      loadingState: loadingState ?? this.loadingState,
+      errorMessage: errorMessage ?? this.errorMessage,
+      keyword: keyword ?? this.keyword,
+      isLiked: isLiked ?? this.isLiked,
+      list: list ?? this.list,
+    );
+  }
+}

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

@@ -0,0 +1,342 @@
+
+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:flutter/cupertino.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/widget_export.dart';
+
+import '../../../respository/services_respository.dart';
+import '../../../router/page/services_page_router.dart';
+import '../clean_order_detail/clean_order_detail_page.dart';
+import 'history_state.dart';
+
+part 'history_vm.g.dart';
+
+@riverpod
+class RepairHistoryVm extends _$RepairHistoryVm {
+  late ServicesRespository servicesRespositoryInstance;
+  bool _needShowPlaceholder = false; //是否展示LoadingView
+  int _page = 1;  // 当前页
+  int _limit = 10; // 每页数量
+  int _count = 0; // 总条数
+
+  Map<String, dynamic> _queryParams = {
+    'category_id': null,
+    'keyword': null,
+    'is_liked': null,
+  };
+
+  // Refresh 控制器
+  final EasyRefreshController refreshController = EasyRefreshController(
+    controlFinishRefresh: true,  //允许刷新
+    controlFinishLoad: true,   //允许加载
+  );
+
+  RepairHistoryState initState() {
+    return RepairHistoryState(
+        list: []
+    );
+  }
+
+  @override
+  RepairHistoryState build(){
+    // 引入数据仓库
+    // servicesRespositoryInstance = ref.read(commonGarageRespositoryProvider);
+    final state = initState();
+    Log.d("--------------------------build---------------------");
+
+    return state;
+  }
+
+
+  //刷新页面状态
+  void changeLoadingState(LoadState loadState, String? errorMsg) {
+    state = state.copyWith(
+        loadingState: loadState,
+        errorMessage: errorMsg
+    );
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----home_service_vm-----initPageData   ${state.loadingState}");
+    onRefresh();
+  }
+
+  // 上拉加载 更多
+  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(list:[]);
+    // 注意:由于 nestedscrollview 嵌套easyfresh 组件  refreshController.callRefresh() 自动刷新只能滚动顶部但是不会触发下拉刷新,这里调用是 用到了将其滚动到顶部的作用,进而刷新操作主动掉接口
+    // https://github.com/xuelongqy/flutter_easy_refresh/issues/692
+    refreshController.callRefresh();
+    refreshController.resetFooter();
+    _page = 1;
+    _needShowPlaceholder = true;
+    getListData();
+  }
+
+
+  // 重试请求
+  Future retryRequest() async {
+    _page = 1;
+    _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': 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");
+    // }
+
+    // 最后赋值
+    _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) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        allList!.addAll(list.map((item) => item.toJson()).toList());
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      if (_page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        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);
+        }
+      }
+    }
+  }
+
+
+  // 点击 收藏/取消收藏
+  Future<bool?> handlerClickCollection(int id, bool? isCollection) async{
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "id": id,
+      };
+      Log.d("请求参数------$params");
+      final result = await servicesRespositoryInstance.fetchGarageColleciton(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        // 修改 该id 的 liked 和 likes_count 字段
+        state.list!.forEach((Map<String, dynamic> element) {
+          GarageSaleRentList elementEntity = GarageSaleRentList.fromJson(element);
+
+          if(elementEntity.id == id){
+            elementEntity.liked = !elementEntity.liked!;
+            elementEntity.likesCount = elementEntity.liked! ? (elementEntity.likesCount! + 1) : (elementEntity.likesCount! - 1);
+          }
+
+          element = elementEntity.toJson();
+
+        });
+        return true;
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      Log.e("Error: $e");
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 设置当前的 _queryParams
+  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;
+  }
+
+  // 去详情页面
+  gotoCleanOrderDetailPage(BuildContext context, int id, int serviceTypeCode, int serviesStatusCode){
+    CleanOrderDetailPage.startInstance(id: id, serviceTypeCode: serviceTypeCode, serviesStatusCode: serviesStatusCode);
+  }
+}

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

@@ -0,0 +1,26 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'history_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$repairHistoryVmHash() => r'a85e3ce352d40334a0721d399e66a94c49f2869e';
+
+/// See also [RepairHistoryVm].
+@ProviderFor(RepairHistoryVm)
+final repairHistoryVmProvider =
+    AutoDisposeNotifierProvider<RepairHistoryVm, RepairHistoryState>.internal(
+  RepairHistoryVm.new,
+  name: r'repairHistoryVmProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$repairHistoryVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RepairHistoryVm = AutoDisposeNotifier<RepairHistoryState>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 232 - 0
packages/cpt_services/lib/modules/services/repair_homeService/home_service_page.dart

@@ -0,0 +1,232 @@
+import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/garage_sale_rent_entity.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter_hooks/flutter_hooks.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_basic/provider/app_config/app_config_service.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/ext_dart.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/screen_util.dart';
+import 'package:shared/utils/size_config.dart';
+import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/my_button.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/my_appbar.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:widgets/widget_export.dart';
+
+import '../../../router/page/services_page_router.dart';
+import 'home_service_vm.dart';
+import 'service_card_item.dart';
+
+@RoutePage()
+class RepairHomeServicePage extends HookConsumerWidget {
+  const RepairHomeServicePage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RepairHomeServicePageRoute());
+    } else {
+      appRouter.push(const RepairHomeServicePageRoute());
+    }
+  }
+
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final vm = ref.read(repairHomeServiceVmProvider.notifier);
+    final state = ref.watch(repairHomeServiceVmProvider);
+    // final appConfigState = ref.watch(appConfigServiceProvider)
+
+
+    useEffect(() {
+      // 组件挂载时执行 - 执行接口请求
+      Future.microtask(() => vm.initPageData());
+      return () {
+        // 组件卸载时执行
+        Log.d("garage_RepairHomeService_page 组件卸载时执行");
+      };
+    }, []);
+
+    return Scaffold(
+      // appBar: MyAppBar.appBar(
+      //   context,
+      //   "RepairHomeService",
+      //   backgroundColor: context.appColors.whiteBG,
+      // ),
+      backgroundColor: ColorUtils.string2Color("#F2F3F6"),
+      body: SizedBox(
+          width: double.infinity,
+          height: double.infinity,
+          child: Column(
+            children: [
+              // sort and filter
+              _buildSortAndFilter(context, ref, vm, state),
+              Expanded(
+                child: EasyRefresh(
+                  key: ValueKey('RepairHomeService'),
+                  controller: vm.refreshController,
+                  // 上拉加载
+                  onLoad: () async{
+                    Log.d("----onLoad");
+                    vm.loadMore();
+                  },
+                  // 下拉刷新
+                  onRefresh: () async{
+                    Log.d("----onRefresh");
+                    vm.onRefresh();
+                  },
+                  child: LoadStateLayout(
+                    state: state.loadingState,
+                    errorMessage: state.errorMessage,
+                    errorRetry: () {
+                      vm.retryRequest();
+                    },
+                    successSliverWidget:[
+                      SliverGrid(
+                        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
+                          crossAxisCount: 2, // 每行显示两个项目
+                          mainAxisSpacing: 15,
+                          crossAxisSpacing: 15,
+                          childAspectRatio: 172.5/170, // 宽高比
+                          // childAspectRatio:  172.5/170 * ScreenUtil.getAdapterSizeCtx(context, 172.5/170), // 宽高比
+                          // childAspectRatio:  172.5/170 * ((172.5/170).ap), // 宽高比
+                        ),
+                        delegate: SliverChildBuilderDelegate(
+                              (context, index) {
+                            return  _buildRepairHomeServiceItem(context, ref, state.list[index], vm).onTap((){
+                              vm.handlerGotoDetail(context: context, id: state.list[index]['id'], serviceTypeCode: state.list[index]['service_type']);
+                            });
+                          },
+                          childCount: state.list.length,
+                        ),
+                      ),
+                    ],
+                  ),
+                ).marginOnly(left: 15,right: 15,top: 0,bottom: 15),
+              ),
+            ],
+          )
+      ),
+    );
+  }
+
+  Widget _buildRepairHomeServiceItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm){
+    return SizedBox(
+      width: double.infinity,
+      // height: 170,
+      child: Container(
+        decoration: BoxDecoration(
+          color: context.appColors.whiteBG,
+          borderRadius: BorderRadius.circular(8),
+          boxShadow: [
+            BoxShadow(
+              color: ColorUtils.string2Color('#E5E5E5'),
+              offset: const Offset(0, 2),
+              blurRadius: 8,
+            ),
+          ],
+        ),
+        child: Column(
+            mainAxisAlignment: MainAxisAlignment.start,
+            crossAxisAlignment: CrossAxisAlignment.start,
+            mainAxisSize: MainAxisSize.max,
+            children: [
+              // 卡片头部(头像 标题 时间)
+              Expanded(
+                child: RepairHomeServiceCard(
+                    key: UniqueKey(),
+                    itemObj: item.cast<String, dynamic>(),
+                    onClickColleciotn: (dynamic collectionValue) async {
+                      Log.d("点击了喜欢按钮  --id:${item['id']}- $collectionValue");
+                      int id = item['id'];
+                      return await vm.handlerClickCollection(id, collectionValue);
+                    }
+                ),
+              ),
+            ]
+        ),
+      ),
+    );
+  }
+
+  Widget _buildSortAndFilter(BuildContext context, WidgetRef ref, vm, state) {
+    final sortTitle = ref.watch(repairHomeServiceVmProvider.select((state) => state.sortBySelectedOption));
+
+    final expandSortIcon = useState<bool>(false);
+
+    return Container(
+      padding: const EdgeInsets.only(left: 15, right: 15, top: 10, bottom: 10),
+      color: context.appColors.whiteBG,
+      child: Row(
+        mainAxisAlignment: MainAxisAlignment.spaceBetween,
+        crossAxisAlignment: CrossAxisAlignment.center,
+        children: [
+          // 筛选
+          Row(
+            children: [
+              MyTextView(
+                "Sort",
+                fontSize: 15,
+                isFontRegular: true,
+                textAlign: TextAlign.center,
+              ),
+              Wrap(
+                crossAxisAlignment: WrapCrossAlignment.center,
+                children: [
+                  Row(
+                    children: [
+                      sortTitle != null? MyTextView(
+                        "${sortTitle}",
+                        fontSize: 13,
+                        isFontRegular: true,
+                        textAlign: TextAlign.center,
+                        marginLeft: 15,
+                        textColor: context.appColors.textPrimary,
+                      ): const SizedBox(),
+                      IconButton(
+                        // padding: EdgeInsets.zero,
+                        constraints: const BoxConstraints(),
+                        onPressed: null,
+                        icon: Icon(
+                            expandSortIcon.value ? Icons.arrow_drop_up: Icons.arrow_drop_down
+                        ),
+                      ),
+                    ],
+                  ),
+                ],
+              ),
+            ],
+          ),
+
+          // 排序
+          const MyAssetImage(
+            Assets.serviceFilterIcon,
+            width: 20.5,
+            height: 20.9,
+          ).onTap((){
+            Log.d("点击了filter");
+            vm.handlerClickFilterIcon(context);
+          }),
+        ]
+      ).onTap((){
+        Log.d("点击了sort");
+        vm.handlerClickSortIcon(context);
+        expandSortIcon.value = !expandSortIcon.value;
+
+      }),
+    );
+  }
+
+  _buildCustomSort(BuildContext context, WidgetRef ref, vm, state) {
+    return Container();
+  }
+
+}

+ 47 - 0
packages/cpt_services/lib/modules/services/repair_homeService/home_service_state.dart

@@ -0,0 +1,47 @@
+import 'package:widgets/load_state_layout.dart';
+
+class RepairHomeServiceState {
+  //页面 LoadView 状态的展示
+  LoadState loadingState;
+  String? errorMessage;
+
+  String? keyword;
+  bool? isLiked;
+  // contact type 类型选项
+  final List<String> sortByOptionsList = ["Most Likes", "Most bookmarked", "View at Most"];
+  String? sortBySelectedOption;
+
+  List<Map<String, dynamic>> activeCateGoryList;
+  List<Map<String, dynamic>> list;
+
+
+  RepairHomeServiceState({
+    this.loadingState = LoadState.State_Loading,
+    String? errorMessage,
+    this.keyword,
+    this.isLiked,
+    this.sortBySelectedOption ,
+    this.activeCateGoryList = const [],
+    required this.list,
+  });
+
+  RepairHomeServiceState copyWith({
+    LoadState? loadingState,
+    String? errorMessage,
+    String? keyword,
+    bool? isLiked,
+    String? sortBySelectedOption,
+    List<Map<String, dynamic>>? activeCateGoryList,
+    List<Map<String, dynamic>>? list,
+  }) {
+    return RepairHomeServiceState(
+      loadingState: loadingState ?? this.loadingState,
+      errorMessage: errorMessage ?? this.errorMessage,
+      keyword: keyword ?? this.keyword,
+      isLiked: isLiked ?? this.isLiked,
+      sortBySelectedOption: sortBySelectedOption ?? this.sortBySelectedOption,
+      activeCateGoryList: activeCateGoryList ?? this.activeCateGoryList,
+      list: list ?? this.list,
+    );
+  }
+}

+ 520 - 0
packages/cpt_services/lib/modules/services/repair_homeService/home_service_vm.dart

@@ -0,0 +1,520 @@
+
+import 'package:cs_resources/generated/assets.dart';
+import 'package:cs_resources/theme/app_colors_theme.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:flutter/material.dart';
+import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:widgets/dialog/app_custom_dialog.dart';
+import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/my_checkbox_group.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import 'package:widgets/widget_export.dart';
+
+import '../../../respository/services_respository.dart';
+import '../../../router/page/services_page_router.dart';
+import 'home_service_state.dart';
+
+part 'home_service_vm.g.dart';
+
+@riverpod
+class RepairHomeServiceVm extends _$RepairHomeServiceVm {
+  late ServicesRespository servicesRespositoryInstance;
+  bool _needShowPlaceholder = false; //是否展示LoadingView
+  int _page = 1;  // 当前页
+  int _limit = 10; // 每页数量
+  int _count = 0; // 总条数
+
+
+  bool _isSingleSelect = true;
+  List<Map<String, dynamic>> _currentSelectedCategory = [];
+
+  Map<String, dynamic> _queryParams = {
+    'category_id': null,
+    'keyword': null,
+    'is_liked': null,
+  };
+
+  // Refresh 控制器
+  final EasyRefreshController refreshController = EasyRefreshController(
+    controlFinishRefresh: true,  //允许刷新
+    controlFinishLoad: true,   //允许加载
+  );
+
+  RepairHomeServiceState initState() {
+    return RepairHomeServiceState(
+        list: []
+    );
+  }
+
+  @override
+  RepairHomeServiceState build(){
+    // 引入数据仓库
+    // servicesRespositoryInstance = ref.read(commonGarageRespositoryProvider);
+    final state = initState();
+    Log.d("--------------------------build---------------------");
+
+    return state;
+  }
+
+
+  //刷新页面状态
+  void changeLoadingState(LoadState loadState, String? errorMsg) {
+    state = state.copyWith(
+        loadingState: loadState,
+        errorMessage: errorMsg
+    );
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----home_service_vm-----initPageData   ${state.loadingState}");
+    onRefresh();
+  }
+
+  // 上拉加载 更多
+  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(list:[]);
+    // 注意:由于 nestedscrollview 嵌套easyfresh 组件  refreshController.callRefresh() 自动刷新只能滚动顶部但是不会触发下拉刷新,这里调用是 用到了将其滚动到顶部的作用,进而刷新操作主动掉接口
+    // https://github.com/xuelongqy/flutter_easy_refresh/issues/692
+    refreshController.callRefresh();
+    refreshController.resetFooter();
+    _page = 1;
+    _needShowPlaceholder = true;
+    getListData();
+  }
+
+
+  // 重试请求
+  Future retryRequest() async {
+    _page = 1;
+    _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',
+        'price': 30,
+        'unit': '/hr',
+        'liked': true,
+        'likes_count': 12,
+        'company_name': 'HONG YE GROUP PTE LTD',
+      },
+      {
+        'id':2,
+        'service_type': 1,  // 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': 'Air Conditioning Cleaning',
+        'price': 10,
+        'unit': '/unit',
+        'liked': false,
+        'likes_count': 10,
+        'company_name': 'HONG YE GROUP PTE LTD',
+      },
+      {
+        'id':3,
+        'service_type': 2,  // 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': 'Repair air Conditioner Services',
+        'price': 200,
+        'unit': '/hr',
+        'liked': true,
+        'likes_count': 1212,
+        '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;
+
+  }
+
+  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) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        allList!.addAll(list.map((item) => item.toJson()).toList());
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      if (_page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        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);
+        }
+      }
+    }
+  }
+
+  // 获取 homeservice 的分类选项
+  Future<List<Map<String, dynamic>>> getRepairHomeServiceCategoryOptions() async{
+    await Future.delayed(const Duration(milliseconds: 300));
+    ToastEngine.dismiss();
+    List<Map<String, dynamic>> serviceCategoryList = [
+      {
+        'id': 1,
+        'name': 'House Cleaning Serivces',
+      },
+      {
+        'id': 2,
+        'name': 'Household Appliance Cleaning',
+      },
+    ];
+
+    // 获取分类列表
+    // try {
+    //   // 加入有缓存 就取缓存
+    //   List<Map<String, dynamic>>? StorageCategoryList = SPUtil.getObjectList(
+    //       AppConstant.storageGarageCategoryList)?.cast<Map<String, dynamic>>();
+    //
+    //   if (StorageCategoryList != null && StorageCategoryList.isNotEmpty) {
+    //     Log.d("取StorageCategoryList 缓存: $StorageCategoryList ");
+    //     serviceCategoryList = StorageCategoryList;
+    //   } else {
+    //     Map<String, dynamic> params = {};
+    //     final result = await commonGarageRespositoryInstance
+    //         .fetchGarageCateGoryList(params);
+    //     if (result.isSuccess) {
+    //       final listJson = result.getListJson();
+    //       // 将 listJson 转换为 List<Map<String, dynamic>>
+    //       serviceCategoryList = (listJson as List?)
+    //           ?.map((item) => item as Map<String, dynamic>)
+    //           .toList() ?? [];
+    //       // 将 serviceCategoryList 存入缓存
+    //       Log.d("设置StorageCategoryList 缓存");
+    //       SPUtil.putObjectList(
+    //           AppConstant.storageGarageCategoryList, serviceCategoryList);
+    //     }
+    //   }
+    // } catch(error){
+    //
+    // }
+    return serviceCategoryList;
+  }
+
+  // 点击了filter icon
+  handlerClickFilterIcon(BuildContext context) async{
+    List<Map<String, dynamic>> serviceCategoryList = await getRepairHomeServiceCategoryOptions();
+    // 显示弹框
+    handlerShowChooseGarageCategoryDialog(context, serviceCategoryList);
+
+  }
+
+  Future<void> handlerShowChooseGarageCategoryDialog(BuildContext context, List<Map<String, dynamic>> garageCategoryList) async{
+    await DialogEngine.show(
+        tag: "chooseGarageSaleCategory",
+        position: DialogPosition.center,
+        widget: AppCustomDialog(
+          message: '',
+          title: 'Choose a Category',
+          dialogWidth: MediaQuery.of(context).size.width * 0.8,
+          // contentBoxMaxHeight: 350,
+          // contentBoxMinHeight: 300,
+          isShowConfirmBtn: garageCategoryList!.length > 0 ? true: false,
+          confirmTxt: "Ok",
+          messageBuilder: (BuildContext context){
+            return Container(
+              color: context.appColors.textWhite,
+              child: Column(
+                mainAxisAlignment: MainAxisAlignment.start,
+                crossAxisAlignment: CrossAxisAlignment.start,
+                children: garageCategoryList!.length > 0 ? [
+                  MyCheckboxGroup(
+                      isSingleSelect: _isSingleSelect,
+                      labelStyle: const TextStyle(
+                        fontSize: 16,
+                        fontWeight: FontWeight.w500,
+                      ),
+                      items: garageCategoryList!,
+                      defaultSelectedItems: [],
+                      onChanged: (List<Map<String, dynamic>> selectedItems){
+                        Log.d("----MyCheckboxGroup onChanged  $selectedItems");
+                        _currentSelectedCategory = selectedItems;
+                      }
+                  )
+                ]: [
+                  Container(
+                    child: CircularProgressIndicator(
+                      strokeWidth: 3,
+                      valueColor: AlwaysStoppedAnimation(context.appColors.textDarkGray),
+                    ),
+                  )
+                ],
+              ),
+            );
+          },
+          isShowCancelBtn:false,
+          confirmAction: (){
+            // 点击了确定
+            Log.d("----点击了确定按钮");
+            int? categoryId;
+            if(_isSingleSelect){
+              if(_currentSelectedCategory.length > 0){
+                categoryId = _currentSelectedCategory[0]['id'];
+              }
+            }
+
+            setCurrentQueryParams({
+              "category_id": _queryParams?['categoryId'],
+            });
+            directRefresh();
+          },
+        )
+    );
+  }
+
+
+  // 点击 收藏/取消收藏
+  Future<bool?> handlerClickCollection(int id, bool? isCollection) async{
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "id": id,
+      };
+      Log.d("请求参数------$params");
+      final result = await servicesRespositoryInstance.fetchGarageColleciton(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        // 修改 该id 的 liked 和 likes_count 字段
+        state.list!.forEach((Map<String, dynamic> element) {
+          GarageSaleRentList elementEntity = GarageSaleRentList.fromJson(element);
+
+          if(elementEntity.id == id){
+            elementEntity.liked = !elementEntity.liked!;
+            elementEntity.likesCount = elementEntity.liked! ? (elementEntity.likesCount! + 1) : (elementEntity.likesCount! - 1);
+          }
+
+          element = elementEntity.toJson();
+
+        });
+        return true;
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      Log.e("Error: $e");
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 设置当前的 _queryParams
+  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;
+  }
+
+  // 点击 sort icon
+  handlerClickSortIcon(BuildContext context) async{
+    // await  SmartDialog.showAttach(
+    //   targetContext: context,
+    //   alignment: Alignment.bottomCenter,
+    //   highlightBuilder: (Offset targetOffset, Size targetSize) {
+    //     Log.d("666 ${targetOffset} ${targetSize}");
+    //     return Positioned(
+    //       right: 0,
+    //       top: 0,
+    //       child: Container(height: targetOffset.dy + 50, width: targetSize.width, color: Colors.white),
+    //     );
+    //   },
+    //   builder: (_) => _listDialog(),
+    // );
+    // DialogEngine.showAttach(
+    //     targetContext: context,
+    //     position: DialogPosition.top,
+    //     clickMaskDismiss:false,
+    //     usePenetrate: true,
+    //     widget: _listDialog()
+    // );
+
+    OptionPickerUtil.showCupertinoOptionPicker(
+      items: state.sortByOptionsList,
+      initialSelectIndex: 0,
+      onPickerChanged: (_, index) {
+        state = state.copyWith(sortBySelectedOption: state.sortByOptionsList?[index]);
+        // 调用list 接口
+      },
+    );
+  }
+
+  Widget _listDialog() {
+    return Container(
+      width: 200,
+      height: 200,
+      color: Colors.white,
+      child: Column(
+        children: [
+          Text("排序方式"),
+          Text("价格从低到高"),
+          Text("价格从高到低"),
+          Text("距离最近"),
+          Text("距离最远"),
+        ],
+      ),
+    );
+  }
+
+  // 去详情页面
+  void handlerGotoDetail({BuildContext? context, required int id, int serviceTypeCode= 0 }){
+    Log.d("去详情页面  $id  $serviceTypeCode");
+    if(serviceTypeCode == 0 || serviceTypeCode == 1){
+      // clean service  跳转到 clean 详情页
+      appRouter.push(ServiceCleanDetailPageRoute(id: id, serviceTypeCode: serviceTypeCode));
+    }else if(serviceTypeCode == 2){
+      // repair service 跳转到 repair 详情页
+      appRouter.push(ServiceRepairDetailPageRoute(id: id, serviceTypeCode: serviceTypeCode));
+    }
+  }
+
+}

+ 27 - 0
packages/cpt_services/lib/modules/services/repair_homeService/home_service_vm.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'home_service_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$repairHomeServiceVmHash() =>
+    r'a3b0fad948ce8102784f895ebc097ee87ffe844d';
+
+/// See also [RepairHomeServiceVm].
+@ProviderFor(RepairHomeServiceVm)
+final repairHomeServiceVmProvider = AutoDisposeNotifierProvider<
+    RepairHomeServiceVm, RepairHomeServiceState>.internal(
+  RepairHomeServiceVm.new,
+  name: r'repairHomeServiceVmProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$repairHomeServiceVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RepairHomeServiceVm = AutoDisposeNotifier<RepairHomeServiceState>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 235 - 0
packages/cpt_services/lib/modules/services/repair_homeService/service_card_item.dart

@@ -0,0 +1,235 @@
+import 'package:cs_resources/generated/assets.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_hooks/flutter_hooks.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/ext_dart.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_view.dart';
+
+import '../../../constants_services.dart';
+
+
+// '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',
+// 'price': 66,
+// 'unit': '/hr',
+// 'liked': true,
+// 'likes_count': 1212,
+// 'company_name': 'HONG YE GROUP PTE LTD',
+
+
+class RepairHomeServiceCard extends StatelessWidget {
+  Map<String, dynamic>? serviceType = servicesConstants.servicesType['houseCleaning'];
+  Map<String, dynamic> itemObj;
+  double? cardHeight;
+  final Function()? onTap;
+  final Function(dynamic)? onClickColleciotn;
+
+  RepairHomeServiceCard({
+    Key? key,
+    this.serviceType,
+    required this.itemObj,
+    this.onTap,
+    this.onClickColleciotn,
+    double? cardHeight,
+  }) : super(key: key) {
+    this.cardHeight ??= 170;
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    List? card_resources = itemObj.getValue<List>("resources", [])?? [];
+    String card_img = card_resources.length>0? card_resources[0]:"";
+    String card_title = itemObj.getValue("title", "");
+    final unit = itemObj.getValue("unit", "");
+
+    int card_price = itemObj.getValue("price", "");
+    String card_created_at = itemObj.getValue("created_at", "");
+    bool card_liked = itemObj.getValue("liked", false);
+    int card_likes_count = itemObj.getValue("likes_count", 0);
+    final company_name = itemObj.getValue("company_name", "");
+    return Column(
+      children: [
+        // 图片
+        Row(
+          mainAxisAlignment: MainAxisAlignment.center,
+          crossAxisAlignment: CrossAxisAlignment.center,
+          children: [
+            Expanded(
+              child: ClipRRect(
+                borderRadius: const BorderRadius.only(topLeft: Radius.circular(8), topRight: Radius.circular(8),),
+                child: MyLoadImage(
+                  card_img,
+                  width: 172.5,
+                  height: 80.5.ap,
+                  isCircle: false,
+                  fit: BoxFit.cover,
+                ),
+              ),
+            ),
+          ],
+        ),
+        // 标题
+        Padding(
+          padding: const EdgeInsets.only(left: 10, right: 10, top: 10,),
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: [
+              Expanded(
+                child: SizedBox(
+                  height: 30.ap,
+                  child: MyTextView(
+                    card_title,
+                    maxLines: 2,
+                    isTextEllipsis: true,
+                    textAlign: TextAlign.left,
+                    textColor: context.appColors.textBlack,
+                    fontSize: 15,
+                    isFontRegular: true,
+                  ),
+                ),
+              ),
+            ],
+          ),
+        ),
+        // 价格 及 收藏
+        Padding(
+          padding: const EdgeInsets.only(left: 10, right: 10,top: 0, bottom: 0),
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.spaceAround,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              Expanded(
+                child: Row(
+                  mainAxisAlignment: MainAxisAlignment.start,
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  children: [
+                    MyTextView(
+                      'from',
+                      maxLines: 1,
+                      isTextEllipsis: true,
+                      textAlign: TextAlign.start,
+                      textColor: ColorUtils.string2Color('#666666'),
+                      fontSize: 11,
+                      isFontMedium: true,
+                    ),
+                    MyTextView(
+                      '\$$card_price',
+                      maxLines: 1,
+                      isTextEllipsis: true,
+                      textAlign: TextAlign.start,
+                      textColor: ColorUtils.string2Color('#4161D0'),
+                      fontSize: 15,
+                      isFontMedium: true,
+                      marginLeft: 2,
+                    ),
+                    MyTextView(
+                      '$unit',
+                      maxLines: 1,
+                      isTextEllipsis: true,
+                      textAlign: TextAlign.start,
+                      textColor: ColorUtils.string2Color('#666666'),
+                      fontSize: 11,
+                      isFontMedium: true,
+                    ),
+                  ],
+                ),
+              ),
+              // 动态的 收藏数
+              CollectionWidget(
+                collectionNum: card_likes_count,
+                isCollection: card_liked,
+                onClickColleciotn: onClickColleciotn,
+              ),
+            ],
+          ),
+        ),
+        // 公司名称
+        Expanded(
+          child: Padding(
+            padding: const EdgeInsets.only(bottom: 5),
+            child: MyTextView(
+              company_name,
+              maxLines: 1,
+              isTextEllipsis: true,
+              textAlign: TextAlign.start,
+              marginLeft: 13,
+              fontSize: 11,
+              textColor: ColorUtils.string2Color('#666666'),
+              alignment: Alignment.centerLeft,
+              isFontRegular: true,
+            ),
+          ),
+        )
+      ],
+    );
+  }
+}
+
+
+
+class CollectionWidget extends HookConsumerWidget {
+  int collectionNum = 0;
+  bool isCollection = false;
+  final Function(dynamic)? onClickColleciotn;
+  CollectionWidget({
+    Key? key,
+    required this.collectionNum,
+    required this.isCollection,
+    this.onClickColleciotn,
+  }) : super(key: key);
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final collectionNumState = useState(collectionNum);
+    final isCollectionState = useState(isCollection);
+    return Container(
+        width: 60,
+        height: 30,
+        alignment: Alignment.center,
+        // decoration: BoxDecoration(
+        //   color: ColorUtils.string2Color('#E5E5E5'),
+        //   borderRadius: BorderRadius.circular(15),
+        // ),
+        child: Row(
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: [
+              MyTextView(
+                '${collectionNumState.value}',
+                textColor: context.appColors.textBlack,
+                fontSize: 14,
+                isFontRegular: true,
+                marginRight: 7,
+              ),
+              MyLoadImage(
+                isCollectionState.value? Assets.communityLikeActive: Assets.communityLike,
+                width: 14.1,
+                height: 14,
+              )
+            ]
+          // 点击 收餐/取消收藏
+        ).onTap(() async{
+          // Log.d("点击了收藏按钮  ${isCollectionState.value}");
+          // ToastEngine.show("点击了收藏按钮 ${isCollectionState.value}");
+          final result = await onClickColleciotn?.call(isCollectionState.value);
+          if(result !=null && result){
+            isCollectionState.value = !isCollectionState.value;
+            collectionNumState.value = (collectionNumState.value + (isCollectionState.value? 1: -1))<0? 0: (collectionNumState.value + (isCollectionState.value? 1: -1));
+            if(isCollectionState.value){
+              // ToastEngine.show("Collect Success");
+            }else {
+              // ToastEngine.show("Cancel Collect Success");
+            }
+          }
+        })
+    );
+  }
+}

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

@@ -0,0 +1,149 @@
+import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/garage_sale_rent_entity.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter_hooks/flutter_hooks.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_basic/provider/app_config/app_config_service.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/ext_dart.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/screen_util.dart';
+import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/my_button.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/my_appbar.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:widgets/widget_export.dart';
+
+import '../../../constants_services.dart';
+import '../../../router/page/services_page_router.dart';
+import 'in_progress_vm.dart';
+import '../../../components/status_card_item.dart';
+
+@RoutePage()
+class RepairInProgressPage extends HookConsumerWidget {
+  const RepairInProgressPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const RepairInProgressPageRoute());
+    } else {
+      appRouter.push(const RepairInProgressPageRoute());
+    }
+  }
+
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final vm = ref.read(repairInProgressVmProvider.notifier);
+    final state = ref.watch(repairInProgressVmProvider);
+    // final appConfigState = ref.watch(appConfigServiceProvider)
+
+    int serviceTypeCode = servicesConstants.servicesType['houseCleaning']?['code'];
+    int serviceStatusCode = servicesConstants.servicesStatus['1']?['code'];
+
+    useEffect(() {
+      // 组件挂载时执行 - 执行接口请求
+      Future.microtask(() => vm.initPageData());
+      return () {
+        // 组件卸载时执行
+        Log.d("inProgress_page 组件卸载时执行");
+      };
+    }, []);
+
+    return Scaffold(
+      // appBar: MyAppBar.appBar(
+      //   context,
+      //   "RepairInProgress",
+      //   backgroundColor: context.appColors.whiteBG,
+      // ),
+      backgroundColor: ColorUtils.string2Color("#F2F3F6"),
+      body: SizedBox(
+          width: double.infinity,
+          height: double.infinity,
+          child: EasyRefresh(
+            key: ValueKey('inProgress'),
+            controller: vm.refreshController,
+            // 上拉加载
+            onLoad: () async{
+              Log.d("----onLoad");
+              vm.loadMore();
+            },
+            // 下拉刷新
+            onRefresh: () async{
+              Log.d("----onRefresh");
+              vm.onRefresh();
+            },
+            child: LoadStateLayout(
+              state: state.loadingState,
+              errorMessage: state.errorMessage,
+              errorRetry: () {
+                vm.retryRequest();
+              },
+              successSliverWidget:[
+                SliverList(
+                  delegate: SliverChildBuilderDelegate(
+                        (context, index) {
+                      return  _buildRepairInProgressItem(
+                          context,
+                          ref,
+                          state.list[index],
+                          vm,
+                          serviceTypeCode,
+                          serviceStatusCode
+                      ).onTap((){
+                        vm.gotoCleanOrderDetailPage(
+                            context,
+                            state.list?[index]['id'],
+                            serviceTypeCode,
+                            serviceStatusCode
+                        );
+                      });
+                    },
+                    childCount: state.list.length,
+                  ),
+                )
+              ],
+            ),
+          ).marginOnly(left: 15,right: 15,top: 0,bottom: 15)
+      ),
+    );
+  }
+
+  Widget _buildRepairInProgressItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int serviceTypeCode, int serviceStatusCode){
+    return Container(
+      margin: const EdgeInsets.only(top: 9),
+      width: double.infinity,
+      decoration: BoxDecoration(
+        color: context.appColors.whiteBG,
+        borderRadius: BorderRadius.circular(8),
+        boxShadow: [
+          BoxShadow(
+            color: ColorUtils.string2Color('#E5E5E5'),
+            offset: const Offset(0, 2),
+            blurRadius: 8,
+          ),
+        ],
+      ),
+      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);
+          },
+      ),
+    );
+  }
+}

+ 38 - 0
packages/cpt_services/lib/modules/services/repair_inProgress/in_progress_state.dart

@@ -0,0 +1,38 @@
+import 'package:widgets/load_state_layout.dart';
+
+class RepairInProgressState {
+  //页面 LoadView 状态的展示
+  LoadState loadingState;
+  String? errorMessage;
+
+  String? keyword;
+  bool? isLiked;
+  List<Map<String, dynamic>> list;
+
+
+  RepairInProgressState({
+    this.loadingState = LoadState.State_Loading,
+    String? errorMessage,
+    this.keyword,
+    this.isLiked,
+    required this.list,
+  });
+
+  RepairInProgressState copyWith({
+    LoadState? loadingState,
+    String? errorMessage,
+    String? keyword,
+    bool? isLiked,
+    Map<String, dynamic>? activeSortMap,
+    List<Map<String, dynamic>>? activeCateGoryList,
+    List<Map<String, dynamic>>? list,
+  }) {
+    return RepairInProgressState(
+      loadingState: loadingState ?? this.loadingState,
+      errorMessage: errorMessage ?? this.errorMessage,
+      keyword: keyword ?? this.keyword,
+      isLiked: isLiked ?? this.isLiked,
+      list: list ?? this.list,
+    );
+  }
+}

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

@@ -0,0 +1,342 @@
+
+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:flutter/cupertino.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/widget_export.dart';
+
+import '../../../respository/services_respository.dart';
+import '../../../router/page/services_page_router.dart';
+import '../clean_order_detail/clean_order_detail_page.dart';
+import 'in_progress_state.dart';
+
+part 'in_progress_vm.g.dart';
+
+@riverpod
+class RepairInProgressVm extends _$RepairInProgressVm {
+  late ServicesRespository servicesRespositoryInstance;
+  bool _needShowPlaceholder = false; //是否展示LoadingView
+  int _page = 1;  // 当前页
+  int _limit = 10; // 每页数量
+  int _count = 0; // 总条数
+
+  Map<String, dynamic> _queryParams = {
+    'category_id': null,
+    'keyword': null,
+    'is_liked': null,
+  };
+
+  // Refresh 控制器
+  final EasyRefreshController refreshController = EasyRefreshController(
+    controlFinishRefresh: true,  //允许刷新
+    controlFinishLoad: true,   //允许加载
+  );
+
+  RepairInProgressState initState() {
+    return RepairInProgressState(
+        list: []
+    );
+  }
+
+  @override
+  RepairInProgressState build(){
+    // 引入数据仓库
+    // servicesRespositoryInstance = ref.read(commonGarageRespositoryProvider);
+    final state = initState();
+    Log.d("--------------------------build---------------------");
+
+    return state;
+  }
+
+
+  //刷新页面状态
+  void changeLoadingState(LoadState loadState, String? errorMsg) {
+    state = state.copyWith(
+        loadingState: loadState,
+        errorMessage: errorMsg
+    );
+  }
+
+  // 初始化页面数据
+  initPageData() {
+    Log.d("----home_service_vm-----initPageData   ${state.loadingState}");
+    onRefresh();
+  }
+
+  // 上拉加载 更多
+  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(list:[]);
+    // 注意:由于 nestedscrollview 嵌套easyfresh 组件  refreshController.callRefresh() 自动刷新只能滚动顶部但是不会触发下拉刷新,这里调用是 用到了将其滚动到顶部的作用,进而刷新操作主动掉接口
+    // https://github.com/xuelongqy/flutter_easy_refresh/issues/692
+    refreshController.callRefresh();
+    refreshController.resetFooter();
+    _page = 1;
+    _needShowPlaceholder = true;
+    getListData();
+  }
+
+
+  // 重试请求
+  Future retryRequest() async {
+    _page = 1;
+    _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;
+
+  }
+
+  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) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        allList!.addAll(list.map((item) => item.toJson()).toList());
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      if (_page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        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);
+        }
+      }
+    }
+  }
+
+
+  // 点击 收藏/取消收藏
+  Future<bool?> handlerClickCollection(int id, bool? isCollection) async{
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "id": id,
+      };
+      Log.d("请求参数------$params");
+      final result = await servicesRespositoryInstance.fetchGarageColleciton(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        // 修改 该id 的 liked 和 likes_count 字段
+        state.list!.forEach((Map<String, dynamic> element) {
+          GarageSaleRentList elementEntity = GarageSaleRentList.fromJson(element);
+
+          if(elementEntity.id == id){
+            elementEntity.liked = !elementEntity.liked!;
+            elementEntity.likesCount = elementEntity.liked! ? (elementEntity.likesCount! + 1) : (elementEntity.likesCount! - 1);
+          }
+
+          element = elementEntity.toJson();
+
+        });
+        return true;
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      Log.e("Error: $e");
+      ToastEngine.show("Error: $e");
+    }
+  }
+
+  // 设置当前的 _queryParams
+  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;
+  }
+
+  //  去详情页面
+  gotoCleanOrderDetailPage(BuildContext context, int id, int serviceTypeCode, int serviesStatusCode){
+    CleanOrderDetailPage.startInstance(id: id, serviceTypeCode: serviceTypeCode, serviesStatusCode: serviesStatusCode);
+  }
+}

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

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'in_progress_vm.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$repairInProgressVmHash() =>
+    r'968f6c5d90c2f5e7b510e0430617bacbff3062d4';
+
+/// See also [RepairInProgressVm].
+@ProviderFor(RepairInProgressVm)
+final repairInProgressVmProvider = AutoDisposeNotifierProvider<
+    RepairInProgressVm, RepairInProgressState>.internal(
+  RepairInProgressVm.new,
+  name: r'repairInProgressVmProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$repairInProgressVmHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$RepairInProgressVm = AutoDisposeNotifier<RepairInProgressState>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

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

@@ -7,7 +7,7 @@ part of 'service_clean_detail_vm.dart';
 // **************************************************************************
 
 String _$serviceCleanDetailVmHash() =>
-    r'c2d89942fd0baf13ac415edc25da0f650f4b34b0';
+    r'77e8421e0ac469ea7f2131499d6c15634efb6faa';
 
 /// See also [ServiceCleanDetailVm].
 @ProviderFor(ServiceCleanDetailVm)

+ 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'c3673d6b8f6296e9f28d6067ea138a001e1223f1';
+    r'e3dcc7851836ad14ed970e2f4d5cc0482c71efcb';
 
 /// See also [ServiceEvaluateCreateVm].
 @ProviderFor(ServiceEvaluateCreateVm)

+ 3 - 75
packages/cpt_services/lib/modules/services/service_order_confirm/service_order_confirm_page.dart

@@ -316,17 +316,17 @@ class ServiceOrderConfirmPage extends HookConsumerWidget {
         ),
         if (serviceTypeCode == servicesConstants.servicesType['houseCleaning']!['code'])
           // 室内清理
-          _buildHouseCleanContent(state, vm, context)
+          _buildCleanContent(state, vm, context)
         else if (serviceTypeCode == servicesConstants.servicesType['airConditioner']!['code'])
           // 空调清理
-          _buildAirConditionContent(state, vm, context)
+          _buildCleanContent(state, vm, context)
         else
           const SizedBox.shrink(),
       ],
     );
   }
 
-  Widget _buildHouseCleanContent(ServiceOrderConfirmState state, ServiceOrderConfirmVm vm, BuildContext context) {
+  Widget _buildCleanContent(ServiceOrderConfirmState state, ServiceOrderConfirmVm vm, BuildContext context) {
     final title = 'House Cleaning Services';
     final areaSizeRange = '1 Bedroom';
     final num =  1;
@@ -399,78 +399,6 @@ class ServiceOrderConfirmPage extends HookConsumerWidget {
     );
   }
 
-  Widget _buildAirConditionContent(ServiceOrderConfirmState state, ServiceOrderConfirmVm vm, 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),
-      margin: EdgeInsets.only(left: 15, right: 15, top: 0, bottom: 0),
-      color: ColorUtils.string2Color('#F8F8F8'),
-      child: Column(
-        children: [
-          Row(
-            mainAxisAlignment: MainAxisAlignment.spaceBetween,
-            mainAxisSize: MainAxisSize.max,
-            children: [
-              Expanded(
-                child: Column(
-                  crossAxisAlignment: CrossAxisAlignment.start,
-                  children: [
-                    MyTextView(
-                      title,
-                      fontSize: 16,
-                      isFontMedium: true,
-                      textColor: context.appColors.textBlack,
-                    ),
-                    MyTextView(
-                      areaSizeRange,
-                      fontSize: 15,
-                      isFontRegular: true,
-                      textColor: context.appColors.textDarkGray999,
-                      marginTop: 5,
-                    ),
-                  ],
-                ),
-              ),
-              // MyCartNum(onChange: (value){
-              //   vm.handlerChangeNum(context, value, index);
-              // })
-              // MyButton(
-              //   text: '\$$price',
-              //   onPressed: (){
-              //       // vm.handlerChangeNum(context, value, index);
-              //   },
-              //   fontSize: 19,
-              //   fontWeight: FontWeight.w500,
-              // )
-              Container(
-                child: MyButton(
-                  text: '\$$price',
-                  onPressed: null,
-                  minWidth: 80,
-                  minHeight: 40,
-                  fontSize: 19,
-                  fontWeight: FontWeight.w500,
-                  // enable: !isDisable.value,
-                  textColor:  context.appColors.textPrimary,
-                  backgroundColor: context.appColors.textWhite,
-                  disabledBackgroundColor: context.appColors.disEnableGray,
-                  disabledTextColor: context.appColors.textWhite,
-                ),
-              ),
-            ],
-          ),
-          // Divider(),
-        ],
-      ),
-    );
-  }
 
   Widget _buildOrderVisitTime(ServiceOrderConfirmState state, ServiceOrderConfirmVm vm, BuildContext context) {
     return Row(

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

@@ -7,7 +7,7 @@ part of 'service_order_confirm_vm.dart';
 // **************************************************************************
 
 String _$serviceOrderConfirmVmHash() =>
-    r'be532359d0dafb1791899b22cd2af3492872a0df';
+    r'f302671a6b33ca6b42dd89579c7a75e3b2356be6';
 
 /// See also [ServiceOrderConfirmVm].
 @ProviderFor(ServiceOrderConfirmVm)

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

@@ -7,7 +7,7 @@ part of 'service_pay_success_vm.dart';
 // **************************************************************************
 
 String _$servicePaySuccessVmHash() =>
-    r'459e97a97f9d2e878e216041d5d5714378cf8ad5';
+    r'37cd1f2a065e99e6bc860775c976a5c901df1f49';
 
 /// See also [ServicePaySuccessVm].
 @ProviderFor(ServicePaySuccessVm)

+ 36 - 3
packages/cpt_services/lib/modules/services/services_main_page.dart

@@ -62,26 +62,31 @@ class ServicesMainPage extends HookConsumerWidget {
         "ServicesMain",
         backgroundColor: context.appColors.whiteBG,
       ),
-      backgroundColor: context.appColors.backgroundDefault,
+      backgroundColor: ColorUtils.string2Color("#F2F3F6"),
       body: Container(
         child: GridView.count(
           crossAxisCount: 2,
           padding: EdgeInsets.all(10),
           mainAxisSpacing: 10,
           crossAxisSpacing: 10,
+          childAspectRatio: 165/146,
           children: [
             _buildServiceCard(
               context,
               ServicesType.cleaning,
-              Assets.serviceInProgress,
+              Assets.serviceHomeServices,
               "Home Services",
+              102.5,
+              82.5,
               ServicesPage.startInstance,
             ),
             _buildServiceCard(
               context,
               ServicesType.repair,
-              Assets.serviceHistory,
+              Assets.serviceMaintenance,
               "Maintenance",
+              129,
+              107.5,
               RepairPage.startInstance,
             ),
           ]
@@ -95,9 +100,12 @@ class ServicesMainPage extends HookConsumerWidget {
     ServicesType type,
     String imagePath,
     String title,
+      double iconWidth,
+      double iconHeight,
     Function() onTap,
   ) {
     return Container(
+      margin: EdgeInsets.all(10),
       decoration: BoxDecoration(
         color: context.appColors.whiteBG,
         borderRadius: BorderRadius.circular(10),
@@ -109,6 +117,31 @@ class ServicesMainPage extends HookConsumerWidget {
           ),
         ],
       ),
+      child: Stack(
+        children: [
+          Padding(
+            padding: const EdgeInsets.only(left: 15, right:15.0, top: 10,bottom: 10),
+            child: MyTextView(
+              title,
+              fontSize: 16,
+              isFontMedium: true,
+              alignment: Alignment.topLeft,
+            ),
+          ),
+          Positioned(
+            bottom: 0,
+            right: 0,
+            child: Container(
+              child: MyLoadImage(
+                imagePath,
+                fit: BoxFit.cover,
+                width: iconWidth,
+                height: iconHeight,
+              ),
+            ),
+          )
+        ]
+      )
     ).onTap((){
       if(type == ServicesType.cleaning){
         ServicesPage.startInstance();

+ 2 - 1
packages/cpt_services/lib/router/component/services_component_service.dart

@@ -1,6 +1,7 @@
 /*
  * Community 组件的组件路由
  */
+import 'package:cpt_services/modules/services/services_main_page.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:router/componentRouter/service_service.dart';
 import 'package:flutter/material.dart';
@@ -20,6 +21,6 @@ class ServicesComponentService extends ServiceService {
 
   @override
   void startServicePage() {
-    ServicesPage.startInstance();
+    ServicesMainPage.startInstance();
   }
 }

+ 20 - 16
packages/cpt_services/lib/router/page/services_page_router.dart

@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:router/path/router_path.dart';
 
+import '../../modules/services/repair_homeService/home_service_page.dart';
 import '../../modules/services/services_main_page.dart';
 
 import '../../modules/services/homeService/home_service_page.dart';
@@ -22,6 +23,9 @@ import '../../modules/services/clean_order_cancel_success/clean_order_cancel_suc
 
 
 import '../../modules/services/repair/repair_page.dart';
+import '../../modules/services/repair_history/history_page.dart';
+import '../../modules/services/repair_homeService/home_service_page.dart';
+import '../../modules/services/repair_inProgress/in_progress_page.dart';
 
 
 part 'services_page_router.gr.dart';
@@ -40,24 +44,24 @@ class ServicesPageRouter extends _$ServicesPageRouter {
     ),
     CustomRoute(
         page: RepairPageRoute.page,
-        path: RouterPath.repair,
+        path: RouterPath.repairServices,
         transitionsBuilder: applySlideTransition,
         children: [
-          // CustomRoute(
-          //     page: RepairHomeServicePageRoute.page,
-          //     path: RouterPath.repaireHomeService,
-          //     transitionsBuilder: applySlideTransition
-          // ),
-          // CustomRoute(
-          //   page: RepairInProgressPageRoute.page,
-          //   path: RouterPath.repairInProgress,
-          //   transitionsBuilder: applySlideTransition,
-          // ),
-          // CustomRoute(
-          //   page: RepairHistoryPageRoute.page,
-          //   path: RouterPath.repairHistory,
-          //   transitionsBuilder: applySlideTransition,
-          // ),
+          CustomRoute(
+              page: RepairHomeServicePageRoute.page,
+              path: RouterPath.repairServicesHomeService,
+              transitionsBuilder: applySlideTransition
+          ),
+          CustomRoute(
+            page: RepairInProgressPageRoute.page,
+            path: RouterPath.repairServicesInProgress,
+            transitionsBuilder: applySlideTransition,
+          ),
+          CustomRoute(
+            page: RepairHistoryPageRoute.page,
+            path: RouterPath.repairServicesHistory,
+            transitionsBuilder: applySlideTransition,
+          ),
         ]
     ),
     CustomRoute(

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

@@ -63,6 +63,24 @@ abstract class _$ServicesPageRouter extends RootStackRouter {
         child: const InProgressPage(),
       );
     },
+    RepairHistoryPageRoute.name: (routeData) {
+      return AutoRoutePage<dynamic>(
+        routeData: routeData,
+        child: const RepairHistoryPage(),
+      );
+    },
+    RepairHomeServicePageRoute.name: (routeData) {
+      return AutoRoutePage<dynamic>(
+        routeData: routeData,
+        child: const RepairHomeServicePage(),
+      );
+    },
+    RepairInProgressPageRoute.name: (routeData) {
+      return AutoRoutePage<dynamic>(
+        routeData: routeData,
+        child: const RepairInProgressPage(),
+      );
+    },
     RepairPageRoute.name: (routeData) {
       final args = routeData.argsAs<RepairPageRouteArgs>(
           orElse: () => const RepairPageRouteArgs());
@@ -291,6 +309,48 @@ class InProgressPageRoute extends PageRouteInfo<void> {
 }
 
 /// generated route for
+/// [RepairHistoryPage]
+class RepairHistoryPageRoute extends PageRouteInfo<void> {
+  const RepairHistoryPageRoute({List<PageRouteInfo>? children})
+      : super(
+          RepairHistoryPageRoute.name,
+          initialChildren: children,
+        );
+
+  static const String name = 'RepairHistoryPageRoute';
+
+  static const PageInfo<void> page = PageInfo<void>(name);
+}
+
+/// generated route for
+/// [RepairHomeServicePage]
+class RepairHomeServicePageRoute extends PageRouteInfo<void> {
+  const RepairHomeServicePageRoute({List<PageRouteInfo>? children})
+      : super(
+          RepairHomeServicePageRoute.name,
+          initialChildren: children,
+        );
+
+  static const String name = 'RepairHomeServicePageRoute';
+
+  static const PageInfo<void> page = PageInfo<void>(name);
+}
+
+/// generated route for
+/// [RepairInProgressPage]
+class RepairInProgressPageRoute extends PageRouteInfo<void> {
+  const RepairInProgressPageRoute({List<PageRouteInfo>? children})
+      : super(
+          RepairInProgressPageRoute.name,
+          initialChildren: children,
+        );
+
+  static const String name = 'RepairInProgressPageRoute';
+
+  static const PageInfo<void> page = PageInfo<void>(name);
+}
+
+/// generated route for
 /// [RepairPage]
 class RepairPageRoute extends PageRouteInfo<RepairPageRouteArgs> {
   RepairPageRoute({

BIN
packages/cs_resources/assets/service/home_services.webp


BIN
packages/cs_resources/assets/service/maintenance.webp


+ 2 - 0
packages/cs_resources/lib/generated/assets.dart

@@ -243,8 +243,10 @@ class Assets {
   static const String serviceFilterIcon = 'assets/service/filter-icon.webp';
   static const String serviceHighlightIcon = 'assets/service/highlight-icon.webp';
   static const String serviceHistory = 'assets/service/history.webp';
+  static const String serviceHomeServices = 'assets/service/home_services.webp';
   static const String serviceInProgress = 'assets/service/in-progress.webp';
   static const String serviceLocationIcon = 'assets/service/location-icon.webp';
+  static const String serviceMaintenance = 'assets/service/maintenance.webp';
   static const String serviceMoneyIcon = 'assets/service/money-icon.webp';
   static const String servicePaySuccessIcon = 'assets/service/pay-success-icon.webp';
   static const String servicePaymentIcon = 'assets/service/payment-icon.webp';

+ 5 - 1
packages/cs_router/lib/path/router_path.dart

@@ -151,7 +151,11 @@ class RouterPath {
   static const servicesEvaluateList = '/services_evaluate_list';
 
 
-  static const repair = '/repair';
+  static const repairServices = '/repair_services';
+  static const repairServicesHomeService = 'repair_services_home_service';
+  static const repairServicesInProgress = 'repair_services_in_progress';
+  static const repairServicesHistory = 'repair_services_history';
+
 
 
   //全局其他