csharp
复制代码
<view class="item-bottom">
<template v-for="(it, index) in item.train" >
<image class="item-img-box" @click="preImg(item.train, index)" :key="index" v-show="index < 4" :src="it.fileDomain + it.filePath"></image>
</template>
<view v-if="item.train.length > 4" class="item-img-num" >
<view>
+{{ item.train.length - 4 }}
</view>
</view>
</view>
scss
复制代码
.item-bottom {
border-radius: 8rpx;
display: flex;
position: relative;
&> .item-img-box:last-child {
margin-right: unset;
}
.item-img-box {
margin-right: 20rpx;
width: 154rpx;
height: 154rpx;
border-radius: 6rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.item-img-num {
position: absolute;
border-radius: 6rpx;
overflow: hidden;
right: 6rpx;
width: 154rpx;
height: 154rpx;
text-align: center;
line-height: 154rpx;
background-color: rgba(0,0,0,0.44);
color: rgba(255,255,255,1);
}
}