<template>
  <div class="padding">
    <div class="card">
      <div class="post-info">{{ detail.title }}
      </div>
      <div class="date">{{ detail.createTime }}</div>
      <div class="form border">
        <div class="label">求职联系人</div>
        <div class="value">{{ detail.linkName }}</div>
      </div>
      <div class="form border">
        <div class="label">联系方式</div>
        <div class="value phone" @click="phone">
          <u-icon name="phone-fill" color="#4181FF" size="32" :custom-stype="{marginRight:'8px'}"></u-icon>
          {{ detail.linkPhone }}
        </div>
      </div>
      <div class="form">
        <div class="label">图片</div>
      </div>
      <div class="photo border">
        <img :src="item.url" alt=""
             v-for="(item,index) in detail.files" :key="index" @click="preview(index)">
      </div>
      <header>详细描述</header>
      <div class="post-require">{{ detail.remark }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "persJob",
  data() {
    return {
      id: null,
      detail: {},
    }
  },
  onLoad({id}) {
    this.id = id;
    this.getDetail();
  },
  methods: {
    preview(index) {
      this.$previewImage(this.detail.files, index, "url");
    },
    phone() {
      uni.makePhoneCall({phoneNumber: this.detail.linkPhone});
    },
    getDetail() {
      this.$instance.post("/app/appjob/detail", null, {
        params: {id: this.id}
      }).then(res => {
        if (res?.data) {
          this.detail = res.data;
        }
      })
    }
  },

  onShareAppMessage() {
    return {
      title: "个人求职",
      path: "/mods/AppJob/persJob?id=" + this.id
    }
  }
}
</script>

<style lang="scss" scoped>
.padding {
  min-height: 100%;
  background-color: #ffffff;

  .card {
    padding: 32px 0 32px 32px;
    background-color: #ffffff;

    .post-info {
      font-size: 40px;
      font-weight: 600;
      color: #333333;
      line-height: 56px;
      padding-right: 32px;
    }

    .date {
      font-size: 32px;
      font-weight: 400;
      color: #999999;
      margin: 16px 0 32px;
    }

    .form {
      height: 112px;
      background: #FFFFFF;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-right: 32px;

      .label {
        font-size: 32px;
        font-weight: 400;
        color: #999999;
      }

      .value {
        font-size: 32px;
        font-weight: 400;
        color: #333333;
      }

      .phone {
        font-size: 28px;
        color: #4181FF;
      }
    }

    .border {
      border-bottom: 1px solid #DDDDDD;
    }

    .photo {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px;
      padding-bottom: 48px;

      & > img {
        width: 225px;
        height: 225px;
      }
    }

    header {
      font-size: 38px;
      font-weight: 600;
      color: #333333;
      padding: 32px 0;
    }

    .post-require {
      font-size: 32px;
      font-weight: 400;
      color: #333333;
      line-height: 56px;
      padding-right: 20px;
    }
  }
}
</style>
