From 7712e2432d6276aac32cc4b0e9c53f2ae22b7d6a Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 9 May 2024 14:42:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop.js | 2 +- src/api/store.js | 2 +- src/router/index.js | 2 +- src/views/saleHome/component/classify.vue | 2 +- src/views/saleHome/component/order.vue | 16 ++++++++-------- src/views/saleHome/component/shop.vue | 6 +++--- src/views/saleHome/index.vue | 17 ++--------------- 7 files changed, 17 insertions(+), 30 deletions(-) diff --git a/src/api/shop.js b/src/api/shop.js index ee703a2..4c36840 100644 --- a/src/api/shop.js +++ b/src/api/shop.js @@ -67,7 +67,7 @@ export function productDetailApi(mer_id, id, data) { * @description 批发商品列表 */ export function saleStoreListApi(data) { - return request.get(`product/spu/lst`, { params: data }) + return request.get(`/goods/goods/lists`, { params: data }) } /** diff --git a/src/api/store.js b/src/api/store.js index 58a3662..3611733 100644 --- a/src/api/store.js +++ b/src/api/store.js @@ -11,7 +11,7 @@ export function cartCreateApi(data) { * @description 购物列表 */ export function cartListApi(data) { - return request.get(`user/cart/lst`, { params: data }) + return request.get(`/order/cart/list`, { params: data }) } /** diff --git a/src/router/index.js b/src/router/index.js index 90ba66b..eced778 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,7 +8,7 @@ const routes = [ path: '/', name: 'layout', component: layout, - redirect: '/home', + redirect: '/saleHome', meta: { title: '里海收银系统' }, children: [ { diff --git a/src/views/saleHome/component/classify.vue b/src/views/saleHome/component/classify.vue index 103497d..1caace0 100644 --- a/src/views/saleHome/component/classify.vue +++ b/src/views/saleHome/component/classify.vue @@ -16,7 +16,7 @@ const getCategoryList = () => { active.value = -1; }); }; -getCategoryList(); +// getCategoryList(); const changeActive = (index=-1, idnexc=-1) => { sactive.value = index; diff --git a/src/views/saleHome/component/order.vue b/src/views/saleHome/component/order.vue index dd23a8d..5929b5c 100644 --- a/src/views/saleHome/component/order.vue +++ b/src/views/saleHome/component/order.vue @@ -40,16 +40,16 @@ const getList = () => { costPrice.value = 0; discounts.value = 0; cartListApi({ - staff_id: userStore.userInfo.service.service_id, + // staff_id: userStore.userInfo.service.service_id, sale_type: 2, }).then((res) => { - if (res.data?.list?.length > 0) { - list.value = res.data.list[0].list; - list.value.forEach((item) => { - allPrice.value += item.productAttr.price * item.cart_num; - }); - costPrice.value = allPrice.value; - } else list.value = []; + // if (res.data?.list?.length > 0) { + // list.value = res.data.list[0].list; + // list.value.forEach((item) => { + // allPrice.value += item.productAttr.price * item.cart_num; + // }); + // costPrice.value = allPrice.value; + // } else list.value = []; }); }; getList(); diff --git a/src/views/saleHome/component/shop.vue b/src/views/saleHome/component/shop.vue index 17a9ec9..5795a78 100644 --- a/src/views/saleHome/component/shop.vue +++ b/src/views/saleHome/component/shop.vue @@ -101,10 +101,10 @@ onUnmounted(() => { :key="index" @click="changeItem(item)" > - -
{{ item.store_name }}
+ +
{{ item.name }}
- ¥{{ item.price }} + ¥{{ item.sell }}/{{item.unit_name}}
diff --git a/src/views/saleHome/index.vue b/src/views/saleHome/index.vue index da9aff3..b67bcab 100644 --- a/src/views/saleHome/index.vue +++ b/src/views/saleHome/index.vue @@ -28,9 +28,6 @@ const where = ref({ }); const getStoreList = (data = {}, reload = false) => { where.value = { - staff_id: userStore.userInfo.service.service_id, - sale_type: 2, - mer_type: 1, ...where.value, ...data, }; @@ -40,18 +37,8 @@ const getStoreList = (data = {}, reload = false) => { loadEnd.value = false; } saleStoreListApi(where.value).then((res) => { - if (res.data?.list?.length < where.value.limit) loadEnd.value = true; - let list = res.data.list.map((item) => { - Object.keys(item.sku).forEach(key=>{ - if(item.sku[key].wholesale_price)item.sku[key].price = item.sku[key].wholesale_price; - }) - item.attrValue.forEach(t => { - if(t.wholesale_price)t.price = t.wholesale_price; - }); - item.attr = Object.keys(item.sku); - return item; - }); - storeList.value = storeList.value.concat(list); + if (res.data?.lists?.length < where.value.limit) loadEnd.value = true; + storeList.value = storeList.value.concat(res.data.lists); if ( data.bar_code && storeList.value.length == 1 &&