From 021d1d8376246638d4f28d5f1c0fecb8e7ffdb36 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Mon, 11 Dec 2023 18:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Businesses2.vue | 6 +++--- src/components/headView.vue | 17 ++++++++++++++++- src/view/index/components/centerItem2.vue | 20 ++++++++++++-------- src/view/index/components/centerMap.vue | 5 +++-- src/view/index/components/leftItme1.vue | 2 +- 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/components/Businesses2.vue b/src/components/Businesses2.vue index d45ebd1..ae6bede 100644 --- a/src/components/Businesses2.vue +++ b/src/components/Businesses2.vue @@ -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); }) diff --git a/src/components/headView.vue b/src/components/headView.vue index 10dc0f7..adfbf04 100644 --- a/src/components/headView.vue +++ b/src/components/headView.vue @@ -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(); }) @@ -141,7 +156,7 @@ onMounted(() => {
- 多云 + {{ weather }}
diff --git a/src/view/index/components/centerItem2.vue b/src/view/index/components/centerItem2.vue index f8151bb..2c0f517 100644 --- a/src/view/index/components/centerItem2.vue +++ b/src/view/index/components/centerItem2.vue @@ -1,5 +1,5 @@ diff --git a/src/view/index/components/leftItme1.vue b/src/view/index/components/leftItme1.vue index 6303f54..b9185a9 100644 --- a/src/view/index/components/leftItme1.vue +++ b/src/view/index/components/leftItme1.vue @@ -25,7 +25,7 @@ const initData = (data) => { ) } list.data = arr; - scrollBoardRef.value.updateRows(list.data); + scrollBoardRef.value?.updateRows(list.data); } const scrollBoardRef = ref(null);