<template>
  <div>
    <el-descriptions class="normal-margin" :column="2"  border labelClassName="my-label" contentClassName="my-content">
      <div slot="title" class="my-label__title">收货信息</div>
      <el-descriptions-item label="收货人">{{ mainData.name?mainData.name:"--" }}</el-descriptions-item>
      <el-descriptions-item label="联系电话">{{ mainData.phonenumber?mainData.phonenumber:"--" }}</el-descriptions-item>
      <el-descriptions-item label="地址">{{`${mainData.province}${mainData.city}${mainData.county}${mainData.address}`}}</el-descriptions-item>
      <el-descriptions-item label="收货时间">{{mainData.receivedate?mainData.receivedate:"--"}}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions  border :column="2" labelClassName="my-label" contentClassName="my-content">
      <div slot="title" class="my-label__title">物流信息</div>
      <el-descriptions-item label="快递公司">{{ mainData.logiscompname?mainData.logiscompname:"--" }}</el-descriptions-item>
      <el-descriptions-item label="快递单号">{{ mainData.logisticno?mainData.logisticno:"--" }}</el-descriptions-item>
      <el-descriptions-item :style="style(mainData.status)" label="运费状态">
        {{ mainData.paytype }}
      </el-descriptions-item>
      <el-descriptions-item label="运费">{{ mainData.freightamount?mainData.freightamount:"--" }}</el-descriptions-item>
      <el-descriptions-item label="备注">{{ mainData.remarks?mainData.kd100remarksid:"--" }}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions  border :column="2" labelClassName="my-label" contentClassName="my-content">
      <div slot="title" class="my-label__title">系统信息</div>
      <el-descriptions-item label="创建人">{{ mainData.createby?mainData.createby:"--" }}</el-descriptions-item>
      <el-descriptions-item label="创建时间">{{ mainData.createdate?mainData.createdate:"--" }}</el-descriptions-item>
      <el-descriptions-item label="审核人">{{ mainData.checkby?mainData.checkby:"--" }}</el-descriptions-item>
      <el-descriptions-item label="审核时间">{{ mainData.checkdate?mainData.checkdate:"--" }}</el-descriptions-item>
      <el-descriptions-item label="收货人">{{ mainData.name?mainData.name:"--" }}</el-descriptions-item>
      <el-descriptions-item label="收货时间">{{ mainData.receivedate?mainData.receivedate:"--" }}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
export default {
  props:["mainData"],
  data(){
    return {
      colorStyle:{
        color:''
      }
    }
  },
  mounted() {
   /* if (this.mainData){
      this.style(this.mainData.status)
    }*/

  },
  methods:{
    style(val) {
      let style = {}
      console.log(val,'执行了')
      switch (val) {
        case '新建':
          style = {color:'#000000'}
          break;
        case '审核':
          style = {color:'#d90a0a'}
          break;
        case '收货':
          style = {color:'#52C41A'}
          break;
        default:
          break;
      }
      console.log(style)
      this.colorStyle.color = style.color
      console.log(this.colorStyle,"1111")
      return style

    }
  }
}
</script>

<style scoped>

</style>