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.

158 lines
3.2 KiB

3 years ago
<template>
<view class="shop-list-box">
<view class="shop-item" v-for="(item,index) in list" :key="index" @tap="clickItem(item,index)">
<view class="item-l">
<view class="shop-info">
<image :src="item.titleImg"></image>
<view class="info-box">
<view class="name">{{item.goodsTitle}}</view>
<view class="surplus">剩余<text class="colR">{{item.endNum}}</text></view>
<view class="tag">
<image class="jifen" src="../../static/img/home/jifen.png"></image>
<text>返还{{item.memberMoney*100}}积分</text>
</view>
</view>
</view>
<view class="location">
<view class="address">虎泉</view>
<view class="">距离{{item.distance}}</view>
</view>
</view>
<view class="item-r">
<image src="@/static/img/home/mt.png" v-if="item.classify == 1"></image>
<image src="@/static/img/home/elm.png" v-if="item.classify == 2"></image>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'shopList',
props: {
list: {
type: Array,
default () {
return [];
}
},
},
data(){
return {}
},
methods:{
clickItem(item, index) {
this.$emit('click', {
item: item,
index: index,
});
}
}
}
</script>
<style lang="scss">
.shop-list-box{
width: 686rpx;
margin: 32rpx auto;
.shop-item{
width: 100%;
height: 200rpx;
margin-bottom: 20rpx;
position: relative;
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.16);
.item-l{
width: 638rpx;
height: 100%;
border-radius: 12rpx;
overflow: hidden;
background: #fff;
padding: 24rpx;
display: flex;
justify-content: space-between;
position: absolute;
left: 0;
z-index: 3;
.shop-info{
width: 450rpx;
display: flex;
image{
width: 152rpx;
height: 152rpx;
margin-right: 18rpx;
border-radius: 8rpx;
}
.info-box{
width: calc(100% - 162rpx);
color: #000;
display: flex;
flex-direction: column;
justify-content: space-around;
.name{
width: 100%;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
font-size: 36rpx;
font-weight: 600;
}
.surplus{
font-size: 28rpx;
.colR{
color: #FF0000;
}
}
.tag{
width: 164rpx;
height: 36rpx;
text-align: center;
line-height: 36rpx;
font-size: 20rpx;
background: #F8E3DF;
border: 2rpx solid #FF6A6A;
border-radius: 4rpx;
color: #FF4848;
display: flex;
align-items: center;
.jifen{
width: 22rpx;
height: 20rpx;
margin: 0 8rpx;
}
}
}
}
.location{
font-size: 20rpx;
color: #686868;
display: flex;
flex-direction: column;
align-items: flex-end;
padding-top: 8rpx;
.address{
width: 60rpx;
height: 32rpx;
background: #FF4848;
line-height: 32rpx;
text-align: center;
border-radius: 4rpx;
color: #fff;
margin-bottom: 16rpx;
}
}
}
.item-r{
width: 76rpx;
height: 200rpx;
position: absolute;
right: 0;
z-index: 1;
image{
width: 100%;
height: 100%;
}
}
}
}
</style>