Project.vue 5.43 KB
<!--
 * @Author: 前端 qianduan01@didihu.com.cn
 * @Date: 2022-10-25 10:12:26
 * @LastEditors: huyue
 * @LastEditTime: 2024-07-12 16:18:10
 * @FilePath: \dj-data-view\src\views\saas\project.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="project-wrap flex">
    <div class="project-item" v-for="(item, index) in projectList" :key="index">
      <div class="project-title">{{ item.name }}</div>
      <div class="project-subtitle">
        <img class="img-icon" src="@/assets/images/left-icon.png" />
        <span>{{ item.subName }}</span>
        <img class="img-icon" src="@/assets/images/right-icon.png" />
      </div>
      <div class="project-right">
        <div class="project-content-item flex">
          <div class="project-content-desc">转化率</div>
          <div class="project-content-num">{{ item.rate }}</div>
        </div>
        <div class="project-content-item flex">
          <div class="project-content-desc">客单价</div>
          <div class="project-content-num">{{ item.value }}</div>
        </div>
        <div class="project-content-item flex">
          <div class="project-content-desc">GMV</div>
          <div class="project-content-num">{{ item.output }}</div>
        </div>
        <!-- <div class="project-content-item">
          <div class="project-content-desc">展业门店数</div>
          <div class="project-content-num">{{ item.totalNum }}</div>
        </div>
        <div class="project-content-item">
          <div class="project-content-desc">当年新增</div>
          <div class="project-content-num">{{ item.incrNum }}</div>
        </div>
        <div class="project-content-item">
          <div class="project-content-desc">转化率</div>
          <div class="project-content-num">{{ toFixRatio(item.conversionrate) }}</div>
        </div>
        <div class="project-content-item">
          <div class="project-content-desc">客单价</div>
          <div class="project-content-num">{{ toFixNum(item.atv) }}</div>
        </div>
        <div class="project-content-item">
          <div class="project-content-desc">GMV</div>
          <div class="project-content-num">{{ numAddSymbol(item.outputValue) }}</div>
        </div> -->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Project',
  data() {
    return {
      projectList: [
        {
          name: '数字化轻改',
          subName: '1.1新车轻改升级',
          rate: '53%',
          value: '1,300',
          output: '25,509,838'
        },
        {
          name: '数字化轻改',
          subName: '1.2次新车增购',
          rate: '10%',
          value: '2,100',
          output: '20,013,764'
        },
        {
          name: '数字化保险',
          subName: '2.1新车权益升级',
          rate: '50%',
          value: '1,650',
          output: '1,893,844'
        },
        {
          name: '数字化保险',
          subName: '2.2售后续保',
          rate: '37%',
          value: '2,590',
          output: '8,531,460'
        },
        {
          name: '数字化保险',
          subName: '2.3新车延保',
          rate: '45%',
          value: '8,800',
          output: '6,127,763'
        }
      ]
    }
  },
  mounted() {
    // this.getBusinessType()
  },
  methods: {
    toFixRatio(val) {
      if (!val) {
        return '0.00%'
      }
      return (val * 100).toFixed(2) + '%'
    },
    toFixNum(val) {
      return this.numAddSymbol(Math.round(val))
    },
    getBusinessType() {
      this.api.operational.getBusinessType().then(res => {
        if (res.code == 0) {
          this.projectList = res.data.dataList
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.project-wrap {
  margin: 0.98vh 0.83vw 0;
  height: 11.71vh;
  flex-wrap: wrap;
  justify-content: space-between;
  .project-item {
    width: 10vw;
    height: 12vh;
    background-image: url(../../../assets/images/bg@2x.png);
    background-size: 100% 100%;
    .project-title {
      margin-top: 1.8vh;
      font-weight: 600;
      font-size: 14px;
      background: linear-gradient(to right, #01a4f9, #6df5f9); /* 从左到右渐变 */
      -webkit-background-clip: text; /* Safari/Chrome支持该属性 */
      color: transparent; /* 将文本颜色设置为透明 */
      text-align: center;
    }
    .project-subtitle {
      font-weight: 400;
      font-size: 12px;
      background: linear-gradient(to right, #01a4f9, #6df5f9); /* 从左到右渐变 */
      -webkit-background-clip: text; /* Safari/Chrome支持该属性 */
      color: transparent; /* 将文本颜色设置为透明 */
      text-align: center;
      .img-icon {
        width: 0.52vw;
        height: 0.19vh;
        vertical-align: middle;
      }
      span {
        margin: 0 0.34vw;
      }
    }
    .project-right {
      flex: 1;
      padding: 0 1.2vw;
      .project-content-item {
        justify-content: space-between;
        // margin-bottom: 0.14vh;
        .project-content-desc {
          font-size: 12px;
          color: #dddddd;
        }
        .project-content-num {
          font-size: 12px;
          color: #ffffff;
          text-align: right;
        }
      }
    }
  }
}
</style>