| | |
| | | success: res => { |
| | | console.log('取消按钮', res) |
| | | this.addressInfor = res |
| | | this.form.pollutePosition = res.address |
| | | this.form.pollutePosition = `${res.name } — ${res.address}` |
| | | }, |
| | | fail: function(err) { |
| | | console.log('取消按钮', err) |
| | |
| | | }, |
| | | handerLocation() { |
| | | let that = this |
| | | uni.getLocation({ |
| | | type: 'gcj02', |
| | | isHighAccuracy: true, //开启高精度定位 |
| | | success: function(res) { |
| | | console.log('111', res) |
| | | that.handerChooseLocation(res.latitude, res.longitude) |
| | | }, |
| | | fail(error) { |
| | | console.log('失败', error) |
| | | } |
| | | }) |
| | | if (this.addressInfor.latitude === '') { |
| | | uni.getLocation({ |
| | | type: 'gcj02', |
| | | isHighAccuracy: true, //开启高精度定位 |
| | | success: function(res) { |
| | | console.log('111', res) |
| | | that.handerChooseLocation(res.latitude, res.longitude) |
| | | }, |
| | | fail(error) { |
| | | console.log('失败', error) |
| | | } |
| | | }) |
| | | } else { |
| | | that.handerChooseLocation(this.addressInfor.latitude, this.addressInfor.longitude) |
| | | } |
| | | }, |
| | | handleOpenSetting() { |
| | | let that = this |
| | |
| | | this.$refs.uForm.validate().then(res => { |
| | | this.sumbitForm.problemDescribe = this.form.problemDescribe |
| | | this.sumbitForm.pollutePosition = this.form.pollutePosition |
| | | this.sumbitForm.address = this.addressInfor.address |
| | | this.sumbitForm.address = this.addressInfor.name |
| | | this.sumbitForm.latitude = this.addressInfor.latitude |
| | | this.sumbitForm.longitude = this.addressInfor.longitude |
| | | this.sumbitForm.name = this.addressInfor.name |
| | |
| | | type: 'gcj02', |
| | | location: '' + res.longitude + ',' + res.latitude + '', |
| | | success: function(e) { |
| | | that.addressInfor.address = e[0].regeocodeData.name |
| | | console.log(e) |
| | | that.addressInfor.address = `${ e[0].desc } — ${e[0].name}` |
| | | that.addressInfor.latitude = e[0].latitude |
| | | that.addressInfor.longitude = e[0].longitude |
| | | that.addressInfor.name = e[0].desc |
| | | that.form.pollutePosition = e[0].regeocodeData.formatted_address |
| | | that.form.pollutePosition = `${ e[0].desc } — ${e[0].name}` |
| | | }, |
| | | fail: res => { |
| | | console.log(JSON.stringify(res)) |