Files
lgp-wx-new/api/page/cart.js
2026-10-13 14:04:22 +08:00

36 lines
1015 B
JavaScript

import {get, post} from '../request';
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 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) => {
return await post(`${prefix}to-cart`, {
list_id: listId,
product_id: productId
})
}
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)
}