zengh
2022-02-23 e258efcddee88929911860c01a922bd09391b132
APP添加
4 files modified
30 ■■■■ changed files
public/grabOrdersMap/js/getPosition.js 11 ●●●● patch | view | raw | blame | history
public/grabOrdersMap/js/vueMain.js 15 ●●●● patch | view | raw | blame | history
public/grabOrdersMap/xcxmap.html patch | view | raw | blame | history
src/views/activitys/real.vue 4 ●●●● patch | view | raw | blame | history
public/grabOrdersMap/js/getPosition.js
@@ -1,4 +1,3 @@
class $getPositions {
    constructor(arg) {
        this.id = arg.id || 0; //任务id
@@ -16,6 +15,7 @@
        this.isContinued = false;
        this.isContinuedTimeInt = null;
        this.isContinuedTimeOut = null;
        this.geolocation = null; //定位实例
        return this;
    }
    //开始获取
@@ -50,6 +50,7 @@
    continuedTime(val) {
        //开始持续获取定位
        let that = this;
        that.geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
        if (val != 1) {
            // console.log(that.id,"开始持续定位")
            this.isContinued = true;
@@ -94,6 +95,9 @@
                clearTimeout(that.isContinuedTimeOut);
                this.isContinuedTimeOut = null;
            }
            if (this.geolocation) {
                this.geolocation = null;
            }
        }
        this.isContinued = false;
        that.outData('out');
@@ -117,12 +121,13 @@
            };
        outit();
        //qq定位
        var geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
        // var geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
        var options = {
            // timeout: 1000
        };
        function showPosition(position) {
            console.log(position)
            let lat = position.lat; //
            let lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑 
            that.onceNowPosition = [lng, lat];
@@ -139,7 +144,7 @@
            ok = true;
            outit();
        };
        geolocation.getLocation(showPosition, showErr, options);
        that.geolocation.getLocation(showPosition, showErr, options);
        // 高德定位
        // console.log(AMap)
        // AMap.plugin("AMap.Geolocation", function() {
public/grabOrdersMap/js/vueMain.js
@@ -220,7 +220,7 @@
        beginCome() {
            var data = {
                    appenUrl: "http://192.168.0.108:83/",
                    butCT: "beginUp",
                    butCT: "begin",
                    buttype: 0,
                    captain: "我",
                    city: "南昌市",
@@ -251,8 +251,8 @@
            if (typeof this.data == "string") {
                this.data = JSON.parse(this.data)
            }
            // console.log(this.data)
            if (this.data.isOn) {
            console.log(this.data)
            if (this.data.isOn || this.data.butCT == "beginUp") {
                //队长开启任务
                let rid = that.data.id;
                that.onPosition = new $getPositions({
@@ -272,6 +272,7 @@
                        let out = res.intlat;
                        if (typeof out != "string") {
                            that.addIcon([out[1], out[0]]);
                            console.log(out)
                            //坐标输出
                            let d = {
                                uid: that.data.myid,
@@ -856,5 +857,11 @@
        //     app.dataList = data.navigation // 赋值
        // }
    },
    wacth: {}
    wacth: {},
    beforeDestroy() {
        let that = this;
        if (that.onPosition) {
            that.onPosition.overContinued();
        }
    }
})
public/grabOrdersMap/xcxmap.html
src/views/activitys/real.vue
@@ -409,11 +409,11 @@
                value: "2",
              },
              {
                label: "正在进行",
                label: "任务结束",
                value: "1",
              },
              {
                label: "任务结束",
                label: "正在进行",
                value: "0",
              },
            ],