diff --git a/src/request/api.js b/src/request/api.js index 74cd3b0..df45bd7 100644 --- a/src/request/api.js +++ b/src/request/api.js @@ -24,3 +24,6 @@ export const reqGetUserInfo = () => request.get("/shop/userProfiles"); //商品详情 export const reqGetDetail = (id) => request.get(`/products/${id}`); + +//加入购物车 +export const reqAddCart = (params) => request.post("/shop/carts/add", qs.stringify( params )); diff --git a/src/views/Details.vue b/src/views/Details.vue index 6230c61..e6c0eac 100644 --- a/src/views/Details.vue +++ b/src/views/Details.vue @@ -67,7 +67,9 @@
-
加入购物车
+
+ 加入购物车 +
立即购买
@@ -144,7 +146,7 @@