Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vue-ssr-mobile
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-mobile
Commits
8e468514
Commit
8e468514
authored
Sep 06, 2019
by
lixy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
营地、旅游列表分类
parent
a0b1923b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
187 additions
and
48 deletions
+187
-48
activity.vue
pages/activity.vue
+1
-1
campsite.vue
pages/campsite.vue
+80
-22
news.vue
pages/news.vue
+1
-1
tour.vue
pages/tour.vue
+104
-23
vehicle.vue
pages/vehicle.vue
+1
-1
No files found.
pages/activity.vue
View file @
8e468514
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
class=
"loading"
>
加载中……
</p>
class=
"loading"
>
加载中……
</p>
<p
<p
v-if=
"touchend"
v-if=
"touchend"
class=
"empty_data"
>
——共
{{
totalCount
}}
个活动——
</p>
class=
"empty_data"
>
——共
{{
totalCount
?
totalCount
:
0
}}
个活动——
</p>
<go-top/>
<go-top/>
<Footer
v-if=
"touchend"
/>
<Footer
v-if=
"touchend"
/>
</div>
</div>
...
...
pages/campsite.vue
View file @
8e468514
...
@@ -13,6 +13,18 @@
...
@@ -13,6 +13,18 @@
@
next=
"next"
@
next=
"next"
@
change=
"changeBanner"
@
change=
"changeBanner"
@
click=
"bannerClick"
/>
@
click=
"bannerClick"
/>
<div>
<nav
id=
"nav"
:class=
"searchBarFixed == true ? 'isFixed' :''"
>
<p
v-for=
"(item, index) in dataType"
:key=
"index"
:class=
"listQuery.type == item.id?'active':''"
@
click=
"chooseSelect(item)"
>
{{
item
.
name
}}
</p>
</nav>
</div>
<div
style=
"padding-top: 0;border-top: 1px solid #dfdfdf;height: 17px;"
/>
<ul
<ul
v-if=
"dataDetail.length"
v-if=
"dataDetail.length"
id=
"scroll-area"
id=
"scroll-area"
...
@@ -37,9 +49,10 @@
...
@@ -37,9 +49,10 @@
<p
<p
v-if=
"preventRepeatReuqest"
v-if=
"preventRepeatReuqest"
class=
"loading"
>
加载中……
</p>
class=
"loading"
>
加载中……
</p>
<p
id=
"empty"
/>
<p
<p
v-if=
"touchend"
v-if=
"touchend"
class=
"empty_data"
>
—— 共
{{
totalCount
}}
个房车营地——
</p>
class=
"empty_data"
>
—— 共
{{
totalCount
?
totalCount
:
0
}}
个房车营地——
</p>
<go-top/>
<go-top/>
<Footer
v-if=
"touchend"
/>
<Footer
v-if=
"touchend"
/>
</div>
</div>
...
@@ -64,6 +77,7 @@
...
@@ -64,6 +77,7 @@
},
},
data
(){
data
(){
return
{
return
{
searchBarFixed
:
false
,
showBanner
:
!
0
,
showBanner
:
!
0
,
looptime
:
4000
,
// 循环时间
looptime
:
4000
,
// 循环时间
touchend
:
false
,
////没有更多数据
touchend
:
false
,
////没有更多数据
...
@@ -105,9 +119,19 @@
...
@@ -105,9 +119,19 @@
},
},
methods
:
{
methods
:
{
handleScroll
:
function
()
{
handleScroll
:
function
()
{
let
path
=
$nuxt
.
$route
.
path
;
if
(
path
==
'/campsite'
){
let
scrollTop
=
window
.
pageYOffset
||
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
let
scrollTop
=
window
.
pageYOffset
||
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
// 设备/屏幕高度
let
scrollObj
=
document
.
getElementById
(
"scroll-area"
);
// 滚动区域
let
scrollObj
=
document
.
getElementById
(
"scroll-area"
);
// 滚动区域
let
menuTop
=
document
.
querySelector
(
'#nav'
).
offsetTop
;
let
empty
=
document
.
querySelector
(
'#empty'
).
offsetTop
;
if
(
scrollTop
>
menuTop
-
44
&&
empty
>
scrollObj
.
clientHeight
)
{
this
.
searchBarFixed
=
true
;
}
if
(
scrollTop
<
80
)
{
this
.
active
=
'activity'
;
this
.
searchBarFixed
=
false
;
}
if
(
scrollObj
)
{
if
(
scrollObj
)
{
let
scrollHeight
=
scrollObj
.
scrollHeight
;
// 滚动条的总高度
let
scrollHeight
=
scrollObj
.
scrollHeight
;
// 滚动条的总高度
//滚动条到底部的条件
//滚动条到底部的条件
...
@@ -125,18 +149,22 @@
...
@@ -125,18 +149,22 @@
this
.
getAll
();
this
.
getAll
();
}
}
}
}
}
},
},
chooseSelect
(
e
)
{
chooseSelect
(
e
)
{
console
.
log
(
e
.
target
.
value
);
this
.
listQuery
.
type
=
e
.
id
;
this
.
listQuery
.
tagId
=
e
.
target
.
value
;
this
.
preventRepeatReuqest
=
true
;
this
.
preventRepeatReuqest
=
true
;
this
.
dataDetail
=
[];
this
.
listQuery
.
pageNo
=
1
;
document
.
documentElement
.
scrollTop
=
0
;
this
.
getAll
();
this
.
getAll
();
},
},
getType
()
{
getType
()
{
let
t
=
this
;
let
t
=
this
;
axios
.
get
(
'/api/uccn/app/unauth/tour/tagList'
)
axios
.
get
(
"/api/campsite/campsiteTag/app/unauth/tags"
)
.
then
(
function
(
response
)
{
.
then
(
function
(
response
)
{
t
.
dataType
=
response
.
data
;
t
.
dataType
=
response
.
data
.
data
;
t
.
dataType
.
unshift
({
id
:
""
,
name
:
'全部'
})
});
});
},
},
getAll
()
{
getAll
()
{
...
@@ -173,6 +201,36 @@
...
@@ -173,6 +201,36 @@
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
@import
"../assets/styles/mixin"
;
@import
"../assets/styles/mixin"
;
.campsite-container
{
.campsite-container
{
nav
{
display
:
-
webkit-box
;
display
:
-
ms-flexbox
;
display
:
flex
;
-webkit-box-align
:
center
;
-ms-flex-align
:
center
;
align-items
:
center
;
overflow
:
auto
;
}
nav
.isFixed
{
position
:
fixed
;
top
:
44px
;
background
:
#fff
;
width
:
100%
;
border-bottom
:
1px
solid
#dfdfdf
;
}
nav
:
:-
webkit-scrollbar
{
width
:
0
!
important
}
p
{
text-align
:
center
;
font-size
:
14px
;
color
:
#999
;
flex-shrink
:
0
;
margin
:
27px
13px
0px
13px
;
padding-bottom
:
13px
;
}
p
.active
{
border-bottom
:
2px
solid
#1bbb9f
;
font-size
:
16px
;
color
:
#333
;
}
.campsite-ul
{
.campsite-ul
{
padding-top
:
0px
;
padding-top
:
0px
;
display
:
flex
;
display
:
flex
;
...
...
pages/news.vue
View file @
8e468514
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
class=
"loading"
>
加载中……
</p>
class=
"loading"
>
加载中……
</p>
<p
<p
v-if=
"touchend"
v-if=
"touchend"
class=
"empty_data"
>
——共
{{
totalCount
}}
篇新闻资讯——
</p>
class=
"empty_data"
>
——共
{{
totalCount
?
totalCount
:
0
}}
篇新闻资讯——
</p>
<go-top/>
<go-top/>
<Footer
v-if=
"touchend"
/>
<Footer
v-if=
"touchend"
/>
</div>
</div>
...
...
pages/tour.vue
View file @
8e468514
...
@@ -13,11 +13,23 @@
...
@@ -13,11 +13,23 @@
@
next=
"next"
@
next=
"next"
@
change=
"changeBanner"
@
change=
"changeBanner"
@
click=
"bannerClick"
/>
@
click=
"bannerClick"
/>
<div
id=
"nav"
:class=
"searchBarFixed == true ? 'isFixed' :''"
class=
"nav-sec-menu"
>
<nav>
<p
v-for=
"(item, index) in dataType"
:key=
"index"
:class=
"listQuery.tagId == item.id?'active':''"
@
click=
"chooseSelect(item)"
>
{{
item
.
name
}}
</p>
</nav>
</div>
<div
style=
"padding-top: 0;margin-top: -17px;border-top: 1px solid #dfdfdf;height: 17px;"
/>
<ul
<ul
v-if=
"dataDetail.length"
v-if=
"dataDetail.length"
id=
"scroll-area"
id=
"scroll-area"
type=
"1"
style=
"padding-top: 0;margin-top: -17px;"
style=
"padding-top: 0;"
class=
"main-padding"
>
class=
"main-padding"
>
<router-link
<router-link
v-for=
"item in dataDetail"
v-for=
"item in dataDetail"
...
@@ -35,9 +47,10 @@
...
@@ -35,9 +47,10 @@
<p
<p
v-if=
"preventRepeatReuqest"
v-if=
"preventRepeatReuqest"
class=
"loading"
>
加载中……
</p>
class=
"loading"
>
加载中……
</p>
<p
id=
"empty"
/>
<p
<p
v-if=
"touchend"
v-if=
"touchend"
class=
"empty_data"
>
——共
{{
totalCount
}}
个旅行路线——
</p>
class=
"empty_data"
>
——共
{{
totalCount
?
totalCount
:
0
}}
个旅行路线——
</p>
<go-top/>
<go-top/>
<Footer
v-if=
"touchend"
/>
<Footer
v-if=
"touchend"
/>
</div>
</div>
...
@@ -83,6 +96,7 @@
...
@@ -83,6 +96,7 @@
dataNull
:
false
,
dataNull
:
false
,
tourList
:
[],
tourList
:
[],
currentPage
:
1
,
//当前加载页
currentPage
:
1
,
//当前加载页
searchBarFixed
:
false
,
preventRepeatReuqest
:
false
,
//到达底部加载数据,防止重复加载
preventRepeatReuqest
:
false
,
//到达底部加载数据,防止重复加载
};
};
},
},
...
@@ -101,15 +115,42 @@
...
@@ -101,15 +115,42 @@
let
cc
=
data
.
data
;
let
cc
=
data
.
data
;
return
{
bannerList
:
cc
}
return
{
bannerList
:
cc
}
},
},
mounted
(){
let
t
=
this
;
let
galleryTop
=
new
Swiper
(
'.gallery-top'
,
{
spaceBetween
:
10
,
loop
:
true
,
autoplay
:
{
delay
:
2500
,
disableOnInteraction
:
false
,
},
on
:
{
slideChangeTransitionEnd
:
function
()
{
console
.
log
(
this
.
activeIndex
);
},
},
});
},
methods
:
{
methods
:
{
handleScroll
:
function
()
{
handleScroll
:
function
()
{
let
path
=
$nuxt
.
$route
.
path
;
if
(
path
==
'/tour'
)
{
let
scrollTop
=
window
.
pageYOffset
||
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
let
scrollTop
=
window
.
pageYOffset
||
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
// 设备/屏幕高度
// 设备/屏幕高度
let
scrollObj
=
document
.
getElementById
(
"scroll-area"
);
// 滚动区域
let
scrollObj
=
document
.
getElementById
(
"scroll-area"
);
// 滚动区域
if
(
scrollObj
){
let
menuTop
=
document
.
querySelector
(
'#nav'
).
offsetTop
;
let
empty
=
document
.
querySelector
(
'#empty'
).
offsetTop
;
if
(
scrollTop
>
menuTop
-
44
&&
empty
>
scrollObj
.
clientHeight
)
{
this
.
searchBarFixed
=
true
;
}
if
(
scrollTop
<
80
)
{
this
.
active
=
'activity'
;
this
.
searchBarFixed
=
false
;
}
if
(
scrollObj
)
{
let
scrollHeight
=
scrollObj
.
scrollHeight
;
// 滚动条的总高度
let
scrollHeight
=
scrollObj
.
scrollHeight
;
// 滚动条的总高度
//滚动条到底部的条件
//滚动条到底部的条件
if
(
document
.
documentElement
.
scrollTop
+
document
.
documentElement
.
clientHeight
>=
document
.
body
.
scrollHeight
)
{
if
(
document
.
documentElement
.
scrollTop
+
document
.
documentElement
.
clientHeight
>=
document
.
body
.
scrollHeight
)
{
if
(
this
.
touchend
)
{
if
(
this
.
touchend
)
{
return
;
return
;
}
}
...
@@ -123,18 +164,23 @@
...
@@ -123,18 +164,23 @@
this
.
getAll
();
this
.
getAll
();
}
}
}
}
}
},
},
chooseSelect
(
e
)
{
chooseSelect
(
e
)
{
console
.
log
(
e
.
target
.
value
);
this
.
listQuery
.
tagId
=
e
.
id
;
this
.
listQuery
.
tagId
=
e
.
target
.
value
;
this
.
preventRepeatReuqest
=
true
;
this
.
preventRepeatReuqest
=
true
;
this
.
dataDetail
=
[];
this
.
listQuery
.
page
=
1
;
document
.
documentElement
.
scrollTop
=
0
;
this
.
getAll
();
this
.
getAll
();
},
},
getType
()
{
getType
()
{
let
t
=
this
;
let
t
=
this
;
axios
.
get
(
'/api/uccn/app/unauth/tour/tagList'
)
axios
.
get
(
'/api/uccn/app/unauth/tour/tagList'
)
.
then
(
function
(
response
)
{
.
then
(
function
(
response
)
{
t
.
dataType
=
response
.
data
;
t
.
dataType
=
response
.
data
.
data
;
t
.
dataType
.
unshift
({
id
:
""
,
name
:
'全部'
})
});
});
},
},
getAll
()
{
getAll
()
{
...
@@ -172,6 +218,41 @@
...
@@ -172,6 +218,41 @@
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
@import
"../assets/styles/mixin"
;
@import
"../assets/styles/mixin"
;
.tour-container
{
.tour-container
{
nav
{
display
:
-
webkit-box
;
display
:
-
ms-flexbox
;
display
:
flex
;
-webkit-box-align
:
center
;
-ms-flex-align
:
center
;
align-items
:
center
;
overflow
:
auto
;
}
nav
:
:-
webkit-scrollbar
{
width
:
0
!
important
}
.nav-sec-menu.isFixed
{
position
:
fixed
;
top
:
44px
;
background
:
#fff
;
height
:
64px
;
width
:
100%
;
border-bottom
:
1px
solid
#dfdfdf
;
}
p
{
text-align
:
center
;
font-size
:
14px
;
color
:
#999
;
flex-shrink
:
0
;
margin
:
27px
13px
0px
13px
;
padding-bottom
:
13px
;
}
p
.active
{
border-bottom
:
2px
solid
#1bbb9f
;
font-size
:
16px
;
color
:
#333
;
}
.tyle-list-li
{
padding-right
:
10px
;
display
:
inline-block
;
}
.tour-item
{
.tour-item
{
margin
:
17px
0
;
margin
:
17px
0
;
}
}
...
...
pages/vehicle.vue
View file @
8e468514
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
class=
"loading"
>
加载中……
</p>
class=
"loading"
>
加载中……
</p>
<p
<p
v-if=
"touchend"
v-if=
"touchend"
class=
"empty_data"
>
—— 共
{{
totalCount
}}
款车型——
</p>
class=
"empty_data"
>
—— 共
{{
totalCount
?
totalCount
:
0
}}
款车型——
</p>
<go-top/>
<go-top/>
<Footer
v-if=
"touchend"
/>
<Footer
v-if=
"touchend"
/>
</div>
</div>
...
...
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