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
0dc28319
Commit
0dc28319
authored
Oct 15, 2019
by
李晓兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'修改定位样式'
parent
79eda834
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
39 deletions
+44
-39
location.vue
src/pages/home/location.vue
+44
-39
No files found.
src/pages/home/location.vue
View file @
0dc28319
...
...
@@ -43,7 +43,7 @@
</div>
</section>
<!-- 省份 -->
<section
ref=
"pro"
class=
"pro-wrapper"
>
<section
v-show=
"province_flag"
ref=
"pro"
class=
"pro-wrapper"
>
<div
class=
"pro-content"
>
<list-item
:item-height=
"40"
>
<item
v-for=
"(item,index) in lists"
:key=
"index"
:proportion=
"[5,2]"
>
...
...
@@ -52,46 +52,47 @@
</list-item>
</div>
</section>
<!-- <!– 城市 –>
<scroll
v-show=
"!province_flag"
:pullUp=
"false"
class=
"content-scroll"
>
<list-item
:item-height=
"40"
>
<item
v-for=
"(item,index) in cityList"
:key=
"index"
:proportion=
"[5,2]"
>
<section
slot=
"name"
@
click=
"selectCity(item.city_name)"
>
{{
item
.
city_name
}}
</section>
</item>
</list-item>
</scroll>
-->
<!-- 城市 -->
<section
v-show=
"!province_flag"
ref=
"city"
class=
"pro-wrapper"
>
<div
class=
"city-content"
>
<list-item
:item-height=
"40"
>
<item
v-for=
"(item,index) in cityList"
:key=
"index"
:proportion=
"[5,2]"
>
<section
slot=
"name"
@
click=
"selectCity(item.city_name)"
>
{{
item
.
city_name
}}
</section>
</item>
</list-item>
</div>
</section>
</section>
</h-view>
</
template
>
<
script
>
import
BScroll
from
'better-scroll'
export
default
{
name
:
'Location'
,
data
()
{
return
{
flag
:
false
,
province_flag
:
true
,
province
:
'请选择省'
,
city
:
'请选择市'
,
places
:
''
,
lists
:
[],
cityList
:
[],
}
},
computed
:
{},
watch
:
{},
created
()
{
// 判断是否是初次进入,不是就显示手动绑定的位置
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
this
.
places
=
window
.
localStorage
.
getItem
(
'province'
)
+
'-'
+
window
.
localStorage
.
getItem
(
'city'
)
}
else
{
this
.
places
=
this
.
$route
.
params
.
province
+
'-'
+
this
.
$route
.
params
.
city
}
this
.
selectLocation
()
},
methods
:
import
BScroll
from
'better-scroll'
export
default
{
name
:
'Location'
,
data
()
{
return
{
flag
:
false
,
province_flag
:
true
,
province
:
'请选择省'
,
city
:
'请选择市'
,
places
:
''
,
lists
:
[],
cityList
:
[],
}
},
computed
:
{},
watch
:
{},
created
()
{
// 判断是否是初次进入,不是就显示手动绑定的位置
if
(
window
.
localStorage
.
getItem
(
'province'
))
{
this
.
places
=
window
.
localStorage
.
getItem
(
'province'
)
+
'-'
+
window
.
localStorage
.
getItem
(
'city'
)
}
else
{
this
.
places
=
this
.
$route
.
params
.
province
+
'-'
+
this
.
$route
.
params
.
city
}
this
.
selectLocation
()
},
methods
:
{
// 重新定位到当前位置
relocation
()
{
...
...
@@ -122,7 +123,7 @@
vm
.
lists
=
res
.
lists
vm
.
$nextTick
(()
=>
{
vm
.
scroll
=
new
BScroll
(
vm
.
$refs
.
pro
,
{
click
:
true
click
:
true
,
})
})
})
...
...
@@ -152,8 +153,12 @@
let
vm
=
this
this
.
hlsHttp
.
post
(
url
,
param
).
then
(
function
(
res
)
{
console
.
log
(
res
)
// this.lists = res.lists
vm
.
cityList
=
res
.
lists
vm
.
$nextTick
(()
=>
{
vm
.
cityScroll
=
new
BScroll
(
vm
.
$refs
.
city
,
{
click
:
true
,
})
})
})
this
.
flag
=
!
this
.
flag
this
.
province_flag
=
false
...
...
@@ -175,7 +180,7 @@
})
},
},
}
}
</
script
>
<
style
lang=
'less'
scoped
>
#location {
...
...
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