<template>
    <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
      <div style="padding: 20px; background-color: #fff;">
         积分商品详情
      </div>
<div class="contentx" v-if="item!=null">
        <div class="desct"> 积分商品信息</div>
        <el-descriptions title="" :column="3" border>
          <el-descriptions-item label="商品名称"><span v-if="item!=null">{{item.goodsName}}</span></el-descriptions-item>
          <el-descriptions-item label="封面图"> <el-image v-if="item.imgUrl!=null"
                  style="width: 100px"
                  :src="item.imgUrl"
                  :preview-src-list="[item.imgUrl]">
              </el-image></el-descriptions-item>
          <el-descriptions-item label="商品分类"> <dict-tag :options="goodsTypeOptions" :value="item.goodsType"/></el-descriptions-item>
          <el-descriptions-item label="原价"><span v-if="item!=null">{{item.otPrice}}</span></el-descriptions-item>


          <el-descriptions-item label="所需积分"><span v-if="item!=null">{{item.integral}}</span></el-descriptions-item>
          <el-descriptions-item label="需支付金额"><span v-if="item!=null">{{item.cash}}</span></el-descriptions-item>
          <el-descriptions-item label="排序"><span v-if="item!=null">{{item.sort}}</span></el-descriptions-item>
          <el-descriptions-item label="库存"><span v-if="item!=null">{{item.stock}}</span></el-descriptions-item>
          <el-descriptions-item label="状态"><span v-if="item!=null"> <dict-tag :options="statusOptions" :value="item.status"/></span></el-descriptions-item>
          <el-descriptions-item label="创建时间"><span v-if="item!=null">{{item.createTime}}</span></el-descriptions-item>
        </el-descriptions>
    </div>
    <div class="contentx" v-if="item!=null">
        <div class="desct"> 积分商品信息</div>
    <span v-html="item.descs"></span>
    </div>

    </div>
</template>

<script>
import { listIntegralGoods, getIntegralGoods, delIntegralGoods, addIntegralGoods, updateIntegralGoods, exportIntegralGoods } from "@/api/his/integralGoods";
  export default {
    name: "coupon",
    data() {
      return {
        // 商品分类字典
        goodsTypeOptions: [],
        // 状态字典
        statusOptions: [],
        item:null,
      }
    },
    created() {
        this.getDicts("sys_integral_goods_type").then(response => {
          this.goodsTypeOptions = response.data;
        });
        this.getDicts("sys_company_status").then(response => {
          this.statusOptions = response.data;
        });
    },
    methods: {
      getDetails(orderId) {
        this.item=null;
        getIntegralGoods(orderId).then(response => {
            this.item = response.data;

        });
      },
    }
  }
</script>
<style>
  .contentx{
      height: 100%;
      background-color: #fff;
      padding: 0px 20px 20px;


      margin: 20px;
  }
  .el-descriptions-item__label.is-bordered-label{
    font-weight: normal;
  }
  .el-descriptions-item__content {
    max-width: 150px;
    min-width: 100px;
  }
  .desct{
      padding-top: 20px;
      padding-bottom: 20px;
      color: #524b4a;
      font-weight: bold;
    }

</style>
