智慧保安互联网APP
shuishen
2021-08-13 eaa83986e35d478bdfef55b49941fc6b4b86d95e
地图及部分配置修改
11 files modified
178 ■■■■■ changed files
mapWz/js/vueMain.js 37 ●●●●● patch | view | raw | blame | history
pages.json 4 ●●●● patch | view | raw | blame | history
pages/dispatch/imgissue.vue 14 ●●●●● patch | view | raw | blame | history
pages/dispatch/issue.vue 14 ●●●●● patch | view | raw | blame | history
pages/examine/addpeople.vue 16 ●●●●● patch | view | raw | blame | history
pages/examine/addunit.vue 14 ●●●●● patch | view | raw | blame | history
pages/login/login-account.vue 2 ●●● patch | view | raw | blame | history
pages/map/map.vue 4 ●●●● patch | view | raw | blame | history
pages/report/initiate.vue 14 ●●●●● patch | view | raw | blame | history
store/actions.js 53 ●●●●● patch | view | raw | blame | history
template.h5.html 6 ●●●● patch | view | raw | blame | history
mapWz/js/vueMain.js
@@ -25,7 +25,7 @@
        resultFeedbackPopupShow: false,
        popupDisplay: "none",
        userId: null,
        geolocation: null
    },
    methods: {
@@ -44,7 +44,7 @@
                            resultData.push(item)
                        }
                    })
                }
                }
                this.map = this.beginMap(this.map, resultData); //创建并接受map
                this.move = new myDomMove('#seedata', '.title', '#map');
