diff --git a/commons/js/config.js b/commons/js/config.js index d69b8ff..dcf695a 100644 --- a/commons/js/config.js +++ b/commons/js/config.js @@ -1,4 +1,4 @@ -const env = "d"; +const env = "p"; const version = 1, diff --git a/pages/channel/index.wxml b/pages/channel/index.wxml index 33e0c86..51d602c 100644 --- a/pages/channel/index.wxml +++ b/pages/channel/index.wxml @@ -57,16 +57,14 @@ - - {{item.name}} - - {{auto_brands.name}} + + {{orders.name}} diff --git a/pages/dataAnalysis/detail/index.js b/pages/dataAnalysis/detail/index.js index 10703a8..c3c562f 100644 --- a/pages/dataAnalysis/detail/index.js +++ b/pages/dataAnalysis/detail/index.js @@ -75,9 +75,7 @@ Page({ } this.getAppArea() - - let that = this - + //消息通讯 _.eventBus.on("customerstats", this, function(res){ let that = this; @@ -292,7 +290,7 @@ Page({ }, - //订单数据 + //数据 getAppStatisticsStats_customer(){ this.setData({ showPie1Chart:false, @@ -413,9 +411,9 @@ Page({ data: [] }, grid: { - top: '1%', - left: '5%', - right: '5%', + top: '2%', + left: '2%', + right: '2%', bottom: '35', containLabel: true }, @@ -442,7 +440,7 @@ Page({ BarChartData.yAxis.data = yAxis_data BarChartData.series[0].data = res.data.bar.series_data this.setData({ - Barheight:100 + 60*(res.data.bar.xAxis_data.length), + Barheight:120 + 60*(res.data.bar.xAxis_data.length), Bartitle:res.data.bar.title, showBarChart:true, ['ecBar.onInit']:BarChart, diff --git a/pages/dataAnalysis/index.wxml b/pages/dataAnalysis/index.wxml index 1c950ed..36ad37c 100644 --- a/pages/dataAnalysis/index.wxml +++ b/pages/dataAnalysis/index.wxml @@ -43,7 +43,9 @@ + 转化漏斗 + diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 5414ed8..6fd0f8f 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -15,7 +15,7 @@ - + {{pandianNum}} @@ -40,7 +40,16 @@ - 数据看板 + + + 数据看板 + + 详细 + + + + + @@ -86,7 +95,7 @@ 客户跟进 - + {{userCal.wl_count.num}} @@ -160,7 +169,7 @@ {{item.total}} - + @@ -218,7 +227,7 @@ - + @@ -226,7 +235,7 @@ - + 亲爱的用户,关注 “理车宝”公众号。后续关于客户、订单以及其他相关资讯,将逐步通过服务号通知的形式进行消息通知,请提前关注~ 联系电话:18965133055 @@ -234,12 +243,12 @@ 不再提示 知道了 - + - + @@ -260,12 +269,12 @@ - + - + {{warning.title}} {{warning.note}} @@ -293,15 +302,15 @@ - + - + 理车宝 {{versionInfo.number}} 更新说明 {{index+1}}、{{item}} - - + + \ No newline at end of file diff --git a/pages/order/detail/index2.wxml b/pages/order/detail/index2.wxml index 0047e58..d124c71 100644 --- a/pages/order/detail/index2.wxml +++ b/pages/order/detail/index2.wxml @@ -275,6 +275,7 @@ + diff --git a/pages/storeData/customerData/index.js b/pages/storeData/customerData/index.js index 8f559ff..e62c590 100644 --- a/pages/storeData/customerData/index.js +++ b/pages/storeData/customerData/index.js @@ -1,11 +1,11 @@ import _ from '../../../commons/js/commons'; -import popularData from '../../../commons/js/lib/popularData'; import * as echarts from '../../../ecCanvas/components/ec-canvas/echarts'; const app = getApp() let BarChartData; let Pie1ChartData; let Pie2ChartData; + function BarChart(canvas, width, height, dpr) { const chart = echarts.init(canvas, null, { width: width, @@ -32,7 +32,6 @@ function Pie1Chart(canvas, width, height, dpr) { chart.on('click',function(e){ if(e.data.id>0){ let obj = {} - obj.type = 1 obj.id = e.data.id _.eventBus.emit("customerstats",obj) } @@ -49,12 +48,7 @@ function Pie2Chart(canvas, width, height, dpr) { let option = Pie2ChartData chart.setOption(option); chart.on('click',function(e){ - if(e.data.id>0){ - let obj = {} - obj.type = 0 - obj.id = e.data.id - _.eventBus.emit("customerstats",obj) - } + console.log(e) }); return chart; } @@ -68,6 +62,9 @@ Page({ ecPie2:{}, showBarChart:false,//是否显示Bar图表 ecBar:{}, + Pie1title:'', + Pie2title:'', + Bartitle:'', }, onLoad: function (options) { @@ -77,23 +74,94 @@ Page({ }) } - // popularData.getDateLater(0,0).then(res => { - // this.setData({ - // s_date:res[0], - // e_date:res[1], - // current_date:res[1], - // }) - // }) - this.getAppBizStats_customer() + this.getUserInfo() - let that = this - //消息通讯 是否显示授权用户信息按钮 + //消息通讯 _.eventBus.on("customerstats", this, function(res){ - let url = '/pages/storeData/subData/index?from=customer&type=' + res.type + '&id=' + res.id + '&s_date=' + that.data.s_date + '&e_date=' + that.data.e_date + '¤t_date=' + that.data.current_date - _.$router.openUrlScheme(url) + let that = this; + let params = {}; + params['id'] = res.id; + params['type'] = that.data.type; + params['province_id'] = that.data.province_id; + params['city_id'] = that.data.city_id; + params['s_time'] = that.data.s_date; + params['e_time'] = that.data.e_date; + + _.apiQuery.getAppBizStats_customer_pid(params, that).then(res => { + if(that.data.Pie2title){ + this.setData({ + pie2noData:true, + }) + } + + this.setData({ + Pie2title:res.data.title, + }) + if(res.data.series_data.length==0){ + this.setData({ + pie2noData:true, + }) + }else{ + Pie2ChartData = { + tooltip: { + trigger: 'item', + formatter: '{b}: {c} ({d}%)' + }, + series: [ + { + name: 'Access From', + type: 'pie', + bottom:'12%', + radius: ['0', '55%'], + avoidLabelOverlap: false, + labelLine: { + fontSize:5, + length:10 + }, + label: { + formatter: '{b| {b} }{abg|}\n{hr|}\n{c| {c}({d}%) }', + backgroundColor: '#F6F8FC', + borderColor: '#8C8D8E', + borderWidth: 1, + borderRadius: 4, + rich: { + hr: { + borderColor: '#8C8D8E', + width: '100%', + borderWidth: 1, + height: 0 + }, + b: { + color: '#4C5058', + fontSize:10, + lineHeight:20, + align: 'center', + }, + c: { + color: '#4C5058', + fontSize:8, + lineHeight:20, + align: 'center', + }, + } + }, + data: [] + } + ] + }; + + Pie2ChartData.series[0].data = res.data.series_data + this.setData({ + pie2noData:false, + showPie2Chart:true, + ['ecPie2.onInit']:Pie2Chart, + pie2Bottom:res.data.bottom, + }) + } + wx.stopPullDownRefresh() + }); }) - }, //生命周期函数--监听页面卸载 @@ -102,6 +170,15 @@ Page({ _.eventBus.remove("customerstats",this); }, + //获取用户信息 + getUserInfo(){ + _.apiQuery.getUserInfo().then(res => { + this.setData({ + userInfo: res + }) + }); + }, + //选择日期 changeDate(e){ if(e.currentTarget.dataset.type=="s_date"){ @@ -174,6 +251,7 @@ Page({ }) let params = {}; + params['type'] = this.data.type; params['s_time'] = this.data.s_date; params['e_time'] = this.data.e_date; _.apiQuery.getAppBizStats_customer(params).then(res => { @@ -184,11 +262,10 @@ Page({ this.setData({ Pie1title:res.data.pie1.title, - //Pie2title:res.data.pie2.title, + Pie2title:res.data.pie2?res.data.pie2.title:'', Bartitle:res.data.bar.title, }) - // Pie1ChartData = getPie1Option() if(res.data.pie1.series_data_1.length==0){ this.setData({ pie1noData:true, @@ -260,127 +337,65 @@ Page({ pie1noData:false, showPie1Chart:true, ['ecPie1.onInit']:Pie1Chart, + pie1Bottom:res.data.pie1.bottom, }) } - // Pie2ChartData = getPie2Option() - // if(res.data.pie2.series_data_1.length==0){ - // this.setData({ - // pie2noData:true, - // }) - // }else{ - // Pie2ChartData = { - // tooltip: { - // trigger: 'item', - // formatter: '{b}: {c} ({d}%)' - // }, - // series: [ - // { - // name: 'Access From', - // type: 'pie', - // selectedMode: 'single', - // radius: [0, '30%'], - // label: { - // position: 'inner', - // fontSize: 10 - // }, - // labelBar: { - // show: false - // }, - // data: [] - // }, - // { - // name: 'Access From', - // type: 'pie', - // radius: ['45%', '65%'], - // labelLine: { - // fontSize:5, - // length:10 - // }, - // label: { - // formatter: '{b| {b} }{abg|}\n{hr|}\n{c| {c}({d}%) }', - // backgroundColor: '#F6F8FC', - // borderColor: '#8C8D8E', - // borderWidth: 1, - // borderRadius: 4, - // rich: { - // hr: { - // borderColor: '#8C8D8E', - // width: '100%', - // borderWidth: 1, - // height: 0 - // }, - // b: { - // color: '#4C5058', - // fontSize:10, - // lineHeight:20, - // align: 'center', - // }, - // c: { - // color: '#4C5058', - // fontSize:8, - // lineHeight:20, - // align: 'center', - // }, - // } - // }, - // data: [] - // }, - // ] - // }; - - // Pie2ChartData.series[0].data = res.data.pie2.series_data_1 - // Pie2ChartData.series[1].data = res.data.pie2.series_data_2 - // this.setData({ - // pie2noData:false, - // showPie2Chart:true, - // ['ecPie2.onInit']:Pie2Chart, - // }) - // } + if(res.data.bar){ + BarChartData = { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + } + }, + xAxis: { + type: 'value', + data: [] + }, + yAxis: { + type: 'category', + data: [] + }, + grid: { + top: '2%', + left: '2%', + right: '2%', + bottom: '35', + containLabel: true + }, + series: [ + { + data: [], + type: 'bar', + top: 0, + bottom:'0', + } + ] + }; - //BarChartData = getBarOption() - BarChartData = { - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'shadow' + let xAxis_data = res.data.bar.xAxis_data + let yAxis_data = [] + xAxis_data.forEach(item => { + if(item.length > 6){ + yAxis_data.push(item.substring(0,6)+'...') + }else{ + yAxis_data.push(item) } - }, - xAxis: { - type: 'value', - data: [] - }, - yAxis: { - type: 'category', - data: [] - }, - grid: { - top: '1%', - left: '2%', - right: '5%', - bottom: '1%', - containLabel: true - }, - series: [ - { - data: [], - type: 'bar', - top: 0, - bottom:'0', - } - ] - }; - - BarChartData.yAxis.data = res.data.bar.xAxis_data - BarChartData.series[0].data = res.data.bar.series_data - this.setData({ - Barheight:100 + 50*(res.data.bar.xAxis_data.length), - showBarChart:true, - ['ecBar.onInit']:BarChart, - }) + }) + + BarChartData.yAxis.data = yAxis_data + BarChartData.series[0].data = res.data.bar.series_data + this.setData({ + Barheight:120 + 60*(res.data.bar.xAxis_data.length), + Bartitle:res.data.bar.title, + showBarChart:true, + ['ecBar.onInit']:BarChart, + barBottom:res.data.bar.bottom, + }) + } wx.stopPullDownRefresh() - }); }, @@ -391,187 +406,9 @@ Page({ } }, - //页面相关事件处理函数--监听用户下拉动作 onPullDownRefresh: function () { this.getAppBizStats_customer() }, -}) - -function getPie1Option() { - return { - tooltip: { - trigger: 'item', - formatter: '{b}: {c} ({d}%)' - }, - series: [ - { - name: 'Access From', - type: 'pie', - selectedMode: 'single', - radius: [0, '30%'], - label: { - position: 'inner', - fontSize: 10 - }, - labelBar: { - show: false - }, - data: [ - { value: 1548, name: 'H' }, - { value: 775, name: 'A' }, - { value: 679, name: 'B', } - ] - }, - { - name: 'Access From', - type: 'pie', - radius: ['45%', '65%'], - labelLine: { - fontSize:5, - length:10 - }, - label: { - formatter: '{b| {b} }{abg|}\n{hr|}\n{c| {c}({d}%) }', - backgroundColor: '#F6F8FC', - borderColor: '#8C8D8E', - borderWidth: 1, - borderRadius: 4, - rich: { - hr: { - borderColor: '#8C8D8E', - width: '100%', - borderWidth: 1, - height: 0 - }, - b: { - color: '#4C5058', - fontSize:10, - lineHeight:20, - align: 'center', - }, - c: { - color: '#4C5058', - fontSize:8, - lineHeight:20, - align: 'center', - }, - } - }, - data: [ - { value: 1048, name: '转介绍' }, - { value: 335, name: '网络推广' }, - { value: 310, name: '外展外拓' }, - { value: 251, name: '自媒体' }, - ] - }, - ] - }; -} - -function getPie2Option() { - return { - tooltip: { - trigger: 'item', - formatter: '{b}: {c} ({d}%)' - }, - series: [ - { - name: 'Access From', - type: 'pie', - selectedMode: 'single', - radius: [0, '30%'], - label: { - position: 'inner', - fontSize: 10 - }, - labelLine: { - show: false - }, - data: [ - { value: 258, name: 'H' }, - { value: 77, name: 'A' }, - { value: 67, name: 'B', } - ] - }, - { - name: 'Access From', - type: 'pie', - radius: ['45%', '65%'], - labelLine: { - fontSize:5, - length:10 - }, - label: { - formatter: '{b|{b}}{abg|}\n{hr|}\n{c| {c}({d}%) }', - backgroundColor: '#F6F8FC', - borderColor: '#8C8D8E', - borderWidth: 1, - borderRadius: 4, - rich: { - hr: { - borderColor: '#8C8D8E', - width: '100%', - borderWidth: 1, - height: 0 - }, - b: { - color: '#4C5058', - fontSize:10, - lineHeight:20, - align: 'center', - }, - c: { - color: '#4C5058', - fontSize:8, - lineHeight:20, - align: 'center', - }, - } - }, - data: [ - { value: 48, name: '转介绍' }, - { value: 35, name: '网络推广' }, - { value: 30, name: '外展外拓' }, - { value: 21, name: '自媒体' }, - ] - }, - ] - }; -} - -function getBarOption() { - - return{ - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'shadow' - } - }, - xAxis: { - type: 'value', - data: [] - }, - yAxis: { - type: 'category', - data: ['张三', '李四', '王五', '赵六', '孙七', '周八', '吴九','郑十'] - }, - grid: { - top: '5%', - left: '2%', - right: '5%', - bottom: '3%', - containLabel: true - }, - series: [ - { - data: [120, 200, 150, 80, 70, 110, 130, 10], - type: 'bar', - top: 0, - bottom:'0', - } - ] - }; -} \ No newline at end of file +}) \ No newline at end of file diff --git a/pages/storeData/customerData/index.wxml b/pages/storeData/customerData/index.wxml index 76ca2fd..f624ac9 100644 --- a/pages/storeData/customerData/index.wxml +++ b/pages/storeData/customerData/index.wxml @@ -1,6 +1,7 @@ - - + + {{userInfo.biz_name}} + {{s_date}} @@ -24,41 +25,43 @@ - - + + + + {{pie1Bottom}} - - 点击分类卡片查看具体数据 + 点击分类扇区可查看下级来源数据 - + - + {{Bartitle}} - - - + + + + {{barBottom}} - + \ No newline at end of file diff --git a/pages/storeData/index.js b/pages/storeData/index.js index 394f0ca..cec0582 100644 --- a/pages/storeData/index.js +++ b/pages/storeData/index.js @@ -60,7 +60,8 @@ Page({ this.getAppBizStats() this.getAppBizStats_days() }) - + + this.getUserInfo() }, //选择日期 @@ -267,6 +268,15 @@ Page({ this.getAppBizStats_days() }, + //获取用户信息 + getUserInfo(){ + _.apiQuery.getUserInfo().then(res => { + this.setData({ + userInfo: res + }) + }); + }, + //显示隐藏提示 optShowTip(e) { this.setData({ diff --git a/pages/storeData/index.wxml b/pages/storeData/index.wxml index 6ef18d5..37305fc 100644 --- a/pages/storeData/index.wxml +++ b/pages/storeData/index.wxml @@ -1,6 +1,7 @@ - - + + {{userInfo.biz_name}} + {{s_date}} @@ -24,7 +25,7 @@ {{item.value_1}} - + {{item.title}} diff --git a/pages/storeData/orderData/index.wxml b/pages/storeData/orderData/index.wxml index 1628d8f..8860788 100644 --- a/pages/storeData/orderData/index.wxml +++ b/pages/storeData/orderData/index.wxml @@ -29,7 +29,7 @@ {{pie1Bottom}} - 点击分类卡片查看具体数据 + 点击分类扇区可查看下级来源数据 @@ -45,7 +45,7 @@ {{pie2Bottom}} - 点击分类卡片查看具体数据 + 点击分类扇区可查看下级来源数据