修复了定位bug

This commit is contained in:
weipengfei 2024-04-24 18:00:36 +08:00
parent ca9dd3db6f
commit 32ff09e5fd
4 changed files with 19 additions and 5 deletions

View File

@ -84,8 +84,8 @@
default: '' default: ''
}, },
sale_type: { sale_type: {
type: String, type: [Number,String],
default: '' default: 1
} }
}, },
data() { data() {

View File

@ -628,7 +628,7 @@
long: longitude long: longitude
}).then(res => { }).then(res => {
let town = res.data.address_reference.town.title let town = res.data.address_reference.town.title
let street_id = street_id = res.data.address_reference.town.id let street_id = res.data.address_reference.town.id
this.street = res.data.address_reference.town.title; this.street = res.data.address_reference.town.title;
this.$store.commit('setAddress', { this.$store.commit('setAddress', {
street_id: street_id, street_id: street_id,
@ -637,6 +637,19 @@
uni.$emit('getLocation_succees', { uni.$emit('getLocation_succees', {
street_id, street_id,
}); });
uni.$emit('changeAddress', {
addr:{
address: res.data.address,
location: `${res.data.location.lat},${res.data.location.lng}`
},
area: res.data.ad_info.adcode,
latitude: res.data.location.lat,
longitude: res.data.location.lng,
street:{
code: street_id,
name: town
}
})
this.where.location = `${latitude},${longitude}`; this.where.location = `${latitude},${longitude}`;
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {

View File

@ -339,7 +339,8 @@ const open = (id = null) => {
uniMP: true, uniMP: true,
token: token, token: token,
avatar: avatar, avatar: avatar,
} },
// path: '/pages/index/index?unimp=true'
}, (ret) => { }, (ret) => {
uni.hideLoading(); uni.hideLoading();
if (0 != ret.code) { if (0 != ret.code) {

View File

@ -3,7 +3,7 @@ import {
uniMPgetLocation, uniMPgetLocation,
test test
} from "@/utils/uniMPfunction.js" } from "@/utils/uniMPfunction.js"
console.log(123)
export const initEvent = () => { export const initEvent = () => {
mp.onUniMPEventReceive(async (ret) => { mp.onUniMPEventReceive(async (ret) => {
console.log('小程序事件: ', ret); console.log('小程序事件: ', ret);