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 &&