| | |
| | | mapPositionLoding: false, //定位loding |
| | | oncePosition: null, //一次定位实例 |
| | | onPosition: false, //持续定位指示 |
| | | |
| | | setPositionTime: null, //发送定位节流 |
| | | setPositionUseTime: 30000, //节流时间 |
| | | }, |
| | | methods: { |
| | | // unis(data) { |
| | |
| | | if (type != 1) { |
| | | if (that.data.butCT == "beginUp") { |
| | | // 反馈 |
| | | if(that.onPosition){ |
| | | if (that.onPosition) { |
| | | that.onPosition.overContinued(); |
| | | } |
| | | uni.redirectTo({ |
| | |
| | | jd: out[0], |
| | | wd: out[1], |
| | | } |
| | | // console.log(d) |
| | | axios.post(that.data.appenUrl + "trar/submit", d) |
| | | .then(res => { |
| | | // console.log('res=>', res); |
| | | }) |
| | | if (that.setPositionTime) { |
| | | return; |
| | | } else { |
| | | that.setPositionTime = setTimeout(() => { |
| | | axios.post(that.data.appenUrl + |
| | | "trar/submit", d) |
| | | .then(res => { |
| | | // console.log('res=>', res); |
| | | }) |
| | | clearTimeout(that.setPositionTime); |
| | | that.setPositionTime = null; |
| | | }, that.setPositionUseTime) |
| | | } |
| | | } else { |
| | | console.log("获取定位失败") |
| | | } |
| | |
| | | serid: "1123598821738675201,", |
| | | team: "你,他,它", |
| | | time: "2022-02-18 14:15:52", |
| | | type: "2", |
| | | url: "http://223.82.109.183:2081/zhba/upload/20220218/67f0c8bf3e7b5024c64133691f265072.ico", |
| | | type: "0", |
| | | url: "http://61.131.136.25:2081/zhba/upload/20220218/67f0c8bf3e7b5024c64133691f265072.ico", |
| | | }, |
| | | that = this; |
| | | //url解码 |
| | |
| | | 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({ |
| | |
| | | let out = res.intlat; |
| | | if (typeof out != "string") { |
| | | that.addIcon([out[1], out[0]]); |
| | | console.log(out) |
| | | //坐标输出 |
| | | let d = { |
| | | uid: that.data.myid, |
| | |
| | | wd: out[1], |
| | | } |
| | | // console.log(d) |
| | | axios.post(that.data.appenUrl + "trar/submit", d) |
| | | .then(res => { |
| | | // console.log('res=>', res); |
| | | }) |
| | | if (that.setPositionTime) { |
| | | return; |
| | | } else { |
| | | that.setPositionTime = setTimeout(() => { |
| | | axios.post(that.data.appenUrl + "trar/submit", d) |
| | | .then(res => { |
| | | // console.log('res=>', res); |
| | | }) |
| | | clearTimeout(that.setPositionTime); |
| | | that.setPositionTime = null; |
| | | }, that.setPositionUseTime) |
| | | } |
| | | } else { |
| | | console.log("获取定位失败") |
| | | } |
| | |
| | | // desc = "+proj=longlat +datum=WGS84 +no_defs ", |
| | | // crs = new L.CRS("EPSG:4326", desc, {}); |
| | | // center = [data[0].wd, data[0].jd], |
| | | // url = `http://223.82.109.183:2082/api/alarm/alarm/APP-getAlarm?id=${data[0].id}`; |
| | | // url = `http://61.131.136.25:2082/api/alarm/alarm/APP-getAlarm?id=${data[0].id}`; |
| | | // url = `http://localhost:89/alarm/alarm/APP-getAlarm?id=${data[0].id}`; |
| | | // this.nowPosition = center; |
| | | // axios.post(url).then((res) => { |
| | |
| | | var city = position.city; //城市 |
| | | var addr = position.addr; //详细地址 |
| | | that.lat = position.lat; // |
| | | that.lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑 |
| | | that.lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑 |
| | | that.haveShishiweizhi++; //控制只执行一次 |
| | | console.log(position) |
| | | // console.log(that.haveShishiweizhi) |
| | |
| | | }; |
| | | |
| | | function showErr() { |
| | | //TODO 如果出错了调用此方法 |
| | | //TODO 如果出错了调用此方法 |
| | | // console.log(15) |
| | | }; |
| | | |
| | |
| | | // app.dataList = data.navigation // 赋值 |
| | | // } |
| | | }, |
| | | wacth: {} |
| | | wacth: {}, |
| | | beforeDestroy() { |
| | | let that = this; |
| | | if (that.onPosition) { |
| | | that.onPosition.overContinued(); |
| | | } |
| | | } |
| | | }) |