areaId
This commit is contained in:
@@ -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])
|
||||||
|
|||||||
Reference in New Issue
Block a user