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' }); }