add
This commit is contained in:
parent
c13e52d482
commit
138bec70e2
33
src/App.vue
33
src/App.vue
|
@ -1,4 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup >
|
||||||
|
|
||||||
|
|
||||||
// let Token =localStorage.getItem('TOKEN')
|
// let Token =localStorage.getItem('TOKEN')
|
||||||
|
@ -7,54 +7,35 @@ import { Push } from '@/common/push'
|
||||||
import { areaObj } from "@/store/index.js"
|
import { areaObj } from "@/store/index.js"
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
const router=useRouter()
|
const router=useRouter()
|
||||||
|
|
||||||
|
|
||||||
const userInfoStore=areaObj()
|
const userInfoStore=areaObj()
|
||||||
userInfoStore.changeUserInfoFn(510521)
|
userInfoStore.changeUserInfoFn(510521)
|
||||||
|
|
||||||
var connection = new Push({
|
|
||||||
|
const openPush=()=>{
|
||||||
|
var 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
|
// 假设用户uid为1
|
||||||
var uid = 3;
|
var uid = 11;
|
||||||
// 浏览器监听user-2频道的消息,也就是用户uid为1的用户消息
|
// 浏览器监听user-2频道的消息,也就是用户uid为1的用户消息
|
||||||
var user_channel = connection.subscribe('user-' + uid);
|
var user_channel = connection.subscribe('user-' + uid);
|
||||||
|
|
||||||
// 当user-2频道有message事件的消息时
|
// 当user-2频道有message事件的消息时
|
||||||
user_channel.on('message', function (data) {
|
user_channel.on('message', function (data) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
globalEventBus.emit(data.content.event, data.content.data)
|
globalEventBus.emit(data.content.event, data.content.data)
|
||||||
});
|
});
|
||||||
// 断线事件
|
// 断线事件
|
||||||
user_channel.on('close', function () {
|
user_channel.on('close', function () {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
globalEventBus.on('refresh', data => {
|
globalEventBus.on('refresh', data => {
|
||||||
router.go(0)
|
router.go(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
// var ws = new WebSocket("ws://192.168.26.167:8080");
|
if( !JSON.parse(localStorage.getItem("TRADE_TYPE")) )openPush();
|
||||||
|
|
||||||
// //当WebSocket创建成功时,触发onopen事件
|
|
||||||
// ws.onopen = function () {
|
|
||||||
// console.log("open");
|
|
||||||
// }
|
|
||||||
// //当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
|
|
||||||
// ws.onmessage = function (e) {
|
|
||||||
|
|
||||||
// let data =JSON.parse(e.data)
|
|
||||||
|
|
||||||
// globalEventBus.emit(data.event, data.data ||'')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -11,6 +11,10 @@ const instacne = axios.create({
|
||||||
|
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
});
|
});
|
||||||
|
const instacneSend = axios.create({
|
||||||
|
baseURL: "http://chat.lihaink.cn/index/",
|
||||||
|
timeout: 30000,
|
||||||
|
});
|
||||||
|
|
||||||
// 请求拦截
|
// 请求拦截
|
||||||
instacne.interceptors.request.use(
|
instacne.interceptors.request.use(
|
||||||
|
@ -37,7 +41,9 @@ instacne.interceptors.response.use(
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
export function sendMsg(params) {
|
||||||
|
return instacneSend.get('/dataviewTouchPush', { params })
|
||||||
|
}
|
||||||
|
|
||||||
export function deviceAlarmCountApi(params) {
|
export function deviceAlarmCountApi(params) {
|
||||||
return instacne.get('/api/dataview.device/deviceAlarmCount', { params })
|
return instacne.get('/api/dataview.device/deviceAlarmCount', { params })
|
||||||
|
|
|
@ -5,10 +5,11 @@
|
||||||
|
|
||||||
<!-- <div style="color: red;">{{ areaStore.userInfo }}</div> -->
|
<!-- <div style="color: red;">{{ areaStore.userInfo }}</div> -->
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div class="rigth-li" @click="choseArea = true"> <img style="width: 1VW;height:1VW;margin-right: 0.5vw;"
|
<div class="rigth-li b-cls" @click="choseArea = true"> <img style="width: 1VW;height:1VW;margin-right: 0.5vw;"
|
||||||
:src="u('DW')" alt=""> {{ areaStore.userInfo.name|| '泸县' }}
|
:src="u('DW')" alt=""> {{ areaStore.userInfo.name|| '泸县' }}
|
||||||
|
<areaList :choseArea="choseArea" @offAreaList="offAreaList" :key="areaStore.userInfo.name" class="a-cls"></areaList>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<areaList :choseArea="choseArea" @offAreaList="offAreaList" :key="areaStore.userInfo.name"></areaList>
|
|
||||||
<div class="right-line">
|
<div class="right-line">
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>
|
<span></span>
|
||||||
|
@ -101,20 +102,12 @@ onMounted(() => {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background-image: url('/static/index/tit.png');
|
background-image: url('/static/index/tit.png');
|
||||||
background-color: #000C14;
|
background-color: #000C14;
|
||||||
|
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
margin-right: 30px;
|
margin-right: 30px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.rigth-li {
|
.rigth-li {
|
||||||
height: 15px;
|
height: 15px;
|
||||||
line-height: 15px;
|
line-height: 15px;
|
||||||
|
@ -140,6 +133,24 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.a-cls{
|
||||||
|
height: 0;
|
||||||
|
position: absolute;
|
||||||
|
top: 2vh;
|
||||||
|
display: block;
|
||||||
|
z-index: 999;
|
||||||
|
transition: 300ms;
|
||||||
|
left: 2vw;
|
||||||
|
|
||||||
|
}
|
||||||
|
.b-cls{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.b-cls:hover .a-cls{
|
||||||
|
height: 18vh;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
.v-enter-active,
|
.v-enter-active,
|
||||||
.v-leave-active {
|
.v-leave-active {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<Transition>
|
<Transition>
|
||||||
<div class="address" v-if="props.choseArea">
|
<div class="address">
|
||||||
<div class="address-li" @click="choseTownFn({ name: '泸县', code: 510521, isArea: true })"> 泸县</div>
|
<div class="address-li" @click="choseTownFn({ name: '泸县', code: 510521, isArea: true })"> 泸县</div>
|
||||||
<div class="address-li" @click="choseTownFn(item)" v-for="( item, index ) in areaList ">{{ item.name }}</div>
|
<div class="address-li" @click="choseTownFn(item)" v-for="( item, index ) in areaList ">{{ item.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,6 +12,12 @@ import { defineProps, defineEmits } from "vue"
|
||||||
import { reactive } from "vue"
|
import { reactive } from "vue"
|
||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
import { areaObj } from "@/store/index.js"
|
import { areaObj } from "@/store/index.js"
|
||||||
|
import { sendMsg } from "@/api.js"
|
||||||
|
const sendFn = (event, data = '') => {
|
||||||
|
sendMsg({ channel: 'user-11', event, data })
|
||||||
|
}
|
||||||
|
const isMainScreen = JSON.parse(localStorage.getItem("TRADE_TYPE"))
|
||||||
|
|
||||||
const userInfoStore = areaObj()
|
const userInfoStore = areaObj()
|
||||||
const emit = defineEmits(['offAreaList'])
|
const emit = defineEmits(['offAreaList'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -19,50 +25,32 @@ const props = defineProps({
|
||||||
})
|
})
|
||||||
const areaList = reactive([])
|
const areaList = reactive([])
|
||||||
|
|
||||||
// 选额镇
|
// 选ze镇
|
||||||
const choseTownFn = (item) => {
|
const choseTownFn = (item) => {
|
||||||
if (item.isArea)
|
if (isMainScreen) {
|
||||||
{
|
// console.log("sdfhsdghfj")
|
||||||
userInfoStore.changeUserInfoFn( item.code ,null )
|
item.code == 510521? sendFn('choserArea', { name: item.name, code: item.code }): sendFn('choseTown', { name: item.name })
|
||||||
userInfoStore.changeAddress(item.name,'')
|
|
||||||
|
} else {
|
||||||
|
item.code == 510521 ? userInfoStore.changeUserInfoFn(510521, '', item.name) : userInfoStore.changeUserInfoFn(510521, Number(item.code), item.name)
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
userInfoStore.changeUserInfoFn(510524, Number(item.code))
|
|
||||||
userInfoStore.changeAddress("",item.name)
|
|
||||||
}
|
|
||||||
console.log(userInfoStore.userInfo)
|
|
||||||
props.choseArea = false
|
|
||||||
emit('offAreaList', item)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// router.replace('/townDetail?id=' + id)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
axios.get(`https://crmeb-test.shop.lihaink.cn/api/city/get_street?area_code=${userInfoStore.userInfo.areaCode}`)
|
axios.get(`https://crmeb-test.shop.lihaink.cn/api/city/get_street?area_code=${userInfoStore.userInfo.areaCode}`)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
|
|
||||||
userInfoStore.changeareaCodeList(response.data.data)
|
userInfoStore.changeareaCodeList(response.data.data)
|
||||||
response.data.data.forEach(item => {
|
response.data.data.forEach(item => {
|
||||||
areaList.push(item)
|
areaList.push(item)
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
|
||||||
// 处理错误情况
|
|
||||||
})
|
|
||||||
.finally(function () {
|
|
||||||
// 总是会执行
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.address {
|
.address {
|
||||||
left: 1vw;
|
|
||||||
top: 18px;
|
|
||||||
position: absolute;
|
|
||||||
width: 8vw;
|
width: 8vw;
|
||||||
height: 18vh;
|
height: 18vh;
|
||||||
background-color: #092049;
|
background-color: #092049;
|
||||||
|
@ -70,12 +58,10 @@ axios.get(`https://crmeb-test.shop.lihaink.cn/api/city/get_street?area_code=${us
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 5px;
|
|
||||||
|
|
||||||
.address-li {
|
.address-li {
|
||||||
padding: 2px 5px;
|
padding: 5px 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
border-bottom: 0.1px solid #24A4F8;
|
border-bottom: 0.1px solid #24A4F8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,6 @@
|
||||||
height: 44vh;
|
height: 44vh;
|
||||||
width: 33.6vw;
|
width: 33.6vw;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
// transform: rotateX(45deg);
|
|
||||||
// animation: spin 2s linear infinite;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#chart2 {
|
#chart2 {
|
||||||
|
@ -39,19 +36,27 @@
|
||||||
import { ref, onMounted, watch, defineEmits, nextTick } from "vue"
|
import { ref, onMounted, watch, defineEmits, nextTick } from "vue"
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
import geoJsonLuxian from "/static/jsonData/luxian_geo.js"
|
import geoJsonLuxian from "/static/jsonData/luxian_geo.js"
|
||||||
import geoJsonGulin from "/static/jsonData/gulin_geo.js"
|
// import geoJsonGulin from "/static/jsonData/gulin_geo.js"
|
||||||
import geoJsonHejiang from "/static/jsonData/hejiang_geo.js"
|
// import geoJsonHejiang from "/static/jsonData/hejiang_geo.js"
|
||||||
import geoJsonJiangyang from "/static/jsonData/jiangyang_geo.js"
|
// import geoJsonJiangyang from "/static/jsonData/jiangyang_geo.js"
|
||||||
import geoJsonLongmatan from "/static/jsonData/longmatan_geo.js"
|
// import geoJsonLongmatan from "/static/jsonData/longmatan_geo.js"
|
||||||
import geoJsonNaxi from "/static/jsonData/naxi_geo.js"
|
// import geoJsonNaxi from "/static/jsonData/naxi_geo.js"
|
||||||
import geoJsonXuyong from "/static/jsonData/xuyong_geo.js"
|
// import geoJsonXuyong from "/static/jsonData/xuyong_geo.js"
|
||||||
import { useRouter } from "vue-router"
|
import { useRouter } from "vue-router"
|
||||||
import { areaObj } from "@/store/index.js"
|
import { areaObj } from "@/store/index.js"
|
||||||
import { landListApi } from "@/api.js"
|
import { landListApi } from "@/api.js"
|
||||||
import { globalEventBus } from '@/common/eventBus'
|
import { globalEventBus } from '@/common/eventBus'
|
||||||
|
import { sendMsg } from "@/api.js"
|
||||||
|
const sendFn = (event, data = '') => {
|
||||||
|
sendMsg({ channel: 'user-11', event, data })
|
||||||
|
}
|
||||||
|
const isMainScreen = JSON.parse(localStorage.getItem("TRADE_TYPE"))
|
||||||
let geoJson = geoJsonLuxian
|
let geoJson = geoJsonLuxian
|
||||||
const areaStore = areaObj()
|
const areaStore = areaObj()
|
||||||
const showArea = (ref(true))
|
const showArea = (ref(true))
|
||||||
|
if(areaStore.userInfo.streetCode)showArea.value=false;
|
||||||
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const icon = "https:\/\/ceshi-worker-task.lihaink.cn\/uploads\/images\/20231204\/202312041608529c9e21252.png"
|
const icon = "https:\/\/ceshi-worker-task.lihaink.cn\/uploads\/images\/20231204\/202312041608529c9e21252.png"
|
||||||
const lx = "https:\/\/ceshi-worker-task.lihaink.cn\/uploads\/images\/20231205\/20231205092709cfe148712.png"
|
const lx = "https:\/\/ceshi-worker-task.lihaink.cn\/uploads\/images\/20231205\/20231205092709cfe148712.png"
|
||||||
|
@ -71,9 +76,7 @@ const deepCopy = (obj) => {
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
const emit = defineEmits(['getTowmName'])
|
const emit = defineEmits(['getTowmName'])
|
||||||
const getTowmName = (e) => {
|
|
||||||
emit('getTowmName', e)
|
|
||||||
}
|
|
||||||
const pointerFn = () => {
|
const pointerFn = () => {
|
||||||
let list = []
|
let list = []
|
||||||
geoJson.center.forEach((item, index) => {
|
geoJson.center.forEach((item, index) => {
|
||||||
|
@ -109,14 +112,13 @@ const pointerFn2 = (lists) => {
|
||||||
})
|
})
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
const initAreaMap = () => {
|
const initAreaMap =async () => {
|
||||||
showArea.value = true
|
showArea.value = true
|
||||||
|
await nextTick()
|
||||||
var mapName = 'lz';
|
var mapName = 'lz';
|
||||||
const myChart = document.getElementById("chart2")
|
const myChart = document.getElementById("chart2")
|
||||||
let option = {
|
let option = {
|
||||||
geo: [
|
geo: [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
type: "map",
|
type: "map",
|
||||||
map: mapName,
|
map: mapName,
|
||||||
|
@ -161,9 +163,6 @@ const initAreaMap = () => {
|
||||||
}],
|
}],
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// borderWidth: 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -289,28 +288,31 @@ const initAreaMap = () => {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
// document.getElementById("chart2").removeAttribute('_echarts_instance_');
|
|
||||||
echarts.registerMap(mapName, geoJson)
|
echarts.registerMap(mapName, geoJson)
|
||||||
const bg = echarts.init(myChart)
|
const bg = echarts.init(myChart)
|
||||||
bg.setOption(option);
|
bg.setOption(option);
|
||||||
bg.on('click', function (params) {
|
bg.on('click', function (params) {
|
||||||
|
|
||||||
getTowmName(params.name)
|
if (isMainScreen) {
|
||||||
areaStore.areaCodeList.forEach(item => {
|
sendFn('choseTown', { name: params.name })
|
||||||
if (item.name == (params.name || params.value)) {
|
} else {
|
||||||
areaStore.changeUserInfoFn(510521, item.code)
|
areaStore.areaCodeList.forEach(item => {
|
||||||
}
|
if (item.name == (params.name || params.value)) {
|
||||||
})
|
areaStore.changeUserInfoFn(510521, item.code, item.name)
|
||||||
areaStore.changeAddress('', params.name || params.value)
|
}
|
||||||
initTownMap(params.name || params.value)
|
})
|
||||||
|
areaStore.changeAddress('', params.name || params.value)
|
||||||
|
initTownMap(params.name || params.value)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
const initTownMap = async (name) => {
|
const initTownMap = async (name) => {
|
||||||
|
|
||||||
|
console.log("首位到访的")
|
||||||
showArea.value = false
|
showArea.value = false
|
||||||
|
await nextTick()
|
||||||
let center = []
|
let center = []
|
||||||
let pointerList = []
|
let pointerList = []
|
||||||
let res = await landListApi({
|
let res = await landListApi({
|
||||||
|
@ -319,7 +321,6 @@ const initTownMap = async (name) => {
|
||||||
|
|
||||||
|
|
||||||
res.data.list.forEach(item => {
|
res.data.list.forEach(item => {
|
||||||
|
|
||||||
center.push([item.longitude, item.latitude])
|
center.push([item.longitude, item.latitude])
|
||||||
pointerList.push({
|
pointerList.push({
|
||||||
value: [item.longitude, item.latitude],
|
value: [item.longitude, item.latitude],
|
||||||
|
@ -521,10 +522,7 @@ const initTownMap = async (name) => {
|
||||||
|
|
||||||
|
|
||||||
bg.on('click', function (params) {
|
bg.on('click', function (params) {
|
||||||
|
|
||||||
|
|
||||||
let longInfo = params.data.coord
|
let longInfo = params.data.coord
|
||||||
|
|
||||||
areaStore.areaCodeList.forEach(item => {
|
areaStore.areaCodeList.forEach(item => {
|
||||||
if (item.name == name) {
|
if (item.name == name) {
|
||||||
areaStore.changeUserInfoFn(510521, item.code)
|
areaStore.changeUserInfoFn(510521, item.code)
|
||||||
|
@ -532,67 +530,31 @@ const initTownMap = async (name) => {
|
||||||
})
|
})
|
||||||
params.data.data.forEach(item => {
|
params.data.data.forEach(item => {
|
||||||
if (item.value[0] == longInfo[0] && item.value[1] == longInfo[1]) {
|
if (item.value[0] == longInfo[0] && item.value[1] == longInfo[1]) {
|
||||||
router.push(`/detail?landId=${item.id}&town=${name}&parmas=${JSON.stringify(areaStore.userInfo)}&landName=${item.name}`)
|
router.replace(`/detail?landId=${item.id}&town=${name}&parmas=${JSON.stringify(areaStore.userInfo)}&landName=${item.name}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(() => areaStore.userInfo, (value, oldValue) => {
|
||||||
|
value.name == '泸县' ? initAreaMap() : initTownMap(value.name)
|
||||||
|
console.log(showArea.value,"fdjfdoijf")
|
||||||
|
|
||||||
watch(() => areaStore.userInfo.areaCode, (value, oldValue) => {
|
|
||||||
if (value) {
|
|
||||||
switch (value) {
|
|
||||||
case "510503":
|
|
||||||
geoJson = geoJsonNaxi
|
|
||||||
break;
|
|
||||||
case "510502":
|
|
||||||
geoJson = geoJsonJiangyang
|
|
||||||
break;
|
|
||||||
case "510504":
|
|
||||||
geoJson = geoJsonLongmatan
|
|
||||||
break;
|
|
||||||
case "510521":
|
|
||||||
geoJson = geoJsonLuxian
|
|
||||||
break;
|
|
||||||
case "510522":
|
|
||||||
geoJson = geoJsonHejiang
|
|
||||||
break;
|
|
||||||
case "510524":
|
|
||||||
geoJson = geoJsonXuyong
|
|
||||||
break;
|
|
||||||
case "510525":
|
|
||||||
geoJson = geoJsonGulin
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
initAreaMap()
|
|
||||||
}
|
|
||||||
// else if (value.area) {
|
|
||||||
// showArea.value = false
|
|
||||||
// initTownMap(value.area)
|
|
||||||
// }
|
|
||||||
}, {
|
}, {
|
||||||
deep: true,
|
deep: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
/* 夏弥睡眼惺忪地抬起头来,脸上还有手表压出的印子,“居然睡着了……都快给高数折磨疯了。我说卡塞尔学院的高数课真是有够变态。”她是一边跟楚子航聊天一边啃课本的时候睡着的,这些天她常常在病房里混迹,好像这里是她的自习室。楚子航渐渐地也习惯了,如果他困了就会直接睡过去,当她不存在,有时候醒来夏弥还在,有时候夏弥走了。*/
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
setTimeout(() => { initAreaMap() }, 500)
|
await nextTick()
|
||||||
|
setTimeout(() => {showArea.value? initAreaMap(): initTownMap() }, 500)
|
||||||
})
|
})
|
||||||
|
|
||||||
globalEventBus.on('choserArea', data => {
|
globalEventBus.on('choserArea', data => {
|
||||||
areaStore.changeUserInfoFn(data.code, '', data.name)
|
areaStore.changeUserInfoFn(data.code, '', data.name)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
globalEventBus.on('choseTown', data => {
|
globalEventBus.on('choseTown', data => {
|
||||||
getTowmName(data.name)
|
|
||||||
areaStore.areaCodeList.forEach(item => {
|
areaStore.areaCodeList.forEach(item => {
|
||||||
if (item.name == (data.name)) {
|
if (item.name == (data.name)) {
|
||||||
areaStore.changeUserInfoFn(areaStore.userInfo.areaCode, item.code, data.name)
|
areaStore.changeUserInfoFn(areaStore.userInfo.areaCode, item.code, data.name)
|
||||||
|
@ -600,18 +562,14 @@ globalEventBus.on('choseTown', data => {
|
||||||
})
|
})
|
||||||
areaStore.changeAddress('', data.name)
|
areaStore.changeAddress('', data.name)
|
||||||
initTownMap(data.name)
|
initTownMap(data.name)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
globalEventBus.on('choseLand', data => {
|
// globalEventBus.on('choseLand', data => {
|
||||||
router.push(`/detail?landId=${data.id}&town=${areaStore.userInfo.name}&parmas=${JSON.stringify(areaStore.userInfo)}&landName=${data.landName}`)
|
// router.push(`/detail?landId=${data.id}&town=${areaStore.userInfo.name}&parmas=${JSON.stringify(areaStore.userInfo)}&landName=${data.landName}`)
|
||||||
})
|
// })
|
||||||
|
|
||||||
|
// globalEventBus.on('initAreaMap', data => {
|
||||||
globalEventBus.on('initAreaMap', data => {
|
// areaStore.changeUserInfoFn(areaStore.userInfo.areaCode, '', '')
|
||||||
areaStore.changeUserInfoFn(areaStore.userInfo.areaCode, '', '')
|
// initAreaMap()
|
||||||
|
// })
|
||||||
console.log("chufa")
|
|
||||||
initAreaMap()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="display: flex;justify-content: space-between;" v-if="userInfoStore.userInfo.streetCode">
|
<div style="display: flex;justify-content: space-between;" v-if="userInfoStore.userInfo.streetCode">
|
||||||
<div class="c-top-tits" style="z-index: 99999;"><span class="color-font" @click="back">返回首页</span></div>
|
<div class="c-top-tits" style="z-index: 99999;"><span class="color-font" @click="back">返回首页</span></div>
|
||||||
<div class="c-top-tits" style="z-index: 99999;"><span class="color-font">{{ props.townName }}地块</span> </div>
|
<div class="c-top-tits" style="z-index: 99999;"><span class="color-font">{{ userInfoStore.userInfo.name }}地块</span> </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="c-top-tit" v-else>
|
<div class="c-top-tit" v-else>
|
||||||
<div class="c-top-li">种植面积 <span class="color-font" style="font-size: 18px;margin-left: 1vw; ">{{
|
<div class="c-top-li">种植面积 <span class="color-font" style="font-size: 18px;margin-left: 1vw; ">{{
|
||||||
|
@ -17,15 +17,11 @@ import {ref,reactive,defineProps} from "vue"
|
||||||
import { centralCountApi } from "@/api.js"
|
import { centralCountApi } from "@/api.js"
|
||||||
import { areaObj } from "@/store/index.js"
|
import { areaObj } from "@/store/index.js"
|
||||||
import { globalEventBus } from '@/common/eventBus'
|
import { globalEventBus } from '@/common/eventBus'
|
||||||
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
|
|
||||||
|
const router =useRouter()
|
||||||
|
|
||||||
|
|
||||||
const userInfoStore = areaObj()
|
const userInfoStore = areaObj()
|
||||||
const props = defineProps({
|
|
||||||
townName: String,
|
|
||||||
})
|
|
||||||
|
|
||||||
centralCountApi({
|
centralCountApi({
|
||||||
...userInfoStore.userInfo
|
...userInfoStore.userInfo
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
@ -41,9 +37,7 @@ const centerData = reactive({
|
||||||
|
|
||||||
})
|
})
|
||||||
const back=(name)=>{
|
const back=(name)=>{
|
||||||
userInfoStore.changeUserInfoFn(userInfoStore.userInfo.areaCode, '', name)
|
router.go(0)
|
||||||
globalEventBus.emit('initAreaMap')
|
|
||||||
|
|
||||||
}
|
}
|
||||||
globalEventBus.on('back', data => {
|
globalEventBus.on('back', data => {
|
||||||
back()
|
back()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,6 @@ const routes = [
|
||||||
name: 'index',
|
name: 'index',
|
||||||
component: () => import('@/view/index.vue'),
|
component: () => import('@/view/index.vue'),
|
||||||
redirect: "/home",
|
redirect: "/home",
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/home',
|
path: '/home',
|
||||||
|
@ -25,7 +24,7 @@ const routes = [
|
||||||
]
|
]
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHashHistory(),
|
||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,7 @@
|
||||||
<leftCenter :data="data" :key="data.land_id"></leftCenter>
|
<leftCenter :data="data" :key="data.land_id"></leftCenter>
|
||||||
</div>
|
</div>
|
||||||
<div class="top center">
|
<div class="top center">
|
||||||
|
<!-- <JessibucaDemo v-if="video_url&&showVideo" :src="video_url"></JessibucaDemo> -->
|
||||||
<JessibucaDemo v-if="video_url&&showVideo" :src="video_url"></JessibucaDemo>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <video style="margin-top: 1vh;width: 100%;height: 100%;" autoplay muted
|
|
||||||
src="http://192.168.1.27/live/test.live.mp4?secret=gqig2yFKkDpIMic1uWZY1L5MsIo0eflm">
|
|
||||||
</video> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
|
@ -85,7 +78,7 @@ const pullStream = () => {
|
||||||
socket.addEventListener('close', onSocketClose);
|
socket.addEventListener('close', onSocketClose);
|
||||||
socket.addEventListener('error', onSocketError);
|
socket.addEventListener('error', onSocketError);
|
||||||
}
|
}
|
||||||
pullStream()
|
// pullStream()
|
||||||
|
|
||||||
|
|
||||||
const getDetail = () => {
|
const getDetail = () => {
|
||||||
|
@ -111,7 +104,7 @@ const getDetail = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
getDetail()
|
// getDetail()
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
socket.close()
|
socket.close()
|
||||||
})
|
})
|
||||||
|
@ -131,6 +124,19 @@ globalEventBus.on('backHome', data => {
|
||||||
back()
|
back()
|
||||||
|
|
||||||
})
|
})
|
||||||
|
globalEventBus.on('choserArea', data => {
|
||||||
|
router.go(-1)
|
||||||
|
areaStore.changeUserInfoFn(data.code, '', data.name)
|
||||||
|
})
|
||||||
|
globalEventBus.on('choseTown', data => {
|
||||||
|
router.go(-1)
|
||||||
|
areaStore.areaCodeList.forEach(item => {
|
||||||
|
if (item.name == (data.name)) {
|
||||||
|
areaStore.changeUserInfoFn(areaStore.userInfo.areaCode, item.code, data.name)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.box {
|
.box {
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
<div class="c">
|
<div class="c">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<centerTop :townName="townName" :key="userInfoStore.userInfo.name"></centerTop>
|
<centerTop :townName="townName" :key="userInfoStore.userInfo.name"></centerTop>
|
||||||
|
|
||||||
<div class="map">
|
<div class="map">
|
||||||
<areaMap @getTowmName="getTowmName"></areaMap>
|
<areaMap @getTowmName="getTowmName"></areaMap>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,7 +42,6 @@ import leftBottom from "../components/index/leftBottom.vue"
|
||||||
import centerBottom from "../components/index/centerBottom.vue"
|
import centerBottom from "../components/index/centerBottom.vue"
|
||||||
import rightBottom from "../components/index/rightBottom.vue"
|
import rightBottom from "../components/index/rightBottom.vue"
|
||||||
import centerTop from "../components/index/centerTop.vue"
|
import centerTop from "../components/index/centerTop.vue"
|
||||||
import { centralCountApi } from "@/api.js"
|
|
||||||
import areaMap from "@/components/areaMap.vue"
|
import areaMap from "@/components/areaMap.vue"
|
||||||
import rightTop from "../components/index/rightTop.vue"
|
import rightTop from "../components/index/rightTop.vue"
|
||||||
import { areaObj } from "@/store/index.js"
|
import { areaObj } from "@/store/index.js"
|
||||||
|
|
|
@ -1,21 +1,20 @@
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
|
|
||||||
<div class="main-box">
|
<div class="main-box">
|
||||||
<Header></Header>
|
<Header></Header>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { useRoute } from "vue-router"
|
||||||
|
const route = useRoute()
|
||||||
import Header from "@/components/Header.vue"
|
import Header from "@/components/Header.vue"
|
||||||
|
if (route.query?.type) { localStorage.setItem("TRADE_TYPE", true) }
|
||||||
|
else {
|
||||||
|
localStorage.setItem("TRADE_TYPE", false)
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
@ -6,7 +6,7 @@ export default defineConfig({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
server: { // ← ← ← ← ← ←
|
server: { // ← ← ← ← ← ←
|
||||||
host: '0.0.0.0', // ← 新增内容 ←
|
host: '0.0.0.0', // ← 新增内容 ←
|
||||||
port:"8888"
|
port:"8886"
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
//别名配置,引用src路径下的东西可以通过@如:import Layout from '@/layout/index.vue'
|
//别名配置,引用src路径下的东西可以通过@如:import Layout from '@/layout/index.vue'
|
||||||
|
|
Loading…
Reference in New Issue