liuyg
2021-07-04 62cbc136e345854704ab341783c8d5b0d5c0ca33
jQmap
4 files modified
97 ■■■■■ changed files
pages/alarm_list/alarm_list.vue 6 ●●●● patch | view | raw | blame | history
pages/poput/mapJQtijiao/mapJQtijiao/mapJQtijiao.vue 8 ●●●● patch | view | raw | blame | history
xcxMapJQLG/css/body.css 4 ●●●● patch | view | raw | blame | history
xcxMapJQLG/js/vueMain.js 79 ●●●●● patch | view | raw | blame | history
pages/alarm_list/alarm_list.vue
@@ -220,11 +220,11 @@
                    datas.size = 300;
                    datas.userid = this.$store.state.puserID;
                    datas.username = this.$store.state.puserName;
                    datas.url = this.$store.state.piAPI + "/alarm/alarm/APP-setAlarm";
                    datas.url = this.$store.state.piAPI + "alarm/alarm/APP-setAlarm";
                    
                    
                    datas.jd = 114.91385;//模拟位置
                    datas.wd = 25.81051;//模拟位置
                    // datas.jd = 114.91385;//模拟位置
                    // datas.wd = 25.81051;//模拟位置
                    // datas.wd = 25.81051;//模拟位置
                    
                    
pages/poput/mapJQtijiao/mapJQtijiao/mapJQtijiao.vue
@@ -94,15 +94,15 @@
                        if (res.data.code == 200) {
                            wx.showToast({
                                title: '提交成功!',
                                duration: 2000
                                duration: 1000
                            });
                            var time = setTimeout(()=>{
                                clearTimeout(time);
                                time = null;
                                uni.navigateTo({
                                uni.redirectTo({
                                    url: '/pages/alarm_list/alarm_list'
                                });
                            },3000)
                            },1500)
                        }
                    }
                });
@@ -227,7 +227,7 @@
                    id: 422
                }
            }
            console.log(e);
            // console.log(e);
            this.datas = e;
        }
    }
xcxMapJQLG/css/body.css
@@ -104,7 +104,7 @@
    height: 33%;
    display: flex;
    align-items: center;
    padding-left: 1rem;
    padding-left: 2rem;
}
#Umain .Um-m:last-child .um-m-t{
    /* border: 1px solid #169BD5; */
@@ -118,7 +118,7 @@
#heads{
    position: absolute;
    top: 76%;
    left: 0;
    left: 1rem;
}
#Umain .Um-m .um-m-t {
xcxMapJQLG/js/vueMain.js
@@ -31,6 +31,7 @@
        wentifankui: '',
        oldlat: '',
        oldlng: '',
        haveJDWD: true,
    },
    methods: {
@@ -52,14 +53,17 @@
            this.getdata = this.getQueryVariable('data') || data;
            // this.getdata = data;
            this.changeDom(this.getdata[0]);
            console.log(this.getdata[0]);
            this.map = this.beginMap(this.map, this.getdata); //创建并接受map
            // this.move = new myDomMove('#seedata', '.title', '#map');
            this.map.invalidateSize(true); //应用地图高度
            // this.move.followFinger(this.map, 'down');
            this.lat = data[0].wd;
            this.lng = data[0].jd;
            this.oldlat = data[0].wd;
            this.oldlng = data[0].jd;
            // this.lat = data[0].wd;
            // this.lng = data[0].jd;
            // this.oldlat = data[0].wd;
            // this.oldlng = data[0].jd;
            this.oldlat = this.getdata[0].wd;
            this.oldlng = this.getdata[0].jd;
        },
        changeDom(data) {
            // console.log(data, 'changeDom');
@@ -71,14 +75,13 @@
            changeDoms('#um-m-t-bz', data.bz);
            changeDoms('#um-m-t-dz', data.place);
            // console.log(data.jtype, data.securityId, '11111111111')
            if (data.jtype == 2) {
                changeDoms('#um-m-t-states', '已处理');
            } else if (data.jtype == 1) {
            if (data.jtype == 1 && data.securityId != '') {
                changeDoms('#um-m-t-states', '处理中');
                $('#jieshou').hide();
                $('#wanchen').show();
            } else {
            } else if (data.jtype == 2) {
                changeDoms('#um-m-t-states', '已处理');
            } else if (data.securityId == null || data.securityId == '') {
                changeDoms('#um-m-t-states', '未处理');
                $('#jieshou').show();
                $('#wanchen').hide();
@@ -165,17 +168,20 @@
            for (var i = 0; i < data.length; i++) {
                var a = data[i];
                if (a.jd == '' || a.wd == '') {
                    console.log('没有坐标', i)
                    console.log('没有坐标', i);
                    that.haveJDWD = false;
                } else {
                    setData(a);
                }
                markers.addLayer(marker);
            }
            map.addLayer(markers);
            if (that.haveJDWD) {
                markers.addLayer(marker);
                map.addLayer(markers);
            }
            var i = 0;
            markers.on('click', function(a) {
                if (i == 0) {
                    console.log(that.getdata)
                } else if (i == 1) {
@@ -189,41 +195,45 @@
        },
        Submit() {
            var data = this.getdata[0];
            console.log(data)
            // console.log(data)
            // receives() {// 接受任务
            var url = data.url,
                Pid = data.id,
                id = data.userid, //警察id
                name = data.username, //警察id
                data = {
                datas = {
                    id: Pid,
                    securityId: id,
                    alarmPeople: name
                };
            // console.log(data);
            // console.log(datas);
            axios({
                    url: url,
                    data: data,
                    header: {
                        "content-type": "application/x-www-form-urlencoded"
                    },
                    method: 'POST',
                    success(res) {
                        console.log(res);
                url: url +
                    `?securityId=${datas.securityId}&id=${datas.id}&alarmPeople=datas.alarmPeople`,
                // data: datas,
                header: {
                    "content-type": "application/x-www-form-urlencoded"
                },
                method: 'POST',
                        $('#loding').show();
                        var time = setTimeout(() => {
                            $('#loding').hide();
                        }, 1000)
                        $('#jieshou').show();
                        $('#wanchen').hide();
                    }
                })
            }).then(res => {
                // console.log(res, 123);
                $('#loding').show();
                var time = setTimeout(() => {
                    $('#loding').hide();
                }, 1000)
                $('#jieshou').hide();
                $('#wanchen').show();
                $('#um-m-t-states').empty();
                $('#um-m-t-states').append('处理中');
            })
            // console.log( 123);
        },
        SubmitDown() {
            // $('#SubmitDown').show();
            console.log(uni.navigateTo)
            // console.log(uni.navigateTo)
            uni.navigateTo({
                url: '/pages/poput/mapJQtijiao/mapJQtijiao/mapJQtijiao?id=' + this.getdata[0].id
            });
@@ -303,6 +313,9 @@
                    that.LXdhStart.addLayer(L.marker([that.lat, that.lng], {
                        icon: qd,
                    }));
                    if (that.haveJDWD == false) {
                        that.map.setView([that.lat, that.lng], 20);
                    }
                    that.map.addLayer(that.LXdhStart);
                    that.getDHLine(+that.oldlng, +that.oldlat)