123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- import 'package:cpt_services/components/chooseVisitTimeBottomFooter_vm.dart';
- import 'package:cpt_services/components/chooseVisitTimeContent_vm.dart';
- import 'package:cpt_services/components/status_card_item.dart';
- import 'package:cs_resources/theme/app_colors_theme.dart';
- import 'package:flutter/material.dart';
- import 'package:auto_route/auto_route.dart';
- import 'package:flutter_hooks/flutter_hooks.dart';
- import 'package:hooks_riverpod/hooks_riverpod.dart';
- import 'package:shared/utils/log_utils.dart';
- import 'package:widgets/ext/ex_widget.dart';
- import 'package:widgets/my_text_view.dart';
- import 'package:widgets/widget_export.dart';
- import 'package:widgets/my_cart_num.dart';
- import '../modules/services/service_order_confirm/service_order_confirm_vm.dart';
- class ChooseVisitTimeBottomFooter extends HookConsumerWidget {
- final int id;
- final String cleanServiceType;
- const ChooseVisitTimeBottomFooter({Key? key,required this.id, required this.cleanServiceType}) : super(key: key);
- @override
- Widget build(BuildContext context, WidgetRef ref) {
- final vm = ref.read(chooseVisitTimeBottomFooterVmProvider.notifier);
- final state = ref.watch(chooseVisitTimeBottomFooterVmProvider);
- double toTalPrice = ref.watch(serviceOrderConfirmVmProvider.select((state) => state.totalPrice??0.0));
- useEffect((){
- // 组件挂载时执行 - 执行接口请求
- // Future.microtask(() => vm.initPageData());
- return () {
- // 组件卸载时执行
- };
- },[]);
- return Container(
- height: 50,
- width: double.infinity,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- mainAxisSize: MainAxisSize.max,
- children: [
- Container(
- constraints: const BoxConstraints(
- minWidth: 122,
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisSize: MainAxisSize.max,
- children: [
- Container(
- alignment: Alignment.center,
- padding: const EdgeInsets.only(left:5, right: 0,top:5,bottom: 5),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- mainAxisSize: MainAxisSize.max,
- children: [
- MyTextView(
- "\$$toTalPrice",
- fontSize: 18,
- textColor: Colors.white,
- isFontRegular: true,
- maxLines:2,
- isTextEllipsis: true,
- marginLeft: 5,
- marginRight: 15,
- ),
- ],
- ),
- ),
- ],
- ).backgroundColor(context.appColors.textPrimary),
- ),
- Expanded(
- child: Container(
- color: context.appColors.redDefault,
- child: Center(
- child: MyTextView(
- 'Confirm',
- textColor: context.appColors.textWhite,
- fontSize: 17,
- isFontMedium: true,
- textAlign: TextAlign.center,
- ),
- ),
- ).onTap((){
- vm.handlerClickVisitTimeConfirm(context, id: id , cleanServiceType: cleanServiceType);
- }),
- ),
- ],
- ),
- );
- }
- }
|