商品收藏:商品详情的底部接入

This commit is contained in:
YunaiV
2023-12-15 09:48:10 +08:00
parent 3b5c84f970
commit 9049182843
3 changed files with 75 additions and 41 deletions
+20
View File
@@ -9,6 +9,26 @@ const FavoriteApi = {
params: data
});
},
// 检查是否收藏过商品
isFavoriteExists: (spuId) => {
return request({
url: '/app-api/product/favorite/exits',
method: 'GET',
params: {
spuId
}
});
},
// 添加商品收藏
createFavorite: (spuId) => {
return request({
url: '/app-api/product/favorite/create',
method: 'POST',
data: {
spuId
}
});
},
// 取消商品收藏
deleteFavorite: (spuId) => {
return request({