This commit is contained in:
weipengfei 2024-05-29 18:06:25 +08:00
parent 0ab4878dfc
commit e631f0fd6b
7 changed files with 55 additions and 17 deletions

View File

@ -1,3 +1,4 @@
VITE_BASE_URL = 'https://crmeb-test.shop.lihaink.cn/api' # VITE_BASE_URL = 'https://crmeb-test.shop.lihaink.cn/api'
# VITE_BASE_URL = 'https://shop.lihaink.cn/api' # VITE_BASE_URL = 'https://shop.lihaink.cn/api'
VITE_BASE_URL = 'https://test.shop.lihaink.cn/api'
# VITE_BASE_URL = '/' # VITE_BASE_URL = '/'

View File

@ -88,7 +88,12 @@ const loadOrderList = (pramas) => {
onMounted(() => { onMounted(() => {
// loadOrderList(); // loadOrderList();
mitt.on('showBusinesses', () => { mitt.on('showBusinesses', (type='address') => {
pages.value.areaCode = appStore[type]?.areaCode;
pages.value.streetCode = appStore[type]?.streetCode;
pages.value.page = 1;
pages.value.total = 0;
pages.value.pageAll = 0;
isShow.value = !isShow.value; isShow.value = !isShow.value;
}) })
}) })

View File

@ -90,7 +90,7 @@ const initList = async (re = false) => {
} }
let area = appStore.area; let area = appStore.area;
if (userSotre.userInfo.street_code) { if (userSotre.userInfo.street_code) {
let data = street.find((item) => item.code == appStore.address.streetCode); let data = appStore.street.find((item) => item.code == appStore.address.streetCode);
info.address = data?.name; info.address = data?.name;
list.value = []; list.value = [];
appStore.setAddress({ appStore.setAddress({
@ -100,14 +100,15 @@ const initList = async (re = false) => {
} else { } else {
let data = area.find((item) => item.code == appStore.address.areaCode); let data = area.find((item) => item.code == appStore.address.areaCode);
info.address = data?.name; info.address = data?.name;
list.value = [data, ...street]; list.value = [data, ...appStore.street];
appStore.setStreet(list.value);
if (appStore.address.streetCode) { if (appStore.address.streetCode) {
data = street.find((item) => item.code == appStore.address.streetCode); data = list.value.find((item) => item.code == appStore.address.streetCode);
info.address = data?.name; info.address = data?.name;
} }
appStore.setAddress({ appStore.setAddress({
areaCode: appStore.address.areaCode, areaCode: appStore.address.areaCode,
streetCode: appStore.address.streetCode, streetCode: appStore.address.streetCode==appStore.address.areaCode?'':appStore.address.streetCode,
}); });
} }
if(!re) mitt.emit("map_info", info); if(!re) mitt.emit("map_info", info);

View File

@ -2,7 +2,7 @@ import axios from "axios";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
const request = axios.create({ const request = axios.create({
baseURL: 'https://shop.lihaink.cn/api', baseURL: import.meta.env.VITE_BASE_URL,
timeout: 5000 timeout: 5000
}) })

View File

@ -359,7 +359,7 @@ const initEcahrts = (yData1 = [], yData2 = [], yData3 = [], yData4 = []) => {
} }
const openList = () => { const openList = () => {
mitt.emit('showBusinesses') mitt.emit('showBusinesses', 'delivery_address')
} }
const initInfo = () => { const initInfo = () => {
@ -391,7 +391,8 @@ const pages = ref({
const loadOrderList = () => { const loadOrderList = () => {
getOrderList(pages.value).then((res) => { getOrderList(pages.value).then((res) => {
initData(res.data.currOrderList); initData(res.data.currOrderList);
orderList.value[0].value = res.data.currOrderCount; // orderList.value[0].value = res.data.currOrderCount;
orderList.value[0].value = res.data.realTodayOrderCount;
orderList.value[1].value = res.data.pendingOrderCount; orderList.value[1].value = res.data.pendingOrderCount;
orderList.value[2].value = res.data.undeliveredOrderCount; orderList.value[2].value = res.data.undeliveredOrderCount;
orderList.value[3].value = res.data.doneOrderCountQuery; orderList.value[3].value = res.data.doneOrderCountQuery;

View File

@ -492,7 +492,7 @@ const mapInfo = async () => {
if (area.name == "合江县") map = hejiang_geo; if (area.name == "合江县") map = hejiang_geo;
if (area.name == "古蔺县") map = gulin_geo; if (area.name == "古蔺县") map = gulin_geo;
map = JSON.parse(JSON.stringify(map)); map = JSON.parse(JSON.stringify(map));
if (appStore.address.streetCode) { if (appStore.address.streetCode&&appStore.address.streetCode!=appStore.address.areaCode) {
if(appStore.street.length==0) { if(appStore.street.length==0) {
let { data } = await getStreet({ let { data } = await getStreet({
area_code: appStore.address.areaCode, area_code: appStore.address.areaCode,

View File

@ -8,7 +8,8 @@ import { useAppStore } from "@/store/app.js"
const appStore = useAppStore(); const appStore = useAppStore();
const list = ref([]) const list = ref([]);
const list2 = ref([]);
const count = ref(0); const count = ref(0);
const loadList = () => { const loadList = () => {
@ -16,7 +17,8 @@ const loadList = () => {
areaCode: appStore.address.areaCode, areaCode: appStore.address.areaCode,
streetCode: appStore.address.streetCode, streetCode: appStore.address.streetCode,
}).then(res => { }).then(res => {
list.value = res.data.list; list.value = res.data.list.slice(0,4);
list2.value = res.data.list.slice(4);
count.value = res.data.count; count.value = res.data.count;
// for (let i = 0; i < 2; i++) { // for (let i = 0; i < 2; i++) {
// list.value = [...list.value, ...res.data.list]; // list.value = [...list.value, ...res.data.list];
@ -71,7 +73,7 @@ onMounted(() => {
<div <div
class="car-item" class="car-item"
:class="{ 'car-item2': index > 1 }" :class="{ 'car-item2': index > 1 }"
v-for="(item, index) in list.slice(0, 4)" v-for="(item, index) in list"
:key="index" :key="index"
@click="navToDelivery(item)" @click="navToDelivery(item)"
> >
@ -89,24 +91,27 @@ onMounted(() => {
</div> </div>
</div> </div>
<div class="car-box"> <div class="car-box">
<div class="car-list2"> <div class="car-list2" v-infinite-scroll style="overflow: auto">
<div <div
class="car-item" class="car-item"
:class="{ 'car-item2': index > 2 && index < 5 }" :class="{ 'car-item2': index > 2 && index < 5 }"
v-for="(item, index) in list.slice(4, 13)" v-for="(item, index) in list2"
:key="index" :key="index"
@click="navToDelivery(item)" @click="navToDelivery(item)"
> >
<img class="img" src="/src/assets/img/icon-car.png" /> <img class="img" src="/src/assets/img/icon-car.png" />
<div>{{ item.license }}</div> <div>{{ item.license }}</div>
</div> </div>
<template v-if="list2.length < 13">
<div <div
class="car-item" class="car-item"
:class="{ 'car-item2': index > 2 && index < 5 }" :class="{ 'car-item2': index > 2 && index < 5 }"
v-for="(item, index) in 13 - list.length" v-for="(item, index) in 13 - list2.length"
:key="'em' + index" :key="'em' + index"
style="background-image: none" style="background-image: none"
></div> ></div>
</template>
</div> </div>
</div> </div>
</div> </div>
@ -231,3 +236,28 @@ onMounted(() => {
} }
} }
</style> </style>
<style lang="scss">
/* 隐藏滚动条但保持可滚动WebKit内核浏览器如Chrome和Safari */
.car-list2::-webkit-scrollbar {
width: 0; /* 隐藏垂直滚动条 */
height: 0; /* 隐藏水平滚动条 */
}
/* 确保内容区域不会因为滚动条消失而缩小 */
.car-list2 {
overflow: scroll; /* 保持内容可滚动 */
-ms-overflow-style: none; /* IE和Edge */
scrollbar-width: none; /* Firefox */
}
/* 针对IE和Edge的额外隐藏滚动条样式 */
.car-list2 {
-ms-overflow-style: none;
}
/* 针对Firefox的额外隐藏滚动条样式 */
.car-list2 {
scrollbar-width: none;
}
</style>