Files
2023-11-14 17:21:03 +08:00

70 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import api from './api'
/**
* 添加购物车
*/
export function getCartAdd(data) {
return api.post('/cart/add', data, {login: false})
}
/**
* 删除购物车
*/
export function getCartDel(data) {
return api.post('/cart/cart/del', data, {login: false})
}
/**
* 购物车列表
*/
export function getCartList(data) {
return api.get('/cart/cart/list', data, {login: false})
}
/**
* 购物车列表
*/
export function getCartNum(data) {
return api.post('/cart/num', data, {login: false})
}
/**
* 购物车数量
*/
export function getCartCount(data) {
return api.get('/cart/count', data, {login: false})
}
// ======================== 👇kahu refactor ================================
/**
* 改变用户购物车数量
* @param data {{number:number,id:any}}
* {number:更改后的数量id:购物车item的id}
* @returns {*}
*/
export const updateCartNumber = (data) => api.post('/cart/num', data, {login: false})
/**
* 获取用户已勾选购物车统计数据
* @param data {{ cartId:string }}
* {cartId:购物车id拼接字符串}
* @returns {*}
*/
export const computeSelectInfo = (data) => api.post('/order/confirm', data, {login: false})
/**
* 根据ids删除购物车
* @param data {{ ids:string[] }}
* @returns {*}
*/
export const deleteCartByIds = (data) => api.post('/cart/cart/del', data, {login: false})
/**
* 更改SKU
* @param data {{id:number,productId:any,productAttrUnique:any}}
* @returns {*}
*/
export const changeCartSku = (data) => api.post('/cart/cart/changeSku', data)