Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
polysoft-nafmii
/
polysoft-h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0755e84a
authored
May 11, 2021
by
amateur
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加首页banner相关布局
1 parent
6151d900
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
12 deletions
src/views/home/components/HomeBanner.vue
src/views/home/index.vue
src/views/home/components/HomeBanner.vue
0 → 100644
View file @
0755e84
<
template
>
<section
class=
"home-banner"
>
<van-swipe
class=
"banner-swiper"
:autoplay=
"autoplay"
lazy-render
@
change=
"handleChange"
>
<van-swipe-item
class=
"swiper-item"
v-for=
"(item, idx) in banners"
:key=
"idx"
>
<img
v-if=
"item.imgUrl"
class=
"banner-img"
:src=
"item.imgUrl"
@
click=
"handleItem(item)"
/>
<div
v-else
class=
"banner-img white"
>
<div
class=
"banner-img skeleton"
></div>
</div>
</van-swipe-item>
<template
#
indicator
>
<div
class=
"nafmii-indicator"
>
<span
class=
"indicator-item"
:class=
"
{'indicator-active': active == idx}" v-for="(item, idx) in banners" :key="idx" />
</div>
</
template
>
</van-swipe>
</section>
</template>
<
script
>
export
default
{
name
:
'HomeBanner'
,
props
:
{
},
data
()
{
return
{
autoplay
:
5000
,
active
:
0
,
banners
:
[
{},
{}
]
}
},
methods
:
{
handleItem
(
banner
)
{
},
handleChange
(
index
)
{
this
.
active
=
index
}
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.white
{
background
:
#eee
;
}
@PaddingSize
:
15
;
.home-banner
{
margin-top
:
@
PaddingSize
;
.banner-swiper
{
.banner-img
{
height
:
145px
;
border-radius
:
5px
;
width
:
100%
;
}
@PointSize
:
5px
;
.nafmii-indicator
{
position
:
absolute
;
left
:
0
;
bottom
:
10px
;
right
:
0
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
height
:
@
PointSize
;
.indicator-item
{
background
:
rgba
(
255
,
255
,
255
,
0.4
);
width
:
@
PointSize
;
height
:
@
PointSize
;
border-radius
:
calc
(
@
PointSize
/
2
);
margin
:
0
4px
;
&.indicator-active
{
background
:
white
;
width
:
21.5px
;
}
}
}
}
}
</
style
>
\ No newline at end of file
src/views/home/index.vue
View file @
0755e84
<
template
>
<div>
<nafm-header
:leftArrow=
"false"
>
<div
class=
"home nafmii-head-bg1"
>
<nafm-header
:leftArrow=
"false"
navClass=
"nafmii-head-bg1"
>
<div
class=
"head-custom-container"
>
<div
class=
"search-input-box"
@
click=
"handleSearch"
>
<div
src=
""
alt=
""
class=
"search-icon"
/>
...
...
@@ -10,43 +10,56 @@
</div>
</div>
</nafm-header>
<span
@
click=
"jumpLogin"
>
跳转登录页面
</span>
<FooterBottom
/>
<main>
<HomeBanner
/>
</main>
</div>
</
template
>
<
script
>
import
HomeBanner
from
'./components/HomeBanner'
export
default
{
name
:
"Home"
,
components
:
{},
data
()
{
components
:
{
HomeBanner
},
data
()
{
return
{};
},
methods
:
{
jumpLogin
()
{
jumpLogin
()
{
this
.
$router
.
push
({
name
:
"Login"
,
});
},
handleSearch
()
{
},
handleSearch
()
{
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.home
{
@
PaddingSize
:
15px
;
main
{
padding
:
0
@
PaddingSize
;
height
:
1000px
;
overflow-y
:
scroll
;
}
}
@PaddingSize
:
15px
;
@HeadHeight
:
33
px
;
@HeadHeight
:
50
px
;
.head-custom-container
{
width
:
100%
;
height
:
@
HeadHeight
;
padding
:
0
@
PaddingSize
;
display
:
flex
;
align-items
:
center
;
@
InputHeight
:
33px
;
.search-input-box
{
width
:
100%
;
height
:
100%
;
border-radius
:
calc
(
@
Head
Height
/
2
);
height
:
@
InputHeight
;
border-radius
:
calc
(
@
Input
Height
/
2
);
background-color
:
rgba
(
255
,
255
,
255
,
0.2
);
padding
:
0
@
PaddingSize
;
display
:
flex
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment