 
<template>
  <div>
    <div class="heior_box">
      {{couponName}}
      <div class="search-box"></div>
    </div>
    <el-table :data="retData.Data" row-key="Id" border size="medium" :height="$getHeight(100)">
      <el-table-column prop="CreateTime" label="创建日期" width="180"></el-table-column>
      <el-table-column prop="OrderNo" label="订单号" width="215"></el-table-column>     
      <el-table-column prop="UserName" label="用户" width="120"></el-table-column>
      <el-table-column prop="ProductName" label="产品"></el-table-column>
      <el-table-column prop="PackageName" label="套餐"></el-table-column>
      <el-table-column prop="Accounts" label="账号">
        <template slot-scope="scope">
          <cutTip :text="scope.row.Accounts"></cutTip>
        </template>
      </el-table-column>
      <el-table-column prop="OrderAmount" label="订单金额"></el-table-column>
      <el-table-column prop="CouponAmount" label="优惠金额"></el-table-column>     
      <!-- <el-table-column label="操作" width="140px">
        <template slot-scope="scope">
          <span class="handel cursor edit" @click="Free(scope.row)">冻结</span>         
        </template>
      </el-table-column> -->
    </el-table>
    <div class="block">
      <el-pagination
        v-if="retData.Data.length>0"
        @current-change="get"
        :current-page.sync="searchModel.PageIndex"
        :page-size="50"
        layout="total,prev, pager, next"
        :total="retData.TotalCount"
      ></el-pagination>
    </div>
  </div>
</template>
<script>
var that = null;
export default {
  components: {},
  data() {
    return {     
      retData: { TotalCount: 0, Data: [] },
      couponName:'',
      searchModel: {
        PageIndex: 1,
        keyWord: "",
        CouponId: 0
      }
    }
  },
  created() {
    this.$store.commit("setCurrentNav", "优惠券明细");
    var couponId=this.$route.query.couponId;
    this.couponName=this.$route.query.couponName;
    this.get(couponId);
  },
  methods: {
    get(couponId) {
      if (Number.isInteger(couponId)) {
        this.searchModel.CouponId = couponId;
      }
      this.$api
        .get("course/v1/order/CouponOrders", this.searchModel)
        .then(res => {
          this.retData = res;
        });
    }
  }
};
</script>

<style scoped>
.xeBtnDefault {
  outline: medium;
  color: #666;
  background: #fafbfc;
  border: 1px solid #e5e7eb;
}

.btnMid {
  display: inline-block;
  width: 90px;
  height: 36px;
  padding: 0;
  text-align: center;
  line-height: 36px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
}
.el-radio {
  padding: 5px 0;
}
</style>
