This commit is contained in:
parent
b89c36a328
commit
859eed4a08
|
@ -3,7 +3,7 @@ import { reactive, ref, provide, nextTick, onMounted, inject } from "vue";
|
|||
import areaList from "./areaList.vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import mitt from "@/utils/mitt";
|
||||
import { getStreet } from "@/api/index.js";
|
||||
import { getStreet, getArea } from "@/api/index.js";
|
||||
import { useAppStore } from "@/store/app.js";
|
||||
import { useUserStore } from "@/store/user.js";
|
||||
import axios from "axios";
|
||||
|
@ -71,6 +71,19 @@ const initList = async () => {
|
|||
}
|
||||
mitt.emit('map_info', info);
|
||||
}
|
||||
const initList2 = async () => {
|
||||
getArea({
|
||||
city_code: 510500
|
||||
}).then(res=>{
|
||||
console.log(res);
|
||||
// list.value = res.data;
|
||||
// appStore.setAddress({
|
||||
// areaCode: res.data[0].code,
|
||||
// streetCode: ''
|
||||
// })
|
||||
})
|
||||
mitt.emit('map_info', info);
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
@ -119,7 +132,15 @@ const initWeather = (city = 510500) => {
|
|||
|
||||
|
||||
onMounted(() => {
|
||||
console.log(route);
|
||||
if(route.query.areaCode){
|
||||
appStore.setAddress({
|
||||
areaCode: route.query.areaCode,
|
||||
streetCode: route.query.streetCode||''
|
||||
})
|
||||
}
|
||||
initList();
|
||||
initList2();
|
||||
|
||||
// 每秒钟更新一次时间
|
||||
setInterval(updateClock, 1000);
|
||||
|
@ -158,10 +179,10 @@ onMounted(() => {
|
|||
<img src="/src/assets/head_img/weather.png" alt="" />
|
||||
{{ weather }}
|
||||
</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">
|
||||
<img src="/src/assets/head_img/close.png" alt="" />
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<img class="img" src="/src/assets/img/shiler.png" alt="" />
|
||||
</div>
|
||||
|
|
|
@ -178,7 +178,7 @@ const initMap = () => {
|
|||
}
|
||||
if (obj) {
|
||||
return `<div
|
||||
style="background-image: url(\'/src/assets/img/item-box.png\');
|
||||
style="background-image: url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/56293202401021747108363.png);
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
|
@ -317,7 +317,7 @@ const initMap = () => {
|
|||
}
|
||||
if (obj) {
|
||||
return `<div
|
||||
style="background-image: url(\'/src/assets/img/item-box.png\');
|
||||
style="background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/def/56293202401021747108363.png');
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
|
|
Loading…
Reference in New Issue