Fix:【商城小程序】购物车页面添加新地址,不会自动同步到购物车的收货地址区域

This commit is contained in:
linxi
2024-09-13 14:51:11 +08:00
parent 27be3935fa
commit 6a2a2755e5
2 changed files with 19 additions and 2 deletions
+4 -1
View File
@@ -361,7 +361,10 @@ export default {
},
addNewAddress() {
this.$yrouter.push({
path: "/pages/user/address/AddAddress/index"
path: "/pages/user/address/AddAddress/index",
query: {
choosMode: 1
}
});
},
getAddress() {
+15 -1
View File
@@ -368,7 +368,7 @@ export default {
is_default: isDefault ? true : false,
post_code: ""
};
postAddress(data).then(function () {
postAddress(data).then(function (res) {
if (that.id) {
uni.showToast({
title: "修改成功",
@@ -382,6 +382,20 @@ export default {
duration: 2000
});
}
if(that.$yroute.query.choosMode == 1) {
const item = {
id: res.data.id,
realName: name,
phone: phone,
district: that.address.district,
province: that.address.province,
city: that.address.city,
detail: detail,
is_default: isDefault ? true : false,
post_code: ""
}
uni.$emit('chooseAddress', item)
}
that.$yrouter.back();
});
} catch (err) {