Commit 5aac943e by 胡悦

添加头部同步数据 客流转化、转化趋势

1 parent 9346226f
// window.$HTTP
export default {
/**获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
getBrandOverallbase (req) {
/** 获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
getBrandOverallbase(req) {
return window.$HTTP.get('brand/overallbase', { req })
},
/*获取品牌---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getBrandOveralltrend (req) {
/* 获取品牌---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getBrandOveralltrend(req) {
return window.$HTTP.get('brand/overalltrend', { req })
},
/* 获取门店总体相关信息 */
getMerchantOverallbase (req) {
getMerchantOverallbase(req) {
return window.$HTTP.get('merchant/overallbase', { req })
},
/*获取门店---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getMerchantOveralltrend (req) {
/* 获取门店---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getMerchantOveralltrend(req) {
return window.$HTTP.get('merchant/overalltrend', { req })
},
/**
* 获取接入门店数
*/
getMerchantNum(req) {
return window.$HTTP.get('brand/getMerchantNum', { req })
}
}
......@@ -8,10 +8,12 @@
<div class="top flex">
<img src="@/assets/images/time.svg" class="icon" />
<div class="now">{{ now }}</div>
<div class="yesterday">数据截止至 {{ yesterday }}</div>
</div>
<div class="bottom flex">
<div class="merchant">已同步门店数:160</div>
数据截止至 {{ yesterday }}
<div class="merchant">已同步门店数:{{ merchantNum.totalNum }}</div>
<div class="merchant">上月新接入店数:{{merchantNum.increLastMonthNum}}</div>
<div class="merchant">本月新接入店数:{{merchantNum.increThisMonthNum}}</div>
</div>
</div>
<div class="center-control">
......@@ -23,21 +25,35 @@
<script type="text/ecmascript-6">
export default {
name: 'ViewTitle',
data () {
data() {
return {
yesterday: '',
now: new Date().format('yyyy-MM-dd hh:mm:ss')
now: new Date().format('yyyy-MM-dd hh:mm:ss'),
merchantNum: {
totalNum: '--',
increLastMonthNum: '--',
increThisMonthNum: '--'
}
}
},
mounted () {
mounted() {
this.yesterday = new Date(new Date().setDate(new Date().getDate() - 1)).format('yyyy-MM-dd')
this.timer()
this.getMerchantNum()
},
methods: {
timer () {
timer() {
setInterval(() => {
this.now = new Date().format('yyyy-MM-dd hh:mm:ss')
}, 1e3)
},
getMerchantNum() {
this.api.overview.getMerchantNum({}).then(res => {
console.log(res)
if (res.code === '0') {
this.merchantNum = res.data.dataList[0]
}
})
}
}
}
......@@ -74,6 +90,11 @@ export default {
color: #ffffff;
.top {
justify-content: flex-end;
.yesterday {
font-size: 10px;
color: #606266;
margin-left: 5px;
}
}
.icon {
width: 16px;
......@@ -88,6 +109,7 @@ export default {
color: #eb6001;
margin-right: 10px;
padding-right: 10px;
line-height: 2vh;
position: relative;
&::after {
position: absolute;
......@@ -97,7 +119,13 @@ export default {
width: 1px;
height: 1.5vh;
content: '';
background-color: #606266;
background-color: #EB6001;
}
&:last-child{
margin-right: 0;
&::after {
width: 0;
}
}
}
}
......
......@@ -20,8 +20,8 @@
<div class="flow-right">
<!-- <div class="ranking-value">{{currentName}}{{ isBrand ? '门店' : '品牌' }}排名</div> -->
<div class="ranking-title">
<div @click="changeRank(1)" :class="isActive == 1 ? 'active' : ''">{{currentName}}前5{{ isBrand ? '门店' : '品牌' }}</div>
<div @click="changeRank(2)" :class="isActive == 2 ? 'active' : ''">{{currentName}}后5{{ isBrand ? '门店' : '品牌' }}</div>
<div @click="changeRank(1)" :style="{'background-color': isActive == 1 ? bgColor : ''}" :class="isActive == 1 ? 'active' : ''">{{currentName}}前5{{ isBrand ? '门店' : '品牌' }}</div>
<div @click="changeRank(2)" :style="{'background-color': isActive == 2 ? bgColor : ''}" :class="isActive == 2 ? 'active' : ''">{{currentName}}后5{{ isBrand ? '门店' : '品牌' }}</div>
</div>
<div class="ranking-content">
<div class="ranking-item" v-for="(item, index) in flowData" :key="index">
......@@ -95,7 +95,9 @@ export default {
topList: [],
lastList: [],
isBrand: false,
currentName: ''
currentName: '',
bgColor: '#BF98FF',
colorList: ['#BF98FF', '#E60115', '#4FA0FF', '#EB6001', '#F5AA01']
}
},
mounted() {
......@@ -152,7 +154,7 @@ export default {
},
borderWidth: 0
},
color: ['#BF98FF', '#E60115', '#4FA0FF', '#EB6001', '#F5AA01'],
color: this.colorList,
series: [
{
name: '漏斗图',
......@@ -195,12 +197,12 @@ export default {
this.echartsFunnel.on(
'mouseover',
utils.debounce(data => {
this.getSaleTrans(this.paramsData, data.data.type, data.data.name)
this.getSaleTrans(this.paramsData, data.data.type, data.data.name, data.dataIndex)
}),
1000 / 60
)
},
getSaleTrans(val, queryItem = 'enter', name = '客流') {
getSaleTrans(val, queryItem = 'enter', name = '客流', index = 0) {
const params = {
req: {
queryItem: queryItem,
......@@ -235,6 +237,7 @@ export default {
}
this.flowData = this.isActive == 1 ? this.topList : this.lastList
this.currentName = name
this.bgColor = this.colorList[index]
})
},
// 切换品牌排序
......@@ -282,12 +285,12 @@ export default {
.ranking-content {
background-color: #262525;
padding: 0.4vh 0;
height: 11vh;
}
.ranking-item {
display: flex;
width: 100%;
align-items: center;
line-height: 2.2vh;
height: 2.2vh;
.ranking-sort {
......
......@@ -34,7 +34,8 @@ export default {
dataList: [],
paramsData: [],
list: ['enter', 'stayfile', 'test', 'placeorder', 'success'],
hasData: true
hasData: true,
colorList: ['#BF98FF', '#E60115', '#4FA0FF', '#EB6001', '#F5AA01']
}
},
mounted() {
......@@ -107,7 +108,9 @@ export default {
const date = this.dataList[0][index].statDate
var txt = date + '<br />'
e.forEach(item => {
txt = txt + item.seriesName + ':' + item.value + '<br />'
console.log(item)
item.marker = '<span style=\"display:inline-block;margin-right:4px;border-radius:5px;width:5px;height:5px;background-color:' + this.colorList[item.componentIndex] + ';\"></span>'
txt = txt + item.marker + item.seriesName + ':' + item.value + '<br />'
})
return txt
}
......@@ -191,6 +194,9 @@ export default {
})
this.echartsTrend.setOption(this.option)
this.chartAction()
this.echartsTrend.on('globalout', () => {
this.chartAction()
})
},
chartAction(type) {
this.echartsTrend.dispatchAction({
......@@ -207,4 +213,11 @@ export default {
width: 100%;
overflow: hidden;
}
.trend-dot {
display: inline-block;
width: 2px;
height: 2px;
border-radius: 50%;
background-color: #BF98FF;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!