ludu-cloud/mobile-web/src/components/common/productcard.vue

128 lines
3.4 KiB
Vue
Raw Normal View History

2019-03-04 15:28:16 +08:00
<template>
2019-03-26 00:27:25 +08:00
<router-link :to="'/product/' + product.id">
<van-cell-group class="additional">
<van-card
:title="product.name"
:desc="product.sellPoint"
:num="(iscard?null:product.quantity)"
style="background:#fff"
>
<template slot="thumb">
2019-04-11 19:49:58 +08:00
<img :src="product.picUrls[0]"/>
<!-- TODO 芋艿 暂时去掉 -->
<!-- <p v-if="product.imageTag!=null&&product.imageTag!=''" class="image_tag">{{product.imageTag}}</p>-->
2019-03-26 00:27:25 +08:00
</template>
<template slot="tags">
<p class="price" v-if="product.price!=null && product.price !== ''">
2019-04-13 22:53:44 +08:00
<span>{{product.price / 100.00}}</span>
<!-- TODO 芋艿 暂时去掉 -->
<!-- <van-tag v-if="product.tags!=null" v-for="tag in product.tags" :key="tag" plain type="danger">-->
<!-- {{tag}}-->
<!-- </van-tag>-->
2019-03-26 00:27:25 +08:00
</p>
<!-- TODO 芋艿 暂时去掉 -->
<!-- <van-stepper v-if="iscard" v-model="product.quantity" :max="product.max" :min="product.min"/>-->
2019-03-26 00:27:25 +08:00
</template>
</van-card>
<!-- TODO 芋艿暂时去掉赠品 -->
<!--<van-cell v-for="(gift,j) in product.gift" :key="j" :value="'x'+gift.quantity" >-->
<!--<template slot="title">-->
<!--<van-tag type="danger" v-if="j==0" >赠品</van-tag>-->
<!--<span class="van-cell-text" :style="(j>0?'margin-left: 35px;':'')" >{{gift.title}}</span>-->
<!--</template>-->
<!--</van-cell>-->
<slot/>
</van-cell-group>
</router-link>
2019-03-04 15:28:16 +08:00
</template>
<script>
2019-03-26 00:27:25 +08:00
export default {
name: 'product-card',
props: {
product: Object,
iscard: {
type: Boolean,
default: false
},
2019-03-04 15:28:16 +08:00
}
2019-03-26 00:27:25 +08:00
}
2019-03-04 15:28:16 +08:00
</script>
<style lang="less">
2019-03-26 00:27:25 +08:00
.additional {
.van-cell {
padding: 0 15px;
font-size: 12px;
}
.van-cell:not(:last-child)::after {
border: 0;
}
.van-card__title {
font-size: 14px;
}
.van-cell__title {
flex: 10;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.van-tag {
line-height: 12px;
2019-03-04 15:28:16 +08:00
margin-right: 5px;
}
2019-03-26 00:27:25 +08:00
.price {
color: #e93b3d;
font-size: 10px;
overflow: hidden;
height: 18px;
span {
font-size: 16px;
margin-right: 5px;
}
.van-tag {
font-size: 12px;
}
}
.van-stepper {
position: absolute;
bottom: 5px;
right: 5px;
&__plus {
width: 30px;
}
&__minus {
width: 30px;
}
}
.image_tag {
position: absolute;
bottom: 0;
width: 90px;
height: 20px;
line-height: 20px;
font-size: 10px;
color: #fff;
text-align: center;
background-color: rgba(0, 0, 0, .7);
2019-03-04 15:28:16 +08:00
}
}
2019-03-26 00:27:25 +08:00
.additional::after {
border-color: #f7f7f7;
}
2019-03-04 15:28:16 +08:00
</style>