getLocation() {
var that = this
console.log("weizhi");
uni.getLocation({
type: 'wgs84',
geocode: true, //设置该参数为true可直接获取经纬度及城市信息
success: function(res) {
console.log(res, 'res');
that.form.lat = res.latitude
that.form.lng = res.longitude
},
fail: (error) => {
console.log("error", error);
this.openSetting() // 小程序打开设置位置
}
});
},
1 个回复
奥利奥饼干
请问解决了吗?