具体如下:
1、效果展示

2、关键代码
index.wxml布局文件代码
纬度:{{latitude}} 经度:{{longitude}}
index.js逻辑文件代码
Page({
data: {
latitude:'',
longitude:''
},
onLoad: function () {
var that=this;
wx.getLocation({
type: 'wgs84',
success: function(res) {
that.setData({
latitude:res.latitude,
longitude:res.longitude
})
}
})
}
})