| | |
| | | }); |
| | | } else if (that.data.butCT == "begin") { |
| | | // 开始任务 |
| | | this.setUniAppMsg({ |
| | | that.setUniAppMsg({ |
| | | type: "start", |
| | | data: { |
| | | id: that.data.id, |
| | |
| | | }, |
| | | fn: function(val) { |
| | | if (val == "success") { |
| | | console.log("成功开启任务") |
| | | this.data.butCT = "beginUp"; |
| | | this.data.rtype = '0'; |
| | | this.data.type = "0"; |
| | | // console.log("成功开启任务") |
| | | that.data.butCT = "beginUp"; |
| | | that.data.rtype = '0'; |
| | | that.data.type = "0"; |
| | | } |
| | | } |
| | | }) |
| | |
| | | this.oncePosition = new $getPositions({ |
| | | id: 1, |
| | | fn: function(res) { |
| | | console.log(res); |
| | | // console.log(res); |
| | | that.mapPositionLoding = res.state; |
| | | if (!res.state) { |
| | | that.addIcon(res.intlat); |
| | | console.log(res) |
| | | if (typeof res.intlat === "string") { |
| | | window.parent.showTip("获取定位失败") |
| | | } else { |
| | | that.addIcon([res.intlat[1], res.intlat[0]]); |
| | | } |
| | | } |
| | | } |
| | | }).init(); |
| | | } |
| | | if (!this.onPosition) { |
| | | this.oncePosition.continuedTime(); |
| | | this.onPosition = !this.onPosition; |
| | | this.oncePosition.once(); |
| | | } else { |
| | | this.oncePosition.overContinued(); |
| | | this.onPosition = !this.onPosition; |
| | | this.oncePosition.once(); |
| | | } |
| | | |
| | | // if (!this.onPosition) { |
| | | // this.oncePosition.continuedTime(); |
| | | // this.onPosition = !this.onPosition; |
| | | // } else { |
| | | // this.oncePosition.overContinued(); |
| | | // this.onPosition = !this.onPosition; |
| | | // } |
| | | }, |
| | | //添加图标 |
| | | addIcon(intlat) { |
| | |
| | | }, |
| | | }); |
| | | this.domMove.init(); |
| | | |
| | | // console.log(window.parent.setIntLat) |
| | | window.parent.setIntLat({ |
| | | rid: this.data.id, |
| | | fn: (out) => { |
| | | console.log(out); |
| | | that.addIcon(out); |
| | | // console.log(out,"1111"); |
| | | // that.addIcon(out); |
| | | that.addIcon([out[1], out[0]]); |
| | | } |
| | | }) |
| | | }, |