修复了定位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: ''
},
sale_type: {
type: String,
default: ''
type: [Number,String],
default: 1
}
},
data() {

View File

@ -628,7 +628,7 @@
long: longitude
}).then(res => {
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.$store.commit('setAddress', {
street_id: street_id,
@ -637,6 +637,19 @@
uni.$emit('getLocation_succees', {
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.$nextTick(() => {
setTimeout(() => {

View File

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

View File

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