This commit is contained in:
liuye
2024-10-12 11:55:00 +08:00
parent 6f820ced1b
commit 87768e3661

View File

@@ -57,8 +57,8 @@ export default {
} }
}, },
computed: {...mapState(['user'])}, computed: {...mapState(['user'])},
onLoad() { onShow() {
console.log(this.user) document.title = '网格动态'
this.forms.girdCode = this.user.gridInfo.girdCode this.forms.girdCode = this.user.gridInfo.girdCode
this.forms.girdName = this.user.girdName this.forms.girdName = this.user.girdName
this.forms.girdId = this.user.girdId this.forms.girdId = this.user.girdId
@@ -68,9 +68,6 @@ export default {
// this.forms.lat = '30.592800' // this.forms.lat = '30.592800'
this.getLocation() this.getLocation()
}, },
onShow() {
document.title = '网格动态'
},
methods: { methods: {
...mapActions(['injectJWeixin']), ...mapActions(['injectJWeixin']),
@@ -102,15 +99,19 @@ export default {
}, },
getLocation () { getLocation () {
this.injectJWeixin(['getLocation']).then(res1 => { this.injectJWeixin(['getLocation']).then(() => {
wx.getLocation({ wx.getLocation({
type: 'wgs84', type: 'wgs84',
success: res2 => { success: res2 => {
alert(res2)
this.forms.lng = res2.longitude this.forms.lng = res2.longitude
this.forms.lat = res2.latitude 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 => { 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 this.forms.address = res.data.result.address
}else {
alert(err)
} }
}) })
}, },