1920屏幕按钮位置适配

main
许宏杰 7 months ago
parent 6cc5341de3
commit 685b052268

@ -28,7 +28,7 @@
</div> </div>
</el-collapse-transition> </el-collapse-transition>
</div> </div>
<div class="albuginea" @click="initTilesetLayer()"> <div class="albuginea" :style="btnStyle" @click="initTilesetLayer()">
{{ show3D ? "关闭" : "开启" }}三维 {{ show3D ? "关闭" : "开启" }}三维
</div> </div>
<mars-map @mapLoad="mapLoad" :options="options"></mars-map> <mars-map @mapLoad="mapLoad" :options="options"></mars-map>
@ -62,6 +62,7 @@ export default {
data() { data() {
const basePathUrl = window.basePathUrl || ""; const basePathUrl = window.basePathUrl || "";
return { return {
btnStyle: {},
timer: null, timer: null,
time2: null, time2: null,
searchList: [], searchList: [],
@ -148,7 +149,18 @@ export default {
this.mapLayer.car.remove(); this.mapLayer.car.remove();
this.mapLayer.car = null; this.mapLayer.car = null;
}, },
created() {
const screenWidth = window.innerWidth;
if (screenWidth > 3000) {
this.btnStyle = {
left: `32.5%`,
};
} else {
this.btnStyle = {
left: `27.8%`,
};
}
},
mounted() { mounted() {
// mounted // mounted
document.addEventListener("click", this.handleClickOutside); document.addEventListener("click", this.handleClickOutside);
@ -583,11 +595,10 @@ export default {
.albuginea { .albuginea {
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
// top: 103px;
bottom: 4%; bottom: 4%;
// left: calc(554px + 24px);
left: 32.5%; z-index: 110;
z-index: 100;
width: 80px; width: 80px;
height: 32px; height: 32px;
text-align: center; text-align: center;

@ -10,10 +10,14 @@
<span>{{ mileData.mile }}</span> <span>{{ mileData.mile }}</span>
</div> </div>
</div> </div>
<div class="albuginea backBtn" @click="initTilesetLayer()"> <div
class="albuginea backBtn"
:style="btnStyle"
@click="initTilesetLayer()"
>
{{ show3D ? "关闭" : "开启" }}三维 {{ show3D ? "关闭" : "开启" }}三维
</div> </div>
<div class="albuginea" @click="$router.back()"> <div class="albuginea" @click="$router.back()" :style="btnStyle">
<i class="el-icon-back"></i> 返回 <i class="el-icon-back"></i> 返回
</div> </div>
<mars-map @mapLoad="mapLoad" :options="options"></mars-map> <mars-map @mapLoad="mapLoad" :options="options"></mars-map>
@ -32,6 +36,7 @@ export default {
data() { data() {
const basePathUrl = window.basePathUrl || ""; const basePathUrl = window.basePathUrl || "";
return { return {
btnStyle: {},
missionData: {}, //id missionData: {}, //id
mileData: { mileData: {
mile: 0, // mile: 0, //
@ -94,6 +99,16 @@ export default {
this.mapLayer.car = null; this.mapLayer.car = null;
}, },
created() { created() {
const screenWidth = window.innerWidth;
if (screenWidth > 3000) {
this.btnStyle = {
left: `32.5%`,
};
} else {
this.btnStyle = {
left: `27.8%`,
};
}
this.missionData = { this.missionData = {
missionId: this.$route.query.missionId, missionId: this.$route.query.missionId,
missionName: this.$route.query.missionName, missionName: this.$route.query.missionName,
@ -392,12 +407,8 @@ export default {
.albuginea { .albuginea {
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
// top: 103px; bottom: 3%;
bottom: 4%; z-index: 110;
left: 32.5%;
// left: calc(554px + 24px);
z-index: 100;
width: 80px; width: 80px;
height: 32px; height: 32px;
text-align: center; text-align: center;
@ -410,8 +421,7 @@ export default {
color: #ffffff; color: #ffffff;
} }
.backBtn { .backBtn {
// top: 145px; bottom: 7%;
bottom: 8%;
} }
.albuginea:hover { .albuginea:hover {
background: #0084ff; background: #0084ff;
@ -457,6 +467,7 @@ export default {
} }
} }
.video-list { .video-list {
width: 35%;
position: absolute; position: absolute;
bottom: 30px; bottom: 30px;
left: 50%; left: 50%;

@ -82,7 +82,7 @@ export default {
}, },
created() { created() {
const screenWidth = window.innerWidth; const screenWidth = window.innerWidth;
console.log(screenWidth);
if (screenWidth > 3000) { if (screenWidth > 3000) {
this.options.scene.center = { this.options.scene.center = {
lat: 28.990656, lat: 28.990656,

Loading…
Cancel
Save