
<template>
  <div class="app-container" style="padding: 0px">
    <div class="card_null" v-if="ticketList===null || ticketList.length===0" >
      <img src="../../assets/service/nodatacard.png" alt=""/>
      <p class="card_nulltit">暂无卡券</p>
    </div>
    <!--卡券 sta-->
    <div v-else>
      <el-row :gutter="16" >
        <el-col :span="6" v-for="(ticket,id) in ticketList" :key="id" class="margin-bottom16">
          <el-card class="box-card">
            <div class="ticket-title boxshadow-4 eff-bgcolor " >
              <div class=" float-left eff-icon"></div>
              <div class="ticket-name hs-hidden-nowrap hs-cursor-pointer float-left" >{{ticket.orgName}}-{{ticket.cardName}}</div>
              <div class="ticket-oper float-right">有效</div>
            </div>
            <div class="ticket-content">
              <div class="ticket-main clearfix" >
                <div class=" hs-hidden-nowrap hs-cursor-pointer float-left ticket-effmoney"  >{{ticket.fullCutValue | fen2Yuan}}</div>

                <div class="ticket-notes float-left">元 优惠券</div>
              </div>
              <div class="ticket-time">有效时间:{{ticket.endTime | string2Date(1)}}</div>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
  import {getCouponPerson} from '@/api/cardticket.js';
export default {
  data() {
    return {
      ticketList:[]
    }
  },
  methods: {
    /**查询车主个人卡券*/
    getCouponPerson:function () {
      getCouponPerson().then(response =>{
        if(response.code='8888'){
             this.ticketList=response.data;
        }
      });
    }
  },
  mounted:function () {
    this.getCouponPerson();
  }
}
</script>

<style lang="scss" scoped>
  .el-card__body{
    padding: 0;
  }
  .ticket-title{
    height: 46px;
    line-height: 46px;
    width: 100%;
  }
  .ticket-content{
    height: 98px;
    width: 100%;
  }
  .eff-bgcolor{
    background-color: rgb(64, 158, 255);
  }
  .off-bgcolor{
    background-color: #909399;
  }
  .eff-icon{
    margin:8px 8px 8px 16px;
    height: 30px;
    width: 30px;
    background-image: url("../../assets/cardticket/card_red.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  .off-icon{
    margin:8px 8px 8px 16px;
    height: 30px;
    width: 30px;
    background-image: url("../../assets/cardticket/card_gray.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  .ticket-name{
    width:120px;
    height:46px;
    font-size:14px;
    font-weight:500;
    color:rgba(255,255,255,1);
    line-height:46px;
  }
  .ticket-oper{
    font-size:12px;
    font-weight:500;
    color:rgba(255,255,255,1);
    width:42px;
    height:20px;
    line-height: 20px;
    text-align: center;
    border-radius:2px;
    margin-top: 10px;
    margin-right: 16px;
    border:1px solid rgba(255,255,255,1);
  }
  .ticket-main{
    width:100%;
    height:62px;
    .ticket-effmoney{
      font-size:44px;
      font-weight:600;
      color:rgb(64, 158, 255);
      height:62px;
      line-height:62px;
      margin-left: 16px;
      max-width: 120px;
    }
    .ticket-offmoney{
      font-size:44px;
      font-weight:600;
      color:rgba(92,92,92,1);
      height:62px;
      line-height:62px;
      margin-left: 16px;
      max-width: 120px;
    }
    .ticket-notes{
      height: 20px;
      line-height: 20px;
      font-size:14px;
      font-weight:500;
      color:rgba(64,64,64,1);
      width: 70px;
      margin-left: 10px;
      margin-top: 30px;
    }
  }
  .ticket-time{
    width:143px;
    height:20px;
    font-size:14px;
    font-weight:500;
    color:rgba(64,64,64,1);
    line-height:20px;
    margin-left: 16px;
  }
  .card_null{
    margin-top: 50px;
    text-align: center;
  }
  .card_null img{
    width: 184px;
    height: 184px;
  }
  .card_nulltit{
    font-size: 20px;
    font-weight: 400;
    height: 30px;
    line-height: 30px;
    color: rgb(144, 147, 153);
  }

</style>

