作者 王智

地址接口获取

... ... @@ -11,6 +11,7 @@ Page({
latitude: '',
longitude: '',
time: '',
my_address: '',
},
onLoad: function (options) {
... ... @@ -38,6 +39,24 @@ Page({
latitude: res.latitude,
longitude: res.longitude
})
let url = '/index/second/getAddressInfo';
let head = {
'XX-Token': wx.getStorageSync('token')
}
let d = {
lat: res.latitude,
lng: res.longitude
}
// console.log(d)
app.post(url, d, head).then((res) => {
console.log(res);
that.setData({
my_address: res.address
})
})
},
})
... ...
... ... @@ -5,7 +5,7 @@
<view class="myactivity_s"> 时间:{{list.start_clock_time}}-{{list.end_clock_time}}</view>
<view class="myactivity_s">我的当前位置:{{list.address}}</view>
<view class="myactivity_s">我的当前位置:{{my_address}}</view>
<view class="myactivity_wrap">
<view class="myactivity_starttime">
... ...