deming/components/shop/seckill/item.vue

72 lines
1.6 KiB
Vue
Raw Normal View History

2020-06-11 09:34:23 +08:00
<template>
<view class="item">
2020-07-16 17:39:06 +08:00
<image class="head" :src="item.groupbuy_image1"></image>
<text class="title u-line-2">{{ item.goods_name }}</text>
2020-06-11 09:34:23 +08:00
<view class="price">
2020-07-16 17:39:06 +08:00
<text>{{ item.groupbuy_price }}</text>
<text>{{ item.goods_price }}</text>
2020-06-11 09:34:23 +08:00
</view>
<view class="info">
2020-07-16 17:39:06 +08:00
<text>剩余{{ item.inventory | formatValue }}</text>
2020-06-11 09:34:23 +08:00
<text>立即购买</text>
</view>
</view>
</template>
<script>
export default {
2020-07-16 17:39:06 +08:00
name:"item",
props: ['item'],
filters: {
formatValue(value) {
let temp = Number(value);
if(temp > 999) temp = '999+';
return temp;
}
}
2020-06-11 09:34:23 +08:00
}
</script>
<style lang="scss" scoped>
.item{
2020-07-16 17:39:06 +08:00
width: 220rpx;
2020-06-11 09:34:23 +08:00
.head{
width: 210rpx;
height: 131rpx;
border-radius: 6rpx;
2020-07-21 21:02:28 +08:00
background-color: antiquewhite;
2020-06-11 09:34:23 +08:00
}
.title{
font-size: 26rpx;
color: #333;
margin-top: 16rpx;
}
.price{
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 19rpx;
>text:first-child{
font-size: 26rpx;
color: #FF3131;
}
>text:last-child{
font-size: 24rpx;
color: #999;
2020-07-16 17:39:06 +08:00
text-decoration: line-through;
2020-06-11 09:34:23 +08:00
}
}
.info{
display: flex;
align-items: center;
justify-content: space-between;
2020-07-16 17:39:06 +08:00
font-size: 20rpx;
2020-06-11 09:34:23 +08:00
margin-top: 19rpx;
>text:first-child{
color: #666;
}
>text:last-child{
color: #FDD360;
}
}
}
</style>