2020-06-11 09:34:23 +08:00
|
|
|
<template>
|
2020-07-22 18:51:48 +08:00
|
|
|
<view class="item" @click="spikeGoods">
|
2020-08-07 19:56:47 +08:00
|
|
|
<image class="head" :src="item.groupbuy_image1" mode="aspectFill"></image>
|
2020-07-16 17:39:06 +08:00
|
|
|
<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>
|
2020-07-22 18:51:48 +08:00
|
|
|
<text class="origin">¥{{ item.goods_price }}</text>
|
2020-06-11 09:34:23 +08:00
|
|
|
</view>
|
2020-08-07 19:56:47 +08:00
|
|
|
<view class="info" v-if="0">
|
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-07-22 18:51:48 +08:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
spikeGoods() {
|
|
|
|
// console.log(this.item.groupbuy_id);
|
2020-07-24 19:48:57 +08:00
|
|
|
// this.$u.api.getSpikeInfo({
|
|
|
|
// groupbuy_id: this.item.groupbuy_id
|
|
|
|
// }).then(res => {
|
|
|
|
// if(res.errCode == 0) {
|
|
|
|
// const goods = {
|
|
|
|
// goods: res.data.goodsInfo,
|
|
|
|
// type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
|
|
|
// }
|
|
|
|
// this.$store.commit('setGoodsDetails', goods);
|
|
|
|
// this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
|
|
|
// this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
|
|
|
// this.$u.route({
|
|
|
|
// url: 'pageB/sdetails/index',
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
this.$u.route({
|
|
|
|
url: 'pageB/sdetails/index',
|
|
|
|
params: {
|
2020-08-07 17:34:59 +08:00
|
|
|
// id: this.item.groupbuy_id,
|
|
|
|
id: this.item.goods_id,
|
|
|
|
// type: 3,
|
2020-07-22 18:51:48 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
2020-07-16 17:39:06 +08:00
|
|
|
}
|
2020-06-11 09:34:23 +08:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.item{
|
2020-08-07 19:56:47 +08:00
|
|
|
width: 30%;
|
|
|
|
margin-right: 50rpx;
|
2020-06-11 09:34:23 +08:00
|
|
|
.head{
|
2020-08-07 19:56:47 +08:00
|
|
|
width: 100%;
|
|
|
|
height: 210rpx;
|
2020-06-11 09:34:23 +08:00
|
|
|
border-radius: 6rpx;
|
2020-07-21 21:02:28 +08:00
|
|
|
background-color: antiquewhite;
|
2020-06-11 09:34:23 +08:00
|
|
|
}
|
|
|
|
.title{
|
2020-08-07 19:56:47 +08:00
|
|
|
width: 200rpx;
|
|
|
|
height: 30rpx;
|
|
|
|
margin-top: 6rpx;
|
2020-06-11 09:34:23 +08:00
|
|
|
font-size: 26rpx;
|
2020-08-07 19:56:47 +08:00
|
|
|
line-height: 30rpx;
|
2020-06-11 09:34:23 +08:00
|
|
|
color: #333;
|
2020-08-07 19:56:47 +08:00
|
|
|
-webkit-line-clamp: 1 !important;
|
2020-06-11 09:34:23 +08:00
|
|
|
}
|
|
|
|
.price{
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
2020-08-07 19:56:47 +08:00
|
|
|
margin-top: 10rpx;
|
2020-06-11 09:34:23 +08:00
|
|
|
>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-08-07 19:56:47 +08:00
|
|
|
margin-top: 10rpx;
|
2020-06-11 09:34:23 +08:00
|
|
|
>text:first-child{
|
|
|
|
color: #666;
|
|
|
|
}
|
|
|
|
>text:last-child{
|
|
|
|
color: #FDD360;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|