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:
parent
4074281088
commit
a44f6c7c35
|
|
@ -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,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@ class _PlantingLocationPageState extends ConsumerState<PlantingLocationPage> {
|
|||
// 1. 选择省市
|
||||
await plantingService.selectProvinceCity(
|
||||
widget.orderNo,
|
||||
_selectedProvinceCode!,
|
||||
_selectedCityCode!,
|
||||
_selectedProvinceName!,
|
||||
_selectedCityName!,
|
||||
);
|
||||
|
||||
// 2. 确认省市选择
|
||||
|
|
|
|||
Loading…
Reference in New Issue