<template>
  <div class="detail">
    <Card dis-hover>
      <p slot="title">基础信息</p>
      <Row>
        <Col span="8">用户ID：123123123</Col>
        <Col span="8">头像：<Avatar icon="ios-person"/></Col>
        <Col span="8">姓名：阿斯顿马丁</Col>
      </Row>
      <Row style="margin-top: 20px;">
        <Col span="8">手机号：17762662211</Col>
        <Col span="8">真我币：1233123</Col>
        <Col span="8">签到次数：365</Col>
      </Row>
    </Card>
    <div class="pc-main">
      <Tabs v-model="tab">
        <TabPane label="签到活动" name="1"></TabPane>
        <TabPane label="优惠卷" name="2"></TabPane>
      </Tabs>
      <Table
      v-if="tab==='1'"
        :loading="$store.state.app.isLoading"
        border
        ref="selection"
        :columns="columns"
        :data="data"
      >
        <template slot-scope="{ row }" slot="name">
          <span>{{ row.details.name }}</span>
        </template>
        <template slot-scope="{ row }" slot="title">
          <span>{{ row.details.title }}</span>
        </template>
        <template slot-scope="{ row }" slot="created_at">
          <span>{{ row.created_at | format }}</span>
        </template>
        <template slot-scope="{ row }" slot="enable">
          <i-switch
            :value="row.is_enable === 1 ? true : false"
            @on-change="
              value => {
                change(value, row);
              }
            "
          />
        </template>
        <template slot-scope="{ row }" slot="action">
          <a @click="edit(row)">编辑</a>
        </template>
        <template slot-scope="{ row }" slot="edit">
          <a @click="goTheme(row)">编辑</a>
        </template>
      </Table>
      <Table
      v-else
        :loading="$store.state.app.isLoading"
        border
        ref="selection"
        :columns="yhqcolumns"
        :data="data"
      >
        <template slot-scope="{ row }" slot="action">
          <a @click="edit(row)">编辑</a>
        </template>
      </Table>
    </div>
    <div class="btn">
      <Button type="primary" @click="$router.go(-1)">返回</Button>
    </div>
  </div>
</template>

<script>
import { getScenes, delScenes, editScenes } from "@/api/scenes";
export default {
  name: "categories",
  components: {},
  data() {
    return {
      tab: "1",
      data: [],
      yhqcolumns: [
        {
          title: "优惠卷名称",
          key: "created_at"
        },
        {
          title: "获奖时间",
          slot: "name"
        }
      ],
      columns: [
        {
          title: "签到日期",
          key: "created_at"
        },
        {
          title: "获得收益",
          slot: "name"
        },
        {
          title: "签到时间",
          slot: "title"
        },
        {
          title: "分享收益",
          key: "created_at"
        },
        {
          title: "总收益",
          slot: "enable"
        },
        {
          title: "操作",
          slot: "action"
        }
      ]
    };
  },
  methods: {},
  mounted() {}
};
</script>

<style lang="less" scoped>
.pc-main {
  padding: 20px;
  margin-top: 20px;
  background-color: #fff;
}
.btn {
    text-align: right;
    width: 80%;
    position: fixed;
    background-color: #fff;
    bottom: 10px;
    padding: 10px 30px;
  }
</style>
