【优化】优化添加地址,如果是从微信直接获取绑定的地址,则地图选点后不更新掉详细地址。

This commit is contained in:
jianweie code
2023-03-28 00:14:25 +08:00
parent c05aeceef1
commit 6e45eafafb

View File

@@ -100,6 +100,7 @@
export default { export default {
data() { data() {
return { return {
getType: 1, //1手动输入0从微信获取
id: 0, id: 0,
form: { form: {
name: '', name: '',
@@ -188,7 +189,10 @@
this.region = [location.province, location.district, location.city]; this.region = [location.province, location.district, location.city];
this.form.street = location.name; this.form.street = location.name;
if (this.getType == 1) {
this.form.address = location.address; this.form.address = location.address;
}
console.log("location1:", location); console.log("location1:", location);
} }
}, },
@@ -473,6 +477,7 @@
}, },
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
wechatAddress() { wechatAddress() {
this.getType = 0;
let _that = this; let _that = this;
wx.chooseAddress({ wx.chooseAddress({
success: res => { success: res => {