<template>
  <div id="detailInfo">
    <el-row>
      <el-col :span="24">
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
          <el-form-item label="产品名称:">
            <span>{{ ruleForm.name }}</span>
          </el-form-item>
          <span v-if="ruleForm.status === '1' || ruleForm.status === '2'">
            <el-form-item label="发布状态:">
              <span>{{ ruleForm.status === '0' ? '未发布' : ruleForm.status === '1' ? '发布' : '下架' }}</span>
            </el-form-item>
          </span>

          <el-form-item label="是否热门:">
            <span>{{ ruleForm.top === '0' ? '非热门推荐' : ruleForm.top === '1' ? '热门推荐' : '' }}</span>
          </el-form-item>
          <el-form-item label="发布时间:">
            <span>{{ ruleForm.publish_time }}</span>
          </el-form-item>
          <el-form-item label="利率范围:">
            <span>{{ ruleForm.mongey_min_rate }}</span
            >-<span>{{ ruleForm.mongey_max_rate }}</span>
          </el-form-item>

          <el-form-item label="贷款期限:">
            <span>{{ ruleForm.claims_min_term }}</span
            >-<span>{{ ruleForm.claims_max_term }}</span>
          </el-form-item>
          <el-form-item label="贷款额度:">
            <span>{{ ruleForm.claims_min_money }}</span
            >-<span>{{ ruleForm.claims_max_money }}</span>
          </el-form-item>

          <el-form-item label="担保方式:">
            <span>{{ ruleForm.ensure_id }}</span
            >-<span>{{ ruleForm.claims_max_money }}</span>
          </el-form-item>
          <el-form-item label="产品简介:">
            <el-col v-for="(tag, index) in ruleForm.news" :key="index">
              <el-col :span="18">
                <el-col :span="24" class="score"> 简介名称{{ tag.news_name }} </el-col>
                <el-col :span="24" class="score"> 简介内容 {{ tag.news_info }}分</el-col>
              </el-col>
            </el-col>
          </el-form-item>

          <el-form-item>
            <span v-if="ruleForm.status === '0'">
              <el-button type="primary" @click="submitForm('ruleForm')">发布</el-button>
            </span>
            <span v-if="ruleForm.status === '1'">
              <el-button type="danger" @click="resetForm('ruleForm')">下架</el-button>
            </span>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'detailInfo',
  props: {
    ruleForm: null,
    rules: null,
  },
  components: {},
  data: () => ({}),
  created() {},
  computed: {},
  methods: {
    submitForm(ruleForm) {
      this.$emit('submitForm', { data: this.ruleForm });
    },
    resetForm(ruleForm) {
      this.$emit('resetForm', { data: this.ruleForm });
    },
  },
};
</script>

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