Fix:【商城小程序】购物车页面添加新地址,不会自动同步到购物车的收货地址区域
This commit is contained in:
+4
-1
@@ -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() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user