// 选择微信自带地址addAddr:function () {wx.chooseAddress({success: function (res) {self.setData({addrInfo:res //获取到地址存到data的addrInfo里});},fail:()=>{this.openConfirm() // 如果获取地址权限失败,弹出确认弹窗,让用户选择是否要打开设置,手动去开权限}})},
// 打开确认弹窗 openConfirm: function () {wx.showModal({content: '检测到您没打开地址权限,是否去设置打开?',confirmText: "确认",cancelText: "取消",success: function (res) {if (res.confirm) {wx.openSetting({success: (res) => { } //打开设置面板})} else {console.log('用户点击取消')}}});},