quanyawei
2024-01-11 da25434b85fc5b4321c429bf95e719d00ec395bb
定位优化
1 files modified
13 ■■■■■ changed files
pages/actionChange/newPage/index.vue 13 ●●●●● patch | view | raw | blame | history
pages/actionChange/newPage/index.vue
@@ -235,7 +235,7 @@
                    success: res => {
                        console.log('取消按钮', res)
                        this.addressInfor = res
                        this.form.pollutePosition = res.address
                        this.form.pollutePosition = `${res.name }  —  ${res.address}`
                    },
                    fail: function(err) {
                        console.log('取消按钮', err)
@@ -244,6 +244,7 @@
            },
            handerLocation() {
                let that = this
                if (this.addressInfor.latitude === '') {
                uni.getLocation({
                    type: 'gcj02',
                    isHighAccuracy: true, //开启高精度定位
@@ -255,6 +256,9 @@
                        console.log('失败', error)
                    }
                })
                } else {
                    that.handerChooseLocation(this.addressInfor.latitude, this.addressInfor.longitude)
                }
            },
            handleOpenSetting() {
                let that = this
@@ -343,7 +347,7 @@
                this.$refs.uForm.validate().then(res => {
                    this.sumbitForm.problemDescribe = this.form.problemDescribe
                    this.sumbitForm.pollutePosition = this.form.pollutePosition
                    this.sumbitForm.address = this.addressInfor.address
                    this.sumbitForm.address = this.addressInfor.name
                    this.sumbitForm.latitude = this.addressInfor.latitude
                    this.sumbitForm.longitude = this.addressInfor.longitude
                    this.sumbitForm.name = this.addressInfor.name
@@ -405,11 +409,12 @@
                            type: 'gcj02',
                            location: '' + res.longitude + ',' + res.latitude + '',
                            success: function(e) {
                                that.addressInfor.address = e[0].regeocodeData.name
                                console.log(e)
                                that.addressInfor.address = `${ e[0].desc }  —  ${e[0].name}`
                                that.addressInfor.latitude = e[0].latitude
                                that.addressInfor.longitude = e[0].longitude
                                that.addressInfor.name = e[0].desc
                                that.form.pollutePosition = e[0].regeocodeData.formatted_address
                                that.form.pollutePosition = `${ e[0].desc }  —  ${e[0].name}`
                            },
                            fail: res => {
                                console.log(JSON.stringify(res))