feat: 清单分享编码与加购选规格

详情展示/复制唯一编码,分享链接按编码只读打开;加购须先选规格;列表可复制编码。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
李琦
2026-10-21 08:17:58 +08:00
parent cfb128d2f0
commit 39446ca08c
4 changed files with 350 additions and 30 deletions

View File

@@ -5,8 +5,16 @@ const prefix = 'list/'
export const getCartListApi = async () => {
return await get(`${prefix}list`)
}
export const getCartItemApi = async (id) => {
return await get(`${prefix}detail`, {id})
export const getCartItemApi = async (params) => {
const query = typeof params === 'object' && params !== null
? params
: { id: params }
return await get(`${prefix}detail`, query)
}
export const ensureShareCodeApi = async (listId) => {
return await post(`${prefix}ensure-share-code`, {
list_id: listId,
})
}
export const createCartApi = async (params) => {
return await post(`${prefix}create`, params)
@@ -21,10 +29,12 @@ export const deleteCartItemApi = async (id) => {
ids: [id]
})
}
export const toCartApi = async (listId, productId) => {
export const toCartApi = async (listId, productId, priceSheetId, routineIndex) => {
return await post(`${prefix}to-cart`, {
list_id: listId,
product_id: productId
product_id: productId,
price_sheet_id: priceSheetId,
routine_index: routineIndex,
})
}
export const submitHighIntentApi = async (list_id, intent_remark = '') => {