couponItem.vue 2.29 KB
Newer Older
潘琦 committed
1 2 3 4 5
<template>
  <div class="coupon-item">
    <img src="../assets/images/coupon-item-bg.png" class="bg"/>
    <div class="coupon-content">
      <div class="coupon-table">
6 7 8 9 10 11
        <div class="cell info" v-if="data.voucherType === 2">
          <div class="price">免费<span class="unit">价值{{data.cost}}</span></div>
          <div class="title">{{data.name}}</div>
          <small class="des">{{data.labelId === 1 || data.labelId === 3 ? '孕产妇检券':data.labelId === 2 ? '儿童健康体检券': ''}}</small>
        </div>
        <div class="cell info" v-else>
潘琦 committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
          <div class="title">{{data.name}}</div>
          <div class="price">{{data.cost}}<span class="unit"></span></div>
          <small class="des">{{data.labelId === 1 || data.labelId === 3 ? '孕产妇检券':data.labelId === 2 ? '儿童健康体检券': ''}}</small>
        </div>
        <div class="cell btn"></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'couponItem',
  data () {
    return {
    }
  },
  props: ['data'],
  created () {
  },
  mounted: function () {
  },
  computed: {
  },
  methods: {
  }
}
</script>

<style scoped>
  .coupon-item {
    position:relative;
    padding: 0.5em 1em 0 1em;
  }

  .coupon-item > .bg  {
    width: 100%;
  }

  .coupon-item > .coupon-content {
    position:absolute;
    left:1em;
54
    top:0;
潘琦 committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
    bottom:0;
    right:1em;
  }

  .coupon-item > .coupon-content > .coupon-table{
    display:table;
    width:100%;
    height:100%;
  }
  .coupon-item > .coupon-content > .coupon-table > .cell {
    display:table-cell;
    vertical-align:middle;
  }
  .coupon-item > .coupon-content > .coupon-table > .info{
    padding-left: 2.5em;
    width: 77%;
  }
  .coupon-item > .coupon-content > .coupon-table > .info .title{
    font-size: 1.1em;
    color:#9B7F53;
    width:12em;
    text-overflow:ellipsis;
    white-space:nowrap;
    overflow:hidden;
  }
  .coupon-item > .coupon-content > .coupon-table > .info .price {
81
    font-size: 1.8em;
潘琦 committed
82 83 84 85 86 87 88
    color:#E9462B;
    margin:0.1em 0;
    font-weight:bold;
  }
  .coupon-item > .coupon-content > .coupon-table > .info .price > .unit {
    font-size: 50%;
    font-weight:normal;
89
    margin-left: 10px;
潘琦 committed
90 91 92 93 94 95
  }
  .coupon-item > .coupon-content > .coupon-table > .info .des{
    font-size: 0.8em;
    color:#9B7F53;
  }
</style>