Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e770b4f1
authored
Sep 19, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
0c8ba4bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
utils/Track.js
utils/Track.js
View file @
e770b4f
...
@@ -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
*
1
e3
)
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
=
''
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment