Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vue-ssr
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
lixy
vue-ssr
Commits
e7024a00
Commit
e7024a00
authored
Sep 09, 2019
by
lixy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
热门营地固定
parent
34614254
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
_id.vue
pages/campsiteDetails/_id.vue
+31
-5
No files found.
pages/campsiteDetails/_id.vue
View file @
e7024a00
...
@@ -88,14 +88,15 @@
...
@@ -88,14 +88,15 @@
<div
v-html=
"notice[0].value"
>
<div
v-html=
"notice[0].value"
>
</div>
</div>
</div>
</div>
<div
style=
"float:left;width:300px;margin-left:20px;background-color:#fff;text-align:center"
>
<div
id =
"fixContainer"
class=
"hot-r-campsite"
style=
"float:left;width:300px;margin-left:20px;background-color:#fff;text-align:center"
>
<div
id=
"campsiteHotId"
:class=
"barFixed?'isFixed':''"
>
<h3
style=
"height:53px;font-weight:400;line-height:53px;border-bottom:1px solid #EEEEEE;font-size:16px"
>
热门营地
</h3>
<h3
style=
"height:53px;font-weight:400;line-height:53px;border-bottom:1px solid #EEEEEE;font-size:16px"
>
热门营地
</h3>
<div
v-for=
"(item,index) in hotList"
:key=
"index"
style=
"width:100%;padding:25px 60px 0 60px"
>
<div
v-for=
"(item,index) in hotList"
:key=
"index"
style=
"width:100%;padding:25px 60px 0 60px"
>
<img
:src=
"item.imgUrl"
alt=
""
style=
"width:180px;height:135px"
>
<img
:src=
"item.imgUrl"
alt=
""
style=
"width:180px;height:135px"
>
<h5
style=
"overflow: hidden;text-overflow:ellipsis;margin:21px 0 30px 0;font-weight:400;font-size:16px;white-space: nowrap;"
>
{{
item
.
name
}}
</h5>
<h5
style=
"overflow: hidden;text-overflow:ellipsis;margin:21px 0 30px 0;font-weight:400;font-size:16px;white-space: nowrap;"
>
{{
item
.
name
}}
</h5>
<nuxt-link
:to=
"item.link"
><button
class=
"buttonDetail"
style=
"font-size:14px;margin-bottom:57px"
>
营地详情
</button></nuxt-link>
<nuxt-link
:to=
"item.link"
><button
class=
"buttonDetail"
style=
"font-size:14px;margin-bottom:57px"
>
营地详情
</button></nuxt-link>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -121,15 +122,16 @@ export default {
...
@@ -121,15 +122,16 @@ export default {
footerModal
footerModal
},
},
created
()
{
created
()
{
// this.getNode();
if
(
typeof
window
!==
'undefined'
)
{
// this.toHot(
);
window
.
addEventListener
(
'scroll'
,
this
.
handleScroll
);
// this.getHot()
}
},
},
data
()
{
data
()
{
return
{
return
{
lengthPic
:
0
,
lengthPic
:
0
,
preIndex
:
0
,
//当前轮播选中图
preIndex
:
0
,
//当前轮播选中图
visible
:
false
,
visible
:
false
,
barFixed
:
false
};
};
},
},
validate
({
params
})
{
validate
({
params
})
{
...
@@ -163,6 +165,23 @@ export default {
...
@@ -163,6 +165,23 @@ export default {
visiblePic
()
{
visiblePic
()
{
this
.
visible
=
!
this
.
visible
;
this
.
visible
=
!
this
.
visible
;
},
},
handleScroll
:
function
()
{
let
scrollTop
=
window
.
pageYOffset
||
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
let
path
=
$nuxt
.
$route
.
path
;
if
(
path
.
indexOf
(
'/campsiteDetail'
)
!=
-
1
){
var
menuTop
=
document
.
querySelector
(
'#campsiteHotId'
).
offsetTop
;
console
.
log
(
menuTop
+
"--"
+
scrollTop
);
//滑动到指定位置菜单吸顶
if
(
scrollTop
>
menuTop
-
120
)
{
this
.
barFixed
=
true
;
}
let
fixContainer
=
document
.
querySelector
(
'#fixContainer'
).
offsetTop
;
if
(
scrollTop
<
fixContainer
-
120
){
this
.
barFixed
=
false
;
// this.tabIndex = 0;
}
}
},
},
},
mounted
()
{
mounted
()
{
let
t
=
this
;
let
t
=
this
;
...
@@ -197,6 +216,7 @@ export default {
...
@@ -197,6 +216,7 @@ export default {
swiper
:
galleryThumbs
swiper
:
galleryThumbs
}
}
});
});
},
},
head
:
{
head
:
{
title
:
"营地详情"
title
:
"营地详情"
...
@@ -205,6 +225,12 @@ export default {
...
@@ -205,6 +225,12 @@ export default {
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.hot-r-campsite
.isFixed
{
position
:
fixed
;
top
:
120px
;
width
:
300px
;
background
:
#fff
;
}
.clearfix
:after
{
.clearfix
:after
{
/*伪元素是行内元素 正常浏览器清除浮动方法*/
/*伪元素是行内元素 正常浏览器清除浮动方法*/
content
:
""
;
content
:
""
;
...
...
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