作者 王智

地址接口获取

@@ -11,6 +11,7 @@ Page({ @@ -11,6 +11,7 @@ Page({
11 latitude: '', 11 latitude: '',
12 longitude: '', 12 longitude: '',
13 time: '', 13 time: '',
  14 + my_address: '',
14 }, 15 },
15 16
16 onLoad: function (options) { 17 onLoad: function (options) {
@@ -38,6 +39,24 @@ Page({ @@ -38,6 +39,24 @@ Page({
38 latitude: res.latitude, 39 latitude: res.latitude,
39 longitude: res.longitude 40 longitude: res.longitude
40 }) 41 })
  42 +
  43 + let url = '/index/second/getAddressInfo';
  44 + let head = {
  45 + 'XX-Token': wx.getStorageSync('token')
  46 + }
  47 + let d = {
  48 + lat: res.latitude,
  49 + lng: res.longitude
  50 + }
  51 + // console.log(d)
  52 + app.post(url, d, head).then((res) => {
  53 + console.log(res);
  54 + that.setData({
  55 + my_address: res.address
  56 + })
  57 + })
  58 +
  59 +
41 }, 60 },
42 }) 61 })
43 62
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 5
6 <view class="myactivity_s"> 时间:{{list.start_clock_time}}-{{list.end_clock_time}}</view> 6 <view class="myactivity_s"> 时间:{{list.start_clock_time}}-{{list.end_clock_time}}</view>
7 7
8 - <view class="myactivity_s">我的当前位置:{{list.address}}</view> 8 + <view class="myactivity_s">我的当前位置:{{my_address}}</view>
9 9
10 <view class="myactivity_wrap"> 10 <view class="myactivity_wrap">
11 <view class="myactivity_starttime"> 11 <view class="myactivity_starttime">