diff --git a/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_position_page.dart b/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_position_page.dart index f4ff684a..3653124e 100644 --- a/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_position_page.dart +++ b/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_position_page.dart @@ -345,9 +345,9 @@ class _PrePlantingPositionPageState ], ), const SizedBox(height: 16), - // 合并进度条 + // 合成进度条 const Text( - '合并进度', + '合成进度', style: TextStyle( fontSize: 14, fontFamily: 'Inter', @@ -389,8 +389,8 @@ class _PrePlantingPositionPageState ), ], ), - // 省市信息(如有) - if (pos.hasProvinceCity) ...[ + // 省市信息(仅在有中文名称时显示) + if (pos.provinceName != null && pos.cityName != null) ...[ const SizedBox(height: 12), Row( children: [ @@ -401,7 +401,7 @@ class _PrePlantingPositionPageState ), const SizedBox(width: 4), Text( - '${pos.provinceName ?? pos.provinceCode} · ${pos.cityName ?? pos.cityCode}', + '${pos.provinceName!} · ${pos.cityName!}', style: const TextStyle( fontSize: 13, color: Color(0xFF745D43), @@ -594,7 +594,7 @@ class _PrePlantingPositionPageState const SizedBox(width: 16), _buildInfoChip( Icons.monetization_on_outlined, - '${order.totalAmount.toInt()} USDT', + '${order.totalAmount.toInt()} 绿积分', ), ], ), diff --git a/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_purchase_page.dart b/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_purchase_page.dart index 18ca123b..b507f02d 100644 --- a/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_purchase_page.dart +++ b/frontend/mobile-app/lib/features/pre_planting/presentation/pages/pre_planting_purchase_page.dart @@ -166,12 +166,12 @@ class _PrePlantingPurchasePageState _pricePerPortion = pricingConfig.totalPortionPrice.toDouble(); _isLoading = false; - // 续购时自动填入已保存的省市 + // 续购时自动填入已保存的省市(名称不回退到代码,避免显示数字) if (position.hasProvinceCity) { _selectedProvinceCode = position.provinceCode; - _selectedProvinceName = position.provinceName ?? position.provinceCode; + _selectedProvinceName = position.provinceName; _selectedCityCode = position.cityCode; - _selectedCityName = position.cityName ?? position.cityCode; + _selectedCityName = position.cityName; } // 根据余额自动计算默认份数(默认 1 份) @@ -445,7 +445,9 @@ class _PrePlantingPurchasePageState const SizedBox(height: 8), _buildDialogRow( '省市', - '${_selectedProvinceName ?? "-"} · ${_selectedCityName ?? "-"}', + _selectedProvinceName != null && _selectedCityName != null + ? '$_selectedProvinceName · $_selectedCityName' + : '-', ), if (_position != null) ...[ const Divider(height: 24, color: Color(0x338B5A2B)), @@ -884,7 +886,7 @@ class _PrePlantingPurchasePageState mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text( - '合并进度', + '合成进度', style: TextStyle( fontSize: 16, fontFamily: 'Inter', @@ -1037,7 +1039,9 @@ class _PrePlantingPurchasePageState children: [ Text( _hasSelectedProvinceCity - ? '$_selectedProvinceName · $_selectedCityName' + ? (_selectedProvinceName != null && _selectedCityName != null + ? '$_selectedProvinceName · $_selectedCityName' + : '已锁定') : '点击选择省份和城市', style: TextStyle( fontSize: 16, diff --git a/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart b/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart index b4ed206b..d3765863 100644 --- a/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart +++ b/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart @@ -1116,14 +1116,18 @@ class _LedgerDetailPageState extends ConsumerState Future _showTransactionDetail(LedgerEntry entry) async { if (entry.refOrderId == null) return; + // 预种订单(PPL 前缀)没有合同,不显示合同按钮 + final bool isPrePlanting = entry.refOrderId!.startsWith('PPL'); + showModalBottomSheet( context: context, isScrollControlled: true, backgroundColor: Colors.transparent, builder: (context) => _TransactionDetailSheet( entry: entry, - onViewContract: () => _viewContractPdf(entry.refOrderId!), - onDownloadContract: () => _downloadContractPdf(entry.refOrderId!), + showContractButtons: !isPrePlanting, + onViewContract: isPrePlanting ? null : () => _viewContractPdf(entry.refOrderId!), + onDownloadContract: isPrePlanting ? null : () => _downloadContractPdf(entry.refOrderId!), ), ); } @@ -1231,13 +1235,15 @@ class _LedgerDetailPageState extends ConsumerState /// 交易详情底部弹窗 class _TransactionDetailSheet extends StatelessWidget { final LedgerEntry entry; - final VoidCallback onViewContract; - final VoidCallback onDownloadContract; + final VoidCallback? onViewContract; + final VoidCallback? onDownloadContract; + final bool showContractButtons; const _TransactionDetailSheet({ required this.entry, - required this.onViewContract, - required this.onDownloadContract, + this.onViewContract, + this.onDownloadContract, + this.showContractButtons = true, }); @override @@ -1326,60 +1332,62 @@ class _TransactionDetailSheet extends StatelessWidget { _buildDetailRow('交易后余额', '${_formatAmount(entry.balanceAfter!)} 绿积分'), _buildDetailRow('交易时间', _formatDateTime(entry.createdAt)), if (entry.memo != null && entry.memo!.isNotEmpty) - _buildDetailRow('备注', entry.memo!), + _buildDetailRow('备注', + entry.refOrderId?.startsWith('PPL') == true ? '预种' : entry.memo!), ], ), ), - // 分隔线 - Container( - height: 1, - color: const Color(0x1A8B5A2B), - ), - // 操作按钮 - Padding( - padding: const EdgeInsets.all(20), - child: Row( - children: [ - Expanded( - child: OutlinedButton.icon( - onPressed: () { - Navigator.of(context).pop(); - onViewContract(); - }, - icon: const Icon(Icons.visibility_outlined, size: 18), - label: const Text('查看合同'), - style: OutlinedButton.styleFrom( - foregroundColor: const Color(0xFF5D4037), - side: const BorderSide(color: Color(0xFFD4AF37)), - padding: const EdgeInsets.symmetric(vertical: 14), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - ), - ), - ), - const SizedBox(width: 12), - Expanded( - child: ElevatedButton.icon( - onPressed: () { - Navigator.of(context).pop(); - onDownloadContract(); - }, - icon: const Icon(Icons.download_outlined, size: 18), - label: const Text('下载合同'), - style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFFD4AF37), - foregroundColor: Colors.white, - padding: const EdgeInsets.symmetric(vertical: 14), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - ), - ), - ), - ], + // 合同操作按钮(仅认种支付显示,预种无合同) + if (showContractButtons) ...[ + Container( + height: 1, + color: const Color(0x1A8B5A2B), ), - ), + Padding( + padding: const EdgeInsets.all(20), + child: Row( + children: [ + Expanded( + child: OutlinedButton.icon( + onPressed: () { + Navigator.of(context).pop(); + onViewContract?.call(); + }, + icon: const Icon(Icons.visibility_outlined, size: 18), + label: const Text('查看合同'), + style: OutlinedButton.styleFrom( + foregroundColor: const Color(0xFF5D4037), + side: const BorderSide(color: Color(0xFFD4AF37)), + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + const SizedBox(width: 12), + Expanded( + child: ElevatedButton.icon( + onPressed: () { + Navigator.of(context).pop(); + onDownloadContract?.call(); + }, + icon: const Icon(Icons.download_outlined, size: 18), + label: const Text('下载合同'), + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFFD4AF37), + foregroundColor: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ], + ), + ), + ], ], ), ),