This commit is contained in:
parent
40c2abeef0
commit
29f84b9255
16
src/App.vue
16
src/App.vue
|
@ -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({
|
const connection = new Push({
|
||||||
url: 'wss://chat.lihaink.cn/tts', // websocket地址
|
url: 'wss://chat.lihaink.cn/tts', // websocket地址
|
||||||
app_key: 'aaea61749929eb53a4bd75a1474c1d27',
|
app_key: 'aaea61749929eb53a4bd75a1474c1d27',
|
||||||
});
|
});
|
||||||
// 假设用户uid为1
|
|
||||||
const uid = 5;
|
|
||||||
// 浏览器监听user-2频道的消息,也就是用户uid为1的用户消息
|
// 浏览器监听user-2频道的消息,也就是用户uid为1的用户消息
|
||||||
const user_channel = connection.subscribe('user-' + uid);
|
const user_channel = connection.subscribe(uid + 'user-logistics-datav');
|
||||||
|
|
||||||
// 当user-2频道有message事件的消息时
|
// 当user-2频道有message事件的消息时
|
||||||
user_channel.on('message', function (data) {
|
user_channel.on('message', function (data) {
|
||||||
|
|
|
@ -80,14 +80,6 @@ const show = () => {
|
||||||
choseArea.value = !choseArea.value;
|
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({
|
defineExpose({
|
||||||
open, close, show
|
open, close, show
|
||||||
})
|
})
|
||||||
|
|
|
@ -33,14 +33,41 @@ const offAreaList = (e) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
info.address = e.name;
|
info.address = e.name;
|
||||||
mitt.emit("map_info", info);
|
// mitt.emit("map_info", info);
|
||||||
reload();
|
// 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 list = ref([]);
|
||||||
const initList = async () => {
|
const initList = async (re = false) => {
|
||||||
let street = appStore.street;
|
let street = appStore.street;
|
||||||
if (street?.length == 0) {
|
if (street?.length == 0 || re) {
|
||||||
let { data } = await getStreet({
|
let { data } = await getStreet({
|
||||||
area_code: appStore.address.areaCode,
|
area_code: appStore.address.areaCode,
|
||||||
});
|
});
|
||||||
|
@ -147,7 +174,7 @@ mitt.on("choserArea", (data) => {
|
||||||
areaCode: data.code,
|
areaCode: data.code,
|
||||||
streetCode: "",
|
streetCode: "",
|
||||||
});
|
});
|
||||||
initList();
|
initList(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -12,6 +12,10 @@ import naxi from "@/assets/json/naxi.json";
|
||||||
import luxian_geo from "@/utils/luxian_geo.js";
|
import luxian_geo from "@/utils/luxian_geo.js";
|
||||||
import xuyong_geo from "@/utils/xuyong_geo.js";
|
import xuyong_geo from "@/utils/xuyong_geo.js";
|
||||||
import jiangyang_geo from "@/utils/jiangyang_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 { useAppStore } from "@/store/app.js";
|
||||||
import { useUserStore } from "@/store/user.js";
|
import { useUserStore } from "@/store/user.js";
|
||||||
|
|
||||||
|
@ -482,6 +486,10 @@ const mapInfo = () => {
|
||||||
if (area.name == "泸县") map = luxian_geo;
|
if (area.name == "泸县") map = luxian_geo;
|
||||||
if (area.name == "江阳区") map = jiangyang_geo;
|
if (area.name == "江阳区") map = jiangyang_geo;
|
||||||
if (area.name == "叙永县") map = xuyong_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));
|
map = JSON.parse(JSON.stringify(map));
|
||||||
if (appStore.address.streetCode) {
|
if (appStore.address.streetCode) {
|
||||||
let street = appStore.street.find(
|
let street = appStore.street.find(
|
||||||
|
|
|
@ -5,21 +5,26 @@ import centerItme1 from "./components/centerItem1.vue";
|
||||||
import centerItme2 from "./components/centerItem2.vue";
|
import centerItme2 from "./components/centerItem2.vue";
|
||||||
import rightItem1 from "./components/rightItem1.vue";
|
import rightItem1 from "./components/rightItem1.vue";
|
||||||
import rightItem2 from "./components/rightItem2.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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<leftItme1 style="height: 58%"></leftItme1>
|
<leftItme1 :key="route.query.areaCode+key+'f1'" style="height: 58%"></leftItme1>
|
||||||
<leftItme2 style="height: 40%"></leftItme2>
|
<leftItme2 :key="route.query.areaCode+key+'f2'" style="height: 40%"></leftItme2>
|
||||||
</div>
|
</div>
|
||||||
<div class="item item_c">
|
<div class="item item_c">
|
||||||
<centerItme1 style="height: 66%"></centerItme1>
|
<centerItme1 :key="route.query.areaCode+key+'c1'" style="height: 66%"></centerItme1>
|
||||||
<centerItme2 style="height: 32%"></centerItme2>
|
<centerItme2 :key="route.query.areaCode+key+'c2'" style="height: 32%"></centerItme2>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<rightItem1 style="height: 35%"></rightItem1>
|
<rightItem1 :key="route.query.areaCode+key+'r1'" style="height: 35%"></rightItem1>
|
||||||
<rightItem2 style="height: 63%"></rightItem2>
|
<rightItem2 :key="route.query.areaCode+key+'r2'" style="height: 63%"></rightItem2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue