resource-tfgoods-list.vue 1.67 KB
<template>
    <resource class="no-padding-right">
        <ul class="resource-tf-goods">
            <li class="product-item" v-for="(item, index) in value.list" :key="index">
                <product-link :value="item" class="link"></product-link>
                <img-format :src="item.default_images" :w="94" :h="125"></img-format>
                <div class="ellipsis">
                    <p class="title">{{item.product_name}}</p>
                    <p class="price">¥{{item.sales_price}}</p>
                </div>
            </li>
        </ul>
    </resource>
</template>

<script>
import Resource from './resource';

export default {
    name: 'ResourceTfGoodsList',
    props: {
        value: Object
    },
    computed: {
    },
    components: {Resource}
};
</script>

<style lang="scss">
.resource-tf-goods {
    width: 100%;
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;

    li.product-item {
        position: relative;
        display: inline-block;
        padding-right: 20px;
        text-align: center;
        line-height: 40px;

        .link {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
        }

        img {
            width: 188px;
            height: 250px;
        }

        .ellipsis > p {
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            font-size: 24px;
            max-width: 188px;
            font-family: HelveticaNeue , Tahoma, Arial, HiraginoSansGB-W3, "PingFang SC", "Heiti SC";

            &.price {
                font-size: 28px;
            }
        }
    }
}
</style>