HTML:
<el-container v-if="view.loadOver" style="height:100%">
<!-- 商品列表 -->
<div class="pro_box">
<div v-for="item in view.awardListPage.awardList" :key="item.id" class="px_x" :title="`${item.name}(${item.model} [ ${item.unit} ] )`">
<span>兑换积分:{{ item.point }}</span>
<div class="x1">
<!-- <el-image :src="`${view.showUrl}${item.picture}`" :fit="contain" alt="" @click="event('btn_showAward', item)">
<div slot="error" class="image-slot" style="padding:100% 0;color:#ddd;font-size:16px">
<i class="el-icon-picture-outline" style="font-size:26px;"></i>
<div>暂无图片</div>
</div>
</el-image> -->
<img v-if="item.picture" :src="`${view.showUrl}${item.picture}`" alt="" @click="event('btn_showAward', item)" />
<p v-if="!item.picture" style="margin-top: 25%; font-size: 18px; color: #999">暂无图片</p>
</div>
<p>{{ item.name }} ( {{ item.model }} [ {{ item.unit }} ] )</p>
<div class="x2">编号:{{ item.no }}</div>
<div class="x3" @click="event('btn_joinAward', item)">
加入购物车
</div>
</div>
</div>
</el-container>
CSS:
<style scoped lang="scss">
.elRowPro {
background: #fafafa;
padding: 13px 10px;
border: 1px solid #ddd;
box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.1);
box-sizing: border-box;
.jifen {
padding-right: 20px;
}
}
.pro_box {
overflow: hidden;
width: 100%;
overflow-y: auto;
.px_x {
width: 23.8%;
// height: 495px;
padding-bottom: 20px;
margin-top: 20px;
background-color: #ffffff;
float: left;
margin-left: 0.5%;
margin-right: 0.5%;
box-shadow: 2px 2px 3px rgba(0, 0, 0, 0);
border: solid 1px #e8e8e8;
transition: all 0.3s linear;
}
}
.pro_box .px_x:hover {
box-shadow: -1px -1px 15px rgba(0, 0, 0, 0.2);
}
.pro_box .px_x {
&:hover {
.x1 img {
transform: scale(1.1);
}
}
}
.pro_box .px_x span {
width: 100px;
padding: 5px 5px;
display: block;
background-color: #ff6700;
color: #fff;
text-align: center;
overflow: hidden;
margin: 0 auto;
font-size: 12px;
}
.pro_box .px_x .x1 {
// width: 70%;
// height: 70%;
width: 90%;
// min-height: 70%;
margin: 0 auto;
margin-top: 30px;
height: 200px;
overflow: hidden;
text-align: center;
}
.pro_box .px_x .x1 img {
display: block;
width: 100%;
height: 100%;
transition: all 0.4s linear;
object-fit: contain;
}
.pro_box .px_x p {
width: 80%;
margin: 0 auto;
font-size: 14px;
color: #333;
text-align: center;
line-height: 24px;
height: 48px;
overflow: hidden;
margin-top: 20px;
}
.pro_box .px_x .x2 {
font-size: 12px;
color: #b0b0b0;
text-align: center;
}
.pro_box .px_x .x3 {
width: 80px;
padding: 2px 8px;
border: solid 1px #ff6700;
margin: auto;
margin-top: 15px;
color: #ff6700;
text-align: center;
font-size: 12px;
cursor: pointer;
transition: all 0.3s linear;
}
.pro_box .px_x .x3:hover {
background-color: #ff6700;
color: #fff;
}
</style>