<template>
  <div v-loading="loading">
    <div class="white-box">
      <el-table class="withdraw-table" :data="tableData" style="width: 100%;">
        <el-table-column label="Member Code" prop="USER_NAME"></el-table-column><!--BA会员编号-->
        <el-table-column label="Member Name" prop="REAL_NAME"></el-table-column><!--BA会员名字-->
        <el-table-column label="Joining Period" prop="PERIOD_AT"></el-table-column><!--加入期数-->
        <el-table-column label="Whether Upgrade" prop="WHETHER_UPGRADE">
          <template slot-scope="scope">
            <el-tag :type="scope.row.WHETHER_UPGRADE == 1 ? 'primary' : 'info'" >{{ scope.row.WHETHER_UPGRADE == 1 ? 'YES' : 'NO' }}</el-tag>
          </template>
        </el-table-column><!--是否已转正-->
      </el-table>
    </div>
  </div>
</template>

<script>
import network from '@/utils/network'

export default {
  name: 'brand-ambassador-list',
  mounted () {
    this.getData();
  },
  data () {
    return {
      tableData: [],
      loading: false,
    }
  },
  methods: {
    getData () {
      let _this = this;
      _this.loading = true;
      network.getData('atlas/brand-ambassador-list').then(response => {
        _this.tableData = response;
        _this.loading = false;
      }).catch(() => {
        _this.loading = false;
      });
    },
  }
}

</script>

<style scoped>
  .white-box a {
    color: #606266;
  }
</style>
