From 6a2a2755e505f96e9f9daace118fb7b7da862d77 Mon Sep 17 00:00:00 2001 From: linxi Date: Fri, 13 Sep 2024 14:51:11 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E8=B4=AD=E7=89=A9=E8=BD=A6?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E4=BC=9A=E8=87=AA=E5=8A=A8=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0=E8=B4=AD=E7=89=A9=E8=BD=A6=E7=9A=84=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/cart.vue | 5 ++++- pages/user/address/AddAddress/index.vue | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pages/cart.vue b/pages/cart.vue index ba1b6ef..4fff1b5 100644 --- a/pages/cart.vue +++ b/pages/cart.vue @@ -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() { diff --git a/pages/user/address/AddAddress/index.vue b/pages/user/address/AddAddress/index.vue index 6db7837..f16b738 100644 --- a/pages/user/address/AddAddress/index.vue +++ b/pages/user/address/AddAddress/index.vue @@ -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) {