fix(transfer): 修复转让记录 API 路径与参数不匹配
- API 路径: /transfers/my → /transfers(后端无 /my 子路由) - 分页参数: page/pageSize → limit/offset(匹配后端 DTO) - 转让记录页显示具体错误信息便于调试 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cb9953047f
commit
d5d61f4f68
|
|
@ -13,7 +13,7 @@ import '../network/api_client.dart';
|
|||
// - POST /transfers 发起转让
|
||||
// - POST /transfers/:no/confirm 卖方确认
|
||||
// - POST /transfers/:no/cancel 取消转让
|
||||
// - GET /transfers/my 我的转让记录
|
||||
// - GET /transfers 我的转让记录
|
||||
// - GET /transfers/:no 转让详情
|
||||
//
|
||||
// === 与现有 PlantingService 的关系 ===
|
||||
|
|
@ -309,10 +309,10 @@ class TransferService {
|
|||
try {
|
||||
debugPrint('[TransferService] 获取转让记录: role=$role');
|
||||
final response = await _apiClient.get(
|
||||
'/transfers/my',
|
||||
'/transfers',
|
||||
queryParameters: {
|
||||
'page': page,
|
||||
'pageSize': pageSize,
|
||||
'limit': pageSize,
|
||||
'offset': (page - 1) * pageSize,
|
||||
if (role != null) 'role': role,
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -211,6 +211,17 @@ class _TransferListPageState extends ConsumerState<TransferListPage>
|
|||
'加载失败',
|
||||
style: const TextStyle(color: Color(0xFF5D4037), fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
child: Text(
|
||||
_errorMessage ?? '',
|
||||
style: const TextStyle(color: Color(0xFF999999), fontSize: 11),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 5,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
GestureDetector(
|
||||
onTap: _loadData,
|
||||
|
|
|
|||
Loading…
Reference in New Issue