<template>
    <router-link :to='{name:"shop",query:{id:info.id,breHref:breHref}}' class="goods">
        <div class="level" :style="{backgroundImage:'url('+require('../assetsPre/startLogo.png')+')'}">{{info.credit}}</div>
        <div class="goodsImg" :style="{backgroundImage:'url('+info.icon+')'}"></div>
        <div class="title">
            <div class="name">{{info.storeName}}</div>
            <div class="address">{{info.citye}}</div>
        </div>
        <div class="subtitle">
            <span>响应时间 :</span>
            <span>{{info.responseTime}}分钟</span>
        </div>
        <div class="subtitle">
            <span>返片率 :</span>
            <span>{{info.reworkRate}}%</span>
        </div>
    </router-link>
</template>

<script>

export default {
    name: 'goodsLittle',
    props: {
        info: {
            type: Object,
            default: {}
        }
    },
    data() {
        return {

        }
    },
    computed: {
        breHref() {
            var str = '首页,/index_;'
            if (this.$route.name == 'index') {

            } else if (this.$route.name == 'business') {
                str += document.title + ',' + this.$route.name + '_;'
            }
            else {
                str = document.title + ',/index_;'
            }
            return str
        }
    },
    methods: {

    }
}
</script>

<style lang="less" scoped>
.goods {
    overflow: hidden;
    padding: 32px 30px 0 0;
    position: relative;
    display: block;
    .level {
        width: 34px;
        height: 20px;
        position: absolute;
        right: 0;
        top: 4px;
        background-position: center center;
        background-size: cover;
        color: #fff;
        font-size: 12px;
        font-weight: bold;
        line-height: 20px;
        padding-right: 5px;
        text-align: right;
    }
    .goodsImg {
        width: 176px;
        height: 100px;
        border-radius: 8px;
        background-position: center center;
        background-size: cover;
        background-repeat: no-repeat;
    }

    .title {
        overflow: hidden;
        width: 176px;
        margin: 9px 0 0;
        .name {
            font-size: 14px;
            font-family: MicrosoftYaHei;
            color: rgba(51, 51, 51, 1);
            line-height: 19px;
            float: left;
            max-width: 140px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .address {
            font-size: 14px;
            font-family: MicrosoftYaHei;
            color: rgba(11, 158, 192, 1);
            line-height: 19px;
            float: right;
        }
    }

    .subtitle {
        margin-top: 8px;
        span {
            font-size: 12px;
            font-family: MicrosoftYaHei;

            line-height: 16px;
            &:first-child {
                color: #666666;
            }
            &:last-child {
                color: #fb6e08;
            }
        }
    }
}
</style>
