位置信息

This commit is contained in:
liuye
2024-08-15 08:32:57 +08:00
parent bc5c1063ff
commit 3d41c2b7ec

View File

@@ -131,7 +131,7 @@ export default {
} }
}, },
computed: { computed: {
...mapState(['user', 'token']), ...mapState(['user', 'wxwork']),
}, },
onLoad() { onLoad() {
}, },
@@ -146,7 +146,7 @@ export default {
this.getHistoryList() this.getHistoryList()
}, },
methods: { methods: {
...mapActions(['autoLogin', 'getUserInfo', 'injectJWeixin',]), ...mapActions(['autoLogin', 'getUserInfo', 'injectJWeixin', 'agentSign']),
startRecord() { startRecord() {
this.isStart = true this.isStart = true
this.recorder = Recorder({ this.recorder = Recorder({
@@ -356,19 +356,23 @@ export default {
}) })
}, },
getLocation() { getLocation() {
this.injectJWeixin(['getLocation']).then(() => { this.agentSign({
wx.getLocation({ corpId: this.wxwork.config.corpId,
type: 'wgs84', suiteId: this.wxwork.config.suiteId
success: res => { }).then(() => {
this.latLng = `${res.latitude},${res.longitude}` this.injectJWeixin(['getLocation']).then(() => {
}, wx.getLocation({
error: res => { type: 'wgs84',
console.log(res) success: res => {
} this.latLng = `${res.latitude},${res.longitude}`
},
error: res => {
console.log(res)
}
})
}).catch(e => {
}) })
}).catch(e => {
}) })
}, },
}, },
} }