feat: #13 公开商品 API 补充 code/barcode/batch.quantity,报错反馈携带商品和门店信息

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-08 22:39:59 +08:00
parent 3b2ebc0202
commit fab7bd21dd
4 changed files with 39 additions and 24 deletions
@@ -70,13 +70,22 @@ class _PublicProductScreenState extends State<PublicProductScreen> {
title: title,
hint: hint,
onSubmit: (msg) async {
final shopNo = (_data?['shop'] as Map<String, dynamic>?)?['code'] as String? ?? '';
final productName = _data?['name'] as String? ?? '';
final productCode = _data?['code'] as String? ?? '';
final productInfo = [
if (productName.isNotEmpty) productName,
if (productCode.isNotEmpty) productCode,
if (widget.publicId.isNotEmpty) widget.publicId,
].join(' / ');
await _dio.post(
'${AppConfig.apiBaseUrl}/public/errors',
data: {
'error_type': errorType,
'error_msg': msg,
'platform': 'web-scan',
'shop_no': (_data?['shop'] as Map<String, dynamic>?)?['code'] as String? ?? '',
'shop_no': shopNo,
if (productInfo.isNotEmpty) 'product_info': productInfo,
},
);
},