微信小程式url訪問
阿新 • • 發佈:2018-12-12
本人最近開發一款微信小程式,遇到一些棘手的問題,就是地圖呼叫,經過一段時間的網上檢視問題,找到一個定位問題,但是其中有一個url訪問不到,還請各位大神幫忙瞅瞅
wx.getLocation({ type: 'wgs84', success: (res) => { this.setData({ cur_pos: [res.longitude, res.latitude] }) console.log(res.longitude, res.latitude) wx.request({ url: 'https://api.getweapp.com/vendor/qqmap/search/toilet', data: { lat: res.latitude, lng: res.longitude, page: 1 }, success: (res) => { res.data.data.map((e) => { e.iconPath = "../../images/location.png" e.width = 20 e.height = 20 e.latitude = e.location.lat e.longitude = e.location.lng }) this.setData({ markers: res.data.data }) console.log(res.data.data) } }) } }) |