This commit is contained in:
weipengfei 2024-02-23 18:19:51 +08:00
parent 40c2abeef0
commit 29f84b9255
9 changed files with 183 additions and 22 deletions

View File

@ -39,14 +39,24 @@ const back = ()=>{
}
}
// URL
const queryString = window.location.search;
//
const searchParams = new URLSearchParams(queryString);
// id
const uid = searchParams.get('local') || localStorage.getItem('local');
if(searchParams.get('local')) localStorage.setItem('local', searchParams.get('local'));
const connection = new Push({
url: 'wss://chat.lihaink.cn/tts', // websocket
app_key: 'aaea61749929eb53a4bd75a1474c1d27',
});
// uid1
const uid = 5;
// user-2uid1
const user_channel = connection.subscribe('user-' + uid);
const user_channel = connection.subscribe(uid + 'user-logistics-datav');
// user-2message
user_channel.on('message', function (data) {

View File

@ -80,14 +80,6 @@ const show = () => {
choseArea.value = !choseArea.value;
}
mitt.on("choseTown", (data) => {
// console.log(data, ...props.list);
let town = props.list.find((item) => item.name == data.name);
if (town && town.code) {
choseTownFn(town)
}
});
defineExpose({
open, close, show
})

View File

@ -33,14 +33,41 @@ const offAreaList = (e) => {
}
});
info.address = e.name;
mitt.emit("map_info", info);
reload();
// mitt.emit("map_info", info);
// reload();
router.push({
path: "/",
query: {
areaCode: route.query.areaCode || appStore.address.areaCode,
streetCode: e.code,
name: e.name,
},
});
};
mitt.on("choseTown", (data) => {
let c = list.value.find((item) => item.name == data.name);
console.log(list.value, data, c);
if (!c) return;
appStore.setAddress({
areaCode: appStore.address.areaCode,
streetCode: c.code,
});
initList();
router.push({
path: "/",
query: {
areaCode: appStore.address.areaCode,
streetCode: c.code,
name: data.name,
},
});
});
const list = ref([]);
const initList = async () => {
const initList = async (re = false) => {
let street = appStore.street;
if (street?.length == 0) {
if (street?.length == 0 || re) {
let { data } = await getStreet({
area_code: appStore.address.areaCode,
});
@ -147,7 +174,7 @@ mitt.on("choserArea", (data) => {
areaCode: data.code,
streetCode: "",
});
initList();
initList(true);
});
onMounted(() => {

35
src/utils/gulin_geo.js Normal file

File diff suppressed because one or more lines are too long

38
src/utils/hejiang_geo.js Normal file

File diff suppressed because one or more lines are too long

22
src/utils/longma_geo.js Normal file

File diff suppressed because one or more lines are too long

24
src/utils/naxi_geo.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,10 @@ import naxi from "@/assets/json/naxi.json";
import luxian_geo from "@/utils/luxian_geo.js";
import xuyong_geo from "@/utils/xuyong_geo.js";
import jiangyang_geo from "@/utils/jiangyang_geo.js";
import longma_geo from "@/utils/longma_geo.js";
import gulin_geo from "@/utils/gulin_geo.js";
import hejiang_geo from "@/utils/hejiang_geo.js";
import naxi_geo from "@/utils/naxi_geo.js";
import { useAppStore } from "@/store/app.js";
import { useUserStore } from "@/store/user.js";
@ -482,6 +486,10 @@ const mapInfo = () => {
if (area.name == "泸县") map = luxian_geo;
if (area.name == "江阳区") map = jiangyang_geo;
if (area.name == "叙永县") map = xuyong_geo;
if (area.name == "龙马潭区") map = longma_geo;
if (area.name == "纳溪区") map = naxi_geo;
if (area.name == "合江县") map = hejiang_geo;
if (area.name == "古蔺县") map = gulin_geo;
map = JSON.parse(JSON.stringify(map));
if (appStore.address.streetCode) {
let street = appStore.street.find(

View File

@ -5,21 +5,26 @@ import centerItme1 from "./components/centerItem1.vue";
import centerItme2 from "./components/centerItem2.vue";
import rightItem1 from "./components/rightItem1.vue";
import rightItem2 from "./components/rightItem2.vue";
import { useRoute } from 'vue-router';
import { ref } from "vue";
const route = useRoute();
const key = ref(Date.now());
</script>
<template>
<div class="center">
<div class="item">
<leftItme1 style="height: 58%"></leftItme1>
<leftItme2 style="height: 40%"></leftItme2>
<leftItme1 :key="route.query.areaCode+key+'f1'" style="height: 58%"></leftItme1>
<leftItme2 :key="route.query.areaCode+key+'f2'" style="height: 40%"></leftItme2>
</div>
<div class="item item_c">
<centerItme1 style="height: 66%"></centerItme1>
<centerItme2 style="height: 32%"></centerItme2>
<centerItme1 :key="route.query.areaCode+key+'c1'" style="height: 66%"></centerItme1>
<centerItme2 :key="route.query.areaCode+key+'c2'" style="height: 32%"></centerItme2>
</div>
<div class="item">
<rightItem1 style="height: 35%"></rightItem1>
<rightItem2 style="height: 63%"></rightItem2>
<rightItem1 :key="route.query.areaCode+key+'r1'" style="height: 35%"></rightItem1>
<rightItem2 :key="route.query.areaCode+key+'r2'" style="height: 63%"></rightItem2>
</div>
</div>
</template>