<template>
    <div class="goods" @click="goDetail">
        <div class="goodsImg" :style="{backgroundImage:'url('+goodsInfo.houseImages[0].imageUrl+')'}"></div>
        <div class="title">{{goodsInfo.title}}</div>
        <div class="money">{{goodsInfo.price}}元/月</div>
    </div>
</template>
<script>
import { mapState } from "vuex";
export default {
    name: 'MiniGoodsItem',
    props:['goodsInfo'],
    data() {
        return {
            city: '上海市'
        }
    },
    created() {


    },
    computed: {
        ...mapState(["locationInfo"])
    },
    methods: {
 goDetail() {

            this.$router.push({
                name: 'houseDetail',
                query: {
                    id: this.goodsInfo.id
                },
                params: {
                    isNext: 1
                }
            })
        }
    }
}
</script>
<style lang="less" scoped>
.goods {
    width: 4.2rem;
    display: flex;
    flex-direction: column;
    flex-direction: column;
    min-width: 4.2rem;
    padding:0 0.1rem;

    .title {
        font-size: 0.28rem;
        color: rgba(0, 0, 0, 1);
        line-height: 0.4rem;
        margin-top: 0.2rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
.goodsImg {
    background-image: url(https://ke-image.ljcdn.com/rent-house-1/92b7541638b3b9d384be099eab31711c-1528275019493/7f8610df30329b36632edffbd1540f23.jpg.750x585.jpg);
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    width: 4rem;
    height: 3rem;
    border-radius: 0.08rem;
}

.money {
    font-size: 0.28rem;
    font-weight: bold;
    color: rgba(0, 0, 0, 1);
    line-height: 0.4rem;
    margin-top: 0.08rem;
}
</style>


