chooseVisitTimeBottomFooter_vm.dart 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import 'package:cpt_services/modules/services/service_order_confirm/service_order_confirm_vm.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:riverpod_annotation/riverpod_annotation.dart';
  5. import 'package:router/ext/auto_router_extensions.dart';
  6. import 'package:shared/utils/log_utils.dart';
  7. import 'package:widgets/dialog/dialog_content_wrap.dart';
  8. import '../../../respository/services_respository.dart';
  9. part 'chooseVisitTimeBottomFooter_vm.g.dart';
  10. List<Map<String, dynamic>> airConditionList = [
  11. {
  12. "name": "Hanging air conditioner (unit)",
  13. "id": 1,
  14. "price": 40.0,
  15. },
  16. {
  17. "name": "Cabinet air conditioner (unit)",
  18. "id": 2,
  19. "price": 50.0,
  20. },
  21. {
  22. "name": "Cylindrical air conditioner (unit)",
  23. "id": 3,
  24. "price": 60.0,
  25. },
  26. {
  27. "name": "Central air conditioning (group)",
  28. "id": 4,
  29. "price": 70.0,
  30. },
  31. ];
  32. @riverpod
  33. class ChooseVisitTimeBottomFooterVm extends _$ChooseVisitTimeBottomFooterVm {
  34. // late ServicesRespository serviceRespositoryInstance;
  35. @override
  36. build(){
  37. // 引入数据仓库
  38. // serviceRespositoryInstance = ref.read(servicesRespositoryProvider);
  39. final state = null;
  40. Log.d("--------------------------build---------------------");
  41. return state;
  42. }
  43. handlerChangeNum(BuildContext context, int num, int index){
  44. // state.airConditionList[index].num = num;
  45. // state = state.copyWith(
  46. // airConditionList: state.airConditionList,
  47. // );
  48. }
  49. handlerClickVisitTimeConfirm(BuildContext context,{required int id, required int serviceTypeCode} ){
  50. Log.d("handlerClickVisitTimeConfirm");
  51. // 关闭 visitTime 弹框
  52. final serviceOrderConfrimVm = ref.read(serviceOrderConfirmVmProvider.notifier);
  53. serviceOrderConfrimVm.handlerHideVisitTimeDialog();
  54. }
  55. }