<template>
  <el-dialog title="查看内容" :visible.sync="dialogVisible" width="500px" @close="cancelSubmit()">
    <div v-loading="loading">
      <div>
        <el-input placeholder="请输入关键词搜索" prefix-icon="el-icon-search" v-model="search" class="mr10 w220" clearable @keyup.enter.native="getSearchList" @clear="getSearchList"></el-input>
      </div>
      <el-table :data="tableData" class="mt20">
        <el-table-column label="卡号" prop="paramOne"></el-table-column>
        <el-table-column label="卡密/券码" prop="paramTwo"></el-table-column>
        <el-table-column label="当前状态" prop="statusFlag">
          <template slot-scope="scope">{{ scope.row.statusFlag === 0 ? '未兑换' : '已兑换' }}</template>
        </el-table-column>
        <el-table-column label="用户/会员" prop="name"></el-table-column>
      </el-table>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancelSubmit()">取消</el-button>
      <el-button type="primary" @click="submitProNanme()">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
// import request from '../service/request.js';
// import api from '@/api/gift.js';
// const { virtualCardList } = api;
export default {
  data() {
    return {
      dialogVisible: false,
      loading: false,
      tableData: [
        {
          paramOne: '123',
          paramTwo: '123',
          statusFlag: 0,
          name: '测试'
        },
        {
          paramOne: '4556',
          paramTwo: '4556',
          statusFlag: 1,
          name: '测试lall'
        }
      ]
    };
  },
  mounted() {
    this.dialogVisible = true;
    this.getTableList();
  },
  methods: {
    getTableList(){
      console.log('查看内容');
      // this.loading = true;
      // let params = {
      //   id: '',
      //   key: ''
      // };
      // virtualCardList(params).then(res =>{
      //   console.log(res);
      // }).finally(() => this.loading = false);
    },
    submitProNanme() {
      this.dialogVisible = false;
      // setInterval(() => {
      this.$emit('closeUploadDetail');
      // }, 10);
    },
    // 取消修改
    cancelSubmit() {
      this.dialogVisible = false;
      // setInterval(() => {
      this.$emit('closeUploadDetail');
      // }, 10);
    }
  }
};
</script>
<style scoped></style>
