不知道大家是如何出现这个的,我的反正是启用过“实时日志”后有这个错误的。如何关闭实时日志我也不知道:https://developers.weixin.qq.com/miniprogram/dev/framework/realtimelog/
reportRealtimeAction:fail not support 为什么会报这个警告?reportRealtimeAction:fail not support 为什么会报这个警告? [图片]
2024-04-26我是这么解决的,亲测有效: wx.chooseLocation({ success: async (res) => { if (res.name) { var reg = /.+?(北京|上海|重庆|天津|省|市|自治区|自治州|县|区)/g; let myLocation = res.address.match(reg); let provinceName = ''; let cityName = ''; let districtName = ''; if (myLocation != undefined && myLocation != null) { // 检查是否为直辖市 if (['北京市', '上海市', '重庆市', '天津市'].includes(myLocation[0])) { provinceName = myLocation[0]; // 直辖市既是省也是市 cityName = myLocation[0]; districtName = myLocation.length > 1 ? myLocation[1] : ''; // 如果有区信息,则为第三个匹配项 } else { provinceName = myLocation[0]; // 非直辖市情况下,市和区可能存在,也可能不存在 cityName = myLocation.length >= 1 ? myLocation[1] : ''; districtName = myLocation.length >= 2 ? myLocation[2] : ''; } } this.setData( { provinceName, cityName, districtName, }); } }, fail: function (res) { logger.warn('wx.chooseLocation failed: ', res); }, });
wx.chooseLocation,address字段不返回省份信息?wx.chooseLocation,success回调,address字段没有省份和地级市的数据。ios上100%复现 微信版本8.0.44 ios17.1.2 机型iphone12 操作视频地址:https://live.csdn.net/v/351855 代码片段:https://developers.weixin.qq.com/s/YvI5RtmO7ONe 附视频截图,更清晰: [图片]
2024-04-25