<style>
    .ActiveImg{
        background-size: cover;
        background-position: center center;
        width: 50px!important;
        height: 50px;
        border-radius: 0%;
    }
</style>
<template>
  <div class="ActiveData">
    <div class="head-title">
      <span @click="CommonJump('pintuanList')" class="blue point">拼团活动</span> / 活动数据
    </div>
    <div class="content">
      <div>
        <el-tabs v-model="msg.status" @tab-click="handleClick">
          <el-tab-pane label="全部" name="-1"></el-tab-pane>
          <el-tab-pane label="进行中" name="1"></el-tab-pane>
          <el-tab-pane label="拼团成功" name="2"></el-tab-pane>
          <el-tab-pane label="拼团失败" name="3"></el-tab-pane>
        </el-tabs>
      </div>
      <div>
        <el-form size="small" :inline="true">
          <el-form-item label="开团时间">
            <el-date-picker v-model="dateList" @change="msg.pageIndex=1,getList()" size="small" type="datetimerange"
              range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <div class="input-item">
              <el-input @keyup.enter.native="getList" size="small" class="input-with-select" placeholder="请输入搜索内容"
                v-model="msg.keyword" clearable @clear='getList'>
                <el-select v-model="msg.keyword_name" slot="prepend" placeholder="请选择">
                  <el-option :label="item.label" v-for="(item,index) in search_list" :key="index" :value="item.value">
                  </el-option>
                </el-select>
                <el-button slot="append" icon="el-icon-search" @click="getList"></el-button>
              </el-input>
            </div>
          </el-form-item>
        </el-form>
      </div>
      <div flex="dir:left cross: center" style="margin-bottom: 15px;">
        <span style="line-height: 76px;margin-right: 16px">商品信息:</span>
        <div flex="box:first" style="width:420px;border: 1px solid #ebeef5;height: 76px;padding:12px;line-height:14px">
          <div class="ActiveImg" :style="{backgroundImage:'url(' + imgUrl + ')'}"></div>
          <div style="font-size: 14px;color:#606266;margin-left:16px" flex="dir:top main:justify">
            <div style="margin-top: 4px;-webkit-line-clamp: 2;word-break: break-all;" class="vue-line-clamp">
              日本POLA宝丽黑BA限定小礼盒（黑ba水20ml +黑ba乳液15ml +黑ba面霜5g +黑ba唇颊膏2g）
            </div>
          </div>
        </div>
      </div>
      <el-table :data="tableData" v-loading="loading" border style="width: 100%;margin:20px 0">
        <el-table-column label="开团时间" width="380">
        </el-table-column>
        <el-table-column label="拼团信息" width="150">
        </el-table-column>
        <el-table-column label="团长信息">
        </el-table-column>
        <el-table-column label="活动状态" width="100">
        </el-table-column>
        <el-table-column label="操作">
          <el-tooltip class="item" effect="dark" content="编辑" placement="top">
            <img style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/edit.png" alt="">
          </el-tooltip>
        </el-table-column>
      </el-table>
      <el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
        layout="prev, pager, next" :current-page.sync="msg.pageIndex" :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
  export default {
    name: "ActiveData",
    data() {
      return {
        //日期数组
        dateList: [],
        msg: {
          pageIndex: 1,
          pageSize: 15,
          status: '-1', //状态
          date_start: '', //开始日期
          date_end: '', //结束日期
          keyword_name: '', //商品名称
          keyword: '' //关键字
        },
        search_list: [], //商品名称下拉
        tableData: [], //列表数据
        total: 0,
        loading: false,
        imgUrl:'https://cdnimg.iotweixin.com/uploads/mall1285/20200506/904171cab7db2201f6f35c0ca5bb0a93.png'
      }
    },
    created() {
      this.getList();
    },
    methods: {
      //获取数据
      getList() {
        if (this.dateList && this.dateList.length > 0) {
          this.msg.date_start = this.dateList[0];
          this.msg.date_end = this.dateList[1];
        } else {
          this.msg.date_start = '';
          this.msg.date_end = '';
        }
        // this.loading = true;
        // this.apipost("/api/GroupBuy/GetGroupbuyActivityPageList", this.msg, res => {
        //   this.loading = false;
        //   if (res.data.resultCode == 1) {
        //     this.total = res.data.data.count;
        //     let pageData = res.data.data.pageData;
        //     this.tableData = pageData;
        //   }
        // })
      },
      //切换活动状态
      handleClick(val) {
        this.msg.pageIndex = 1
        this.getList();
      },
      handleCurrentChange(val) {
        this.msg.pageIndex = val;
        this.getList();
      },
    },
  };

</script>
<style>
  .ActiveData .content {
    background: #fff;
    margin-top: 10px;
    padding: 20px;
    box-sizing: border-box;
  }

</style>
