From fe019ae2eaa3d499ff26fbeaf53c54b016e51b59 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Tue, 2 Apr 2024 13:33:53 +0800 Subject: [PATCH] 1 --- src/api/store.js | 25 +++++- src/views/home/component/order.vue | 15 +++- src/views/home/component/pay.vue | 112 ++++++++++++++++++++++++ src/views/home/component/pupop.vue | 9 +- src/views/home/component/shop.vue | 16 ++-- src/views/home/index.vue | 134 +++++++++++++++++++---------- 6 files changed, 250 insertions(+), 61 deletions(-) create mode 100644 src/views/home/component/pay.vue diff --git a/src/api/store.js b/src/api/store.js index 61037b1..a4ac42b 100644 --- a/src/api/store.js +++ b/src/api/store.js @@ -4,5 +4,26 @@ import request from '@/utils/axios.js' * @description 商品列表 */ export function storeListApi(id, data) { - return request.get(`server/${30}/product/lst`, { params: data }) -} \ No newline at end of file + return request.get(`server/${id}/product/lst`, { params: data }) +} + +/** + * @description 加入购物车 + */ +export function cartCreateApi(data) { + return request.post(`user/cart/create`, data) +} + +/** + * @description 购物车 + */ +export function cartListApi(data) { + return request.get(`user/cart/lst`, { params: data }) +} + +// /** +// * @description 购物车数量 +// */ +// export function cartListApi(id, data) { +// return request.get(`count`, { params: data }) +// } \ No newline at end of file diff --git a/src/views/home/component/order.vue b/src/views/home/component/order.vue index 4c09b6b..bc2db2a 100644 --- a/src/views/home/component/order.vue +++ b/src/views/home/component/order.vue @@ -1,5 +1,6 @@ + + diff --git a/src/views/home/component/pupop.vue b/src/views/home/component/pupop.vue index d7b7905..48b42df 100644 --- a/src/views/home/component/pupop.vue +++ b/src/views/home/component/pupop.vue @@ -8,6 +8,13 @@ const show = (e)=>{ dialogVisible.value = e; } +const emit = defineEmits(['changeItem']) + +const changeItem = ()=>{ + emit('changeItem', item, change); + dialogVisible = false +} + defineExpose({ show }) @@ -45,7 +52,7 @@ defineExpose({