diff --git a/common/api/shop.js b/common/api/shop.js
index b0c65cc..e39de01 100644
--- a/common/api/shop.js
+++ b/common/api/shop.js
@@ -19,6 +19,19 @@ export default {
getCartTreeList() {
return vm.$u.post('cart/cartTreeList');
},
+ // 添加购物车
+ addCart({ goods_id, quantity }) {
+ return vm.$u.post('cart/cartAdd', {
+ goods_id: goods_id,
+ quantity: quantity
+ });
+ },
+ // 购物车删除商品
+ deleteCart({ id }) {
+ return vm.$u.post('cart/cartDel', {
+ cart_id: id
+ });
+ }
}
}
diff --git a/common/api/user.js b/common/api/user.js
index 87b6ff8..586052d 100644
--- a/common/api/user.js
+++ b/common/api/user.js
@@ -175,9 +175,21 @@ export default {
// 店铺收藏列表
getStoreFavoritesList({ type }) {
return vm.$u.post('Member/getFavoritesList', {
- type: type
+ type: type,
});
},
+ // 设置-用户信息
+ getMemberInfo() {
+ return vm.$u.post('Member/MemberInfo');
+ },
+ // 设置-修改用户信息
+ updateMemberInfo({ nickname, gender, avatar }) {
+ return vm.$u.post('Member/changeMemberInfo', {
+ nickname: nickname,
+ sex: gender,
+ avatar: avatar,
+ });
+ }
}
}
}
\ No newline at end of file
diff --git a/components/shop/list/index.vue b/components/shop/list/index.vue
index 9abc1a8..d9819fb 100644
--- a/components/shop/list/index.vue
+++ b/components/shop/list/index.vue
@@ -4,7 +4,6 @@
商品推荐
- 分类名称
{{ item.gc_name }}
diff --git a/components/shop/list/item.vue b/components/shop/list/item.vue
index 123965e..7679877 100644
--- a/components/shop/list/item.vue
+++ b/components/shop/list/item.vue
@@ -1,6 +1,6 @@
-
-
+
+
{{ info.goods_name }}
{{ info.goods_advword }}
@@ -13,7 +13,20 @@ export default {
name:"item",
props: {
info: Object
- }
+ },
+ methods: {
+ addCart() {
+ console.log(1);
+
+ this.$u.api.addCart({
+ goods_id: this.info.goods_id,
+ quantity: 1
+ }).then((res)=>{
+ if (res.errCode == 0) {
+ }
+ })
+ }
+ },
}