修正商品发货地定位逻辑

改用高德地图附近 POI 查询发货地,移除闲鱼定位接口调用。发货地改为可选项,虚拟商品可直接发布;修正闲鱼网页版要求的纬度、经度 GPS 顺序,并补充前端映射与发布测试。
This commit is contained in:
Christ committed 2026-08-13 11:44:35 +08:00
1 parent 65bcb8f15c
commit ac85ac8a0a
15 files changed
+255 -214

No files matched your search

+19 -2
View File
@@ -17,8 +17,9 @@ import {
getShippingRules,
getShippingRulesPage,
getSystemSettings,
getValidOrders,
logout,
getValidOrders,
publishItem,
logout,
importOrders,
passwordLogin,
resolveAutomationRun,
@@ -228,6 +229,22 @@ test('deleteItemPublishBatch removes an abandoned preview', async () => {
}));
});
test('publishItem allows virtual publishing without an optional location', async () => {
const fetchMock = vi.fn().mockResolvedValue(jsonResponse({ success: true }));
vi.stubGlobal('fetch', fetchMock);
await publishItem({
cookie_id: 'acc1',
title: '虚拟商品',
description: '',
price: '12.50',
quantity: 1,
postage_mode: 'none',
images: [],
});
const body = fetchMock.mock.calls[0][1].body as FormData;
expect(body.get('location')).toBeNull();
});
test('getItems normalizes multi-spec flags from backend values', async () => {
vi.stubGlobal('fetch', vi.fn().mockResolvedValue(jsonResponse([{
cookie_id: 'cookie-1',