|
|
|
/*
|
|
|
|
* @Author: ch
|
|
|
|
* @Date: 2022-04-06 10:14:03
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditTime: 2022-04-07 09:58:43
|
|
|
|
* @Description: file content
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {ToAsyncAwait, MsbRequestTk} from '@/common/utils';
|
|
|
|
|
|
|
|
const BASE_URL = '/mall/product';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 设置购物车数量
|
|
|
|
* @param {id,number} data
|
|
|
|
*/
|
|
|
|
export const ApiPutCartNum = (data) =>
|
|
|
|
ToAsyncAwait(MsbRequestTk.put(`${BASE_URL}/shoppingCart/number`, data));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 往购物车中添加商品
|
|
|
|
* @param {prodcutId, productSkuId, number} data
|
|
|
|
*/
|
|
|
|
export const ApiPutAddCart = (data) =>
|
|
|
|
ToAsyncAwait(MsbRequestTk.put(`${BASE_URL}/shoppingCart/increase`, data));
|
|
|
|
/**
|
|
|
|
* 删除购物车中的商品
|
|
|
|
* @param {idList} data
|
|
|
|
*/
|
|
|
|
export const ApiDeleteCartGoods = (data) =>
|
|
|
|
ToAsyncAwait(MsbRequestTk.delete(`${BASE_URL}/shoppingCart?idList=${data.idList}`, data));
|
|
|
|
/**
|
|
|
|
* 获取购物车列表
|
|
|
|
*/
|
|
|
|
export const ApiGetCartList = () =>
|
|
|
|
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/shoppingCart`));
|
|
|
|
|
|
|
|
|