<template>
  <div class="app-container">
    <!-- 搜索区域 -->
    <div class="filter-container">
      <div class="filter-control">
        <span>供应商名称:</span>
        <el-input v-model="listQuery.shopName" placeholder="供应商名称" @keyup.enter.native="getList" />
      </div>
      <div class="filter-control">
        <span>供应商类型:</span>
        <el-select v-model="listQuery.shopType" placeholder="供应商类型" clearable @change="getList">
          <el-option label="所有类型" value="" />
          <el-option label="代理商" :value="2" />
          <el-option label="品牌方" :value="1" />
        </el-select>
      </div>
      <div class="filter-control">
        <span>手机号:</span>
        <el-input v-model="listQuery.mobile" placeholder="手机号" @keyup.enter.native="getList" />
      </div>
      <div class="filter-control">
        <span>联系人:</span>
        <el-input v-model="listQuery.limkMan" placeholder="联系人" @keyup.enter.native="getList" />
      </div>
      <div class="filter-control">
        <span>会员状态:</span>
        <el-input v-model="listQuery.state" placeholder="会员状态" @keyup.enter.native="getList" />
      </div>
      <div class="filter-control">
        <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
        <el-button type="primary" @click="$_navigationTo('/member/handsel')">赠送会员</el-button>
      </div>
    </div>
    <!-- 搜索区域END -->
    <el-table
      v-loading="listLoading"
      :data="list"
      style="width: 100%"
      border
      fit
      highlight-current-row
      header-row-class-name="tableHeader"
      class="table-cell"
    >
      <el-table-column :index="indexMethod" label="序号" type="index" width="80" align="center" />
      <el-table-column prop="shopName" label="供应商名称" align="center" />
      <el-table-column label="供应商类型" align="center">
        <template slot-scope="{ row }">
          <span v-if="row.shopType === 1">品牌方</span>
          <span v-else>代理商</span>
        </template>
      </el-table-column>
      <el-table-column prop="account" label="登录账号" align="center" />
      <el-table-column prop="mobile" label="手机号" align="center" />
      <el-table-column prop="limkMan" label="联系人" align="center" />
      <el-table-column label="会员状态" align="center">
        <template slot-scope="{ row }">
          <span v-if="row.state === 1" class="status success">生效中</span>
          <span v-else class="status danger">已过期</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center">
        <template>
          <el-button type="primary" size="mini" @click="$_navigationTo('/member/record')">购买记录</el-button>
          <el-button type="primary" size="mini" @click="$_navigationTo('/member/service')">配置定制化服务</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      listLoading: false,
      listQuery: {
        shopName: '',
        shopType: '',
        mobile: '',
        state: '',
        limkMan: '',
        pageNum: 1,
        pageSize: 10
      },
      list: [
        {
          shopName: '火影大战葫芦娃',
          shopType: 1,
          account: 'admin',
          mobile: '15872950940',
          limkMan: '还差的远呢',
          state: 1
        }
      ]
    }
  },
  methods: {
    indexMethod(index) {
      return index + this.listQuery.pageSize * (this.listQuery.pageNum - 1) + 1
    },
    getList() {}
  }
}
</script>

<style scoped lang="scss">

</style>
