From 9c5734f4870ba0486957e8a5e536ec9f332e83eb Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 11 Feb 2022 13:48:08 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/school-web
---
src/components/mobileWindow/index.vue | 8
src/components/mobilemap/index.vue | 249 ++++++++++++++---------------------
src/components/mobileActivity/index.vue | 2
src/components/mobilePopupOurAfter/index.vue | 2
src/styles/mobile/popup.scss | 1
src/components/mobileLeftNav/index.vue | 24 +++
src/components/mobilePopupOur/index.vue | 30 ++--
src/store/getters.js | 3
src/store/modules/mobile.js | 75 +++++++---
src/components/mobileCortrolSearch/index.vue | 1
src/components/mobilePopupOurOnce/index.vue | 15 +
11 files changed, 213 insertions(+), 197 deletions(-)
diff --git a/src/components/mobileActivity/index.vue b/src/components/mobileActivity/index.vue
index f579db8..a0bb2c6 100644
--- a/src/components/mobileActivity/index.vue
+++ b/src/components/mobileActivity/index.vue
@@ -305,6 +305,8 @@
this.$store.commit("removePolylineMany");
//关闭随地图弹窗
this.$store.dispatch("closeMobileWindowsDom");
+ //显示右侧栏
+ this.$store.commit("SET_SeeAndNotSee", true);
},
checkDom(methods, name, fn) {
// 声明定时器
diff --git a/src/components/mobileCortrolSearch/index.vue b/src/components/mobileCortrolSearch/index.vue
index 5270a09..294b324 100644
--- a/src/components/mobileCortrolSearch/index.vue
+++ b/src/components/mobileCortrolSearch/index.vue
@@ -67,6 +67,7 @@
justify-content: center;
.m-left-S-input {
border: none;
+ font-size: 16px;
}
.iconSearch {
width: 30px;
diff --git a/src/components/mobileLeftNav/index.vue b/src/components/mobileLeftNav/index.vue
index 1c75245..20103b1 100644
--- a/src/components/mobileLeftNav/index.vue
+++ b/src/components/mobileLeftNav/index.vue
@@ -1,5 +1,5 @@
<template>
- <div class="m-left-nav" :style="[navStyle]">
+ <div :class="['m-left-nav', seeRight ? '' : 'nones']" :style="[navStyle]">
<!-- :style="[coutrolStyle]" -->
<div class="m-left-coutrol" @click="changeIconHide">
<i :class="icons"></i>
@@ -44,9 +44,26 @@
this.imgStyle.right = "0";
}
},
+ seeRight() {
+ if (this.seeRight) {
+ this.leftNavData[0].flag = false;
+ this.leftNavData[0].img = this.leftNavData[0].checked;
+ this[this.leftNavData[0].layer].show = true;
+ } else {
+ let lnd = this.leftNavData;
+ for (let k in lnd) {
+ if (this[this.leftNavData[k].layer]._show) {
+ // console.log(lnd[k].label, "所有开启");
+ this.leftNavData[k].flag = false;
+ this.leftNavData[k].img = this.leftNavData[k].normal;
+ this[this.leftNavData[k].layer].show = false;
+ }
+ }
+ }
+ },
},
computed: {
- ...mapGetters(["iconHide", "dimensionData"]),
+ ...mapGetters(["iconHide", "dimensionData", "seeRight"]),
},
data() {
return {
@@ -475,4 +492,7 @@
}
}
}
+.nones {
+ display: none;
+}
</style>
diff --git a/src/components/mobilePopupOur/index.vue b/src/components/mobilePopupOur/index.vue
index 9c8feb9..0252535 100644
--- a/src/components/mobilePopupOur/index.vue
+++ b/src/components/mobilePopupOur/index.vue
@@ -305,24 +305,24 @@
//正常获取全部数据
let outList = [];
data.forEach((item) => {
- let icon = item.list.tpurl.split(",");
+ let icon = item.tpurl.split(",");
let useData = {
- name: item.list.mechanismname,
- lntLat: [item.list.jd, item.list.wd],
- alt: item.list.gd,
- heading: item.list.heading,
- pitch: item.list.pitch,
- roll: item.list.roll,
- bgImg: item.list.tpurl,
+ name: item.mechanismname,
+ lntLat: [item.jd, item.wd],
+ alt: item.gd,
+ heading: item.heading,
+ pitch: item.pitch,
+ roll: item.roll,
+ bgImg: item.tpurl,
icon: icon,
- icons: icon + item.list.mechanismname, //图片响应改变
+ icons: icon + item.mechanismname, //图片响应改变
from: this.choiceMain,
- QRImg: item.list.codeurl,
- websiteUrl: item.list.websiteurl,
- telePhone: item.list.telephone,
- address: item.list.address,
- introduce: item.list.introduce,
- video: item.list.videourl,
+ QRImg: item.codeurl,
+ websiteUrl: item.websiteurl,
+ telePhone: item.telephone,
+ address: item.address,
+ introduce: item.introduce,
+ video: item.videourl,
buts:
that.mBigPopup.name == "社区建筑" ||
that.mBigPopup.name == "文化风景"
diff --git a/src/components/mobilePopupOurAfter/index.vue b/src/components/mobilePopupOurAfter/index.vue
index 20028e5..4b1d5f4 100644
--- a/src/components/mobilePopupOurAfter/index.vue
+++ b/src/components/mobilePopupOurAfter/index.vue
@@ -261,6 +261,8 @@
openBigPopup(val) {
if (val.name == "活动" && !this.useHD) {
this.openHDPopup(this.avtivityData[0][0]);
+ //隐藏右侧栏
+ this.$store.commit("SET_SeeAndNotSee", false);
return;
}
const d = {
diff --git a/src/components/mobilePopupOurOnce/index.vue b/src/components/mobilePopupOurOnce/index.vue
index 097ce3b..f69923c 100644
--- a/src/components/mobilePopupOurOnce/index.vue
+++ b/src/components/mobilePopupOurOnce/index.vue
@@ -8,18 +8,23 @@
}"
>
<div class="mobilePopupOurOnce_left">
- <img :src="icon" alt="" :key="icon" />
+ <!-- <img :src="icon" alt="" :key="icon" /> -->
<el-image
- style="width: 100px; height: 100px"
+ style="width: 80px; height: 80px"
:src="icon"
:id="'mobileBigImgs' + icon + ''"
- v-show="false"
:preview-src-list="srcList"
>
+ <!-- v-show="false" -->
</el-image>
</div>
- <div class="mobilePopupOurOnce_right">
- <div class="mobilePopupOurOnce_r_up">{{ onceData.name }}</div>
+ <div class="mobilePopupOurOnce_right" @click.self.stop="openOnce('定位')">
+ <div
+ class="mobilePopupOurOnce_r_up"
+ @click.self.stop="openOnce('定位')"
+ >
+ {{ onceData.name }}
+ </div>
<div class="mobilePopupOurOnce_r_down">
<div v-for="(item, index) in seebut" :key="index">
<el-link
diff --git a/src/components/mobileWindow/index.vue b/src/components/mobileWindow/index.vue
index a9ba440..a44e4a3 100644
--- a/src/components/mobileWindow/index.vue
+++ b/src/components/mobileWindow/index.vue
@@ -31,14 +31,16 @@
<i class="el-icon-close icon" @click="closeWindow"></i>
</div>
<video :src="video" controls="controls" autoplay v-if="video"></video>
- <img :src="url" alt="" v-show="url && !video" />
+ <!-- <img :src="url" alt="" v-show="url && !video" /> -->
+ <!-- style="width: 100px; height: 100px" -->
<el-image
- style="width: 100px; height: 100px"
+ class="imgs"
:src="url"
id="mobileBigImgs"
- v-show="false"
+ v-show="url && !video"
:preview-src-list="srcList"
>
+ <!-- v-show="false" -->
</el-image>
<!-- <div>{{ query.query }}</div> -->
<div class="mobileBig-center-our" v-show="!video">
diff --git a/src/components/mobilemap/index.vue b/src/components/mobilemap/index.vue
index f177910..f1560f0 100644
--- a/src/components/mobilemap/index.vue
+++ b/src/components/mobilemap/index.vue
@@ -284,8 +284,8 @@
// if (height > 2000) {
// conBack(2000);
// }
- if (height <= 190 && isSet) {
- conBack(190);
+ if (height <= 79 && isSet) {
+ conBack(79);
}
// if (height > 220 && height <= 280 && isSet) {
// conBack(280);
@@ -296,12 +296,30 @@
// if (height > 340 && height <= 400 && isSet) {
// conBack(400);
// }
- if (height > 400 && isSet) {
- conBack(400);
+ if (height > 200 && isSet) {
+ conBack(200);
}
});
// 按钮事件
+ let butSetViews = (num) => {
+ viewer.camera.flyTo({
+ destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(
+ viewer.camera.positionCartographic.longitude,
+ viewer.camera.positionCartographic.latitude,
+ num
+ ),
+ orientation: {
+ // 指向
+ heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
+ // 视角
+ pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
+ roll: 0.0,
+ },
+ duration: 0.5, // 定位的时间间隔
+ });
+ overii();
+ };
that.butbut = function () {
//放大
document.querySelector(".dc-zoom-controller").children[0].onclick =
@@ -310,60 +328,18 @@
const height = Math.ceil(
viewer.camera.positionCartographic.height
);
-
- if (height > 360) {
- viewer.camera.setView({
- destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(
- viewer.camera.positionCartographic.longitude,
- viewer.camera.positionCartographic.latitude,
- 330
- ),
- orientation: {
- // 指向
- heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
- // 视角
- pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
- roll: 0.0,
- },
- });
-
+ if (height > 180) {
+ butSetViews(160);
return;
}
- if (height > 300) {
- viewer.camera.setView({
- destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(
- viewer.camera.positionCartographic.longitude,
- viewer.camera.positionCartographic.latitude,
- 270
- ),
- orientation: {
- // 指向
- heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
- // 视角
- pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
- roll: 0.0,
- },
- });
-
+ if (height > 140) {
+ butSetViews(120);
return;
}
- if (height > 240) {
- viewer.camera.setView({
- destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(
- viewer.camera.positionCartographic.longitude,
- viewer.camera.positionCartographic.latitude,
- 200
- ),
- orientation: {
- // 指向
- heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
- // 视角
- pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
- roll: 0.0,
- },
- });
+ if (height > 100) {
+ butSetViews(80);
}
}
};
@@ -374,56 +350,18 @@
const height = Math.ceil(
viewer.camera.positionCartographic.height
);
+ console.log(height);
- if (height <= 240) {
- viewer.camera.setView({
- destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(
- viewer.camera.positionCartographic.longitude,
- viewer.camera.positionCartographic.latitude,
- 270
- ),
- orientation: {
- // 指向
- heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
- // 视角
- pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
- roll: 0.0,
- },
- });
+ if (height <= 100) {
+ butSetViews(120);
}
- if (height > 240 && height <= 300) {
- viewer.camera.setView({
- destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(
- viewer.camera.positionCartographic.longitude,
- viewer.camera.positionCartographic.latitude,
- 330
- ),
- orientation: {
- // 指向
- heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
- // 视角
- pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
- roll: 0.0,
- },
- });
+ if (height > 100 && height <= 140) {
+ butSetViews(160);
}
- if (height > 300 && height < 360) {
- viewer.camera.setView({
- destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(
- viewer.camera.positionCartographic.longitude,
- viewer.camera.positionCartographic.latitude,
- 400
- ),
- orientation: {
- // 指向
- heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
- // 视角
- pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
- roll: 0.0,
- },
- });
+ if (height > 140 && height < 180) {
+ butSetViews(200);
}
}
};
@@ -431,29 +369,31 @@
// 指示器
var ii = 1,
startHeight = 0,
- cutHeight = 0;
- let overii = function () {
- ii = 1;
- startHeight = 0;
- cutHeight = 0;
- };
- let setViews = (num) => {
- viewer.camera.setView({
- destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(
- viewer.camera.positionCartographic.longitude,
- viewer.camera.positionCartographic.latitude,
- num
- ),
- orientation: {
- // 指向
- heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
- // 视角
- pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
- roll: 0.0,
- },
- });
- overii();
- };
+ cutHeight = 0,
+ overii = function () {
+ ii = 1;
+ startHeight = 0;
+ cutHeight = 0;
+ },
+ setViews = (num) => {
+ viewer.camera.flyTo({
+ destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(
+ viewer.camera.positionCartographic.longitude,
+ viewer.camera.positionCartographic.latitude,
+ num
+ ),
+ orientation: {
+ // 指向
+ heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
+ // 视角
+ pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
+ roll: 0.0,
+ },
+ duration: 0.5, // 定位的时间间隔
+ });
+ overii();
+ },
+ isCameraTime = null;
viewer.on(that.DC.SceneEventType.CAMERA_CHANGED, (e) => {
if (that.dimension == "2.5D") {
// console.log(e);
@@ -464,39 +404,53 @@
ii++;
cutHeight = height - startHeight;
// console.log(cutHeight);
- console.log(height);
+ // console.log(height);
that.heights = height;
that.heights1 = cutHeight;
// return;
- if (ii != 1) {
- if (cutHeight >= 0) {
- if (cutHeight > 3) {
- if (height >= 200 && height < 270) {
- setViews(270);
+ if (isCameraTime) {
+ clearTimeout(isCameraTime);
+ isCameraTime = setTimeout(() => {
+ takes();
+ isCameraTime = null;
+ }, 200);
+ } else {
+ isCameraTime = setTimeout(() => {
+ takes();
+ isCameraTime = null;
+ }, 200);
+ }
+ let takes = () => {
+ if (ii != 1) {
+ if (cutHeight >= 0) {
+ if (cutHeight > 3) {
+ if (height >= 83 && height < 120) {
+ setViews(120);
+ }
+ if (height >= 123 && height < 160) {
+ setViews(160);
+ }
+ if (height >= 163 && height < 200) {
+ setViews(200);
+ }
}
- if (height >= 273 && height < 330) {
- setViews(330);
- }
- if (height >= 333 && height < 400) {
- setViews(400);
- }
- }
- //放大
- } else {
- //缩小
- if (cutHeight < -3) {
- if (height <= 400 && height > 327) {
- setViews(330);
- }
- if (height <= 327 && height > 267) {
- setViews(270);
- }
- if (height <= 267 && height > 200) {
- setViews(200);
+ //放大
+ } else {
+ //缩小
+ if (cutHeight < -3) {
+ if (height <= 200 && height > 157) {
+ setViews(160);
+ }
+ if (height <= 157 && height > 117) {
+ setViews(120);
+ }
+ if (height <= 117 && height > 80) {
+ setViews(80);
+ }
}
}
}
- }
+ };
}
});
};
@@ -812,6 +766,7 @@
video: item.videourl,
buts: ["定位", "实景", "图集"],
panoramaurl: item.panoramaurl, //全景
+ fromTo: "mapClick",
};
// 定制化窗体
// console.log(item, useData, "111111");
@@ -857,7 +812,7 @@
};
that.dimension == "2.5D"
? doit2(
- [114.03928791, 27.62954732, 200.0],
+ [114.04020791, 27.62934732, 160.0],
// [114.04062292, 27.62666834, 220.0],
[
that.dimensionData.heading,
diff --git a/src/store/getters.js b/src/store/getters.js
index a6eb549..cdc57b9 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -32,7 +32,8 @@
showActivity: (state) => state.mobile.showActivity, // 显影活动弹窗
showActivityData: (state) => state.mobile.showActivityData, // 活动弹窗数据
- isOpenDrawALineMany: (state) => state.mobile.isOpenDrawALineMany // 显影活动弹窗
+ isOpenDrawALineMany: (state) => state.mobile.isOpenDrawALineMany, // 显影活动弹窗
+ seeRight: (state) => state.mobile.seeRight // 右侧控制栏显影
}
const navigation = {
diff --git a/src/store/modules/mobile.js b/src/store/modules/mobile.js
index 2df62a2..831c8f3 100644
--- a/src/store/modules/mobile.js
+++ b/src/store/modules/mobile.js
@@ -75,6 +75,7 @@
drawALineLayerMany: null, //活动路线图层
drawAPointLayerMany: null, //活动点图层
isOpenDrawALineMany: null, //是否开启活动
+ seeRight: true, //右侧控制栏显影
},
mutations: {
MSET_VIEWER(state, viewer) {
@@ -224,9 +225,9 @@
state.startPointFn(); //移动默认视角
state.areaLayer.show = true; //绿布
//2.5D视角限制
- state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 190;
+ state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 80;
// 最大
- state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 400;
+ state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 200;
// 设置相机缩小时的速率
state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 2000;
// 设置相机放大时的速率
@@ -335,6 +336,9 @@
state.select.overlay = data[0];
state.select.color = data[1];
},
+ SET_SeeAndNotSee(state, data) {
+ state.seeRight = data;
+ },
},
actions: {
MSET_CREADE({ state, commit, dispatch }) {
@@ -434,8 +438,24 @@
0,
state.dimensionData.pitch
);
+ if (!state.MobileWindowsHide) {
+ //关闭弹窗
+ commit("MSET_MOBILEWINDOWSHIDE", true);
+ }
+ if (
+ state.select.overlay != undefined &&
+ data.query.fromTo != "mapClick"
+ ) {
+ //关闭绿色边框
+ state.select.overlay.setStyle({
+ material: state.select.color,
+ outline: false,
+ });
+ commit("mset_changeSelect", [undefined, undefined]);
+ }
// console.log(state.dimension);
if (state.dimension != "2.5D") {
+ // if (true) {
// if (true) {
dispatch("mapFlyTo", {
//飞入
@@ -445,28 +465,35 @@
roll: Position.roll,
});
} else {
- state.mviewer.camera.setView({
- // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
- // fromDegrees()方法,将经纬度和高程转换为世界坐标
- destination: new global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
- // 114.0351,
- // 27.6314,
- // 200.0
- Position.lng - 0.012,
- Position.lat,
- Position.alt || 15000.0
- ),
- orientation: {
- heading: global.DC.Namespace.Cesium.Math.toRadians(
- Position.heading
- ),
- pitch: global.DC.Namespace.Cesium.Math.toRadians(Position.pitch),
- // heading: data.heading,
- // pitch: data.pitch,
- roll: Position.roll,
- },
+ dispatch("mapFlyTo", {
+ //飞入
+ lntLat: [Position.lng, +Position.lat - 0.0003, 160],
+ heading: Position.heading,
+ pitch: Position.pitch,
+ roll: Position.roll,
});
- commit("MSET_MOBILEWINDOWSHIDE", false); // 显示弹窗
+ // state.mviewer.camera.setView({
+ // // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
+ // // fromDegrees()方法,将经纬度和高程转换为世界坐标
+ // destination: new global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
+ // // 114.0351,
+ // // 27.6314,
+ // // 200.0
+ // Position.lng - 0.012,
+ // Position.lat - 0.0003,
+ // Position.alt || 15000.0
+ // ),
+ // orientation: {
+ // heading: global.DC.Namespace.Cesium.Math.toRadians(
+ // Position.heading
+ // ),
+ // pitch: global.DC.Namespace.Cesium.Math.toRadians(Position.pitch),
+ // // heading: data.heading,
+ // // pitch: data.pitch,
+ // roll: Position.roll,
+ // },
+ // });
+ // commit("MSET_MOBILEWINDOWSHIDE", false); // 显示弹窗
}
// })
commit("MSET_POPUPDOM", popupsDom);
@@ -540,7 +567,7 @@
// 自定义回调
setTimeout(() => {
data.fn();
- }, 500);
+ }, 200);
}
if (!data.noOpen) {
setTimeout(() => {
diff --git a/src/styles/mobile/popup.scss b/src/styles/mobile/popup.scss
index 3b283b5..a50f19e 100644
--- a/src/styles/mobile/popup.scss
+++ b/src/styles/mobile/popup.scss
@@ -101,6 +101,7 @@
width: 100%;
height: 100%;
}
+ .imgs,
img {
margin-left: calc(50% - 35px);
width: 70px;
--
Gitblit v1.9.3