| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376 |
- import 'package:flutter/material.dart';
- import 'package:go_router/go_router.dart';
- import 'package:flutter_riverpod/flutter_riverpod.dart';
- import '../../core/theme/app_colors.dart';
- import '../shell/nav_bar_config.dart';
- import '../../core/utils/date_utils.dart' as du;
- import '../../core/i18n/app_localizations.dart';
- import 'outing_log_list_controller.dart';
- class OutingLogDetailPage extends ConsumerWidget {
- final String id;
- const OutingLogDetailPage({super.key, required this.id});
- @override
- Widget build(BuildContext context, WidgetRef ref) {
- final log = mockOutingLogs.firstWhere(
- (e) => e.id == id,
- orElse: () => mockOutingLogs.first,
- );
- final l10n = AppLocalizations.of(context);
- ref
- .read(navBarConfigProvider.notifier)
- .update(
- NavBarConfig(
- title: l10n.get('outingLogDetail'),
- showBack: true,
- onBack: () => context.pop(),
- ),
- );
- return SingleChildScrollView(
- child: Column(
- children: [
- // 地图占位区
- Container(
- width: double.infinity,
- height: 160,
- padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
- child: Container(
- decoration: BoxDecoration(
- color: const Color(0xFFE8F4FD),
- borderRadius: BorderRadius.circular(8),
- ),
- child: const Center(
- child: Icon(
- Icons.map_outlined,
- size: 40,
- color: AppColors.primary,
- ),
- ),
- ),
- ),
- // 信息卡片区
- Padding(
- padding: const EdgeInsets.all(16),
- child: Column(
- children: [
- // 客户信息
- Container(
- width: double.infinity,
- padding: const EdgeInsets.all(16),
- decoration: BoxDecoration(
- color: AppColors.bgCard,
- borderRadius: BorderRadius.circular(8),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- log.customerName,
- style: const TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.w700,
- color: AppColors.textPrimary,
- ),
- ),
- const SizedBox(height: 8),
- Text(
- '${log.visitNo} · ${du.DateUtils.formatDate(log.visitDate)}',
- style: const TextStyle(
- fontSize: 12,
- color: AppColors.textSecondary,
- ),
- ),
- const SizedBox(height: 4),
- Text(
- log.visitLocation,
- style: const TextStyle(
- fontSize: 13,
- color: AppColors.textSecondary,
- ),
- ),
- ],
- ),
- ),
- const SizedBox(height: 16),
- // 工作总结
- Container(
- width: double.infinity,
- padding: const EdgeInsets.all(16),
- decoration: BoxDecoration(
- color: AppColors.bgCard,
- borderRadius: BorderRadius.circular(8),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- '工作总结',
- style: TextStyle(
- fontSize: 14,
- fontWeight: FontWeight.w600,
- color: AppColors.textPrimary,
- ),
- ),
- const SizedBox(height: 8),
- Text(
- log.visitSummary.isNotEmpty
- ? log.visitSummary
- : '暂无工作总结',
- style: const TextStyle(
- fontSize: 14,
- color: AppColors.textSecondary,
- height: 1.5,
- ),
- ),
- ],
- ),
- ),
- const SizedBox(height: 16),
- // 后续计划
- Container(
- width: double.infinity,
- padding: const EdgeInsets.all(16),
- decoration: BoxDecoration(
- color: AppColors.bgCard,
- borderRadius: BorderRadius.circular(8),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- '后续计划',
- style: TextStyle(
- fontSize: 14,
- fontWeight: FontWeight.w600,
- color: AppColors.textPrimary,
- ),
- ),
- const SizedBox(height: 8),
- Text(
- log.nextVisitContent.isNotEmpty
- ? log.nextVisitContent
- : '${du.DateUtils.formatDate(log.nextVisitTime)} · 暂无计划',
- style: const TextStyle(
- fontSize: 14,
- color: AppColors.textSecondary,
- height: 1.5,
- ),
- ),
- ],
- ),
- ),
- const SizedBox(height: 16),
- // 现场照片
- Container(
- width: double.infinity,
- padding: const EdgeInsets.all(16),
- decoration: BoxDecoration(
- color: AppColors.bgCard,
- borderRadius: BorderRadius.circular(8),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- '现场照片',
- style: TextStyle(
- fontSize: 14,
- fontWeight: FontWeight.w600,
- color: AppColors.textPrimary,
- ),
- ),
- const SizedBox(height: 12),
- Row(
- children: [
- _buildPhotoPlaceholder(),
- const SizedBox(width: 8),
- _buildPhotoPlaceholder(),
- const SizedBox(width: 8),
- _buildPhotoPlaceholder(),
- ],
- ),
- ],
- ),
- ),
- const SizedBox(height: 16),
- // 主管点评
- Container(
- width: double.infinity,
- padding: const EdgeInsets.all(12),
- decoration: BoxDecoration(
- color: AppColors.primaryLight,
- borderRadius: BorderRadius.circular(8),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const Text(
- '王经理 · 销售总监',
- style: TextStyle(
- fontSize: 14,
- fontWeight: FontWeight.w600,
- color: AppColors.textPrimary,
- ),
- ),
- const Row(
- children: [
- Icon(
- Icons.star,
- size: 16,
- color: AppColors.warning,
- ),
- Icon(
- Icons.star,
- size: 16,
- color: AppColors.warning,
- ),
- Icon(
- Icons.star,
- size: 16,
- color: AppColors.warning,
- ),
- Icon(
- Icons.star,
- size: 16,
- color: AppColors.warning,
- ),
- Icon(
- Icons.star_border,
- size: 16,
- color: AppColors.textPlaceholder,
- ),
- ],
- ),
- ],
- ),
- const SizedBox(height: 8),
- const Text(
- '本次拜访准备充分,方案汇报专业到位。建议后续跟进加快节奏,争取本月内签单。',
- style: TextStyle(
- fontSize: 14,
- color: AppColors.textSecondary,
- height: 1.5,
- ),
- ),
- const SizedBox(height: 8),
- Text(
- du.DateUtils.formatDateTime(log.updateTime),
- style: const TextStyle(
- fontSize: 12,
- color: AppColors.textPlaceholder,
- ),
- ),
- ],
- ),
- ),
- // 底部点评输入区
- const SizedBox(height: 16),
- Container(
- width: double.infinity,
- padding: const EdgeInsets.all(16),
- decoration: BoxDecoration(
- color: AppColors.bgCard,
- borderRadius: BorderRadius.circular(8),
- ),
- child: Row(
- children: [
- const Row(
- children: [
- Icon(
- Icons.star_border,
- size: 20,
- color: AppColors.warning,
- ),
- SizedBox(width: 2),
- Icon(
- Icons.star_border,
- size: 20,
- color: AppColors.warning,
- ),
- SizedBox(width: 2),
- Icon(
- Icons.star_border,
- size: 20,
- color: AppColors.warning,
- ),
- SizedBox(width: 2),
- Icon(
- Icons.star_border,
- size: 20,
- color: AppColors.warning,
- ),
- SizedBox(width: 2),
- Icon(
- Icons.star_border,
- size: 20,
- color: AppColors.textPlaceholder,
- ),
- ],
- ),
- const SizedBox(width: 12),
- Expanded(
- child: Container(
- padding: const EdgeInsets.symmetric(
- horizontal: 12,
- vertical: 8,
- ),
- decoration: BoxDecoration(
- color: AppColors.bgPage,
- borderRadius: BorderRadius.circular(18),
- ),
- child: const Text(
- '输入点评…',
- style: TextStyle(
- fontSize: 14,
- color: AppColors.textPlaceholder,
- ),
- ),
- ),
- ),
- const SizedBox(width: 8),
- const Text(
- '发送',
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: AppColors.primary,
- ),
- ),
- ],
- ),
- ),
- const SizedBox(height: 24),
- ],
- ),
- ),
- ],
- ),
- );
- }
- Widget _buildPhotoPlaceholder() {
- return Container(
- width: 105,
- height: 105,
- decoration: BoxDecoration(
- color: const Color(0xFFD0E8F8),
- borderRadius: BorderRadius.circular(4),
- ),
- );
- }
- }
|