progress.vue 2.83 KB
<template>
  <div class="progress_container">
    <main class="progress_content">
      <section class="progress_own">
        <h3 class="section_title">{{progressTitle}}</h3>
        <van-steps direction="vertical" :active="1">
          <van-step v-for="stepItem in stepsInfo" :key="stepItem.id">
            <div slot="active-icon" class="circle_outer">
              <div class="circle_inner"></div>
            </div>
            <div class="step_content">
              <span class="step_left">
                <h3 class="step_title">{{stepItem.title}}</h3>
                <a href="" class="step_link" v-if="stepItem.link">{{stepItem.link}}</a>
                <div class="step_action" v-if="stepItem.expand"></div>
              </span>
              <span class="step_right">{{stepItem.time}}</span>
            </div>
          </van-step>
        </van-steps>
      </section>
      <section class="progress_expand">
        <h3 class="section_title">
          <slot name="title">
          </slot>
        </h3>
        <main>
          <slot name="content">
          </slot>
        </main>
      </section>
    </main>
  </div>
</template>
<script>
export default {
  name: "ProgressComponent",
  props: {
    stepsInfo: {
      type: Object|Object,
      default: ()=> {
        return {}
      }
    },
    progressTitle: {
      type: String,
      default: ()=> {
        return ''
      }
    }
  },
  data() {
    return {

    }
  },
}
</script>
<style lang="less" scoped>
.progress_container {
  padding: 15px;
  .section_title {
    font-size: 16px;
    line-height: 16px;
    padding-left: 6px;
    color: #222222;
    font-family: PingFangSC-Semibold;
    border-left: 2.5px solid #135faa;
  }
}
::v-deep .van-step--vertical {
  opacity: 0.3;
  .van-step__circle {
    width: 6px;
    height: 6px;
    background-color: #106abc;
  }
  .van-step__line {
    opacity: 0.3;
  }
}
::v-deep .van-step--finish,
::v-deep .van-step--process {
  opacity: 1;
}
::v-deep .van-step--finish {
  .van-step__line {
    opacity: 1;
  }
}
::v-deep .van-step__line {
  background: linear-gradient(
    to bottom,
    #106abc,
    #106abc 2px,
    transparent 2px,
    transparent
  );
  background-size: 100% 4px;
  margin-left: -1px;
}
::v-deep .van-hairline::after {
  border: none;
}

.step_content {
  display: flex;
  justify-content: space-between;
  .step_left {
    .step_title {
      font-size: 15px;
      color: #333333;
      line-height: 21px;
    }
    .step_link {
      font-size: 12px;
      line-height: 17px;
      color: #388de2;
      text-decoration: underline;
    }
  }
  .step_right {
    font-size: 12px;
    color: #666666;
    line-height: 17px;
  }
}

.circle_outer {
  padding: 3px;
  border-radius: 50%;
  background-color: #cbe3f9;
  .circle_inner {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #106abc;
  }
}
</style>