2023-06-09 12:43:37 +00:00
|
|
|
import request from "@/utils/request.js";
|
|
|
|
|
|
|
|
// 检查是否收藏过商品
|
|
|
|
export function isFavoriteExists(spuId) {
|
|
|
|
return request.get('app-api/product/favorite/exits', {
|
|
|
|
spuId
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-08-19 09:00:08 +00:00
|
|
|
// 获得商品收藏数量
|
|
|
|
export function getFavoriteCount() {
|
|
|
|
return request.get('app-api/product/favorite/get-count');
|
|
|
|
}
|
|
|
|
|
2023-06-09 12:43:37 +00:00
|
|
|
// 添加商品收藏
|
|
|
|
export function createFavorite(spuId) {
|
|
|
|
return request.post('app-api/product/favorite/create', {
|
|
|
|
spuId
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-08-30 11:14:46 +00:00
|
|
|
// 添加多个商品收藏
|
|
|
|
export function createFavoriteList(spuIds) {
|
|
|
|
return request.post('app-api/product/favorite/create-list', {
|
|
|
|
spuIds
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-06-09 12:43:37 +00:00
|
|
|
// 取消商品收藏
|
|
|
|
export function deleteFavorite(spuId) {
|
|
|
|
return request.delete('app-api/product/favorite/delete', {
|
|
|
|
spuId
|
|
|
|
});
|
|
|
|
}
|
2023-06-25 04:26:24 +00:00
|
|
|
|
|
|
|
// 获得商品收藏分页
|
|
|
|
export function getFavoritePage(data) {
|
|
|
|
return request.get('app-api/product/favorite/page', data);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 取消多个商品收藏
|
|
|
|
export function deleteFavoriteList(spuIds) {
|
|
|
|
return request.delete('app-api/product/favorite/delete-list', {
|
|
|
|
spuIds
|
|
|
|
});
|
|
|
|
}
|