Commit 7a5d7f8d by 前端

commit

1 parent ce39783c
/*
* @Description: 售后数据
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 19:13:34
*/
// 品牌-售后档案客户
const getAfterSale = params => {
return window.$HTTP.get('brand/aftersale', params)
}
// 门店-售后档案客户
const getMerchantAfterSale = params => {
return window.$HTTP.get('merchant/aftersale', params)
}
// 获取品牌售后其他信息
const aftersaleother = params => {
return window.$HTTP.get('brand/aftersaleother', params)
}
// 获取门店品牌售后其他信息
const afterMerchantSaleother = params => {
return window.$HTTP.get('merchant/aftersaleother', params)
}
export default { getAfterSale, aftersaleother, afterMerchantSaleother, getMerchantAfterSale }
/*
* @Description: 售后数据
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 19:13:34
*/
// 私域用户池总览数据
const getoverview = params => {
return window.$HTTP.get('/privateDomainUserPool/getoverview', params)
}
// 客户年龄分布/车价占比/购车年限分布/里程分布
const getDistribution = params => {
return window.$HTTP.get('privateDomainUserPool/getDistribution', params)
}
// // 获取品牌售后其他信息
// const aftersaleother = params => {
// return window.$HTTP.get('brand/aftersaleother', params)
// }
// // 获取门店品牌售后其他信息
// const afterMerchantSaleother = params => {
// return window.$HTTP.get('merchant/aftersaleother', params)
// }
export default { getoverview, getDistribution }
......@@ -126,7 +126,10 @@ img {
height: 8.54vh;
margin: 8px 6px 8px 8px;
}
.user-container{
height:6.1vh;
margin: 5px 6px 5px 6px;
}
.empty {
display: flex;
width: 100%;
......
......@@ -50,7 +50,7 @@ export default {
font-size: 7px;
color: #fff;
box-sizing: border-box;
margin: 2px 0;
margin: 2px 2px 2px 0;
white-space: nowrap;
span {
width: 5px;
......
......@@ -163,8 +163,8 @@ export default {
},
// 事件触发
emitEvent(data) {
this.text = data.name
this.subtext = data.value
// this.text = data.name
// this.subtext = data.value
this.echartsPie.setOption(this.option)
this.$emit('pieAction', data)
},
......@@ -185,10 +185,10 @@ export default {
})
//高亮项this.currentIndex
this.mainValue = this.option.series[0].data[this.currentIndex].value
this.numDesc = this.option.series[0].data[this.currentIndex].name
this.descColor = this.option.color[this.currentIndex]
this.setAnamiteText()
// this.mainValue = this.option.series[0].data[this.currentIndex].value
// this.numDesc = this.option.series[0].data[this.currentIndex].name
// this.descColor = this.option.color[this.currentIndex]
// this.setAnamiteText()
},
setAnamiteText() {
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
......
import { changeMixin } from './index'
export default {
data() {
return {
areaData:[],
brandData:[],
storeData:[],
clientData: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
],
brandList: [],
distributionRank: '',
isBrand: false,
brandName: ''
storeData:[]
}
},
mixins: [changeMixin],
created() {
this.getClientData()
},
......@@ -31,10 +18,7 @@ export default {
if(item.queryitem == '品牌分布') this.brandData = item.rankDistributions
if(item.queryitem == '门店类型') this.storeData = item.rankDistributions
});
}
this.clientData = []
this.brandList = []
}
})
}
......
import changeMixin from './changeMixin'
import clientMixin from './clientMixin'
import salesMixin from './salesMixin'
import userMixin from './userMixin'
export {
changeMixin,
clientMixin,
salesMixin
salesMixin,
userMixin
}
\ No newline at end of file
export default {
data() {
return {
ageData: [],
priceData: [],
buyCarData: [],
mileageData: []
}
},
created() {
this.getDistribution()
},
methods: {
getDistribution() {
this.api.user.getDistribution().then(res => {
console.log(res)
if (res.code == 0) {
res.data.dataList.forEach(item => {
if (item.queryitem == '年龄') this.ageData = item.distribution
if (item.queryitem == '车价') this.priceData = item.distribution
if (item.queryitem == '购车年限') this.buyCarData = item.distribution
if (item.queryitem == '里程') this.mileageData = item.distribution
})
}
})
}
}
}
......@@ -7,7 +7,7 @@
</div>
<div class="container flex">
<pie-chart :id="chart.id" :list="areaData" :keys="chart.keys"></pie-chart>
<Legend :list="areaData" :colors="chart.colors"></Legend>
<Legend :list="areaData"></Legend>
</div>
</div>
</template>
......
......@@ -5,29 +5,59 @@
<span class="icon"></span>
<span>客户年龄分布</span>
</div>
<!-- <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart>
<Legend></Legend>
</div> -->
<div class="user-container flex">
<pie-chart ref="pieChart" :id="chart.id" :list="ageData" :keys="chart.keys" :radius="chart.radius" height="6.1vh" @pieAction="pieAction"></pie-chart>
<div class="legend-item flex">
<span :style="{ background: descColor }"></span>
{{ selectData&&selectData.name }}
</div>
</div>
</div>
</template>
<script>
import { clientMixin } from '../../mixins/index'
import { userMixin } from '../../mixins/index'
export default {
name: 'Age',
mixins: [clientMixin],
mixins: [userMixin],
data() {
return {
chart: {
id: 'user-age',
}
keys: ['name', 'num'],
radius: ['56%', '85%']
},
selectData: '',
descColor: ''
}
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
}
}
</script>
<style lang="scss" scoped>
.title{
font-size: 10px;
.user-box {
.title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
......@@ -5,29 +5,59 @@
<span class="icon"></span>
<span>购车年限</span>
</div>
<!-- <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart>
<Legend></Legend>
</div> -->
<div class="user-container flex">
<pie-chart @pieAction="pieAction" ref="pieChart" :id="chart.id" :list="buyCarData" :keys="chart.keys" :radius="chart.radius" height="6.1vh"></pie-chart>
<div class="legend-item flex">
<span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div>
</template>
<script>
import { clientMixin } from '../../mixins/index'
import { userMixin } from '../../mixins/index'
export default {
name: 'bugCar',
mixins: [clientMixin],
mixins: [userMixin],
data() {
return {
selectData: '',
descColor: '',
chart: {
id: 'bugCar',
keys: ['name', 'num'],
radius: ['56%', '85%']
}
}
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
}
}
</script>
<style lang="scss" scoped>
.title{
font-size: 10px;
.user-box {
.title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
......@@ -5,29 +5,59 @@
<span class="icon"></span>
<span>里程分布</span>
</div>
<!-- <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart>
<Legend></Legend>
</div> -->
<div class="user-container flex">
<pie-chart @pieAction="pieAction" ref="pieChart" :id="chart.id" :list="mileageData" :keys="chart.keys" :radius="chart.radius" height="6.1vh"></pie-chart>
<div class="legend-item flex">
<span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div>
</template>
<script>
import { clientMixin } from '../../mixins/index'
import { userMixin } from '../../mixins/index'
export default {
name: 'Mileage',
mixins: [clientMixin],
mixins: [userMixin],
data() {
return {
selectData: '',
descColor: '',
chart: {
id: 'mileage',
keys: ['name', 'num'],
radius: ['56%', '85%']
}
}
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
}
}
</script>
<style lang="scss" scoped>
.title{
font-size: 10px;
.user-box {
.title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
......@@ -5,24 +5,60 @@
<span class="icon"></span>
<span>车价占比</span>
</div>
<!-- <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart>
<Legend></Legend>
</div> -->
<div class="user-container flex">
<pie-chart @pieAction="pieAction" ref="pieChart" :id="chart.id" :list="priceData" :keys="chart.keys" :radius="chart.radius" height="6.1vh"></pie-chart>
<div class="legend-item flex">
<span :style="{ background: descColor }"></span>
{{ selectData && selectData.name }}
</div>
</div>
</div>
</template>
<script>
import { clientMixin } from '../../mixins/index'
import { userMixin } from '../../mixins/index'
export default {
name: 'Price',
mixins: [clientMixin],
mixins: [userMixin],
data() {
return {
selectData: '',
descColor: '',
chart: {
id: 'area',
id: 'user-price',
keys: ['name', 'num'],
radius: ['56%', '85%']
}
}
},
methods: {
pieAction(data) {
this.descColor = this.$refs.pieChart.descColor
this.selectData = data
}
}
}
</script>
<style lang="scss" scoped>
.user-box {
.title {
font-size: 10px;
}
.legend-item {
width: 4.65vw;
height: 1.83vh;
background: #0d133b;
font-weight: 400;
font-size: 9px;
color: #fff;
span {
width: 5px;
height: 5px;
border-radius: 50%;
margin: 4px;
display: inline-block;
}
}
}
</style>
......@@ -4,10 +4,10 @@
<template v-for="(tab, index) in userData">
<div class="tab-item" :key="index">
<div class="tab-title">{{ tab.text }}</div>
<div class="tab-count text-linear">153</div>
<div class="tab-count text-linear">{{dataList[tab.value]}}</div>
<div class="tab-increase flex-between">
<div class="increase-text">当年新增</div>
<div class="increase-count">24</div>
<div class="increase-count">{{dataList[tab.key]}}</div>
</div>
</div>
</template>
......@@ -19,34 +19,47 @@ export default {
name: 'UserTab',
data() {
return {
dataList: {},
userData: [
{
text: '用户数',
value: obj => obj.increnum,
increase: obj => obj.increnum
value: 'totalnum',
key: 'increnum'
},
{
text: '企微客户数',
value: obj => obj.totalwechatnum,
increase: obj => obj.increwechatnum
value: 'totalwechatnum',
key: 'increwechatnum'
},
{
text: '企微群数',
value: obj => obj.totalwechatgroupnum,
increase: obj => obj.increwechatgroupnum
value: 'totalwechatgroupnum',
key: 'increwechatgroupnum'
},
{
text: '小程序',
value: obj => obj.totalappletnum,
increase: obj => obj.increappletnum
value: 'totalappletnum',
key: 'increappletnum'
},
{
text: '个微客户数',
value: obj => obj.totalsinglewechantnum,
increase: obj => obj.incresinglewechantnum
value: 'totalsinglewechantnum',
key: 'incresinglewechantnum'
}
]
}
},
created() {
this.getoverview()
},
methods: {
getoverview() {
this.api.user.getoverview().then(res => {
if (res.code == 0) {
this.dataList = res.data.dataList[0]
}
})
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!