<!-- 求购信息详情 -->
<template>
  <div class="bg-F5">
    <div class="container">
      <div class="leftLine"></div>
      <div class="title">
        <span class="type">求购</span>
        <span class="name">{{ demandInfo.purchaseTitle }}</span>
      </div>
      <div class="xqDiv mt5rem">
        <div class="tit">需求概要：</div>
        <div class="con">{{ demandInfo.summaryOfNeeds }}</div>
      </div>
      <div class="xqDiv">
        <div class="tit">需求详情：</div>
        <div class="con">
          {{ demandInfo.demandDetails }}
        </div>
      </div>
      <div class="xqDiv">
        <div class="tit">联&nbsp;&nbsp;系&nbsp;&nbsp;人：</div>
        <div class="con">{{ demandInfo.contacts }}</div>
      </div>
      <div class="xqDiv">
        <div class="tit">联系电话：</div>
        <div class="con">{{ demandInfo.contactNumber }}</div>
      </div>
      <div class="xqDiv">
        <div class="tit">发布时间：</div>
        <div class="con">{{ demandInfo.releaseTime }}</div>
      </div>
    </div>
  </div>
</template>
<script>
import { Component, Vue, Watch } from "vue-property-decorator";
export default {
  name: "app",
  components: {},
  data() {
    return {
      id: null,
      demandInfo: {}
    };
  },
  methods: {
    // 需求信息详情数据请求 liuqiwen
    detailData() {
      var that = this;
      that
        .$post("/demand/info/getDemandInfo", {
          id: that.id
        })
        .then(function(res) {
          console.log(res);
          if (!res[0]) {
            that.demandInfo = res[1].demandInfo;
          }
        });
    }
  },
  activated() {
    if (this.$route.query.id) {
      this.id = parseInt(this.$route.query.id);
      this.detailData();
    }
  },
  mounted() {
    this.id = parseInt(this.$route.query.id);
    this.detailData();
  }
};
</script>
<style lang="scss" scoped>
.container {
  background: #fff;
  margin-top: 2rem;
  margin-bottom: 4rem;
  padding: 3rem 4rem 2rem 4rem;
  position: relative;
  box-sizing: border-box;
  border-radius: 0.4rem;
  .leftLine {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 1rem;
    border-radius: 0.5rem;
    background: #fccabb;
  }
  .title {
    height: 4rem;
    line-height: 4rem;
    text-align: center;
    .type {
      display: inline-block;
      height: 2.2rem;
      line-height: 2.2rem;
      font-size: 1.4rem;
      color: #fff;
      border-radius: 0.4rem;
      padding: 0 0.6rem;
      background: #fd5522;
    }
    .name {
      font-size: 1.8rem;
      color: #333;
      margin-left: 1.6rem;
    }
  }
  .xqDiv {
    line-height: 2.4rem;
    overflow: hidden;
    font-size: 1.4rem;
    .tit {
      color: #333;
      width: 7%;
      float: left;
    }
    .con {
      color: #666;
      width: 93%;
      float: left;
    }
  }
}
.mt5rem {
  margin-top: 5rem;
}
</style>
