Commit 8aaf526d by 前端

commit

1 parent 695058bf
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div class="tabs flex box"> <div class="tabs flex box">
<div class="tab" v-for="item in tabs" :key="item.key"> <div class="tab" v-for="item in tabs" :key="item.key">
<div class="tab-title">{{ item.title }}</div> <div class="tab-title">{{ item.title }}</div>
<div v-if="item.key!='retention'" class="tab-text text-linear">{{numAddSymbol(dataList[item.key])}}</div> <div v-if="item.key != 'retention'" class="tab-text text-linear">{{ numAddSymbol(dataList[item.key]) }}</div>
<div v-else class="tab-text text-linear">{{(dataList[item.key])*100}}%</div> <div v-else class="tab-text text-linear">{{ toFixNum(dataList[item.key]) }}</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
name: 'ViewTabs', name: 'ViewTabs',
data() { data() {
return { return {
dataList:{}, dataList: {},
tabs: [ tabs: [
{ {
title: '总门店数', title: '总门店数',
...@@ -39,9 +39,12 @@ export default { ...@@ -39,9 +39,12 @@ export default {
this.getEnterpriseOverview() this.getEnterpriseOverview()
}, },
methods: { methods: {
toFixNum(val) {
return (val * 100).toFixed(0) + '%'
},
getEnterpriseOverview() { getEnterpriseOverview() {
this.api.customer.getEnterpriseOverview().then(res => { this.api.customer.getEnterpriseOverview().then(res => {
if(res.code == 0){ if (res.code == 0) {
this.dataList = res.data.dataList[0] this.dataList = res.data.dataList[0]
} }
}) })
......
...@@ -11,15 +11,19 @@ ...@@ -11,15 +11,19 @@
<div class="business-data"> <div class="business-data">
<business-view :businessNum="businessNum"></business-view> <business-view :businessNum="businessNum"></business-view>
</div> </div>
<div class="business-category">2</div> <div class="business-category">
<Category></Category>
</div>
</div> </div>
</template> </template>
<script> <script>
import businessView from './businessView' import businessView from './businessView'
import Category from './category.vue'
export default { export default {
components: { components: {
businessView businessView,
Category
}, },
name: 'Business', name: 'Business',
data() { data() {
......
<template>
<div class="user-box">
<div class="title title-icon">
<span class="icon"></span>
<span>品类业务</span>
</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> -->
/ <Legend :list="areaData"></Legend>
</div>
</div>
</template>
<script>
// import { userMixin } from '../../mixins/index'
export default {
name: 'Category',
// mixins: [userMixin],
data() {
return {
chart: {
id: 'category',
keys: ['name', 'num'],
radius: ['56%', '85%']
}
}
},
methods: {}
}
</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>
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
<div :class="['content-item', 'flex', info.pd ? info.pd : '']" v-for="(info, index) in infoList" :key="index"> <div :class="['content-item', 'flex', info.pd ? info.pd : '']" v-for="(info, index) in infoList" :key="index">
<div class="content-title">{{ info.title }}</div> <div class="content-title">{{ info.title }}</div>
<template v-for="(data, ids) in info.dataList"> <template v-for="(data, ids) in info.dataList">
<div v-if="ids!=3" :class="['content-number', 'num-' + ids]" :key="ids">{{ index == 0 ? numAddSymbol(data(smartClueData)) : index == 1 ? numAddSymbol(data(merchantData) ): numAddSymbol(data(smartData)) }}</div> <div v-if="ids != 3" :class="['content-number', 'num-' + ids]" :key="ids">
<div v-else :class="['content-number', 'num-' + ids]" :key="ids">{{ index == 0 ? (data(smartClueData)*100) : index == 1 ? (data(merchantData)*100 ): (data(smartData)*100) }}%</div> {{ index == 0 ? numAddSymbol(data(smartClueData)) : index == 1 ? numAddSymbol(data(merchantData)) : numAddSymbol(data(smartData)) }}
</div>
<div v-else :class="['content-number', 'num-' + ids]" :key="ids">{{ index == 0 ? toFixNum(data(smartClueData)) : index == 1 ? toFixNum(data(merchantData)) : toFixNum(data(smartData)) }}</div>
</template> </template>
</div> </div>
</div> </div>
...@@ -21,7 +23,9 @@ ...@@ -21,7 +23,9 @@
<template v-for="(clewData, clewIds) in clew"> <template v-for="(clewData, clewIds) in clew">
<div class="clew-line-text flex-between" :key="clewIds"> <div class="clew-line-text flex-between" :key="clewIds">
<div>{{ clewData.title }}</div> <div>{{ clewData.title }}</div>
<div class="clew-num">{{clewInx == 0 ? numAddSymbol(clewData.value(smartClueData)) : index == 1 ? numAddSymbol(clewData.value(merchantData)) : numAddSymbol(clewData.value(smartData)) }}</div> <div class="clew-num">
{{ clewInx == 0 ? numAddSymbol(clewData.value(smartClueData)) : index == 1 ? numAddSymbol(clewData.value(merchantData)) : numAddSymbol(clewData.value(smartData)) }}
</div>
</div> </div>
</template> </template>
</div> </div>
...@@ -34,7 +38,9 @@ ...@@ -34,7 +38,9 @@
<template v-for="(estimateData, estimateIds) in estimate"> <template v-for="(estimateData, estimateIds) in estimate">
<div :class="['estimate-line-text', estimateInx == 2 ? 'flex-column retrieve' : 'text-center']" :key="estimateIds"> <div :class="['estimate-line-text', estimateInx == 2 ? 'flex-column retrieve' : 'text-center']" :key="estimateIds">
<div v-if="estimateInx == 2">挽回损失</div> <div v-if="estimateInx == 2">挽回损失</div>
<div class="estimate-num">{{estimateInx == 0 ? numAddSymbol(estimateData(smartClueData)) : index == 1 ? numAddSymbol(estimateData(merchantData)) : numAddSymbol(estimateData(smartData)) }}</div> <div class="estimate-num">
{{ estimateInx == 0 ? numAddSymbol(estimateData(smartClueData)) : index == 1 ? numAddSymbol(estimateData(merchantData)) : numAddSymbol(estimateData(smartData)) }}
</div>
</div> </div>
</template> </template>
</div> </div>
...@@ -95,6 +101,9 @@ export default { ...@@ -95,6 +101,9 @@ export default {
this.getSmartClueData() this.getSmartClueData()
}, },
methods: { methods: {
toFixNum(val) {
return (val * 100).toFixed(0) + '%'
},
getMerchantData() { getMerchantData() {
this.api.sass.getMerchantData().then(res => { this.api.sass.getMerchantData().then(res => {
console.log(res) console.log(res)
......
<template> <template>
<div class="user-tab flex"> <div class="user-tab flex">
<template v-for="(tab, index) in userData"> <template v-for="(tab, index) in userData">
<div class="tab-item" :key="index"> <div class="tab-item" :key="index" @click="getTrend(tab.view, tab.text)">
<div class="tab-title">{{ tab.text }}</div> <div class="tab-title">{{ tab.text }}</div>
<div class="tab-count text-linear">{{numAddSymbol(dataList[tab.value])}}</div> <div class="tab-count text-linear">{{ numAddSymbol(dataList[tab.value]) }}</div>
<div class="tab-increase flex-between"> <div class="tab-increase flex-between">
<div class="increase-text">当年新增</div> <div class="increase-text">当年新增</div>
<div class="increase-count">{{numAddSymbol(dataList[tab.key])}}</div> <div class="increase-count">{{ numAddSymbol(dataList[tab.key]) }}</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -24,33 +23,39 @@ export default { ...@@ -24,33 +23,39 @@ export default {
{ {
text: '用户数', text: '用户数',
value: 'totalnum', value: 'totalnum',
key: 'increnum' key: 'increnum',
view: 'total'
}, },
{ {
text: '企微客户数', text: '企微客户数',
value: 'totalwechatnum', value: 'totalwechatnum',
key: 'increwechatnum' key: 'increwechatnum',
view: 'wechat'
}, },
{ {
text: '企微群数', text: '企微群数',
value: 'totalwechatgroupnum', value: 'totalwechatgroupnum',
key: 'increwechatgroupnum' key: 'increwechatgroupnum',
view: 'wechatgroup'
}, },
{ {
text: '小程序', text: '小程序',
value: 'totalappletnum', value: 'totalappletnum',
key: 'increappletnum' key: 'increappletnum',
view: 'applet'
}, },
{ {
text: '个微客户数', text: '个微客户数',
value: 'totalsinglewechantnum', value: 'totalsinglewechantnum',
key: 'incresinglewechantnum' key: 'incresinglewechantnum',
view: 'individual'
} }
] ]
} }
}, },
created() { async created() {
this.getoverview() await this.getoverview()
this.getTrend('total', '用户数')
}, },
methods: { methods: {
getoverview() { getoverview() {
...@@ -59,6 +64,20 @@ export default { ...@@ -59,6 +64,20 @@ export default {
this.dataList = res.data.dataList[0] this.dataList = res.data.dataList[0]
} }
}) })
},
getTrend(queryItem, name) {
const params = { req: { queryItem } }
this.api.user.getTrend(params).then(res => {
if (res.code == 0) {
const dataList = res.data.dataList
const obj = {
dataList,
name
}
this.$bus.$emit('drawPrivateChart', obj)
}
})
} }
} }
} }
...@@ -68,6 +87,7 @@ export default { ...@@ -68,6 +87,7 @@ export default {
height: 9.02vh; height: 9.02vh;
margin: 1.46vh 0 0.98vh 0; margin: 1.46vh 0 0.98vh 0;
.tab-item { .tab-item {
cursor: pointer;
width: 9.65vw; width: 9.65vw;
height: 9.02vh; height: 9.02vh;
background: #0b0e31; background: #0b0e31;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!