@@ -62,7 +62,8 @@
            return null;
        },
        beginMap(map, data) {
            var that = this, center = [28.708432053474827, 115.85883507433789];
            var that = this,
                center = [28.708432053474827, 115.85883507433789];
            // url = `http://s16s652780.51mypc.cn/api/alarm/alarm/APP-getAlarm?id=${data[0].id}`;
            // url = `http://localhost:89/alarm/alarm/APP-getAlarm?id=${data[0].id}`;
            this.nowPosition = center;
@@ -170,6 +171,10 @@
            });
            this.nowPosition = center;
            this.getLocationData(this.geolocation);
            return map; //抛出map
        },
        getDHLine(x, y) {
@@ -316,9 +321,8 @@
        upData() {
            console.log('上传信息成功')
        },
        getLocationData() {
        getLocationData(geolocation) {
            var that = this;
            var geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
            var positionNum = 0;
            var options = {
                timeout: 8000
@@ -331,22 +335,6 @@
                var addr = position.addr; //详细地址
                that.lat = position.lat; //
                that.lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑 
                console.log(adCode, position, addr, 15145)
                axios.post("http://223.82.109.183:2080/api/liveLocation/saveLiveLocationAndLocus", {
                    type: 1,
                    workerId: that.userId,
                    longitude: position.lng,
                    latitude: position.lat,
                    location: addr == '' ? position.province + position.city : addr
                }).then((res) => {
                    console.log(res, 4848)
                })
                if (that.LXdhStart != null) {
                    that.map.removeLayer(that.LXdhStart);
@@ -384,16 +372,17 @@
    },
    created() {},
    mounted() {
        this.geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
        this.beginCome();
        this.getLocationData();
        var that = this;
        setInterval(() => {
            that.getLocationData();
            that.getLocationData(that.geolocation);
        }, 10000);
        }, 30000);
    },
    wacth: {}
})
pages.json
@@ -436,13 +436,13 @@
                "pagePath": "pages/groupChat/groupChat",
                "iconPath": "static/images/tabbar/demo.png",
                "selectedIconPath": "static/images/tabbar/demo_selected.png",
                "text": "好友"
                "text": "聊天"
            },
            {
                "pagePath": "pages/manage/manage",
                "iconPath": "static/images/tabbar/manage.png",
                "selectedIconPath": "static/images/tabbar/manage_selected.png",
                "text": "管理"
                "text": "工作台"
            },
            {
                "pagePath": "pages/user/center",
pages/dispatch/imgissue.vue
@@ -98,14 +98,18 @@
            },
            recipientConfirm(e) {
                if (e.length > 1) {
                    this.form.recipient = e[1].value
                    this.form.recipientText = e[1].label
                } else {
                if (e.length == 1) {
                    this.form.recipient = e[0].value
                    this.form.recipientText = e[0].label
                } else if (e.length == 2) {
                    this.form.recipient = e[1].value
                    this.form.recipientText = e[1].label
                } else if (e.length == 3) {
                    this.form.recipient = e[2].value
                    this.form.recipientText = e[2].label
                }
            },
            initiateClick() {
                var imgurl = '';
pages/dispatch/issue.vue
@@ -90,14 +90,18 @@
            },
            recipientConfirm(e) {
                if (e.length > 1) {
                    this.form.recipient = e[1].value
                    this.form.recipientText = e[1].label
                } else {
                if (e.length == 1) {
                    this.form.recipient = e[0].value
                    this.form.recipientText = e[0].label
                } else if (e.length == 2) {
                    this.form.recipient = e[1].value
                    this.form.recipientText = e[1].label
                } else if (e.length == 3) {
                    this.form.recipient = e[2].value
                    this.form.recipientText = e[2].label
                }
            },
            initiateClick() {
                this.$refs.uForm.validate(valid => {
pages/examine/addpeople.vue
@@ -126,15 +126,17 @@
            peopleConfirm(e) {
                
                if (e.length > 1) {
                    this.form.people = e[1].value
                    this.form.peopleText = e[1].label
                    this.form.unitText = e[0].label
                } else {
                if (e.length == 1) {
                    this.form.people = e[0].value
                    this.form.peopleText = e[0].label
                } else if (e.length == 2) {
                    this.form.people = e[1].value
                    this.form.peopleText = e[1].label
                    this.form.unitText = e[0].label
                } else if (e.length == 3) {
                    this.form.people = e[2].value
                    this.form.peopleText = e[2].label
                    this.form.unitText = e[1].label
                }
            },
pages/examine/addunit.vue
@@ -51,7 +51,7 @@
    export default {
        components: {
            seeImgs
        },
        },
        data() {
            return {
@@ -125,12 +125,16 @@
            },
            unitConfirm(e) {
                if (e.length > 1) {
                    this.form.unit = e[1].value
                    this.form.unitText = e[1].label
                } else {
                if (e.length == 1) {
                    this.form.unit = e[0].value
                    this.form.unitText = e[0].label
                } else if (e.length == 2) {
                    this.form.unit = e[1].value
                    this.form.unitText = e[1].label
                } else if (e.length == 3) {
                    this.form.unit = e[2].value
                    this.form.unitText = e[2].label
                }
            },
pages/login/login-account.vue
@@ -90,7 +90,7 @@
            },
            judgeMsg() {
                this.msg = this.names == '' ? (this.passwords == '' ? '账号密码不能为空' : '账号不能为空') : (this.passwords == '' ?
                    '密码不能为空' : this.passwords.length <= 5 ? '密码最少6位' :
                    '密码不能为空' : this.passwords.length <= 4 ? '密码最少6位' :
                    '格式正确');
                if (this.msg == "格式正确") {
                    this.icons = 'success';
pages/map/map.vue
@@ -16,8 +16,8 @@
        mounted() {},
        onLoad: function(options) {
            
            this.urls = "http://web.byisf.com/mapWz/xcxmap.html?id="+ this.$store.state.UserData.jurisdiction + "&userid="+ this.$store.state.UserData.role_id;
            // this.urls = "http://127.0.0.1:5500/mapWz/xcxmap.html?id="+ this.$store.state.UserData.jurisdiction + "&userid="+ this.$store.state.UserData.role_id;
            // this.urls = "http://web.byisf.com/mapWz/xcxmap.html?id="+ this.$store.state.UserData.jurisdiction + "&userid="+ this.$store.state.UserData.role_id;
            this.urls = "http://127.0.0.1:5500/mapWz/xcxmap.html?id="+ this.$store.state.UserData.jurisdiction + "&userid="+ this.$store.state.UserData.role_id;
            
        },
    }
pages/report/initiate.vue
@@ -175,14 +175,18 @@
                this.form.typeText = e[0].label
            },
            recipientConfirm(e) {
                if (e.length > 1) {
                    this.form.recipient = e[1].value
                    this.form.recipientText = e[1].label
                } else {
                if (e.length == 1) {
                    this.form.recipient = e[0].value
                    this.form.recipientText = e[0].label
                } else if (e.length == 2) {
                    this.form.recipient = e[1].value
                    this.form.recipientText = e[1].label
                } else if (e.length == 3) {
                    this.form.recipient = e[2].value
                    this.form.recipientText = e[2].label
                }
            },
            initiateClick() {
                this.$refs.uForm.validate(valid => {
store/actions.js
@@ -1,5 +1,41 @@
import md5 from 'js-md5'
import axios from 'axios'
const geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
const getLocationData = (userId) => {
    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; //详细地址
        axios.post("http://223.82.109.183:2080/api/liveLocation/saveLiveLocationAndLocus", {
            type: 1,
            workerId: userId,
            longitude: position.lng,
            latitude: position.lat,
            location: addr == '' ? position.province + position.city : position.province + position.city +
                addr
        }).then((res) => {
        })
    };
    function showErr() {
        //TODO 如果出错了调用此方法
    };
    geolocation.getLocation(showPosition, showErr, options);
};
const actions = {
    loging(store, data) {
        var user = [{
@@ -63,12 +99,19 @@
                    data.accounts = data.name;
                    data.pass = data.pass;
                    // data.userPhon = res.user_id;
                    setInterval(function() {
                            getLocationData(res.data.user_id);
                        },
                        30000)
                    uni.request({
                        url: "http://223.82.109.183:2080/api/blade-system/dept/detail?id=" + res.data.dept_id,
                        url: "http://223.82.109.183:2080/api/blade-system/dept/detail?id=" + res
                            .data.dept_id,
                        method: "get",
                        data: {
                        },
                        success: (result) => {
                            data.deptName = result.data.data.deptName
@@ -77,8 +120,8 @@
                            uni.$u.func.login(res.data)
                        }
                    });
                }
            },
            fail: (res) => {
template.h5.html
@@ -4,7 +4,8 @@
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico">
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta name="viewport"
            content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <title>
            <%= htmlWebpackPlugin.options.title %>
        </title>
@@ -13,6 +14,9 @@
                document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
            })
        </script>
        <!-- 百度地图api -->
        <script type="text/javascript" src="https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js">
        </script>
        <link rel="stylesheet" href="<%= BASE_URL %>static/index.css" />
    </head>
    <body>