You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
2.7 KiB

3 years ago
<template>
3 years ago
<swiper class="swiper-block" vertical="true" circular="true" previous-margin="80rpx" next-margin="80rpx" current="0" @change="swiperChange">
<block v-for="(item, index) in articleList" :key="index">
3 years ago
<swiper-item class="swiper-item" :class="(swiperIndex == index ? 'active' : '')" @tap="previewImg">
<view class="item-box" :class="(swiperIndex == index ? 'active' : '')" @click="toDetial(item.id)">
<image mode="aspectFill" :src="item.imageInput" class="slide-image"></image>
<view class="content-box">
3 years ago
<view class="mask"></view>
<view class="title-box line1">{{item.title}}</view>
3 years ago
<view class="content acea-row">
<view>{{item.author}}</view>
<view>{{item.createTime}}</view>
3 years ago
<!-- <view class="acea-row row-middle">
<image src="../static/images/eye2.png" class="eye"></image>
<text>{{item.visit}}</text>
3 years ago
</view> -->
3 years ago
</view>
</view>
</view>
</swiper-item>
</block>
</swiper>
</template>
<script>
export default{
props: {
articleList: {
3 years ago
type: Array,
default: []
}
},
data(){
return {
swiperIndex: 0
}
},
methods: {
swiperChange(e) {
const that = this;
that.setData({
swiperIndex: e.detail.current
});
},
toDetial(id){
uni.navigateTo({
url: '/pages/life/articleDetail/index?id='+id
})
},
previewImg() {
uni.previewImage({
urls: this.imgs
});
}
}
}
</script>
<style lang="less">
.swiper-block {
width: 670rpx;
height: 300rpx;
margin: 0 auto;
3 years ago
border-radius: 20rpx;
3 years ago
}
.swiper-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
overflow: unset;
}
.item-box{
3 years ago
width: 600rpx;
height: 230rpx;
3 years ago
position: relative;
border-radius: 20rpx;
}
.slide-image {
width: 100%;
height: 100%;
z-index: 1;
border-radius: 20rpx;
}
.content-box{
3 years ago
width: 556rpx;
height: 100rpx;
3 years ago
position: absolute;
bottom: 20rpx;
left: 20rpx;
color: #0081FF;
z-index: 5;
}
3 years ago
.mask{
width: 100%;
height: 100%;
background:rgba(255,255,255,.5);
filter: blur(1px);
position: absolute;
top: 0;
left: 0;
border-radius: 12rpx;
}
3 years ago
.title-box{
font-size: 32rpx;
font-weight: 500;
3 years ago
color: #000;
3 years ago
margin-bottom: 10rpx;
3 years ago
position: absolute;
top: 10rpx;
left: 10rpx;
z-index: 99;
3 years ago
}
.content{
3 years ago
color: #000;
3 years ago
font-size: 26rpx;
3 years ago
position: absolute;
top: 56rpx;
z-index: 99;
left: 10rpx;
3 years ago
}
.content view{
margin-right: 50rpx;
}
.active {
3 years ago
// transform: scale(1.02);
width: 670rpx;
height: 256rpx;
3 years ago
transition: all 0.2s ease-in 0s;
border-radius: 20rpx;
z-index: 20;
}
.eye{
width: 24rpx;
height: 24rpx;
}
3 years ago
</style>