This commit is contained in:
liuye
2024-05-21 15:49:34 +08:00
parent d719644038
commit 9bc3e453c0

View File

@@ -80,7 +80,8 @@ export default {
// } // }
], ],
current: 1, current: 1,
pages: 2 pages: 2,
areaId: ''
} }
}, },
computed: { computed: {
@@ -92,6 +93,21 @@ export default {
this.upLoad(res.tempFilePath) this.upLoad(res.tempFilePath)
}); });
this.getHistoryList() this.getHistoryList()
uni.getLocation({
type: 'wgs84', // 返回可以用于uni.openLocation的经纬度默认为wgs84的gps坐标
success : (res) => {
let location = `${res.latitude}, ${res.longitude}`
console.log(location)
this.$instance.post(`/admin/area/reverseGeocoding?location=${location}`).then(res => {
if(res.code == 0) {
this.areaId = res.data.result.addressComponent.adcode + '000000'
}
})
},
fail: (error) => {
console.log('获取位置失败:', error);
}
});
}, },
onPullDownRefresh() { onPullDownRefresh() {
if(this.current > this.pages) { if(this.current > this.pages) {
@@ -169,7 +185,7 @@ export default {
}, },
sendMsg() { sendMsg() {
this.$loading() this.$loading()
this.$instance.post("/app/appaigccopilotinfo/add", {content: this.content, appType: 0}).then(res => { this.$instance.post("/app/appaigccopilotinfo/add", {content: this.content, appType: 0, areaId: this.areaId}).then(res => {
if(res.code == 0) { if(res.code == 0) {
this.content = '' this.content = ''
this.messageList.push(res.data[0]) this.messageList.push(res.data[0])