liuyg
2021-05-22 99eb6850a5c7febd5f061af746aeed81d2356924
小程序地图
3 files modified
1 files added
38 ■■■■ changed files
public/xcxjingqingmap/css/body.css 16 ●●●●● patch | view | raw | blame | history
public/xcxjingqingmap/img/dingwei.png patch | view | raw | blame | history
public/xcxjingqingmap/js/vueMain.js 19 ●●●● patch | view | raw | blame | history
public/xcxjingqingmap/xcxmap.html 3 ●●●●● patch | view | raw | blame | history
public/xcxjingqingmap/css/body.css
@@ -17,7 +17,21 @@
    overflow: hidden;
    /* border: solid 1px springgreen; */
}
.dingwei{
    position: fixed;
    width: 38px;
    height: 38px;
    top: 100px;
    right: 0;
    z-index: 10000;
    background-color: #fff;
    border-radius: 20px;
    opacity: 0.8;
    border: 1px solid gray;
    display: flex;
    align-items: center;
    justify-content: center;
}
#seedata {
    position: fixed;
    bottom: 0;
public/xcxjingqingmap/img/dingwei.png
public/xcxjingqingmap/js/vueMain.js
@@ -13,6 +13,8 @@
        move: null,//存放移动实例
        seedata: '',
        nowPosition: '',
    },
    methods: {
        getDataList() {
@@ -57,18 +59,19 @@
            var that = this,
                center = [data[0].wd, data[0].jd],
                url = `/api/blade-jfpts/alarm/alarm/APP-getAlarm?id=${data[0].id}`;
            this.nowPosition = center;
            axios.post(url).then((res) => {
                // console.log(res)
                if(res.data.data.length != 0){
                if (res.data.data.length != 0) {
                    var dat = res.data.data[0];
                    for(var key in dat){
                        if(dat[key] == null || dat[key] == ''){
                    for (var key in dat) {
                        if (dat[key] == null || dat[key] == '') {
                            dat[key] = '暂无'
                        }
                    }
                    this.seedata = dat;
                }else{
                } else {
                    this.seedata = data[0];
                }
                // console.log(this.seedata, 1524545453)
@@ -160,11 +163,17 @@
        },
        handleClick(tab, event) {
            // console.log(tab, event);
        },
        locationMap() {
            this.map.setView(this.nowPosition, 12);
        }
    },
    created() {
    },
    mounted() {
        this.getDataList();
    },
    wacth:{
    }
})
public/xcxjingqingmap/xcxmap.html
@@ -47,6 +47,9 @@
<body>
    <div id="mapVue">
        <div class="dingwei" @click="locationMap">
            <img style="width: 80%;height: 80%;" src="./img/dingwei.png" alt="">
        </div>
        <div id="map"></div>
        <div id="seedata">
            <div class="title">