home-step.vue 11 KB
<template>
  <div class="home-data-container" v-loading="loading">
    <div class="home-data-item">
      <div class="arrow-icon"><img src="@/assets/img/home/arrow1.png" alt="" /></div>
      <div class="step-title">阶段一:数据导入</div>
      <div class="background-f7 step-border-1">
        <div class="step-icon"><img src="@/assets/img/home/up.png" alt="" /></div>
        <div class="step-title-h3">基盘客户</div>
        <div class="step-title-h2 text-number" v-if="purchaseCustomerCount">
          {{ purchaseCustomerCount }}
          <label>人</label>
        </div>
        <div class="step-title-h2" v-else>请上传数据</div>
        <div class="base-download" @click="jumpUrl('/drainage/square/index')" v-if="!cgacarUrl">
          <i class="el-icon-upload"></i>
          {{ purchaseCustomerCount ? '点击更新' : '上传文件' }}
        </div>
      </div>
      <div class="background-f7 step-border-1">
        <div class="step-icon"><img src="@/assets/img/home/wx.png" alt="" /></div>
        <div class="step-title-h3">企微客户</div>
        <div class="step-title-h2 text-number" v-if="entmicroAddCustomerCount">
          {{ entmicroAddCustomerCount }}
          <label>人</label>
        </div>
        <div class="step-title-h2" v-else>请上传数据</div>
        <div class="step-ceil-panel">
          占比{{ entmicroAddCustomerCountPercent + '%' }}
          <!-- <span><img src="@/assets/img/home/up_icon.png" /></span>
          24% 月环比
          <span><img src="@/assets/img/home/up_icon.png" /></span>
          20% -->
        </div>
      </div>
    </div>
    <div class="home-data-item item-step-2">
      <div class="step-title">阶段二:基盘客户识别及分群</div>
      <div class="step-panel-2">
        <div class="background-f7 step-border-2">
          <div class="arrow-icon"><img src="@/assets/img/home/arrow2.png" alt="" /></div>

          <div class="base-container" :style="`background-image: url(${require('@/assets/img/home/circle.png')})`">
            <div class="base-box" :style="`background-image: url(${require('@/assets/img/home/square.png')})`">
              <div class="base-panel">
                <div class="step-title-h3">基盘匹配</div>
                <div class="step-title-h2 text-number" v-if="purchaseCustomerAddCount">
                  {{ purchaseCustomerAddCount }}
                  <label>人</label>
                </div>
                <div class="step-title-h2" v-else>正在匹配数据…</div>
                <div class="step-ceil-panel" v-if="purchaseCustomerAddCount">
                  累计提升
                  <img src="@/assets/img/home/up_icon.png" />
                  {{ purchaseCustomerAddPercent + '%' }}
                </div>
                <div class="step-ceil-panel" v-else>
                  环比
                  <img src="@/assets/img/home/up_icon.png" />
                  正在计算…
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="background-f7 step-border-3">
          <div class="arrow-icon"><img src="@/assets/img/home/arrow3.png" alt="" /></div>
          <div class="step-icon"><img src="@/assets/img/home/step2_i.png" alt="" /></div>
          <div class="step-title-h2">人群标签</div>
          <div class="step-operation" @click="jumpUrl('/custom/crowdManage/index')">
            <label>人群管理</label>
            <img src="@/assets/img/home/forward.png" alt="" />
          </div>
          <div class="step-operation" @click="jumpUrl('/custom/tagsManage/index')">
            <label>标签管理</label>
            <img src="@/assets/img/home/forward.png" alt="" />
          </div>
        </div>
      </div>
    </div>
    <div class="home-data-item">
      <div class="step-title">阶段三:精准营销</div>
      <div class="background-f7 step-border-4">
        <div class="step-icon"><img src="@/assets/img/home/step3_i.png" alt="" /></div>
        <div class="step-title-h2">精准营销</div>
        <div class="step-operation" @click="jumpUrl('/marketing/friendGroup/index')">
          <label>朋友圈营销</label>
          <img src="@/assets/img/home/forward.png" alt="" />
        </div>
        <div class="step-operation" @click="jumpUrl('/marketing/customerTransform/index')">
          <label>群发助手</label>
          <img src="@/assets/img/home/forward.png" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'homeStep',
  data() {
    return {
      cgacarUrl: false,
      loading: false,
      customerCount: 0,
      purchaseCustomerCount: 0,
      waitMatchCustomerAddCount: 0,
      purchaseCustomerAddCount: 0,
      purchaseCustomerAddPercent: 0,
      waitMatchPercent: 0,
      entmicroAddCustomerCount: 0,
      entmicroAddCustomerCountPercent: 0
    }
  },
  methods: {
    jumpUrl(url) {
      this.$history.push(url)
    },
    viewData() {
      this.loading = true
      this.$apis.home.viewData({}).then(res => {
        this.loading = false
        if (res) {
          const { purchaseCustomerCount, waitMatchCustomerAddCount, purchaseCustomerAddCount, purchaseCustomerAddPercent, waitMatchPercent, entmicroAddCustomerCount, customerCount } = res
          this.purchaseCustomerCount = purchaseCustomerCount
          this.waitMatchCustomerAddCount = waitMatchCustomerAddCount
          this.purchaseCustomerAddCount = purchaseCustomerAddCount
          this.purchaseCustomerAddPercent = (purchaseCustomerAddPercent * 100).toFixed(2)
          this.waitMatchPercent = waitMatchPercent.toFixed(2)
          this.entmicroAddCustomerCount = entmicroAddCustomerCount
          this.entmicroAddCustomerCountPercent = customerCount ? ((100 * this.entmicroAddCustomerCount) / customerCount).toFixed(2) : 0
        }
      })
    }
  },
  mounted() {
    this.viewData()
    if (/cgacar/.test(location.host)) {
      this.cgacarUrl = true
    }
  }
}
</script>

