pc-master #257

Merged
xiaomeng merged 2 commits from pc-master into portal 2025-06-28 03:29:09 +00:00
4 changed files with 88 additions and 5 deletions
Showing only changes of commit a75b50eca7 - Show all commits

View File

@ -6,6 +6,15 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<script
type="text/javascript"
src="https://webapi.amap.com/maps?v=2.0&key=6bb8457c7f0b7661c2e925c25ae53852&plugin=AMap.ElasticMarker"
></script>
<script>
window._AMapSecurityConfig = {
securityJsCode: "68fc1cc8e2dd5d683ddc93ee7bbdd05d",
};
</script>
</head>
<body>
<noscript>

View File

@ -13,6 +13,11 @@ const routes = [
name: 'login',
component: login,
},
{
path: '/test',
name: 'test',
component: () => import('../views/test.vue')
},
{
path: '/home',
name: 'home',

View File

@ -229,7 +229,8 @@
</div>
<!-- 长兴前卫柑桔新优品种扩繁基地 -->
<div class="drag_box13" ref="drag_box13" v-show="limitUserId == 13">
<img class="drag_img" src="../../assets/img/map9.jpg" alt="" />
<div class="map-13" id="map-13"></div>
<!-- <img class="drag_img" src="../../assets/img/map9.jpg" alt="" />
<img class="axis_shimen" src="../../assets/img/axis1.png" alt="" @click="handlerAxis_5" />
<img class="axis_shimen1" src="../../assets/img/axis1.png" alt="" @click="handlerAxis_5" />
<img class="axis_shimen2" src="../../assets/img/axis1.png" alt="" @click="handlerAxis_5" />
@ -243,7 +244,7 @@
<img class="axis_shimen10" src="../../assets/img/axis1.png" alt="" @click="handlerAxis_5" />
<img class="axis_shimen11" src="../../assets/img/axis1.png" alt="" @click="handlerAxis_5" />
<img class="axis_shimen12" src="../../assets/img/axis1.png" alt="" @click="handlerAxis_5" />
<img class="axis_shimen13" src="../../assets/img/axis1.png" alt="" @click="handlerAxis_5" />
<img class="axis_shimen13" src="../../assets/img/axis1.png" alt="" @click="handlerAxis_5" /> -->
</div>
</div>
</div>
@ -1280,14 +1281,42 @@ export default {
this.drag_boxHandler12();
this.dataInit(userId, this.limitUserId);
}else if (this.limitUserId == 13) {
this.drag_boxHandler13();
// this.drag_boxHandler13();
this.mapInit()
this.dataInit(userId, this.limitUserId);
}
}
});
},
mapInit(){
const map = new AMap.Map("map-13", {
zoom: 18,
center: [121.696506, 31.410799],
});
var satelliteLayer = new AMap.TileLayer.Satellite();
var roadNetLayer = new AMap.TileLayer.RoadNet();
// map.setLayers([]); //
satelliteLayer.setMap(map); //
// roadNetLayer.setMap(map); //
//
const iconUrl = require("@/assets/img/axis1.png");
const icon = new AMap.Icon({
image: iconUrl,
size: new AMap.Size(70, 86), //
imageSize: new AMap.Size(35, 43) // 35x43
});
const marker = new AMap.Marker({
position:new AMap.LngLat(121.696506, 31.410799),
icon: icon,
title: "上海前卫柑桔有限公司",
offset: new AMap.Pixel(-17.5, -40), // icon [center bottom]
});
map.add(marker);
},
// autoPlay1() {
// this.autoPlay = false;
// clearInterval(this.timer_) && this.timer_;
@ -1997,7 +2026,12 @@ window.open("http://localhost:8080/");
}
}
}
.amap-icon{
img{
width: 100%;
height: 100%;
}
}
.e_content1 {
height: 100%;
@ -2701,7 +2735,8 @@ window.open("http://localhost:8080/");
}
.drag_box13{
width: 100%;
height: auto;
// height: auto;
height: 100%;
position: absolute;
// top: 0.3rem;
// left: 0.5rem;
@ -2718,6 +2753,10 @@ window.open("http://localhost:8080/");
blue 13%,
blue 73%,
transparent 97%);
}
.map-13{
width: 100%;
height: 100%;
}
.axis_shimen {
width: 0.3rem;

30
src/views/test.vue Normal file
View File

@ -0,0 +1,30 @@
<template>
<div class="test">
<div class="map-container" id="map-container"></div>
</div>
</template>
<script>
export default {
data(){
return {
}
},
mounted(){
const map = new AMap.Map("map-container", {
zoom: 12,
center: [116.397428, 39.90923],
});
},
methods:{
},
}
</script>
<style lang="scss">
.map-container{
width: 100vw;
height: 100vh;
}
</style>