This commit is contained in:
parent
0ab4878dfc
commit
e631f0fd6b
|
@ -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://test.shop.lihaink.cn/api'
|
||||
# VITE_BASE_URL = '/'
|
|
@ -88,7 +88,12 @@ const loadOrderList = (pramas) => {
|
|||
|
||||
onMounted(() => {
|
||||
// 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;
|
||||
})
|
||||
})
|
||||
|
|
|
@ -90,7 +90,7 @@ const initList = async (re = false) => {
|
|||
}
|
||||
let area = appStore.area;
|
||||
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;
|
||||
list.value = [];
|
||||
appStore.setAddress({
|
||||
|
@ -100,14 +100,15 @@ const initList = async (re = false) => {
|
|||
} else {
|
||||
let data = area.find((item) => item.code == appStore.address.areaCode);
|
||||
info.address = data?.name;
|
||||
list.value = [data, ...street];
|
||||
list.value = [data, ...appStore.street];
|
||||
appStore.setStreet(list.value);
|
||||
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;
|
||||
}
|
||||
appStore.setAddress({
|
||||
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);
|
||||
|
|
|
@ -2,7 +2,7 @@ import axios from "axios";
|
|||
import { ElMessage } from "element-plus";
|
||||
|
||||
const request = axios.create({
|
||||
baseURL: 'https://shop.lihaink.cn/api',
|
||||
baseURL: import.meta.env.VITE_BASE_URL,
|
||||
timeout: 5000
|
||||
})
|
||||
|
||||
|
|
|
@ -359,7 +359,7 @@ const initEcahrts = (yData1 = [], yData2 = [], yData3 = [], yData4 = []) => {
|
|||
}
|
||||
|
||||
const openList = () => {
|
||||
mitt.emit('showBusinesses')
|
||||
mitt.emit('showBusinesses', 'delivery_address')
|
||||
}
|
||||
|
||||
const initInfo = () => {
|
||||
|
@ -391,7 +391,8 @@ const pages = ref({
|
|||
const loadOrderList = () => {
|
||||
getOrderList(pages.value).then((res) => {
|
||||
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[2].value = res.data.undeliveredOrderCount;
|
||||
orderList.value[3].value = res.data.doneOrderCountQuery;
|
||||
|
|
|
@ -492,7 +492,7 @@ const mapInfo = async () => {
|
|||
if (area.name == "合江县") map = hejiang_geo;
|
||||
if (area.name == "古蔺县") map = gulin_geo;
|
||||
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) {
|
||||
let { data } = await getStreet({
|
||||
area_code: appStore.address.areaCode,
|
||||
|
|
|
@ -8,7 +8,8 @@ import { useAppStore } from "@/store/app.js"
|
|||
|
||||
const appStore = useAppStore();
|
||||
|
||||
const list = ref([])
|
||||
const list = ref([]);
|
||||
const list2 = ref([]);
|
||||
const count = ref(0);
|
||||
|
||||
const loadList = () => {
|
||||
|
@ -16,7 +17,8 @@ const loadList = () => {
|
|||
areaCode: appStore.address.areaCode,
|
||||
streetCode: appStore.address.streetCode,
|
||||
}).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;
|
||||
// for (let i = 0; i < 2; i++) {
|
||||
// list.value = [...list.value, ...res.data.list];
|
||||
|
@ -71,7 +73,7 @@ onMounted(() => {
|
|||
<div
|
||||
class="car-item"
|
||||
:class="{ 'car-item2': index > 1 }"
|
||||
v-for="(item, index) in list.slice(0, 4)"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
@click="navToDelivery(item)"
|
||||
>
|
||||
|
@ -89,24 +91,27 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
<div class="car-box">
|
||||
<div class="car-list2">
|
||||
<div class="car-list2" v-infinite-scroll style="overflow: auto">
|
||||
<div
|
||||
class="car-item"
|
||||
:class="{ 'car-item2': index > 2 && index < 5 }"
|
||||
v-for="(item, index) in list.slice(4, 13)"
|
||||
v-for="(item, index) in list2"
|
||||
:key="index"
|
||||
@click="navToDelivery(item)"
|
||||
>
|
||||
<img class="img" src="/src/assets/img/icon-car.png" />
|
||||
<div>{{ item.license }}</div>
|
||||
</div>
|
||||
<template v-if="list2.length < 13">
|
||||
<div
|
||||
class="car-item"
|
||||
: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"
|
||||
style="background-image: none"
|
||||
></div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -231,3 +236,28 @@ onMounted(() => {
|
|||
}
|
||||
}
|
||||
</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>
|
Loading…
Reference in New Issue