Commit e770b4f1 by 胡悦

修改

1 parent 0c8ba4bf
...@@ -204,29 +204,29 @@ class TRACK { ...@@ -204,29 +204,29 @@ class TRACK {
} }
} }
/**获取用户位置信息 */ /**获取用户位置信息 */
getAddressInfo() { // getAddressInfo() {
let addressInfo = wx.getStorageSync('address_info') // let addressInfo = wx.getStorageSync('address_info')
return new Promise((resolve) => { // return new Promise((resolve) => {
if (addressInfo && Date.now() - addressInfo.createTime < 2 * 60 * 1e3) resolve(addressInfo) // if (addressInfo && Date.now() - addressInfo.createTime < 2 * 60 * 1e3) resolve(addressInfo)
else wx.getLocation({ // else wx.getLocation({
type: 'gcj02' // type: 'gcj02'
}).then(({ // }).then(({
latitude, // latitude,
longitude // longitude
}) => { // }) => {
if (!addressInfo) this.setTrack({}, 5) // if (!addressInfo) this.setTrack({}, 5)
return // return
mapApi.detailedAdrress([latitude, longitude]).then(detail => { // mapApi.detailedAdrress([latitude, longitude]).then(detail => {
let info = { // let info = {
...detail, // ...detail,
createTime: Date.now() // createTime: Date.now()
} // }
resolve(info) // resolve(info)
wx.setStorageSync('address_info', info) // wx.setStorageSync('address_info', info)
}) // })
}) // })
}) // })
} // }
/**获取游客ID */ /**获取游客ID */
setGuestNo(length = 30) { setGuestNo(length = 30) {
let name = '', let name = '',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!