分包页面引用腾讯地图,开发工具正常,手机不显示
import QQMapWX from '../../../utils/libs/qqmap-wx-jssdk.js';
var qqmapsdk = new QQMapWX({
key: 'XDZBZ-ZJUW4-I2AUQ-XTPDQ' //腾讯地图秘钥key
});
_fetchLocation: function (e) {
wx.getLocation({
type: 'gcj02',
success: res => {
qqmapsdk.reverseGeocoder({
success: res => {
console.log(res)
var address = res.result.address_component
this.setData({
city: address.city,
})
}
})
}
})
},
开发工具可以正常获取到数据,手机预览获取不到数据,函数不执行。