Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
project-www-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
project-www-pc
Commits
90eec3ae
提交
90eec3ae
authored
12月 28, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
官网修改
上级
fb2665ec
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
131 行增加
和
77 行删除
+131
-77
headmasterMsg.vue
components/home/headmasterMsg.vue
+16
-76
textSwiper.vue
components/home/textSwiper.vue
+110
-0
swiperCom.vue
components/services/swiperCom.vue
+5
-1
没有找到文件。
components/home/headmasterMsg.vue
浏览文件 @
90eec3ae
...
@@ -21,30 +21,19 @@
...
@@ -21,30 +21,19 @@
<div
class=
"swiper-pagination swiper-pagination-bullets"
></div>
<div
class=
"swiper-pagination swiper-pagination-bullets"
></div>
</div>
</div>
</div>
</div>
<div
class=
"title-swiper"
>
<text-swiper
v-if=
"isShowSwiper"
:listData=
"listData"
@
slideTo=
"handleSlideTo"
/>
<div
v-swiper:secondSwiper=
"swiperOption1"
ref=
"mySwiper1"
@
click=
"handleClick"
>
<div
class=
"swiper-wrapper"
>
<div
class=
"swiper-slide"
v-for=
"(item, index) in listData"
:key=
"index"
>
{{
item
.
title
}}
</div>
</div>
</div>
<div
class=
"swiper-btn swiper-button-prev"
>
<img
src=
"https://webapp-pub.ezijing.com/www/pc/swipe-prev-btn.png"
>
</div>
<div
class=
"swiper-btn swiper-button-next"
>
<img
src=
"https://webapp-pub.ezijing.com/www/pc/swipe-next-btn.png"
>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
appLink
from
'@/components/Link'
import
appLink
from
'@/components/Link'
import
textSwiper
from
'./textSwiper.vue'
export
default
{
export
default
{
components
:
{
components
:
{
appLink
appLink
,
textSwiper
},
},
data
()
{
data
()
{
const
that
=
this
return
{
return
{
listData
:
[],
listData
:
[],
swiperOption
:
{
swiperOption
:
{
...
@@ -60,21 +49,7 @@ export default {
...
@@ -60,21 +49,7 @@ export default {
height
:
500
height
:
500
// autoHeight: true
// autoHeight: true
},
},
swiperOption1
:
{
isShowSwiper
:
false
observer
:
true
,
observeParents
:
true
,
speed
:
400
,
autoplay
:
false
,
delay
:
3000
,
loop
:
true
,
slidesPerView
:
'auto'
,
centeredSlides
:
true
,
spaceBetween
:
20
,
navigation
:
{
nextEl
:
'.swiper-button-next'
,
prevEl
:
'.swiper-button-prev'
,
}
}
}
}
},
},
async
fetch
()
{
async
fetch
()
{
...
@@ -83,7 +58,10 @@ export default {
...
@@ -83,7 +58,10 @@ export default {
type_tag
:
'img_text_school'
type_tag
:
'img_text_school'
}
}
this
.
listData
=
await
this
.
$axios
.
get
(
'/api/cms/api/v1/articles'
,
{
params
}).
then
(
res
=>
{
this
.
listData
=
await
this
.
$axios
.
get
(
'/api/cms/api/v1/articles'
,
{
params
}).
then
(
res
=>
{
// console.log(res.data.data)
this
.
isShowSwiper
=
false
setTimeout
(()
=>
{
this
.
isShowSwiper
=
true
},
100
)
return
res
.
data
.
data
return
res
.
data
.
data
})
})
},
},
...
@@ -93,18 +71,16 @@ export default {
...
@@ -93,18 +71,16 @@ export default {
// }
// }
},
},
mounted
()
{
mounted
()
{
this
.
isShowSwiper
=
false
setTimeout
(()
=>
{
this
.
isShowSwiper
=
true
},
100
)
},
},
methods
:
{
methods
:
{
handle
Click
(
)
{
handle
SlideTo
(
index
)
{
cons
t
index
=
this
.
$refs
.
mySwiper1
.
swiper
.
clickedSlide
.
dataset
.
swiperSlideIndex
cons
ole
.
log
(
index
)
this
.
$refs
.
mySwiper
.
swiper
.
slideTo
(
index
)
this
.
$refs
.
mySwiper
.
swiper
.
slideTo
(
index
)
}
}
// swiperStop() {
// this.swiper.autoplay.stop()
// },
// swiperStart() {
// this.swiper.autoplay.start()
// }
}
}
}
}
</
script
>
</
script
>
...
@@ -171,40 +147,5 @@ export default {
...
@@ -171,40 +147,5 @@ export default {
}
}
}
}
}
}
.title-swiper
{
padding
:
0
25px
;
margin-top
:
5px
;
position
:relative
;
// overflow: auto;
// width: 100%;
.swiper-slide
{
position
:
relative
;
width
:
250px
;
height
:
58px
;
margin-right
:
10px
;
padding
:
7px
10px
;
line-height
:
22px
;
font-size
:
16px
;
cursor
:
pointer
;
}
.swiper-btn
{
width
:
20px
;
height
:
35px
;
position
:absolute
;
left
:
-5px
;
top
:
50%
;
transform
:translateY
(
-50
%
)
;
z-index
:
2
;
img
{
width
:
100%
;
height
:
100%
;
display
:block
;
}
}
.swiper-button-next
{
left
:unset
;
right
:
-5px
;
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
components/home/textSwiper.vue
0 → 100644
浏览文件 @
90eec3ae
<
template
>
<div
class=
"title-swiper"
>
<div
v-swiper:secondSwiper=
"swiperOption1"
ref=
"mySwiper1"
@
click=
"handleClick"
>
<div
class=
"swiper-wrapper"
>
<div
class=
"swiper-slide swiper-no-swiping"
v-for=
"(item, index) in listData"
:key=
"index"
>
{{
item
.
title
}}
</div>
</div>
</div>
<div
class=
"swiper-btn swiper-button-prev"
>
<img
src=
"https://webapp-pub.ezijing.com/www/pc/swipe-prev-btn.png"
>
</div>
<div
class=
"swiper-btn swiper-button-next"
>
<img
src=
"https://webapp-pub.ezijing.com/www/pc/swipe-next-btn.png"
>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
listData
:
{
type
:
Array
,
default
()
{
return
[]
}
}
},
data
()
{
return
{
swiperOption1
:
{
observer
:
true
,
observeParents
:
true
,
speed
:
400
,
autoplay
:
false
,
delay
:
3000
,
loop
:
true
,
slidesPerView
:
'auto'
,
centeredSlides
:
true
,
spaceBetween
:
0
,
disableOnInteraction
:
false
,
on
:{
init
:
function
(){
// that.isShowSwiper = true
}
},
navigation
:
{
nextEl
:
'.swiper-button-next'
,
prevEl
:
'.swiper-button-prev'
,
}
},
isEn
:
false
}
},
created
()
{
this
.
isEn
=
this
.
$cookies
.
get
(
'lang'
)
===
'en-US'
},
methods
:
{
handleClick
(
e
)
{
const
index
=
e
.
target
.
dataset
.
swiperSlideIndex
this
.
$emit
(
'slideTo'
,
index
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.title-swiper
{
padding
:
0
25px
;
margin-top
:
5px
;
position
:relative
;
// overflow: auto;
// width: 100%;
.swiper-slide
{
position
:
relative
;
width
:
266px
;
height
:
44px
;
padding
:
0
20px
;
margin
:
7px
0
;
line-height
:
22px
;
font-size
:
16px
;
cursor
:
pointer
;
user-select
:none
;
border-right
:
1px
solid
#a81840
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-
webkit-box
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
}
.swiper-btn
{
width
:
20px
;
height
:
35px
;
position
:absolute
;
left
:
-5px
;
top
:
50%
;
transform
:translateY
(
-50
%
)
;
z-index
:
2
;
user-select
:none
;
img
{
width
:
100%
;
height
:
100%
;
display
:block
;
}
}
.swiper-button-next
{
left
:unset
;
right
:
-5px
;
}
}
</
style
>
\ No newline at end of file
components/services/swiperCom.vue
浏览文件 @
90eec3ae
...
@@ -54,8 +54,12 @@ export default {
...
@@ -54,8 +54,12 @@ export default {
nextEl
:
'.swiper-button-next'
,
nextEl
:
'.swiper-button-next'
,
prevEl
:
'.swiper-button-prev'
,
prevEl
:
'.swiper-button-prev'
,
}
}
}
},
isEn
:
false
}
}
},
created
()
{
this
.
isEn
=
this
.
$cookies
.
get
(
'lang'
)
===
'en-US'
}
}
}
}
</
script
>
</
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论