<template>
  <div id="model-5">
    <el-row class="list">
      <el-col :span="24" class="name">
        {{ data.name }}
      </el-col>
      <el-col :span="24" class="other">
        <el-col :span="12" class="other_info textOver">
          创新券类型：<span>{{ data.coupons_type || '暂无' }}</span>
        </el-col>
        <el-col :span="12" class="other_info textOver">
          所属分类：<span>{{ data.classify || '暂无' }}</span>
        </el-col>
        <el-col :span="12" class="other_info textOver">
          折扣类型：<span>{{ data.discount_type || '暂无' }}</span>
        </el-col>
        <el-col :span="12" class="other_info textOver">
          适用服务类型：<span>{{ data.use_type || '暂无' }}</span>
        </el-col>
      </el-col>
      <el-col :span="24" class="btn">
        <el-button type="primary" size="mini" @click.native="toDetail">详情</el-button>
        <el-button type="success" size="mini" @click.native="toApply">申领</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'model-5',
  props: {
    data: { type: Object, default: () => {} },
    router: { type: String },
  },
  components: {},
  data: function () {
    return {
      kjpx: require('@a/kjpx.jpg'),
    };
  },
  created() {},
  methods: {
    toDetail() {
      this.$router.push({ path: this.router ? this.router : this.detailRouter, query: { id: this.data._id } });
    },
    toApply() {
      this.$router.push({ path: this.router ? this.router : this.applyRouter, query: { id: this.data._id } });
    },
  },
  computed: {
    ...mapState(['user', 'menuParams']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
    detailRouter() {
      const key = this.$route.meta.key;
      return `/adminCompany/${key}/detail`;
    },
    applyRouter() {
      const key = this.$route.meta.key;
      return `/adminCompany/${key}/apply`;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped>
.list {
  background-color: #fff;
  border-radius: 5px;
  margin: 0 0 10px 0;
  padding: 8px;
  .name {
    font-size: 16px;
    margin: 0 0 5px 0;
    font-weight: bold;
  }
  .other {
    .other_info {
      font-size: 14px;
      color: #666;
      margin: 0 0 5px 0;
      span {
        color: #000;
      }
    }
  }
  .btn {
    text-align: center;
    margin: 10px 0 0 0;
  }
}
</style>
