This commit is contained in:
weipengfei 2024-05-09 14:42:24 +08:00
parent 61694fc119
commit 7712e2432d
7 changed files with 17 additions and 30 deletions

View File

@ -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 })
}
/**

View File

@ -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 })
}
/**

View File

@ -8,7 +8,7 @@ const routes = [
path: '/',
name: 'layout',
component: layout,
redirect: '/home',
redirect: '/saleHome',
meta: { title: '里海收银系统' },
children: [
{

View File

@ -16,7 +16,7 @@ const getCategoryList = () => {
active.value = -1;
});
};
getCategoryList();
// getCategoryList();
const changeActive = (index=-1, idnexc=-1) => {
sactive.value = index;

View File

@ -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();

View File

@ -101,10 +101,10 @@ onUnmounted(() => {
:key="index"
@click="changeItem(item)"
>
<el-image loading="lazy" :src="item.image"></el-image>
<div class="shop-name">{{ item.store_name }}</div>
<el-image loading="lazy" :src="item.imgs"></el-image>
<div class="shop-name">{{ item.name }}</div>
<div class="shop-price">
¥<span>{{ item.price }}</span>
¥<span>{{ item.sell }}/{{item.unit_name}}</span>
</div>
<div class="no-stock" v-if="item.stock == 0">
<div>

View File

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