<template>
    <router-link
        :to="{
            name: 'successDetail',
            query: {
                id: info.id
            }
        }"
        class="patent"
    >
        <el-image :src="getImg(info.img)" fit="cover"></el-image>

        <div class="content">
            <div class="title">{{ info.name }}</div>
            <div class="info">
                <!-- <div class="info-item" v-if="info.patentType">
                    <span class="text1">专利类型：</span>
                    <span class="text2">{{ getLabelName(info.patentType, patentTypeOptions) }}</span>
                </div> -->
                <div class="info-item">
                    <span class="text1">成交时间：</span>
                    <span class="text2">{{ info.soldAt }}</span>
                </div>
                <div class="info-item">
                    <span class="text1">成交地点：</span>
                    <span class="text2">{{ info.soldAddress }}</span>
                </div>
                <!-- <div class="info-item"> -->
                <!-- <span class="text1">成交地点：</span> -->
                <!-- <span class="text2" v-html="info.manual"></span> -->
                <!-- </div> -->
            </div>
        </div>

        <div class="btn">
            <el-button type="primary" class="icon-button" @click.prevent="connectKefu" size="small" plain>
                <i class="iconfont iconfont-nav_icon_xiaoxi1"></i>
                咨询客服
            </el-button>
            <el-button type="primary" @click.prevent="postMessage" class="icon-button" size="small" plain>
                <i class="iconfont iconfont-nav_icon_xiaoxi"></i>提交留言
            </el-button>
        </div>

        <div class="look">
            <i class="iconfont iconfont-icon-lliulan"></i>
            <span>{{ info.view }}个人看过</span>
        </div>
    </router-link>
</template>

<script>
import comEvent from '../../mixins/comEvent';
import { patentTypeOptions } from '../../utils/variables';
export default {
    props: {
        info: {
            type: Object,
            default: () => {
                return {};
            }
        }
    },
    data() {
        return { patentTypeOptions };
    },
    mixins: [comEvent],
    created() {
        console.log(this.info);
    }
};
</script>

<style lang="less" scoped>
.patent {
    padding: 20px;
    .flex();

    .el-image {
        width: 122px;
        height: 182px;
        flex-shrink: 0;
    }
    position: relative;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom-color: @bg;

    &:hover {
        box-shadow: 0px 3px 12px 0px rgba(255, 135, 0, 0.2);
        border: 1px solid #ff8700;
    }
}

.content {
    padding: 20px 20px 55px 20px;
    flex-grow: 1;
    padding-right: 80px;
    .title {
        font-size: 16px;
        font-weight: bold;
        color: #292c33;
        line-height: 22px;
    }

    .info {
        margin-top: 20px;
        .flex();
        flex-wrap: wrap;
        .info-item {
            width: 50%;
            padding-right: 50px;
            box-sizing: border-box;
            line-height: 32px;
            .flex();

            .text1 {
                font-size: 13px;
                color: #939599;
                display: inline-block;
                min-width: 65px;
                flex-shrink: 0;
            }

            .text2 {
                font-size: 13px;
                color: #00684f;
                margin-left: 10px;
                display: inline-block;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
        }
        .text2 {
            color: #ccc;
        }
    }
}

.look {
    i {
        font-size: 18px;
        color: #c8c9cc;
        vertical-align: middle;
    }
    span {
        font-size: 13px;
        font-weight: 400;
        color: #818999;
        line-height: 18px;
        vertical-align: middle;
        margin-left: 5px;
    }
    position: absolute;
    left: 160px;
    bottom: 50px;
}
.icon-button {
    line-height: 36px;
    display: flex;
}
.icon-button + .icon-button {
    margin-left: 0;
    margin-top: 16px;
}

.edit-btn {
    .flex();
    .el-button {
        &:first-child {
            width: 88px;
        }

        &:last-child {
            width: 56px;
        }
    }
}
</style>
