去除高德定位

This commit is contained in:
guanj
2025-08-13 10:42:31 +08:00
parent 032eed6768
commit c387cc9589
9 changed files with 80 additions and 72 deletions

View File

@@ -284,17 +284,17 @@ export default {
})
})
},
chooseLocation() {
uni.chooseLocation({
success: function (res) {
this.address = res.name
console.log('位置名称:' + res.name)
console.log('详细地址:' + res.address)
console.log('纬度:' + res.latitude)
console.log('经度:' + res.longitude)
},
})
},
// chooseLocation() {
// uni.chooseLocation({
// success: function (res) {
// this.address = res.name
// console.log('位置名称:' + res.name)
// console.log('详细地址:' + res.address)
// console.log('纬度:' + res.latitude)
// console.log('经度:' + res.longitude)
// },
// })
// },
chooseGplot() {
this.$refs.gplot.open()
},

View File

@@ -23,7 +23,7 @@
</button>
</view>
</template>
<template v-else>
<template v-else >
<view class="content">
<uni-forms>
<uni-forms-item label="项目">
@@ -97,9 +97,12 @@
</uni-forms>
</view>
<image class="gplot-image" ref="gplot-image" :src="formData.topologyDiagramUrl" mode="widthFix" />
<view class="btn-wrap">
<view class="btn-wrap" >
<!-- <view class="btn-wrap-item" @click="add"> 添加监测点 </view> -->
<view class="btn-wrap-item" @click="submit"> 提交</view>
<!-- <view class="btn-wrap-item" @click="submit" > 提交</view> -->
<button class="btn-wrap-item" :loading="isLoading1" :disabled="isLoading1" @click="submit">
{{ isLoading1 ? '提交中...' : '提交' }}
</button>
</view>
<uni-drawer ref="gplot" mode="right" :mask-click="false">
<scroll-view style="height: 100%" scroll-y="true">
@@ -189,6 +192,7 @@ export default {
projectRange: [],
point: {},
isLoading: false,
isLoading1: false,
pointList: [],
activeGplot: 0,
positionList: [],
@@ -360,17 +364,17 @@ export default {
this.isLoading = false
})
},
chooseLocation() {
uni.chooseLocation({
success: function (res) {
this.address = res.name
console.log('位置名称:' + res.name)
console.log('详细地址:' + res.address)
console.log('纬度:' + res.latitude)
console.log('经度:' + res.longitude)
},
})
},
// chooseLocation() {
// uni.chooseLocation({
// success: function (res) {
// this.address = res.name
// console.log('位置名称:' + res.name)
// console.log('详细地址:' + res.address)
// console.log('纬度:' + res.latitude)
// console.log('经度:' + res.longitude)
// },
// })
// },
chooseGplot() {
this.$refs.gplot.open()
this.dialogOpen = true
@@ -451,6 +455,7 @@ export default {
this.$util.toast('监测点不能重复')
return
}
this.isLoading1 = true
addDevice({
...this.formData,
list: this.pointList,
@@ -459,10 +464,13 @@ export default {
}).then((res) => {
console.log(res)
this.$util.toast('提交成功')
this.isLoading1 = false
setTimeout(() => {
this.type = 3
uni.navigateBack({ delta: 1 })
}, 1500)
}).catch(()=>{
this.isLoading1 = false
})
},
},

View File

@@ -93,17 +93,17 @@ export default {
select(e) {
console.log(e)
},
chooseLocation() {
uni.chooseLocation({
success: function (res) {
this.address = res.name
console.log('位置名称:' + res.name)
console.log('详细地址:' + res.address)
console.log('纬度:' + res.latitude)
console.log('经度:' + res.longitude)
},
})
},
// chooseLocation() {
// uni.chooseLocation({
// success: function (res) {
// this.address = res.name
// console.log('位置名称:' + res.name)
// console.log('详细地址:' + res.address)
// console.log('纬度:' + res.latitude)
// console.log('经度:' + res.longitude)
// },
// })
// },
async submit() {
console.log(this.formData)
if (!this.formData.name) {

View File

@@ -26,8 +26,8 @@
<view style="display:flex;">
<uni-easyinput :clearable="false" type="textarea" autoHeight v-model="formData.address"
placeholder="请输入位置信息" />
<uni-icons type="location" color="#007aff" size="26" class="ml20"
@click="chooseLocation"></uni-icons>
<!-- <uni-icons type="location" color="#007aff" size="26" class="ml20"
@click="chooseLocation"></uni-icons> -->
</view>
</uni-forms-item>
<uni-forms-item label="拓扑图">
@@ -97,17 +97,17 @@ export default {
register () {
this.type = 2
},
chooseLocation () {
uni.chooseLocation({
success: function (res) {
this.address = res.name
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
}
});
},
// chooseLocation () {
// uni.chooseLocation({
// success: function (res) {
// this.address = res.name
// console.log('位置名称:' + res.name);
// console.log('详细地址:' + res.address);
// console.log('纬度:' + res.latitude);
// console.log('经度:' + res.longitude);
// }
// });
// },
submit () {
this.$util.toast('提交成功')
setTimeout(() => {

View File

@@ -24,13 +24,13 @@
v-model="formData.area"
placeholder="请输入区域信息"
/>
<uni-icons
<!-- <uni-icons
type="location"
color="#007aff"
size="26"
class="ml20"
@click="chooseLocation"
></uni-icons>
></uni-icons> -->
</view>
</uni-forms-item>
<uni-forms-item label="描述">
@@ -241,19 +241,19 @@ export default {
this.formData.files.push(...e.tempFiles)
console.log(this.formData.files)
},
chooseLocation() {
uni.chooseLocation({
success: (res) => {
this.formData.area = res.name
this.formData.lat = res.latitudeame
this.formData.lng = res.longitude
console.log('位置名称:' + res.name)
console.log('详细地址:' + res.address)
console.log('纬度:' + res.latitude)
console.log('经度:' + res.longitude)
},
})
},
// chooseLocation() {
// uni.chooseLocation({
// success: (res) => {
// this.formData.area = res.name
// this.formData.lat = res.latitudeame
// this.formData.lng = res.longitude
// console.log('位置名称:' + res.name)
// console.log('详细地址:' + res.address)
// console.log('纬度:' + res.latitude)
// console.log('经度:' + res.longitude)
// },
// })
// },
async submit() {
console.log(this.formData)
if (!this.formData.name) {