diff --git a/app.json b/app.json index 7202de1..9ad9950 100644 --- a/app.json +++ b/app.json @@ -96,5 +96,8 @@ } ] }, + "requiredPrivateInfos":[ + "chooseAddress" + ], "sitemapLocation": "sitemap.json" } \ No newline at end of file diff --git a/pages/address/index.js b/pages/address/index.js index e048c05..84a5001 100644 --- a/pages/address/index.js +++ b/pages/address/index.js @@ -305,4 +305,40 @@ Page({ url: '../address/upaddress?addr_id=' + addrId, }) }, + chooseAddress: function () { + var that = this; + if (wx.chooseAddress) { + wx.chooseAddress({ + success: function (res) { + that.setData({ + userName: res.userName, + mobile: res.telNumber, + place: res.provinceName+'-'+res.cityName+'-'+res.countyName, + address: res.detailInfo, + }) + that.saveAddress() + }, + }) + } else { + console.log('当前微信版本不支持chooseAddress'); + } + }, + // 点击保存 + saveAddress: function (e) { + var that = this; + WXAPI.saveAddress({ + accessId: app.globalData.accessId, + storeId: 239, + storeType: 1, + user_name: that.data.userName, + mobile: that.data.mobile, + place: that.data.place, + is_default: 1, + address: that.data.address, + }).then(res => { + if (res.code == 200) { + + } + }); + }, }) \ No newline at end of file diff --git a/pages/address/index.wxml b/pages/address/index.wxml index 55e03ea..e14f668 100644 --- a/pages/address/index.wxml +++ b/pages/address/index.wxml @@ -45,6 +45,12 @@ 新增地址 + + + diff --git a/pages/login/login.wxml b/pages/login/login.wxml index 85c03b9..b758198 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -12,7 +12,11 @@ - + + + + + diff --git a/pages/login/login.wxss b/pages/login/login.wxss index bec3d97..304fb20 100644 --- a/pages/login/login.wxss +++ b/pages/login/login.wxss @@ -73,6 +73,10 @@ page{ margin-left: 30rpx; line-height: 55rpx; } +.inptHideen{ + height:0px !important; + min-height:1rpx !important; +} /* 密码图标+输入框+小眼睛图标+下划线父容器view */ .passwordCs{ margin-top: 190rpx;