<template>
  <div class="search-group">
    <Select class="sel" v-model="registerStatus">
      <Option v-for="item in getUseStatus"
              :value="item.value"
              :key="item.value">{{ item.label }}</Option>
    </Select>
    <Input class="ipt" v-model.trim="phone"
           placeholder="请输入手机号搜索"
           :maxlength="11" clearable/>
    <Button type="primary"
            style='margin-right:20px'
            @click='searchList(false)'>搜索</Button>
    <Button @click='searchList(true)'>重置</Button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      registerStatus: -1,
      phone: '',
      getUseStatus: [
        {
          value: -1,
          label: '全部'
        },
        {
          value: 0,
          label: '未邀请'
        },
        {
          value: 1,
          label: '已邀请'
        },
        {
          value: 2,
          label: '未注册'
        },
        {
          value: 3,
          label: '已注册'
        }
      ]
    }
  },
  methods: {
    searchList(fresh) {
      this.registerStatus = fresh ? -1 : this.registerStatus
      this.phone = fresh ? '' : this.phone
      this.$emit('searchList', {
        registerStatus: this.registerStatus,
        phone: this.phone
      })
    }
  }
}
</script>
