test
This commit is contained in:
@@ -57,8 +57,8 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user'])},
|
||||
onLoad() {
|
||||
console.log(this.user)
|
||||
onShow() {
|
||||
document.title = '网格动态'
|
||||
this.forms.girdCode = this.user.gridInfo.girdCode
|
||||
this.forms.girdName = this.user.girdName
|
||||
this.forms.girdId = this.user.girdId
|
||||
@@ -68,9 +68,6 @@ export default {
|
||||
// this.forms.lat = '30.592800'
|
||||
this.getLocation()
|
||||
},
|
||||
onShow() {
|
||||
document.title = '网格动态'
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['injectJWeixin']),
|
||||
|
||||
@@ -102,15 +99,19 @@ export default {
|
||||
},
|
||||
|
||||
getLocation () {
|
||||
this.injectJWeixin(['getLocation']).then(res1 => {
|
||||
this.injectJWeixin(['getLocation']).then(() => {
|
||||
wx.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res2 => {
|
||||
alert(res2)
|
||||
this.forms.lng = res2.longitude
|
||||
this.forms.lat = res2.latitude
|
||||
this.$http.post('/api/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${res2.latitude},${res2.longitude}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (res.code == 0) {
|
||||
alert(res)
|
||||
this.forms.address = res.data.result.address
|
||||
}else {
|
||||
alert(err)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user