Commit 0e2022dd by 匡雅琴

接口联调

1 parent f2d6111b
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
<template> <template>
<div class="right"> <div class="right">
<div class="top box"> <div class="top box">
<box-title title="SaaS+增值转化业务"></box-title> <box-title title="营销增值服务业务"></box-title>
<Business></Business> <Business></Business>
<Project></Project> <Project></Project>
</div> </div>
<div class="bottom"> <div class="bottom">
<box-title title="SaaS订阅业务总览"></box-title> <box-title title="私域用户池总览"></box-title>
<div class="bottom-content"> <div class="bottom-content">
<UserTab></UserTab> <UserTab></UserTab>
<view-chart></view-chart> <view-chart></view-chart>
......
...@@ -2,29 +2,48 @@ ...@@ -2,29 +2,48 @@
<div class="user-tab"> <div class="user-tab">
<!-- <StatisticsBox class="user" :list="userData"></StatisticsBox> --> <!-- <StatisticsBox class="user" :list="userData"></StatisticsBox> -->
<div class="statistics user"> <div class="statistics user">
<div :class="['statistics-item', {'item-active': selectIndex == index && selectIndex < 3}]" v-for="(item, index) in userData" :key="index" :style="{'width': 100 / userData.length + '%'}" @click="clickSaasTab(index)"> <div
:class="['statistics-item', { 'item-active': selectIndex == index && selectIndex < 3 }]"
v-for="(item, index) in userData"
:key="index"
:style="{ width: 100 / userData.length + '%' }"
@click="clickSaasTab(index)"
>
<div class="statistics-top"> <div class="statistics-top">
<div class="statistics-name">{{item.name}}</div> <div class="statistics-name">{{ item.name }}</div>
<div class="statistics-price"><span class="statistics-unit" v-if="item.unitType == 'left'">{{item.unit}}</span><span class="statistics-price-number">{{numAddSymbol(item.value)}}</span><span v-if="item.unitType == 'right'">{{item.unit}}</span></div> <div class="statistics-price">
<div v-if="item.rate" class="statistics-top-rate">占比<span>{{item.rate}}%</span></div> <span class="statistics-unit" v-if="item.unitType == 'left'">{{ item.unit }}</span>
<span class="statistics-price-number">{{ numAddSymbol(item.value) }}</span>
<span v-if="item.unitType == 'right'">{{ item.unit }}</span>
</div>
<div v-if="item.rate" class="statistics-top-rate">
占比
<span>{{ item.rate }}%</span>
</div>
</div> </div>
<div class="statistics-bottom" v-if="item.bottomLabel || item.bottomType"> <div class="statistics-bottom" v-if="item.bottomLabel || item.bottomType">
<template v-if="item.bottomType == 'money'"> <template v-if="item.bottomType == 'money'">
<span> {{item.bottomLabel}}</span> <span>{{ item.bottomLabel }}</span>
<span>¥{{numAddSymbol(item.bottomValue)}}</span> <span>¥{{ numAddSymbol(item.bottomValue) }}</span>
</template> </template>
<template v-else-if="item.bottomType == 'slot'"> <template v-else-if="item.bottomType == 'slot'">
<slot :name="item.valueName" :[item.valueName]="item"></slot> <slot :name="item.valueName" :[item.valueName]="item"></slot>
</template> </template>
<template v-else-if="item.bottomType == 'ratio'"> <template v-else-if="item.bottomType == 'ratio'">
<div class="ratio"> <div class="ratio">
<div class="ratio-left">{{item.ratioLeftLabel}}<span :class="item.ratioLeftValue > 0 ? 'positive' : 'negative'">{{item.ratioLeftValue}}%</span></div> <div class="ratio-left">
<div class="ratio-right">{{item.ratioRightLabel}}<span :class="item.ratioRightValue > 0 ? 'positive' : 'negative'">{{item.ratioRightValue}}%</span></div> {{ item.ratioLeftLabel }}
<span :class="item.ratioLeftValue > 0 ? 'positive' : 'negative'">{{ item.ratioLeftValue }}%</span>
</div>
<div class="ratio-right">
{{ item.ratioRightLabel }}
<span :class="item.ratioRightValue > 0 ? 'positive' : 'negative'">{{ item.ratioRightValue }}%</span>
</div>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<span>{{item.bottomLabel}}</span> <span>{{ item.bottomLabel }}</span>
<span class="bottom-num">{{numAddSymbol(item.bottomValue)}}</span> <span class="bottom-num">{{ numAddSymbol(item.bottomValue) }}</span>
</template> </template>
</div> </div>
</div> </div>
...@@ -107,7 +126,7 @@ export default { ...@@ -107,7 +126,7 @@ export default {
this.selectIndex = selectIndex this.selectIndex = selectIndex
const params = { req: { queryItem }} const params = { req: { queryItem }}
this.api.operational.getTrend(params).then(res => { this.api.operational.getTrend(params).then(res => {
console.log(res); console.log(res)
if (res.code === '0') { if (res.code === '0') {
const dataList = res.data.dataList const dataList = res.data.dataList
const obj = { const obj = {
...@@ -120,6 +139,18 @@ export default { ...@@ -120,6 +139,18 @@ export default {
}, },
clickSaasTab(val) { clickSaasTab(val) {
if (val > 2) return if (val > 2) return
if (val === this.selectIndex) return
switch (val) {
case 0:
this.getTrend('total', '用户数')
break
case 1:
this.getTrend('wechat', '企微客户数')
break
case 2:
this.getTrend('wechatgroup', '企微群数')
break
}
this.selectIndex = val this.selectIndex = val
} }
} }
...@@ -131,88 +162,88 @@ export default { ...@@ -131,88 +162,88 @@ export default {
height: 9.02vh; height: 9.02vh;
margin: 1.22vh 0 0.98vh 0; margin: 1.22vh 0 0.98vh 0;
.statistics { .statistics {
display: flex; display: flex;
color: #fff; color: #fff;
height: 9.51vh; height: 9.51vh;
&-item { &-item {
padding: 0.49vh 0.53vw; padding: 0.49vh 0.53vw;
margin-right: 0.56vw; margin-right: 0.56vw;
background: #061422; background: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69; box-shadow: inset 0 0 20px 0 #3d57ff69;
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
}
} }
} &-top {
&-top { position: relative;
position: relative; padding-left: 0.3vw;
padding-left: 0.3vw; &-rate {
&-rate { position: absolute;
position: absolute; right: 0;
right: 0; top: 0;
top: 0; font-size: 12px;
font-size: 12px; color: #95acd9;
color: #95ACD9; span {
span { color: #eb6001;
color: #EB6001; }
} }
} }
} &-name {
&-name { font-weight: 500;
font-weight: 500; font-size: 14px;
font-size: 14px; margin-bottom: 0.4vh;
margin-bottom: 0.4vh; height: 2.22vh;
height: 2.22vh; }
} &-unit {
&-unit {
padding-right: 0.56vw;
}
&-price {
display: flex;
align-items: center;
color: #25D6FF;
font-weight: 600;
font-size: 14px;
height: 3.11vh;
&-number {
padding-right: 0.56vw; padding-right: 0.56vw;
font-size: 20px;
color: #5894FF;
background-image:-webkit-linear-gradient(left,#24D8FF,#7787FF);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
} }
} &-price {
&-bottom {
display: flex;
justify-content: space-between;
font-size: 12px;
color: #95ACD9;
border-top: 1px solid #2A3D72;
padding: 0.4vh 0.3vw 0;
margin-top: 0.4vh;
.ratio {
display: flex; display: flex;
width: 100%; align-items: center;
justify-content: space-between; color: #25d6ff;
.positive, font-weight: 600;
.negative{ font-size: 14px;
display: inline-block; height: 3.11vh;
margin-left: 0.28vw; &-number {
padding-right: 0.56vw;
font-size: 20px;
color: #5894ff;
background-image: -webkit-linear-gradient(left, #24d8ff, #7787ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
} }
.positive { }
color: #EB6001; &-bottom {
display: flex;
justify-content: space-between;
font-size: 12px;
color: #95acd9;
border-top: 1px solid #2a3d72;
padding: 0.4vh 0.3vw 0;
margin-top: 0.4vh;
.ratio {
display: flex;
width: 100%;
justify-content: space-between;
.positive,
.negative {
display: inline-block;
margin-left: 0.28vw;
}
.positive {
color: #eb6001;
}
.negative {
color: #16e193;
}
} }
.negative { .bottom-num {
color: #16E193; color: #fff;
} }
} }
.bottom-num{ .item-active {
color: #fff; border: 1px solid #24d8ff;
} }
} }
.item-active {
border: 1px solid #24D8FF;
}
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!