Commit e770b4f1 by 胡悦

修改

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