<template>
  <el-dialog title="守护流水详情" :close-on-click-modal="false" :visible.sync="open" width="1200px" append-to-body>
    <el-descriptions :contentStyle="CS" :label-style="LS " class="margin-top" :column="3" size="medium" border>
      <el-descriptions-item :label="'赠送'+systemName+'号'">
        {{info.fromUsercode}}
      </el-descriptions-item>
      <el-descriptions-item label="赠送手机号" :span="2">
        {{info.fromMobile}}
      </el-descriptions-item>
      <el-descriptions-item :label="'接受'+systemName+'号'">
        {{info.toUsercode}}
      </el-descriptions-item>
      <el-descriptions-item label="接受手机号" :span="2">
        {{info.toMobile}}
      </el-descriptions-item>
      <el-descriptions-item label="发生时间">
        {{info.createTime}}
      </el-descriptions-item>
      <el-descriptions-item label="个数">
        {{info.guardNum}}
      </el-descriptions-item>
      <el-descriptions-item label="守护值">
        {{info.guardValue}}
      </el-descriptions-item>
      <el-descriptions-item label="单价">
        {{info.guardPrice}}
      </el-descriptions-item>
      <el-descriptions-item label="链路号">
        {{info.traceId}}
      </el-descriptions-item>
    </el-descriptions>
  </el-dialog>
</template>

<script>
import {userGiftTypeList} from '@/constant/statusMap'
import {getGuardLog, getGuardLogByTraceId} from "@/api/cai/guardLog";

export default {
  name: "UserInfo",
  data() {
    return {
      userGiftTypeList,
      systemName: process.env.VUE_APP_SYSTEM_HOME,
      CS: {
        'text-align': 'center',  //文本居中
        'min-width': '250px',   //最小宽度
        'word-break': 'break-all'  //过长时自动换行
      },
      LS: {
        // 'color': '#000',
        'text-align': 'center',
        // 'font-weight': '600',
        'height': '40px',
        // 'background-color': 'rgba(255, 97, 2, 0.1)',
        'min-width': '110px',
        'word-break': 'keep-all'
      },
      open:false,
      info:{},
    };
  },
  created() {

  },
  methods: {
    init(id){
      this.open = true;
      getGuardLog(id).then(response => {
        this.info = response.data;
      });
    },
    traceIdInit(traceId){
      this.open = true;
      getGuardLogByTraceId(traceId).then(response => {
        this.info = response.data;
      });
    },
  }
};
</script>
<style lang="scss" scoped>
.el-row {
  margin-bottom: -15px;
  display: flex;
  flex-wrap: wrap
}

/* .el-card {
   min-width: 100%;
   height: 80%;  // 高度要设置百分比才可以
   margin-right: 20px;
   transition: all .5s;
 }*/
</style>
