From 603bba1079b8fa5dee8e2d80e2ee933b14d36b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Mon, 31 Oct 2022 23:21:58 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=9C=B0=E5=9D=80=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E3=80=90=E4=BB=8E=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E3=80=91=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BD=86?= =?UTF-8?q?=E5=9B=A0=E5=BE=AE=E4=BF=A1=E5=9C=B0=E5=9D=80=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9C=89=E9=99=90=EF=BC=8C=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E7=9C=81=E5=B8=82=E5=8E=BF=E4=B8=8D=E7=BB=9F=E4=B8=80=EF=BC=8C?= =?UTF-8?q?=E4=BC=9A=E6=9C=89=E9=83=A8=E5=88=86=E6=95=B0=E6=8D=AE=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=89=8B=E5=8A=A8=E8=BE=93=E5=85=A5=EF=BC=8C=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=85=A8=E9=83=A8=E4=B8=80=E9=94=AE=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CoreCms.Net.Uni-App/CoreShop/manifest.json | 3 ++ .../pages/member/address/index/index.vue | 28 +++++++++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CoreCms.Net.Uni-App/CoreShop/manifest.json b/CoreCms.Net.Uni-App/CoreShop/manifest.json index 3268ae6f..0ff0c4a6 100644 --- a/CoreCms.Net.Uni-App/CoreShop/manifest.json +++ b/CoreCms.Net.Uni-App/CoreShop/manifest.json @@ -121,6 +121,9 @@ } }, "permission": { + "scope.userFuzzyLocation": { + "desc": "你的位置信息将用于小程序定位" + }, "scope.userLocation": { "desc": "你的位置信息将用于小程序定位" } diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/address/index/index.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/address/index/index.vue index 8b3f2db0..fe0bb34d 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/member/address/index/index.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/address/index/index.vue @@ -84,7 +84,7 @@ - + @@ -275,7 +275,7 @@ //编辑获取收货地址信息 getShipInfo() { let data = { - 'id': this.id + id: this.id } this.$u.api.shipDetail(data).then(res => { if (res.status) { @@ -472,24 +472,36 @@ // #endif }, // #ifdef MP-WEIXIN - wechatAddress: function () { + wechatAddress() { let _that = this; wx.chooseAddress({ success: res => { if (res.errMsg == "chooseAddress:ok") { //获取成功 - //存储这个收获地区信息到数据库 + _that.form.name = res.userName; + _that.form.mobile = res.telNumber; + _that.form.address = res.detailInfo; + + _that.pickerValue = res.provinceName + " " + res.cityName + " " + res.countyName; let data = { provinceName: res.provinceName, cityName: res.cityName, countyName: res.countyName, - postalCode: res.postalCode }; + this.$u.api.getAreaId(data).then(res => { + if (res.status) { + this.areaId = res.data; + this.init(); + } else { + uni.showModal({ + title: '提示', + content: '地区选择出现问题,请重新选择地区', + showCancel: false + }); + } + }); console.log(res); - - - } else { this.$refs.uToast.show({ title: '获取微信地址失败', type: 'error' }); }