<template>
    <view class="goods-coupon-section">
        <view class="section">
            <view class="label">优惠券：</view>
            <view class="coupon-tags">
                <template v-for="(item, index) in couponList">
                    <view class="tag" v-text="item.name" v-if="index < 2" :key="item.id"></view>
                </template>
                <text class="ellipsis" v-if="couponList.length > 2">...</text>
            </view>
            <view class="iconfont icon-chakangengduo more"></view>
        </view>
    </view>
</template>

<script>
export default {
    name:'goods-coupon-section',
    data() {
        return {
            couponList: [
                {
                    id: 1,
                    name: '满300减60'
                },
                {
                    id: 2,
                    name: '满300减60'
                },
                {
                    id: 3,
                    name: '满300减60'
                }
            ]
        }
    }
}
</script>

<style lang="scss" scoped>
.goods-coupon-section {
    padding: 24rpx;
    background-color: #fff;
    .section {
        @extend .cm-flex-between;
        font-size: 24rpx;

        .label {
            color: #666;
        }

        .coupon-tags {
            flex: 1;
            text-align: right;
            margin-right: 24rpx;
            .tag {
                display: inline-block;
                height: 30rpx;
                padding: 0 8rpx;
                margin-right: 8rpx;
                background: #fff3f7;
                border: 1rpx solid #ff457b;
                border-radius: 4rpx;
                color: #ff457b;
                font-size: 22rpx;

                &::before {
                    content: '券 |';
                    margin: 0 6rpx;
                }

                &:first-child {
                    margin-left: 0;
                }
            }

            .ellipsis {
                font-size: 24rpx;
                color: #ff457b;
            }
        }
        .more {
            font-size: 24rpx;
            color: #ff457b;
        }
    }
}
</style>
