完善商品发布位置与 Docker 运行环境
This commit is contained in:
1 parent
9adc77df73
commit
7ec0b4a078
21 files changed
+431
-176
No files matched your search
@@ -522,6 +522,7 @@ export const publishItem = async (form: {
|
||||
postage_mode: string;
|
||||
postage?: string;
|
||||
images: File[];
|
||||
location: PublishLocation;
|
||||
}): Promise<any> => {
|
||||
const body = new FormData();
|
||||
body.set('cookie_id', form.cookie_id);
|
||||
@@ -532,12 +533,29 @@ export const publishItem = async (form: {
|
||||
body.set('quantity', String(form.quantity));
|
||||
body.set('postage_mode', form.postage_mode);
|
||||
body.set('postage', form.postage || '');
|
||||
body.set('location', JSON.stringify(form.location));
|
||||
for (const file of form.images) {
|
||||
body.append('images', file);
|
||||
}
|
||||
return postForm('/items/publish', body);
|
||||
}
|
||||
|
||||
export interface PublishLocation {
|
||||
area: string;
|
||||
city: string;
|
||||
division_id: string;
|
||||
longitude: number;
|
||||
latitude: number;
|
||||
poi_id: string;
|
||||
poi_name: string;
|
||||
province: string;
|
||||
}
|
||||
|
||||
export const getPublishLocations = async (cookieId: string, longitude: number, latitude: number): Promise<PublishLocation[]> => {
|
||||
const result = await post<any>('/items/publish-locations', { cookie_id: cookieId, longitude, latitude });
|
||||
return Array.isArray(result?.locations) ? result.locations : [];
|
||||
}
|
||||
|
||||
export const recommendPublishCategory = async (cookieId: string, keyword: string): Promise<{
|
||||
success: boolean;
|
||||
category: {
|
||||
@@ -560,6 +578,7 @@ export const previewItemPublishBatch = async (form: {
|
||||
channelCatId?: string;
|
||||
tbCatId?: string;
|
||||
};
|
||||
location: PublishLocation;
|
||||
}): Promise<any> => {
|
||||
const body = new FormData();
|
||||
body.set('file', form.file);
|
||||
@@ -569,6 +588,7 @@ export const previewItemPublishBatch = async (form: {
|
||||
body.set('fallback_category_name', form.fallbackCategory.catName);
|
||||
body.set('fallback_channel_category_id', form.fallbackCategory.channelCatId || '');
|
||||
body.set('fallback_tb_category_id', form.fallbackCategory.tbCatId || '');
|
||||
body.set('location', JSON.stringify(form.location));
|
||||
return postForm('/items/publish-batches/preview', body);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user