<template>
  <div id="userAudit">
    <el-row>
      <el-col :span="24" class="topTabs">
        <el-tabs v-model="activeNameTop" type="card" @tab-click="handleClicks">
          <el-tab-pane label="我的需求" name="first">
            <el-col :span="24" class="first">
              <el-tabs v-model="activeNameFirst" @tab-click="handleClickFirst">
                <el-tab-pane label="已经审核信息" name="first">
                  <el-col :span="24" class="list" v-for="(item, index) in alreadyList" :key="index">
                    <el-col :span="20" class="name"> 信息号：123 </el-col>
                    <el-col :span="4" class="date">{{
                      item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || ''
                    }}</el-col>
                    <el-col :span="9" class="left">
                      <el-col :span="8" style="margin:0 10px 0 0;">
                        <el-image style="width:110px;height:110px;" :src="item.url"></el-image>
                      </el-col>
                      <el-col :span="15" class="leftInfo">
                        <p>{{ item.name }}</p>
                        <p>类别：{{ item.totaltype === 0 ? '技术' : item.totaltype === 1 ? '产品' : '服务' }}</p>
                        <p style="color:red;">¥{{ item.price }}{{ item.priceunit }}</p>
                      </el-col>
                    </el-col>
                    <el-col :span="11" class="left center">
                      <span>最新申请：</span>
                      <p>申请内容</p>
                    </el-col>
                    <el-col :span="4" class="left right">
                      <el-link :underline="false" @click="handleDelete(item)">徹底刪除</el-link><br />
                      <el-link :underline="false" @click="handleDelete(item)">查看详情</el-link>
                    </el-col>
                  </el-col>
                  <el-col :span="24" class="page">
                    <el-pagination
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page="currentPage1"
                      layout="total, prev, pager, next, jumper"
                      :total="alreadyListTotal"
                    >
                    </el-pagination>
                  </el-col>
                </el-tab-pane>
                <el-tab-pane label="审核中信息" name="second">
                  <el-col :span="24" class="list" v-for="(item, index) in notList" :key="index">
                    <el-col :span="20" class="name"> 信息号：123 </el-col>
                    <el-col :span="4" class="date">{{
                      item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || ''
                    }}</el-col>
                    <el-col :span="9" class="left">
                      <el-col :span="8" style="margin:0 10px 0 0;">
                        <el-image style="width:110px;height:110px;" :src="item.url"></el-image>
                      </el-col>
                      <el-col :span="15" class="leftInfo">
                        <p>{{ item.name }}</p>
                        <p>类别：{{ item.totaltype === 0 ? '技术' : item.totaltype === 1 ? '产品' : '服务' }}</p>
                        <p style="color:red;">¥{{ item.price }}{{ item.priceunit }}</p>
                      </el-col>
                    </el-col>
                    <el-col :span="11" class="left center">
                      <span>最新申请：</span>
                      <p>申请内容</p>
                    </el-col>
                    <el-col :span="4" class="left right">
                      <el-link :underline="false" @click="handleDelete(item)">徹底刪除</el-link>
                    </el-col>
                  </el-col>
                  <el-col :span="24" class="page">
                    <el-pagination
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page="currentPage2"
                      layout="total, prev, pager, next, jumper"
                      :total="notListTotal"
                    >
                    </el-pagination>
                  </el-col>
                </el-tab-pane>
                <el-tab-pane label="审核完成信息" name="third">
                  <el-col :span="24" class="list" v-for="(item, index) in JiaoyiList" :key="index">
                    <el-col :span="20" class="name"> 信息号：123 </el-col>
                    <el-col :span="4" class="date">{{
                      item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || ''
                    }}</el-col>
                    <el-col :span="9" class="left">
                      <el-col :span="8" style="margin:0 10px 0 0;">
                        <el-image style="width:110px;height:110px;" :src="item.url"></el-image>
                      </el-col>
                      <el-col :span="15" class="leftInfo">
                        <p>{{ item.name }}</p>
                        <p>类别：{{ item.totaltype === 0 ? '技术' : item.totaltype === 1 ? '产品' : '服务' }}</p>
                        <p style="color:red;">¥{{ item.price }}{{ item.priceunit }}</p>
                      </el-col>
                    </el-col>
                    <el-col :span="11" class="left center">
                      <span>最新申请：</span>
                      <p>申请内容</p>
                    </el-col>
                    <el-col :span="4" class="left right">
                      <el-link :underline="false" @click="handleDelete(item)">徹底刪除</el-link>
                    </el-col>
                  </el-col>
                  <el-col :span="24" class="page">
                    <el-pagination
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page="currentPage3"
                      layout="total, prev, pager, next, jumper"
                      :total="JiaoyiTotal"
                    >
                    </el-pagination>
                  </el-col>
                </el-tab-pane>
              </el-tabs>
            </el-col>
          </el-tab-pane>
          <el-tab-pane label="我的供给" name="second">
            <el-col :span="24" class="first">
              <el-tabs v-model="activeNameSecond" @tab-click="handleClickSecond">
                <el-tab-pane label="已经审核信息" name="first">
                  <el-col :span="24" class="list" v-for="(item, index) in alreadyTwoList" :key="index">
                    <el-col :span="20" class="name"> 信息号：123 </el-col>
                    <el-col :span="4" class="date">{{
                      item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || ''
                    }}</el-col>
                    <el-col :span="9" class="left">
                      <el-col :span="8" style="margin:0 10px 0 0;">
                        <el-image style="width:110px;height:110px;" :src="item.url"></el-image>
                      </el-col>
                      <el-col :span="15" class="leftInfo">
                        <p>{{ item.name }}</p>
                        <p>类别：{{ item.totaltype === 0 ? '技术' : item.totaltype === 1 ? '产品' : '服务' }}</p>
                        <p style="color:red;">¥{{ item.price }}{{ item.priceunit }}</p>
                      </el-col>
                    </el-col>
                    <el-col :span="11" class="left center">
                      <span>最新申请：</span>
                      <p>申请内容</p>
                    </el-col>
                    <el-col :span="4" class="left right">
                      <el-link :underline="false" @click="handleDelete(item)">徹底刪除</el-link><br />
                      <el-link :underline="false">查看详情</el-link>
                    </el-col>
                  </el-col>
                  <el-col :span="24" class="page">
                    <el-pagination
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page="currentPage4"
                      layout="total, prev, pager, next, jumper"
                      :total="alreadyTwoListTotal"
                    >
                    </el-pagination>
                  </el-col>
                </el-tab-pane>
                <el-tab-pane label="审核中信息" name="second">
                  <el-col :span="24" class="list" v-for="(item, index) in notTwoList" :key="index">
                    <el-col :span="20" class="name"> 信息号：123 </el-col>
                    <el-col :span="4" class="date">{{
                      item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || ''
                    }}</el-col>
                    <el-col :span="9" class="left">
                      <el-col :span="8" style="margin:0 10px 0 0;">
                        <el-image style="width:110px;height:110px;" :src="item.url"></el-image>
                      </el-col>
                      <el-col :span="15" class="leftInfo">
                        <p>{{ item.name }}</p>
                        <p>类别：{{ item.totaltype === 0 ? '技术' : item.totaltype === 1 ? '产品' : '服务' }}</p>
                        <p style="color:red;">¥{{ item.price }}{{ item.priceunit }}</p>
                      </el-col>
                    </el-col>
                    <el-col :span="11" class="left center">
                      <span>最新申请：</span>
                      <p>申请内容</p>
                    </el-col>
                    <el-col :span="4" class="left right">
                      <el-link :underline="false" @click="handleDelete(item)">徹底刪除</el-link>
                    </el-col>
                  </el-col>
                  <el-col :span="24" class="page">
                    <el-pagination
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page="currentPage5"
                      layout="total, prev, pager, next, jumper"
                      :total="notTwoListTotal"
                    >
                    </el-pagination>
                  </el-col>
                </el-tab-pane>
                <el-tab-pane label="审核完成信息" name="third">
                  <el-col :span="24" class="list" v-for="(item, index) in JiaoyiTwoList" :key="index">
                    <el-col :span="20" class="name"> 信息号：123 </el-col>
                    <el-col :span="4" class="date">{{
                      item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || ''
                    }}</el-col>
                    <el-col :span="9" class="left">
                      <el-col :span="8" style="margin:0 10px 0 0;">
                        <el-image style="width:110px;height:110px;" :src="item.url"></el-image>
                      </el-col>
                      <el-col :span="15" class="leftInfo">
                        <p>{{ item.name }}</p>
                        <p>类别：{{ item.totaltype === 0 ? '技术' : item.totaltype === 1 ? '产品' : '服务' }}</p>
                        <p style="color:red;">¥{{ item.price }}{{ item.priceunit }}</p>
                      </el-col>
                    </el-col>
                    <el-col :span="11" class="left center">
                      <span>最新申请：</span>
                      <p>申请内容</p>
                    </el-col>
                    <el-col :span="4" class="left right">
                      <el-link :underline="false" @click="handleDelete(item)">徹底刪除</el-link>
                    </el-col>
                  </el-col>
                  <el-col :span="24" class="page">
                    <el-pagination
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page="currentPage6"
                      layout="total, prev, pager, next, jumper"
                      :total="JiaoyiTwoListTotal"
                    >
                    </el-pagination>
                  </el-col>
                </el-tab-pane>
              </el-tabs>
            </el-col>
          </el-tab-pane>
        </el-tabs>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'userAudit',
  props: {
    // 我的需求
    alreadyList: null,
    alreadyListTotal: null,
    notList: null,
    notListTotal: null,
    JiaoyiList: null,
    JiaoyiTotal: null,
    // 我的供给
    alreadyTwoList: null,
    alreadyTwoListTotal: null,
    notTwoList: null,
    notTwoListTotal: null,
    JiaoyiTwoList: null,
    JiaoyiTwoListTotal: null,
  },
  components: {},
  data: () => ({
    activeNameTop: 'first',
    activeNameFirst: 'first',
    activeNameSecond: 'first',
    currentPage1: 1,
    currentPage2: 1,
    currentPage3: 1,
    currentPage4: 1,
    currentPage5: 1,
    currentPage6: 1,
  }),
  created() {},
  computed: {},
  methods: {
    handleClicks(tab, event) {
      console.log(tab, event);
    },
    handleClickFirst(tab, event) {
      console.log(tab, event);
    },
    handleClickSecond(tab, event) {
      console.log(tab, event);
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    handleDelete(item) {
      this.$emit('deletes', { item });
    },
  },
};
</script>

<style lang="less" scoped>
// /deep/.el-tabs__header {
//   margin: 0;
// }
p {
  padding: 0;
  margin: 0;
}
.first {
  padding: 0 20px;
}
.page {
  height: 30px;
  text-align: center;
}
.list {
  height: 190px;
  overflow: hidden;
  margin: 0 0 15px 0;
  border: 1px solid #ccc;
}
.list .name {
  height: 40px;
  line-height: 40px;
  background: #fafafa;
  color: #888;
  padding: 0 10px;
  font-size: 14px;
}
.list .date {
  height: 40px;
  line-height: 40px;
  background: #fafafa;
  color: #888;
  font-size: 14px;
}
.list .left {
  border-right: 2px solid #ccc;
  height: 110px;
  margin: 19px 0;
}
.list .left .leftInfo p {
  font-size: 14px;
  margin: 10px 0;
}
.list .center {
  padding: 0 10px;
  font-size: 14px;
}
.list .center span {
  color: #215299;
}
.list .right {
  border-right: none;
  text-align: center;
  padding: 30px 0;
}
</style>
