fix(mobile): send provinceName/cityName instead of codes to API

API expects provinceName and cityName (strings) but frontend was
sending provinceCode and cityCode (numbers), causing 400 error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-10 08:23:03 -08:00
parent 4074281088
commit a44f6c7c35
2 changed files with 9 additions and 9 deletions

View File

@ -142,21 +142,21 @@ class PlantingService {
/// ///
/// ///
/// [orderNo] /// [orderNo]
/// [provinceCode] /// [provinceName]
/// [cityCode] /// [cityName]
Future<PlantingOrder> selectProvinceCity( Future<PlantingOrder> selectProvinceCity(
String orderNo, String orderNo,
String provinceCode, String provinceName,
String cityCode, String cityName,
) async { ) async {
try { try {
debugPrint('[PlantingService] 选择省市: orderNo=$orderNo, province=$provinceCode, city=$cityCode'); debugPrint('[PlantingService] 选择省市: orderNo=$orderNo, province=$provinceName, city=$cityName');
final response = await _apiClient.post( final response = await _apiClient.post(
'/planting/orders/$orderNo/select-province-city', '/planting/orders/$orderNo/select-province-city',
data: { data: {
'provinceCode': provinceCode, 'provinceName': provinceName,
'cityCode': cityCode, 'cityName': cityName,
}, },
); );

View File

@ -126,8 +126,8 @@ class _PlantingLocationPageState extends ConsumerState<PlantingLocationPage> {
// 1. // 1.
await plantingService.selectProvinceCity( await plantingService.selectProvinceCity(
widget.orderNo, widget.orderNo,
_selectedProvinceCode!, _selectedProvinceName!,
_selectedCityCode!, _selectedCityName!,
); );
// 2. // 2.