indexCouponItem.vue 1.66 KB
<template>
    <router-link :to="{ name: 'couponCenterDetail', params: { cplId: item.id }}" tag="div" class="index-coupon-item">
        <div class="coupon-left">
            <!--优惠券类型-->
            <div class="coupon-type">
                <div class="coupon-type-left" :style="{'color':item.bgColor}">{{item.useVal}}</div>
                <div class="coupon-type-right">
                    <!--<div class="type-up">{{item.cplTypeName}}</div>-->
                    <div class="type-down">{{item.cplUnit}}</div>
                </div>
            </div>
            <!--优惠券名称-->
            <div class="coupon-name"><span :style="{'color':item.bgColor,'border-color':item.bgColor}" class="typer">{{item.cplTypeName}}</span>{{item.cplName}}
            </div>
            <!--优惠券有效期--->
            <div class="coupon-time">{{StartTime}} 至 {{EndTime}}</div>
        </div>
        <div class="coupon-right" :style="{'background':item.bgColor}">
            <div class="coupon-num">{{item.faceMoney}}</div>
            <div class="coupon-jg-type">{{siteUnitName}}</div>
            <div class="coupon-btn">立即兑换</div>
        </div>
    </router-link>
</template>
<script type="text/ecmascript-6">

    export default {
        props: {
            item: '',
            siteUnitName: ''
        },
        data() {
            return {
                popupVisible: false


            };
        },
        computed: {
            StartTime(){
                return this.item.grantStartTime.substring(0, 11);
            },
            EndTime(){
                return this.item.grantEndTime.substring(0, 11);
            }
        }
    };
</script>