| | |
| | | onPosition: false, //持续定位指示 |
| | | }, |
| | | methods: { |
| | | setUniAppMsg(state, data) { |
| | | let that = this; |
| | | |
| | | state == "hBackMsg" ? window.parent.hBackMsg(data); |
| | | state == "setIntLat" ? window.parent.setIntLat({ |
| | | rid: that.data.id, |
| | | fn: (out) => { |
| | | // console.log(out,"1111"); |
| | | // that.addIcon(out); |
| | | that.addIcon([out[1], out[0]]); |
| | | unis(data) { |
| | | //向uniapp传值 |
| | | uni.postMessage({ |
| | | data: { |
| | | action: data |
| | | } |
| | | }); |
| | | state == "showTip" ? that.parent.showTip("获取定位失败"); |
| | | }, |
| | | setUniAppMsg(state, data) { |
| | | let that = this; |
| | | if (window.parent) { |
| | | console.log("有window.parent") |
| | | if (state == "hBackMsg") { |
| | | window.parent.hBackMsg(data); |
| | | } |
| | | if (state == "setIntLat") { |
| | | window.parent.setIntLat({ |
| | | rid: that.data.id, |
| | | fn: (out) => { |
| | | // console.log(out,"1111"); |
| | | // that.addIcon(out); |
| | | that.addIcon([out[1], out[0]]); |
| | | } |
| | | }); |
| | | } |
| | | if (state == "showTip") { |
| | | that.parent.showTip("获取定位失败"); |
| | | } |
| | | } else { |
| | | console.log("没window.parent") |
| | | if (state == "hBackMsg") { |
| | | // window.parent.hBackMsg(data); |
| | | that.unis("hBackMsg") |
| | | } |
| | | if (state == "setIntLat") { |
| | | // window.parent.setIntLat({ |
| | | // rid: that.data.id, |
| | | // fn: (out) => { |
| | | // // console.log(out,"1111"); |
| | | // // that.addIcon(out); |
| | | // that.addIcon([out[1], out[0]]); |
| | | // } |
| | | // }); |
| | | that.unis("setIntLat") |
| | | } |
| | | if (state == "showTip") { |
| | | // that.parent.showTip("获取定位失败"); |
| | | that.unis("showTip") |
| | | } |
| | | |
| | | } |
| | | }, |
| | | openAPP(type) { |
| | | // console.log(type) |
| | |
| | | }); |
| | | } else if (that.data.butCT == "begin") { |
| | | // 开始任务 |
| | | that.setUniAppMsg({ |
| | | that.setUniAppMsg("hBackMsg", { |
| | | type: "start", |
| | | data: { |
| | | id: that.data.id, |
| | |
| | | if (typeof res.intlat === "string") { |
| | | // that.parent.showTip("获取定位失败") |
| | | //向uniapp传值 |
| | | that.setUniAppMsg("showTip") |
| | | |
| | | } else { |
| | | that.addIcon([res.intlat[1], res.intlat[0]]); |
| | |
| | | }); |
| | | this.domMove.init(); |
| | | // console.log(window.parent.setIntLat) |
| | | that.setUniAppMsg("setIntLat") |
| | | // window.parent.setIntLat({ |
| | | // rid: this.data.id, |
| | | // fn: (out) => { |