| | |
| | | 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("获取定位失败") |
| | | } |
| | |
| | | beginCome() { |
| | | var data = { |
| | | appenUrl: "http://192.168.0.108:83/", |
| | | butCT: "begin", |
| | | butCT: "beginUp", |
| | | buttype: 0, |
| | | captain: "我", |
| | | city: "南昌市", |
| | |
| | | serid: "1123598821738675201,", |
| | | team: "你,他,它", |
| | | time: "2022-02-18 14:15:52", |
| | | type: "2", |
| | | type: "0", |
| | | url: "http://223.82.109.183:2081/zhba/upload/20220218/67f0c8bf3e7b5024c64133691f265072.ico", |
| | | }, |
| | | that = this; |
| | |
| | | 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("获取定位失败") |
| | | } |