<template>
  <div class="padding-20">
    <div class="search-box">
      <el-form
        ref="form"
        :inline="true"
        :model="searchForm"
        clearable
        class="mt-10">
        <el-form-item label="会员账号:">
          <el-input style="width: 230px;" v-model="searchForm.user_id" placeholder="请输入会员账号/ID/手机号码"
                    clearable></el-input>
        </el-form-item>
        <el-form-item label="会员状态:">
          <el-select
            v-model="searchForm.user_status"
            clearable
            placeholder="请选择会员状态">
            <el-option
              v-for="item in [{label: '禁用', value: 0}, {label: '正常', value: 1}]"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="注册开始时间:">
          <el-date-picker
            v-model="searchForm.user_start_time"
            type="datetime"
            placeholder="选择注册开始时间"
            value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
        </el-form-item>
        <el-form-item label="注册结束时间:">
          <el-date-picker
            v-model="searchForm.user_end_time"
            type="datetime"
            placeholder="选择注册结束时间"
            value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
        </el-form-item>
        <el-form-item class="ml-10">
          <el-button icon="el-icon-search" type="primary" @click="searchSubmit">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <el-table :data="tableData"
              stripe
              v-loading="tableLoading"
              fit
              class="marginT-10 order-table"
              border
              :max-height="vheight">
      <el-table-column label="ID" prop="id"></el-table-column>
      <el-table-column label="演唱艺人" prop="support_user_name"></el-table-column>
      <el-table-column label="留言" prop="order_remark"></el-table-column>
      <el-table-column label="赞赏人昵称" prop="user_name"></el-table-column>
      <el-table-column label="赞赏时间" prop="created_at"></el-table-column>
      <el-table-column label="演出时间" prop="plan_start_time"></el-table-column>
      <el-table-column label="订单编号" prop="order_number"></el-table-column>
      <el-table-column label="订单状态">
        <template slot-scope="scope">
          <p>{{ ['待支付', '已支付', '全部退款', '部分退款', '已取消'][scope.row.order_status] }}</p>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      class="marginT-20"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :hide-on-single-page="true"
      :current-page="page"
      :page-size="page_size"
      :page-sizes="[10, 20, 100, 200, 300, 400]"
      background
      layout="total, sizes, prev, pager, next, jumper"
      :total="totalCount"/>
  </div>
</template>

<script>
import page from '@/mixin/page'

export default {
  mixins: [page],
  data () {
    return {
      time: [],
      searchForm: {},
      tableData: [],
      tableUrl: '/v1/user/support/order/list'
    }
  },
  mounted () {
    this.init()
  },
}
</script>

<style lang="scss" scoped>
</style>
