Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-xcmg-vue-app
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
xugong
hls-xcmg-vue-app
Commits
1cd6ac20
Commit
1cd6ac20
authored
Mar 16, 2020
by
linxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
a94f95d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
home-page.vue
src/pages/home/home-page.vue
+13
-4
No files found.
src/pages/home/home-page.vue
View file @
1cd6ac20
...
...
@@ -82,14 +82,15 @@ export default {
},
watch
:
{},
created
()
{
this
.
getLocation
()
//
this.getLocation()
},
beforeRouteEnter
(
to
,
from
,
next
)
{
next
(
vm
=>
{
// if (from.name === 'Login') {
vm
.
moduleSeparateList
=
[...
functionState
.
moduleSeparateList
]
vm
.
userQuery
()
vm
.
guessingQuery
()
// 猜你喜欢查询
// vm.guessingQuery() // 猜你喜欢查询
vm
.
getLocation
()
// }
})
...
...
@@ -101,17 +102,21 @@ export default {
let
vm
=
this
if
(
vum
.
Platform
.
isAndroid
())
{
// 安卓采用jsapi
var
geolocation
=
new
BMap
.
Geolocation
()
vm
.
hlsPopup
.
showLoading
(
'数据加载中'
)
geolocation
.
getCurrentPosition
(
function
(
res
)
{
vm
.
hlsPopup
.
hideLoading
()
if
(
this
.
getStatus
()
===
0
)
{
// 判断是否是手动选择过定位
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
vm
.
city
=
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
window
.
localStorage
.
getItem
(
'province'
)
vm
.
guessingQuery
(
vm
.
city
)
}
else
{
// 没有就定位当前位置
console
.
log
(
res
)
vm
.
city
=
res
.
address
.
city
vm
.
province
=
res
.
address
.
province
vm
.
guessingQuery
(
res
.
address
.
city
)
}
}
},
{
enableHighAccuracy
:
true
})
...
...
@@ -121,13 +126,16 @@ export default {
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
vm
.
city
=
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
window
.
localStorage
.
getItem
(
'province'
)
vm
.
guessingQuery
(
vm
.
city
)
}
else
{
vm
.
city
=
result
.
city
vm
.
province
=
result
.
province
vm
.
guessingQuery
(
result
.
city
)
}
},
function
(
error
)
{
})
}
// setTimeout(vm.guessingQuery(), 0)
},
goFunctionHome
(
data
)
{
this
.
$router
.
push
({
...
...
@@ -169,12 +177,13 @@ export default {
})
},
// 猜你喜欢
guessingQuery
()
{
guessingQuery
(
e
)
{
console
.
log
(
e
)
let
vm
=
this
let
url
=
$config
.
basePath
+
'guess_you_like_query'
let
param
=
{
'user_phone'
:
window
.
localStorage
.
getItem
(
'user_phone'
),
'city'
:
vm
.
city
,
'city'
:
e
,
}
vm
.
hlsPopup
.
showLoading
(
'数据加载中'
)
vm
.
$post
(
url
,
param
).
then
(
function
(
res
)
{
...
...
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