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

View File

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