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
Hide 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 {
...
@@ -82,14 +82,15 @@ export default {
},
},
watch
:
{},
watch
:
{},
created
()
{
created
()
{
this
.
getLocation
()
//
this.getLocation()
},
},
beforeRouteEnter
(
to
,
from
,
next
)
{
beforeRouteEnter
(
to
,
from
,
next
)
{
next
(
vm
=>
{
next
(
vm
=>
{
// if (from.name === 'Login') {
// if (from.name === 'Login') {
vm
.
moduleSeparateList
=
[...
functionState
.
moduleSeparateList
]
vm
.
moduleSeparateList
=
[...
functionState
.
moduleSeparateList
]
vm
.
userQuery
()
vm
.
userQuery
()
vm
.
guessingQuery
()
// 猜你喜欢查询
// vm.guessingQuery() // 猜你喜欢查询
vm
.
getLocation
()
// }
// }
})
})
...
@@ -101,17 +102,21 @@ export default {
...
@@ -101,17 +102,21 @@ export default {
let
vm
=
this
let
vm
=
this
if
(
vum
.
Platform
.
isAndroid
())
{
// 安卓采用jsapi
if
(
vum
.
Platform
.
isAndroid
())
{
// 安卓采用jsapi
var
geolocation
=
new
BMap
.
Geolocation
()
var
geolocation
=
new
BMap
.
Geolocation
()
vm
.
hlsPopup
.
showLoading
(
'数据加载中'
)
geolocation
.
getCurrentPosition
(
function
(
res
)
{
geolocation
.
getCurrentPosition
(
function
(
res
)
{
vm
.
hlsPopup
.
hideLoading
()
if
(
this
.
getStatus
()
===
0
)
{
if
(
this
.
getStatus
()
===
0
)
{
// 判断是否是手动选择过定位
// 判断是否是手动选择过定位
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
vm
.
city
=
window
.
localStorage
.
getItem
(
'city'
)
vm
.
city
=
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
window
.
localStorage
.
getItem
(
'province'
)
vm
.
province
=
window
.
localStorage
.
getItem
(
'province'
)
vm
.
guessingQuery
(
vm
.
city
)
}
else
{
}
else
{
// 没有就定位当前位置
// 没有就定位当前位置
console
.
log
(
res
)
console
.
log
(
res
)
vm
.
city
=
res
.
address
.
city
vm
.
city
=
res
.
address
.
city
vm
.
province
=
res
.
address
.
province
vm
.
province
=
res
.
address
.
province
vm
.
guessingQuery
(
res
.
address
.
city
)
}
}
}
}
},
{
enableHighAccuracy
:
true
})
},
{
enableHighAccuracy
:
true
})
...
@@ -121,13 +126,16 @@ export default {
...
@@ -121,13 +126,16 @@ export default {
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
vm
.
city
=
window
.
localStorage
.
getItem
(
'city'
)
vm
.
city
=
window
.
localStorage
.
getItem
(
'city'
)
vm
.
province
=
window
.
localStorage
.
getItem
(
'province'
)
vm
.
province
=
window
.
localStorage
.
getItem
(
'province'
)
vm
.
guessingQuery
(
vm
.
city
)
}
else
{
}
else
{
vm
.
city
=
result
.
city
vm
.
city
=
result
.
city
vm
.
province
=
result
.
province
vm
.
province
=
result
.
province
vm
.
guessingQuery
(
result
.
city
)
}
}
},
function
(
error
)
{
},
function
(
error
)
{
})
})
}
}
// setTimeout(vm.guessingQuery(), 0)
},
},
goFunctionHome
(
data
)
{
goFunctionHome
(
data
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
...
@@ -169,12 +177,13 @@ export default {
...
@@ -169,12 +177,13 @@ export default {
})
})
},
},
// 猜你喜欢
// 猜你喜欢
guessingQuery
()
{
guessingQuery
(
e
)
{
console
.
log
(
e
)
let
vm
=
this
let
vm
=
this
let
url
=
$config
.
basePath
+
'guess_you_like_query'
let
url
=
$config
.
basePath
+
'guess_you_like_query'
let
param
=
{
let
param
=
{
'user_phone'
:
window
.
localStorage
.
getItem
(
'user_phone'
),
'user_phone'
:
window
.
localStorage
.
getItem
(
'user_phone'
),
'city'
:
vm
.
city
,
'city'
:
e
,
}
}
vm
.
hlsPopup
.
showLoading
(
'数据加载中'
)
vm
.
hlsPopup
.
showLoading
(
'数据加载中'
)
vm
.
$post
(
url
,
param
).
then
(
function
(
res
)
{
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