<template>
  <div class="buyRecords">
    <div class="head-title">
      会员购买记录
    </div>
    <div class="content">
      <el-table :data="dataList" v-loading="loading" border style="width: 100%;margin:20px 0">
        <el-table-column prop="UserName" label="会员名称">
        </el-table-column>
        <el-table-column prop="Money" label="支付金额">
        </el-table-column>
        <el-table-column prop="ExpiryDateStr" label="过期时间">
        </el-table-column>
        <el-table-column prop="GradeName" label="等级名称">
        </el-table-column>
        <el-table-column prop="PayState" label="支付状态">
          <template slot-scope="scope">
            <span v-if="scope.row.PayState==0">未支付</span>
            <span v-if="scope.row.PayState==1">已支付</span>
          </template>
        </el-table-column>
        <el-table-column prop="PayTimeStr" label="支付时间">
        </el-table-column>
      </el-table>
      <el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
        layout="prev, pager, next" :total="total">
      </el-pagination>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        loading: false,
        dataList: [],
        msg: {
          pageIndex: 1,
          pageSize: 15,
        },
        total: 0,
      };
    },
    components: {},
    created() {

    },
    methods: {
      handleCurrentChange(val) {
        this.msg.pageIndex = val;
        this.getList();
      },
      getList() {
        this.loading=true;
        this.apipost("/api/UserVip/GetVipBuyPageList", this.msg, res => {
          this.loading=false;
          if (res.data.resultCode == 1) {
            this.dataList = res.data.data.pageData;
            this.total = res.data.data.count;
          } else {
            this.Info(res.data.message);
          }
        })
      },
    },
    mounted() {
      this.getList();
    }
  };

</script>
<style>

</style>
