smallPic.vue
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<template>
<router-link :to="{ name: 'goodsDetail', params: { productId: item.id }}" tag="li" class="component-smallpic-li">
<img v-lazy="imgsrc"/>
<!--卡片样式-->
<div class="component-smallpic-txt" v-if="showType!=2">
<p class="goods-name" v-show="showTitle==1">{{item.title}}</p>
<p class="goods-Price" v-show="isShowPrice==1">{{item.price}}{{siteUnitName}}</p>
</div>
<!--极简样式-->
<div class="component-smallpic-Minitxt" v-else>
<p class="goods-name" v-show="showTitle==1">{{item.title}}</p>
<p class="goods-Price" v-show="isShowPrice==1">{{item.price}}{{siteUnitName}}</p>
</div>
</router-link>
</template>
<script>
import Lazyload from 'mint-ui';
import {formatImg} from '../../utils/commonUtil';
export default {
props: {
item: '',
showType: '',
showTitle: '',
isShowPrice: '',
siteUnitName: ''
},
data() {
return {};
},
computed: {
imgsrc(){
return formatImg.formatSRC(this.item.image, 200, 200);
},
},
};
</script>