Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
和慭琛
take_order
Commits
2b2fe8ae
Commit
2b2fe8ae
authored
May 12, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定位信息缓存
parent
31ccb757
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
take.vue
take-order/pages/photo/take.vue
+23
-4
No files found.
take-order/pages/photo/take.vue
View file @
2b2fe8ae
...
@@ -45,7 +45,8 @@
...
@@ -45,7 +45,8 @@
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak
:
"lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
ak
:
"lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
});
import
standard
from
'@/components/photo/standard.vue'
import
standard
from
'@/components/photo/standard.vue'
import
cache
from
'../../common/cache.js'
export
default
{
export
default
{
components
:
{
components
:
{
'photo-standard'
:
standard
,
'photo-standard'
:
standard
,
...
@@ -95,7 +96,17 @@
...
@@ -95,7 +96,17 @@
getApp
().
trackPage
(
'拍照页'
)
getApp
().
trackPage
(
'拍照页'
)
// this.ctx = uni.createCameraContext();
// this.ctx = uni.createCameraContext();
this
.
updateTime
()
this
.
updateTime
()
this
.
getLocation
()
const
locationData
=
cache
.
getCache
(
'locationData'
)
const
validityTime
=
60000
if
(
Date
.
now
()
-
locationData
.
locationTime
<
validityTime
)
{
// 1分钟内不重复请求位置信息
this
.
waterInfo
.
latitude
=
locationData
.
waterInfo
.
latitude
this
.
waterInfo
.
longitude
=
locationData
.
waterInfo
.
longitude
this
.
baiduLocation
()
}
else
{
this
.
getLocation
()
}
this
.
getMarkPath
()
this
.
getMarkPath
()
this
.
initData
()
this
.
initData
()
...
@@ -256,8 +267,16 @@
...
@@ -256,8 +267,16 @@
type
:
'gcj02'
,
type
:
'gcj02'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
waterInfo
.
longitude
=
parseFloat
(
res
.
longitude
).
toFixed
(
4
)
waterInfo
.
longitude
=
parseFloat
(
res
.
longitude
).
toFixed
(
4
)
waterInfo
.
latitude
=
parseFloat
(
res
.
latitude
).
toFixed
(
3
)
waterInfo
.
latitude
=
parseFloat
(
res
.
latitude
).
toFixed
(
3
)
// console.log(waterInfo.longitude, 'that.longitude', waterInfo.latitude, 'that.latitude')
const
data
=
{
waterInfo
:
{
latitude
:
waterInfo
.
latitude
,
longitude
:
waterInfo
.
longitude
},
locationTime
:
Date
.
now
()
}
cache
.
setCache
(
'locationData'
,
data
)
that
.
baiduLocation
()
that
.
baiduLocation
()
},
},
fail
(
err
)
{
fail
(
err
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment