Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
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
panyongping
uni-pdtravel
Commits
01d56b68
Commit
01d56b68
authored
Aug 30, 2024
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组合票定位取消
parent
31d096d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
31 deletions
+43
-31
distributionCombiChoose.vue
...ation/distributionCombiChoose/distributionCombiChoose.vue
+43
-31
No files found.
pages/combination/distributionCombiChoose/distributionCombiChoose.vue
View file @
01d56b68
...
...
@@ -344,37 +344,49 @@ export default {
let
newTimestamp
=
uni
.
getStorageSync
(
'newTimestamp'
)
||
''
let
token
=
uni
.
getStorageSync
(
'token'
)
if
(
token
)
{
uni
.
getLocation
({
success
:
res
=>
{
let
latitude
=
res
.
latitude
//纬度
let
longitude
=
res
.
longitude
//经度
this
.
showDistance
=
true
//判断时间戳,之前请求失败,必须大于缓存时间戳才进行请求
if
(
newTimestamp
){
if
(
Date
.
now
()
>
newTimestamp
){
this
.
initList
(
latitude
,
longitude
)
}
else
{
this
.
showTip
=
true
}
}
else
{
this
.
initList
(
latitude
,
longitude
)
}
},
fail
:
res
=>
{
let
latitude
=
''
let
longitude
=
''
//判断时间戳,之前请求失败,必须大于缓存时间戳才进行请求
if
(
newTimestamp
){
if
(
Date
.
now
()
>
newTimestamp
){
this
.
initList
(
latitude
,
longitude
)
}
else
{
this
.
showTip
=
true
}
}
else
{
this
.
initList
(
latitude
,
longitude
)
}
}
})
let
latitude
=
''
let
longitude
=
''
//判断时间戳,之前请求失败,必须大于缓存时间戳才进行请求
if
(
newTimestamp
){
if
(
Date
.
now
()
>
newTimestamp
){
this
.
initList
(
latitude
,
longitude
)
}
else
{
this
.
showTip
=
true
}
}
else
{
this
.
initList
(
latitude
,
longitude
)
}
// uni.getLocation({//定位暂时注释
// success: res => {
// let latitude = res.latitude //纬度
// let longitude = res.longitude //经度
// this.showDistance = true
// //判断时间戳,之前请求失败,必须大于缓存时间戳才进行请求
// if(newTimestamp){
// if(Date.now()>newTimestamp){
// this.initList(latitude, longitude)
// }else{
// this.showTip=true
// }
// }else{
// this.initList(latitude, longitude)
// }
// },
// fail: res => {
// let latitude = ''
// let longitude = ''
// //判断时间戳,之前请求失败,必须大于缓存时间戳才进行请求
// if(newTimestamp){
// if(Date.now()>newTimestamp){
// this.initList(latitude, longitude)
// }else{
// this.showTip=true
// }
// }else{
// this.initList(latitude, longitude)
// }
// }
// })
}
},
methods
:
{
...
...
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