南昌市物联网技防平台-小程序
zengh
2021-06-03 4d93ba5ce580c91d5341034c54ac068387070974
样式优化
5 files modified
5 files added
237 ■■■■ changed files
pages/investigation/investigation.vue 29 ●●●●● patch | view | raw | blame | history
pages/investigation/prizesquare.vue 40 ●●●●● patch | view | raw | blame | history
xcxMapJQ/img/dingw.gif patch | view | raw | blame | history
xcxMapJQ/js/vueMain.js 60 ●●●●● patch | view | raw | blame | history
xcxMapJQ/xcxmap.html 3 ●●●●● patch | view | raw | blame | history
xcxjingqingmap_lxdh/img/ces.gif patch | view | raw | blame | history
xcxjingqingmap_lxdh/img/dingw.gif patch | view | raw | blame | history
xcxjingqingmap_lxdh/img/dingw.png patch | view | raw | blame | history
xcxjingqingmap_lxdh/js/lxdhmap.js 99 ●●●● patch | view | raw | blame | history
xcxjingqingmap_lxdh/lxdhmap.html 6 ●●●●● patch | view | raw | blame | history
pages/investigation/investigation.vue
@@ -15,6 +15,7 @@
        methods: {},
        mounted() {},
        onLoad: function(options) {
            var that = this;
            var data = [];
            if (options.data == undefined) {
                data = [{
@@ -27,10 +28,34 @@
                    "wd": "28.646341"
                }]
                data = JSON.stringify(data);
            }else{
            } else {
                data = options.data;
            }
            this.urls = "https://web.byisf.com/xcxjingqingmap_lxdh/lxdhmap.html?data=" + data;
            //alert("Hello");
            wx.getLocation({
                type: 'wgs84',
                success: function(res) {
                    // 经纬度
                    var latitude = res.latitude
                    var longitude = res.longitude
                    wx.setStorageSync("latitude", latitude);
                    wx.setStorageSync("longitude", longitude);
                },
                fail: function() {
                    console.log("定位失败")
                }
            });
            var latitude = wx.getStorageSync("latitude");
            var longitude = wx.getStorageSync("longitude");
            // alert(wx.getStorageSync("longitude"));
            that.urls = "https://web.byisf.com/xcxjingqingmap_lxdh/lxdhmap.html?data=" + data + "&latitude=" +
                latitude + "&longitude=" + longitude;
            // this.dataList = data;
            // console.log(this.urls);
        },
pages/investigation/prizesquare.vue
New file
@@ -0,0 +1,40 @@
<template>
</template>
<script>
    export default {
        data() {
            return {
                urls: '',
                // dataList: [],
            }
        },
        methods: {},
        mounted() {},
        onLoad: function(options) {
            debugger
            console.log(options)
                var that = this,
                info_detail = options;
                console.log("----------------------特惠广场地址导航------------")
                console.log(info_detail.latitude)
                if (info_detail.latitude != '' && info_detail.latitude!=undefined){
                  wx.getLocation({//获取当前经纬度
                    type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
                    success: function (res) {
                      wx.openLocation({//​使用微信内置地图查看位置。
                        latitude: Number(info_detail.latitude),//要去的纬度-地址
                        longitude: Number(info_detail.longitude),//要去的经度-地址
                        address: info_detail.address,
                        name: info_detail.name,
                      })
                    }
                  })
                }
        },
    }
</script>
<style>
</style>
xcxMapJQ/img/dingw.gif
xcxMapJQ/js/vueMain.js
@@ -7,12 +7,18 @@
        layuiLayer: null,
        nowIndex: null,
        
        LXdhStart: null,
        LXdhEnd: null,
        LxdhLine: null,
        activeName: 'first',
        move: null,//存放移动实例
        //存放实时坐标
        lat: "",
        lng: "",
        seedata: '',
@@ -199,8 +205,8 @@
                url: `https://web.byisf.com/sf/rp/v2/api`,
                params: {
                    ak: "1986afc8a5744263971b7f2482253dfc",
                    x1: "114.95675749182703",
                    y1: "25.84163062532512",
                    x1: that.lng,
                    y1: that.lat,
                    x2: x,
                    y2: y,
                    type: "1",
@@ -386,13 +392,61 @@
                    console.log('success');   //页面跳转胜利的回调函数
                }
            });
        }
        },
        getLocationData() {
            var that = this;
            var geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
            var positionNum = 0;
            var options = {
                timeout: 8000
            };
            function showPosition(position) {
                var adCode = position.adCode; //邮政编码
                var nation = position.nation; //中国
                var city = position.city; //城市
                var addr = position.addr; //详细地址
                that.lat = position.lat; //
                that.lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑
                if (that.LXdhStart != null) {
                    that.map.removeLayer(that.LXdhStart);
                }
                //绘制起点和终点
                that.LXdhStart = L.markerClusterGroup();
                var transportIcon = L.Icon.extend({ //图标初始化
                    options: {
                        iconSize: [50, 50], // 图标尺寸
                    }
                });
                var qd = new transportIcon({
                    iconUrl: './img/dingw.gif'
                });
                that.LXdhStart.addLayer(L.marker([that.lat, that.lng], {
                    icon: qd,
                }));
                that.map.addLayer(that.LXdhStart);
            };
            function showErr() {
                //TODO 如果出错了调用此方法
            };
            geolocation.getLocation(showPosition, showErr, options);
        },
    },
    created() {
    },
    mounted() {
        this.getDataList();
        this.getLocationData();
    },
    wacth: {
    }
xcxMapJQ/xcxmap.html
@@ -21,6 +21,9 @@
    <!-- layui支持 -->
    <!-- <link rel="stylesheet" href="../map/lib/layui/css/layui.css" media="all"> -->
    <!-- <script src="../map/lib/layui/layui.js" charset="utf-8"></script> -->
    <!-- 百度地图api -->
    <script type="text/javascript" src="https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js"></script>
    <!-- axios支持 -->
    <script src="../map/lib/axios.js"></script>
xcxjingqingmap_lxdh/img/ces.gif
xcxjingqingmap_lxdh/img/dingw.gif
xcxjingqingmap_lxdh/img/dingw.png
xcxjingqingmap_lxdh/js/lxdhmap.js
@@ -13,8 +13,13 @@
        ZBCXresult: null,
        LXdhStart: null,
        LXdhEnd: null,
        LxdhLine: null,
        //存放实时坐标
        lat: "",
        lng: "",
        move: null, //存放移动实例
@@ -71,8 +76,8 @@
        },
        beginMap(map, data) {
            var that = this,
                center = [data[0].wd, data[0].jd],
                url = `/api/blade-jfpts/alarm/alarm/APP-getAlarm?id=${data[0].id}`;
                center = [that.lat, that.lng];
            //    url = `/api/blade-jfpts/alarm/alarm/APP-getAlarm?id=${data[0].id}`;
            // this.nowPosition = center;
            // axios.post(url).then((res) => {
            //     // console.log(res)
@@ -94,7 +99,7 @@
            var createMap = () => {
                map = L.map('map', { //初始化地图
                    center: center,
                    //center: center,
                    zoom: 12,
                    minZoom: 2,
                    maxZoom: 17,
@@ -256,15 +261,15 @@
        getDHLine(x, y) {
            var that = this;
            //获取导航信息
            axios({
                method: "get",
                url: `https://web.byisf.com/sf/rp/v2/api`,
                params: {
                    ak: "1986afc8a5744263971b7f2482253dfc",
                    x1: "114.95675749182703",
                    y1: "25.84163062532512",
                    x1: that.lng,
                    y1: that.lat,
                    x2: x,
                    y2: y,
                    type: "1",
@@ -333,14 +338,68 @@
                color: 'red'
            }).addTo(that.map);
            alert(wx.getStorageSync("longitude"));
            // zoom the map to the polyline
            that.map.fitBounds(that.LxdhLine.getBounds())
        },
        getLocationData() {
            var that = this;
            var geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
            var positionNum = 0;
            var options = {
                timeout: 8000
            };
            function showPosition(position) {
                var adCode = position.adCode; //邮政编码
                var nation = position.nation; //中国
                var city = position.city; //城市
                var addr = position.addr; //详细地址
                that.lat = position.lat; //
                that.lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑
                if (that.LXdhStart == null) {
                    //点位
                    var position = [that.lat, that.lng];
                    //把map定位到点位上,13为地图的级别,也可以直接marker.getLatLng()
                    that.map.setView(position, 15);
                }else{
                    that.map.removeLayer(that.LXdhStart);
                }
                //绘制起点和终点
                that.LXdhStart = L.markerClusterGroup();
                var transportIcon = L.Icon.extend({ //图标初始化
                    options: {
                        iconSize: [50, 50], // 图标尺寸
                    }
                });
                var qd = new transportIcon({
                    iconUrl: './img/dingw.gif'
                });
                that.LXdhStart.addLayer(L.marker([that.lat, that.lng], {
                    icon: qd,
                }));
                that.map.addLayer(that.LXdhStart);
            };
            function showErr() {
                //TODO 如果出错了调用此方法
            };
            geolocation.getLocation(showPosition, showErr, options);
        },
    },
    created() {
    },
    created() {},
    mounted() {
        //警情点查询
        axios({
@@ -362,25 +421,11 @@
                    }
                }
            }
            this.getDataList(res);
            debugger
            var latitude = null;
            var longitude = null;
            var speed = null;
            var accuracy = null;
            wx.getLocation({
                type: 'wgs84',
                success(resLo) {
                    latitude = resLo.latitude
                    longitude = resLo.longitude
                    speed = resLo.speed
                    accuracy = resLo.accuracy
                },fail(reserr){
                }
            });
            this.getDataList(res);
            this.getLocationData();
        });
    },
xcxjingqingmap_lxdh/lxdhmap.html
@@ -24,7 +24,6 @@
    <!-- axios支持 -->
    <script src="../map/lib/axios.js"></script>
    <!-- elementui -->
    <script src="../map/lib/elementUi.js"></script>
    <!-- <link rel="stylesheet" href="../map/lib/elementUi.css"> -->
@@ -37,7 +36,10 @@
    <!-- 微信支持 -->
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
    <!-- <script src="./js/wx.js"></script> -->
    <!-- 百度地图api -->
    <script type="text/javascript" src="https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js"></script>
    <!-- omyself支持 -->
    <link rel="stylesheet" href="./css/lxdhmap.css" />