修复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) => { const loadOrderList = (pramas) => {
logisticsList(pramas).then((res) => { logisticsList(pramas).then((res) => {
initData(res.data.currOrderList); initData(res.data.list);
pages.value.total = res.data.currOrderCount; pages.value.total = res.data.count;
pages.value.pageAll = Math.ceil(res.data.currOrderCount / pages.value.limit); pages.value.pageAll = Math.ceil(res.data.count / pages.value.limit);
}).catch(err => { }).catch(err => {
console.error(err); console.error(err);
}) })

View File

@ -6,6 +6,7 @@ import mitt from "@/utils/mitt";
import { getStreet } from "@/api/index.js"; import { getStreet } from "@/api/index.js";
import { useAppStore } from "@/store/app.js"; import { useAppStore } from "@/store/app.js";
import { useUserStore } from "@/store/user.js"; import { useUserStore } from "@/store/user.js";
import axios from "axios";
const reload = inject('reload'); const reload = inject('reload');
@ -105,11 +106,25 @@ const logout = () => {
router.push('/login') 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(() => { onMounted(() => {
initList(); initList();
// //
setInterval(updateClock, 1000); setInterval(updateClock, 1000);
initWeather();
}) })
</script> </script>
@ -141,7 +156,7 @@ onMounted(() => {
<img class="icon item" src="/src/assets/head_img/icon.png" alt="" /> <img class="icon item" src="/src/assets/head_img/icon.png" alt="" />
<div class="item"> <div class="item">
<img src="/src/assets/head_img/weather.png" alt="" /> <img src="/src/assets/head_img/weather.png" alt="" />
多云 {{ weather }}
</div> </div>
<img class="icon item" src="/src/assets/head_img/icon.png" alt="" /> <img class="icon item" src="/src/assets/head_img/icon.png" alt="" />
<div class="item" @click="logout"> <div class="item" @click="logout">

View File

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

View File

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

View File

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