<style lang="scss" scoped>
.background-f7 {
  background: #f7f7fc;
}
.home-data-container {
  margin: 16px 0px;
  display: flex;
  .home-data-item {
    background: #ffffff;
    padding: 16px;
    margin-right: 16px;
    width: 20%;
    position: relative;
    &:nth-child(3) {
      margin-right: 0px;
    }
    .step-icon {
      width: 32px;
      height: 32px;
      margin: 14px auto 20px;
    }
    .arrow-icon {
      position: absolute;
      right: -25px;
      z-index: 99;
      top: 50%;
      width: 34px;
      height: 26px;
      margin-top: 2px;
    }
    &.item-step-2 {
      flex: 1;
    }
    .step-title {
      font-size: 16px;
      color: #333333;
      letter-spacing: 0;
      font-weight: 600;
      text-align: center;
    }
    .step-border-1 {
      margin-top: 16px;
      padding: 10px 16px;
      position: relative;
      .step-icon {
        position: absolute;
        top: 8px;
        right: 8px;
        height: 20px;
        width: 20px;
        margin: 0px;
      }
      .step-title-h3 {
        font-size: 14px;
        font-weight: 400;
        color: #666666;
        line-height: 20px;
      }
      .step-title-h2 {
        font-size: 18px;
        font-weight: 600;
        color: #333333;
        line-height: 25px;
        margin: 6px 0px 10px;
        &.text-number {
          font-size: 26px;
          label {
            font-size: 14px;
            font-weight: 500;
          }
        }
      }
      .base-download {
        cursor: pointer;
        width: 104px;
        height: 32px;
        line-height: 32px;
        background: #2cca74;
        border-radius: 3px;
        text-align: center;
        font-size: 14px;
        font-weight: 400;
        color: #ffffff;
        i {
          font-size: 20px;
          vertical-align: middle;
        }
      }
      .step-ceil-panel {
        font-size: 12px;
        font-weight: 400;
        color: #666666;
        line-height: 18px;
        margin-top: 20px;
        img {
          width: 14px;
          height: 15px;
        }
      }
    }
    .step-panel-2 {
      display: flex;
      .step-border-2 {
        width: 60%;
        margin-top: 16px;
        margin-right: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        .base-container {
          width: 20.78vw;
          height: 7.55vw;
          background-size: 100% 100%;
          position: relative;
          display: flex;
          align-items: center;
          justify-content: center;
          .base-box {
            width: 210px;
            height: 160px;
            position: absolute;
            background-size: 100% 100%;
            .base-panel {
              background: none;
              padding-left: 30px;
              .step-title-h3 {
                margin-top: 30px;
                font-size: 14px;
                font-weight: 400;
                color: #666666;
                line-height: 20px;
              }
              .step-title-h2 {
                font-size: 18px;
                font-weight: 600;
                color: #333333;
                line-height: 25px;
                margin: 6px 0px 10px;
                &.text-number {
                  font-size: 26px;
                  label {
                    font-size: 14px;
                    font-weight: 500;
                  }
                }
              }
              .step-ceil-panel {
                font-size: 12px;
                font-weight: 400;
                color: #666666;
                line-height: 18px;
                margin-top: 20px;

                img {
                  width: 14px;
                  height: 15px;
                }
              }
            }
          }
        }
        .base-panel {
          background: #ffffff;
          border-radius: 6px;
        }
        .arrow-icon {
          position: absolute;
          right: -25px;
          z-index: 99;
          top: 50%;
          width: 34px;
          height: 26px;
          margin-top: -13px;
        }
      }
      .step-border-3 {
        flex: 1;
        position: relative;
        .arrow-icon {
          position: absolute;
          right: -42px;
          z-index: 99;
          top: 50%;
          width: 34px;
          height: 26px;
          margin-top: -13px;
        }
      }
    }
    .step-border-3,
    .step-border-4 {
      margin-top: 16px;
      padding: 30px 0px 20px;
      .step-title-h2 {
        font-size: 18px;
        color: #111111;
        letter-spacing: 0;
        text-align: center;
        line-height: 28px;
        font-weight: 600;
        margin: 4px 0px;
      }
      .step-operation {
        background: #5850ff;
        border-radius: 3px;
        width: 60%;
        height: 32px;
        margin: 16px auto 0px;
        padding: 0px 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        cursor: pointer;
        z-index: 99;
        label {
          cursor: pointer;
          display: inline-block;
          width: 96px;
          text-align: center;
        }
        img {
          width: 18px;
          height: 18px;
        }
      }
    }
  }
}
</style>