Files
lgp-wx-new/api/page/cart.js
2026-06-05 14:06:20 +08:00

31 lines
745 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
})
}