time-line.vue 1.44 KB
<template>
  <ul class="time-line-wrapper">
    <li
      :class="i === 0 ? 'time-line-item active' : 'time-line-item'"
      v-for="(deliveryDetail, i) in deliveryList"
      :key="i"
    >
      <i class="time-line-label"></i>
      <div>
        <p class="content">{{ deliveryDetail.acceptRemark }}</p>
        <p class="time">{{ deliveryDetail.createTimeStr }}</p>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: {
    deliveryList: {
      type: Array,
      default: []
    }
  }
};
</script>

<style lang="scss" scoped>
.time-line-wrapper {
  padding: 50px;

  .time-line-item {
    position: relative;
    padding: 0 40px 40px 40px;
    border-left: 1px solid #eee;
    font-size: 28px;
    color: #999;
    display: flex;
    align-items: flex-start;

    &:last-child {
      border-left: none;
    }

    .content {
      margin-top: -8px;
    }

    .time-line-label {
      width: 20px;
      height: 20px;
      background: #eee;
      border-radius: 50%;
      display: block;
      position: absolute;
      left: -10px;
    }

    &.active {
      font-size: 32px;
      color: #000;

      .content {
        margin-top: 0;
      }

      & > i {
        width: 40px;
        height: 40px;
        left: -20px;
        display: block;
        position: absolute;
        border-radius: 50%;
        background-image: url("~statics/image/order/time-icon@3x.png");
        background-size: contain;
      }
    }
  }
}
</style>