<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.orderCode}}</span></el-descriptions-item>
          <el-descriptions-item label="课程名称"><span v-if="item!=null">{{item.courseName}}</span></el-descriptions-item>
          <el-descriptions-item label="小节名称"><span v-if="item!=null">{{item.videoName}}</span></el-descriptions-item>
          <el-descriptions-item label="用户"><span v-if="item!=null">{{item.userName}}</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.payPrice}}</span></el-descriptions-item>
          <el-descriptions-item label="优惠金额"><span v-if="item!=null">{{item.discountPrice}}</span></el-descriptions-item>
          <el-descriptions-item label="实付金额"><span v-if="item!=null">{{item.payMoney}}</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"><dict-tag :options="orderTypeOptions" :value="item.createType"/></span></el-descriptions-item>
          <el-descriptions-item label="支付方式"><span v-if="item!=null"><dict-tag :options="payTypeOptions" :value="item.payType"/></span></el-descriptions-item>
          <el-descriptions-item label="创建时间"><span v-if="item!=null">{{item.createTime}}</span></el-descriptions-item>
          <el-descriptions-item label="支付时间"><span v-if="item!=null">{{item.payTime}}</span></el-descriptions-item>
          <el-descriptions-item label="备注"><span v-if="item!=null">{{item.remark}}</span></el-descriptions-item>
        </el-descriptions>
    </div>


    </div>
</template>

<script>
import { listUserCourseOrder, getUserCourseOrder, delUserCourseOrder, addUserCourseOrder, updateUserCourseOrder, exportUserCourseOrder } from "@/api/course/userCourseOrder";
  export default {
    name: "userCourseOrderDetails",
    data() {
      return {
        item:null,
        statusOptions:[],
        payTypeOptions:[],
        orderTypeOptions:[]
      }
    },
    created() {
      this.getDicts("sys_course_pay_type").then(response => {
        this.payTypeOptions = response.data;
      });
      this.getDicts("sys_course_order_type").then(response => {
        this.orderTypeOptions = response.data;
      });
      this.getDicts("sys_course_order_status").then(response => {
        this.statusOptions = response.data;
      });
    },
    methods: {
      getDetails(orderId) {
        this.item=null;
        getUserCourseOrder(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>
