修复bug

This commit is contained in:
weipengfei 2023-12-11 18:19:40 +08:00
parent c38a156943
commit 021d1d8376
5 changed files with 35 additions and 15 deletions

View File

@ -78,9 +78,9 @@ const pages = ref({
const loadOrderList = (pramas) => {
logisticsList(pramas).then((res) => {
initData(res.data.currOrderList);
pages.value.total = res.data.currOrderCount;
pages.value.pageAll = Math.ceil(res.data.currOrderCount / pages.value.limit);
initData(res.data.list);
pages.value.total = res.data.count;
pages.value.pageAll = Math.ceil(res.data.count / pages.value.limit);
}).catch(err => {
console.error(err);
})

View File

@ -6,6 +6,7 @@ import mitt from "@/utils/mitt";
import { getStreet } from "@/api/index.js";
import { useAppStore } from "@/store/app.js";
import { useUserStore } from "@/store/user.js";
import axios from "axios";
const reload = inject('reload');
@ -105,11 +106,25 @@ const logout = () => {
router.push('/login')
}
const weather = ref("暂无天气信息")
const initWeather = (city = 510500) => {
axios.get(`https://restapi.amap.com/v3/weather/weatherInfo?city=${city}&key=5731d3b4c3f34e09226e084ce556e259`).then((res) => {
if (res.data.status == 1) {
weather.value = res.data.lives[0].weather;
}
}).catch((e) => {
console.log(e);
})
}
onMounted(() => {
initList();
//
setInterval(updateClock, 1000);
initWeather();
})
</script>
@ -141,7 +156,7 @@ onMounted(() => {
<img class="icon item" src="/src/assets/head_img/icon.png" alt="" />
<div class="item">
<img src="/src/assets/head_img/weather.png" alt="" />
多云
{{ weather }}
</div>
<img class="icon item" src="/src/assets/head_img/icon.png" alt="" />
<div class="item" @click="logout">

View File

@ -1,5 +1,5 @@
<script setup>
import { onMounted, reactive, ref } from "vue";
import { nextTick, onMounted, reactive, ref } from "vue";
import * as echarts from 'echarts';
import border from "../../../components/border.vue"
import { orderRanking } from "@/api/index.js"
@ -12,12 +12,9 @@ const data1 = ref([]);
const data_bottom = ref([]);
const orderCount = ref(0);
const echartsRef = ref(null);
const echartsRef = ref();
const initMap = () => {
// DOMecharts
const chart = echarts.init(echartsRef.value);
let option = {
backgroundColor: 'rgba(0,0,0,0)',
tooltip: {
@ -154,8 +151,15 @@ const initMap = () => {
]
}
try {
// DOMecharts
const chart = echarts.init(echartsRef?.value);
// 使
chart.setOption(option);
} catch (error) {
console.log(error);
}
}
const loadOrderList = () => {
@ -192,7 +196,7 @@ onMounted(() => {
</div>
<div>订单总数</div>
</div>
<div class="map" ref="echartsRef"></div>
<div class="map" id="c2map" ref="echartsRef"></div>
</div>
</div>
</border>

View File

@ -260,7 +260,6 @@ const mapInfo = () => {
if (area.name == "江阳区") map = jiangyang_geo;
if (area.name == "叙永县") map = xuyong_geo;
map = JSON.parse(JSON.stringify(map));
if (appStore.address.streetCode) {
let street = appStore.street.find(item => item.code == appStore.address.streetCode);
initStreetMap(street, map);
@ -281,8 +280,10 @@ onMounted(() => {
changeType('xuyong');
mapInfo();
initDataValue();
setTimeout(() => {
initMap();
})
})
</script>

View File

@ -25,7 +25,7 @@ const initData = (data) => {
)
}
list.data = arr;
scrollBoardRef.value.updateRows(list.data);
scrollBoardRef.value?.updateRows(list.data);
}
const scrollBoardRef = ref(null);