南昌市物联网技防平台-小程序
zengh
2021-06-05 913df471222a8d1913f7412181624c38177a956b
样式优化
2 files modified
2 files added
196 ■■■■■ changed files
components/pColumn/pColumn.vue 6 ●●●●● patch | view | raw | blame | history
xcxMapJQ/js/geolocation.min.js 94 ●●●●● patch | view | raw | blame | history
xcxjingqingmap_lxdh/js/geolocation.min.js 94 ●●●●● patch | view | raw | blame | history
xcxjingqingmap_lxdh/lxdhmap.html 2 ●●● patch | view | raw | blame | history
components/pColumn/pColumn.vue
@@ -135,9 +135,11 @@
                .top {
                    .t-type {
                        font-size: 1.1rem;
                        color: #ff0000;
                    }
                    .t-id {
                        color: #00aaff;
                        font-size: 0.8rem;
                        line-height: 1.6rem;
                        position: relative;
@@ -146,7 +148,7 @@
                }
                .bottom {
                    font-size: 1rem;
                    font-size: 0.9rem;
                }
            }
xcxMapJQ/js/geolocation.min.js
New file
@@ -0,0 +1,94 @@
window.qq = window.qq || {}, qq.maps = qq.maps || {}, window.soso || (window.soso = qq), soso.maps || (soso.maps = qq
    .maps), qq.maps.Geolocation = function() {
    "use strict";
    var e = [],
        t = null,
        o = 0,
        n = "_geoIframe_" + Math.ceil(1e7 * Math.random()),
        i = document.createElement("iframe"),
        r = null,
        s = null,
        a = null,
        c = null,
        u = function(u, l) {
            if (!u) return void alert("请输入key!");
            if (!l) return void alert("请输入referer!");
            var p = document.getElementById(n);
            if (!p) {
                i.setAttribute("id", n), i.setAttribute("allow", "geolocation");
                var g = "https:";
                i.setAttribute("src", g + "//web.byisf.com/txdw/tools/geolocation?key=" + u + "&referer=" + l), i
                    .setAttribute("style", "display: none; width: 100%; height: 30%"), document.body ? document.body
                    .appendChild(i) : document.write(i.outerHTML);
                var m = this;
                window.addEventListener("message", function(n) {
                    var i = n.data;
                    if (i && "geolocation" == i.module) {
                        if (clearTimeout(c), e.length > 0) {
                            var u = e.shift();
                            u.sucCb && u.sucCb(i)
                        }
                        o = 2, m.executeNextGeo(), t && t(i)
                    } else {
                        s = (new Date).getTime();
                        var l = s - r;
                        if (l >= a) {
                            if (e.length > 0 && "geo" === e[0].type) {
                                var u = e.shift(),
                                    p = {
                                        type: "fail",
                                        code: 5,
                                        message: "The request"
                                    };
                                u.errCb && u.errCb(p)
                            }
                            clearTimeout(c), o = -1, m.executeNextGeo()
                        }
                        if (e.length > 0 && "ip" === e[0].type) {
                            var u = e.shift();
                            u.errCb && u.errCb(p)
                        }
                    }
                }, !1)
            }
        };
    return u.prototype.executeNextGeo = function() {
        1 !== o && e.length > 0 && (o = 1, e[0].geoprocess())
    }, u.prototype.getLocation = function(t, n, i) {
        if (i && i.timeout) {
            var r = new RegExp("^[0-9]*$");
            if (!r.test(i.timeout)) return void alert("timeout 请输入数字")
        }
        if (e.length > 10) throw new Error("geolocation queue must be lass than 10");
        e.push({
            sucCb: t,
            errCb: n,
            option: i,
            geoprocess: this.getOnceLocation,
            type: "geo"
        }), 1 !== o && (o = 1, this.getOnceLocation())
    }, u.prototype.getOnceLocation = function() {
        var t = e[0] && e[0].option;
        r = (new Date).getTime(), a = t && t.timeout ? +t.timeout : 1e4, clearTimeout(c), c = setTimeout(
            function() {
                if (e.length > 0) {
                    var t = e.shift();
                    t.errCb && t.errCb()
                }
            }, a), document.getElementById(n).contentWindow.postMessage("getLocation", "*")
    }, u.prototype.getIpLocation = function(t, n) {
        if (e.length > 10) throw new Error("geolocation queue mast be lass than 10");
        e.push({
            sucCb: t,
            errCb: n,
            geoprocess: this.getOnceIpLocation,
            type: "ip"
        }), 1 !== o && (o = 1, this.getOnceIpLocation())
    }, u.prototype.getOnceIpLocation = function() {
        document.getElementById(n).contentWindow.postMessage("getLocation.robust", "*")
    }, u.prototype.watchPosition = function(e) {
        t = e, document.getElementById(n).contentWindow.postMessage("watchPosition", "*")
    }, u.prototype.clearWatch = function() {
        t = null, document.getElementById(n).contentWindow.postMessage("clearWatch", "*")
    }, u
}();
xcxjingqingmap_lxdh/js/geolocation.min.js
New file
@@ -0,0 +1,94 @@
window.qq = window.qq || {}, qq.maps = qq.maps || {}, window.soso || (window.soso = qq), soso.maps || (soso.maps = qq
    .maps), qq.maps.Geolocation = function() {
    "use strict";
    var e = [],
        t = null,
        o = 0,
        n = "_geoIframe_" + Math.ceil(1e7 * Math.random()),
        i = document.createElement("iframe"),
        r = null,
        s = null,
        a = null,
        c = null,
        u = function(u, l) {
            if (!u) return void alert("请输入key!");
            if (!l) return void alert("请输入referer!");
            var p = document.getElementById(n);
            if (!p) {
                i.setAttribute("id", n), i.setAttribute("allow", "geolocation");
                var g = "https:";
                i.setAttribute("src", g + "//web.byisf.com/txdw/tools/geolocation?key=" + u + "&referer=" + l), i
                    .setAttribute("style", "display: none; width: 100%; height: 30%"), document.body ? document.body
                    .appendChild(i) : document.write(i.outerHTML);
                var m = this;
                window.addEventListener("message", function(n) {
                    var i = n.data;
                    if (i && "geolocation" == i.module) {
                        if (clearTimeout(c), e.length > 0) {
                            var u = e.shift();
                            u.sucCb && u.sucCb(i)
                        }
                        o = 2, m.executeNextGeo(), t && t(i)
                    } else {
                        s = (new Date).getTime();
                        var l = s - r;
                        if (l >= a) {
                            if (e.length > 0 && "geo" === e[0].type) {
                                var u = e.shift(),
                                    p = {
                                        type: "fail",
                                        code: 5,
                                        message: "The request"
                                    };
                                u.errCb && u.errCb(p)
                            }
                            clearTimeout(c), o = -1, m.executeNextGeo()
                        }
                        if (e.length > 0 && "ip" === e[0].type) {
                            var u = e.shift();
                            u.errCb && u.errCb(p)
                        }
                    }
                }, !1)
            }
        };
    return u.prototype.executeNextGeo = function() {
        1 !== o && e.length > 0 && (o = 1, e[0].geoprocess())
    }, u.prototype.getLocation = function(t, n, i) {
        if (i && i.timeout) {
            var r = new RegExp("^[0-9]*$");
            if (!r.test(i.timeout)) return void alert("timeout 请输入数字")
        }
        if (e.length > 10) throw new Error("geolocation queue must be lass than 10");
        e.push({
            sucCb: t,
            errCb: n,
            option: i,
            geoprocess: this.getOnceLocation,
            type: "geo"
        }), 1 !== o && (o = 1, this.getOnceLocation())
    }, u.prototype.getOnceLocation = function() {
        var t = e[0] && e[0].option;
        r = (new Date).getTime(), a = t && t.timeout ? +t.timeout : 1e4, clearTimeout(c), c = setTimeout(
            function() {
                if (e.length > 0) {
                    var t = e.shift();
                    t.errCb && t.errCb()
                }
            }, a), document.getElementById(n).contentWindow.postMessage("getLocation", "*")
    }, u.prototype.getIpLocation = function(t, n) {
        if (e.length > 10) throw new Error("geolocation queue mast be lass than 10");
        e.push({
            sucCb: t,
            errCb: n,
            geoprocess: this.getOnceIpLocation,
            type: "ip"
        }), 1 !== o && (o = 1, this.getOnceIpLocation())
    }, u.prototype.getOnceIpLocation = function() {
        document.getElementById(n).contentWindow.postMessage("getLocation.robust", "*")
    }, u.prototype.watchPosition = function(e) {
        t = e, document.getElementById(n).contentWindow.postMessage("watchPosition", "*")
    }, u.prototype.clearWatch = function() {
        t = null, document.getElementById(n).contentWindow.postMessage("clearWatch", "*")
    }, u
}();
xcxjingqingmap_lxdh/lxdhmap.html
@@ -38,7 +38,7 @@
    <!-- <script src="./js/wx.js"></script> -->
    
    <!-- 百度地图api -->
    <script type="text/javascript" src="https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js"></script>
    <script type="text/javascript" src="./js/geolocation.min.js"></script>
    
    <!-- omyself支持 -->
    <link rel="stylesheet" href="./css/lxdhmap.css" />