46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
import {get, post} from '../request';
|
|
|
|
const prefix = 'list/'
|
|
|
|
export const getCartListApi = async () => {
|
|
return await get(`${prefix}list`)
|
|
}
|
|
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)
|
|
}
|
|
export const deleteCartApi = async (id) => {
|
|
return await post(`${prefix}delete`, {
|
|
ids: [id]
|
|
})
|
|
}
|
|
export const deleteCartItemApi = async (id) => {
|
|
return await post(`${prefix}delete-item`, {
|
|
ids: [id]
|
|
})
|
|
}
|
|
export const toCartApi = async (listId, productId, priceSheetId, routineIndex) => {
|
|
return await post(`${prefix}to-cart`, {
|
|
list_id: listId,
|
|
product_id: productId,
|
|
price_sheet_id: priceSheetId,
|
|
routine_index: routineIndex,
|
|
})
|
|
}
|
|
export const submitHighIntentApi = async (list_id, intent_remark = '') => {
|
|
return await post(`${prefix}submit-high-intent`, { list_id, intent_remark })
|
|
}
|
|
export const savePreferSkuApi = async (params) => {
|
|
return await post(`${prefix}save-prefer-sku`, params)
|
|
}
|