bigPic.vue 1.19 KB
<template>
    <router-link :to="{ name: 'goodsDetail', params: { productId: item.id }}" tag="li" class="component-bigpic-li">
        <img v-lazy="imgsrc"/>
        <!--卡片样式-->
        <div class="component-bigpic-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-bigpic-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, 400, 400);
            },
        },
    };
</script>