<template>
  <div class="app-container">
    <el-card class="card-layout">
      <div class="detail-title">标题</div>
    </el-card>

    <el-card class="card-layout" style="margin-top: 20px;">
      <div class="detail-info">
        <el-row>
          <el-col :span="12">优惠券标题：{{ detail.couponTitle }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12">优惠券分类：{{ detail.categoryName }}</el-col>
        </el-row>
        <el-row>
          <el-col :span="12">优惠券类型：<dict-tag style="display: inline-block;" :options="dict.type.coupon_type" :value="detail.couponType" /></el-col>
        </el-row>
        <el-row>
          <el-col :span="12">有效期：{{detail.validityType === '1' ? `${detail.validityStartDate} ~ ${detail.validityEndDate}` : `领取后${detail.validityNum}天内`}}</el-col>
        </el-row>
        <!-- <el-row>
          <el-col :span="12">
            <div class="detail-label">默认决策：</div>
            <div class="detail-value">
              <div v-for="(item, index) in detail.defaultPolicy" :key="index">
                {{ item.groupName }}
                {{ item.fieldZhName }}
                等于
                {{ item.fieldValue }}
              </div>
            </div>
          </el-col>
          <el-col :span="12">创建人：{{ detail.createBy }}</el-col>
        </el-row> -->
      </div>

      <div class="detail-info">
        <div class="detail-title-tip">决策配置信息</div>
        <!-- <TreeFlowChartDetail ref="treeFlowChartDetail" :flow-data="flowData" /> -->
        <ImagePreview :src="detail.policyImage || ''" :src-list="[detail.policyImage]" />
      </div>
    </el-card>

  </div>
</template>

<script>
import { auditDetail } from '@/api/coupon/audit.js'

export default {
  name: 'CouponAuditDetail',
  dicts: ['coupon_type'],
  data() {
    return {
      detail: {}
    }
  },
  mounted() {
    this.getDetail()
  },
  methods: {
    getDetail() {
      auditDetail(this.$route.params.id).then(res => {
        this.detail = res.data
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.detail-info {
  width: 90%;
  margin-top: 26px;
  font-size: 14px;
  line-height: 3;

  &:first-child {
    margin-top: 0;
  }

  .el-col {
    display: flex;
  }
}
</style>
