<template>
  <div id="menuScreen">
    <div class="title">今日食材</div>
    <div class="title2" style="width: 80%;color: #FFF;margin:1% auto;display: flex;justify-content: space-around;">
        <span>食材</span>
        <span>地址</span>
        <span>日期</span>
    </div>

    <div class="tables">
    <div class="gun">
      <el-table
      :cell-style="{ color: '#fff' }"
      :header-cell-style="{ color: '#fff' }"
      :data="tableData"
      style="width: 100%;height:100%;font-size: 2.5vh;">
      <el-table-column
        prop="product"
        align="center"
        label="">
      </el-table-column>
      <el-table-column
        prop="address"
        label=""
        align="center">
      </el-table-column>
      <el-table-column
        prop="billDate"
        label=""
        align="center">
      </el-table-column>
      </el-table>
    </div>
    </div>
  </div>
</template>

<script>
import {foodList} from '@/api/canteen/basic.js'
export default {
  data() {
    return{
      tableData: [],
      nowDate: ''
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      this.getNow()
      // {billDate: this.nowDate}
      foodList().then(res => {
        if (res.code === 200 ) {
          this.tableData = res.rows
        }
      })
    },
    getNow() {
      var date = new Date();
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      if (month < 10) {
          month = "0" + month;
      }
      if (day < 10) {
          day = "0" + day;
      }
      const nowDate = year + "-" + month + "-" + day;
      this.nowDate = nowDate
    }
  }
}
</script>

<style lang="scss" scoped>
#menuScreen {
  width: 100%;
  height: 100%;
  background-image: url('../../assets/images/menu_bg.jpg');
  background-repeat: no-repeat;
  background-size: cover;
}
.title {
  text-align: center;
  font-size: 8vh;
  color: #fff;
  text-shadow: 0 0 5px #fff,
  0 0 10px #fff,
  0 0 15px #fff,
  0 0 20px #00a67c,
  0 0 35px #00a67c,
  0 0 40px #00a67c,
  0 0 50px #00a67c,
  0 0 75px #00a67c;
}
.title2 {
  text-align: center;
  font-size: 3vh;
  color: #fff;
  text-shadow: 0 0 5px #fff,
  0 0 10px #fff,
  0 0 15px #fff,
  0 0 20px #00a67c,
  0 0 35px #00a67c,
  0 0 40px #00a67c,
  0 0 50px #00a67c,
  0 0 75px #00a67c;
}
.gun {
  animation: tables 12s linear infinite;
}
.tables {
  width: 80%;
  height: 680px;
  margin: 0 auto;
  overflow: hidden;
}
@keyframes tables {
        0%{
            transform:translateY(0px)
        }
        100%{
            transform: translateY(calc(-100% + 680px));
        }
    }
/*最外层透明*/
::v-deep .el-table,
::v-deep .el-table__expanded-cell {
  background-color: transparent !important;
}
/* 表格内背景颜色 */
::v-deep .el-table th,
::v-deep .el-table tr,
::v-deep .el-table td {
  background-color: transparent !important;
}
</style>