数据统计-静态

This commit is contained in:
老叶
2022-08-10 17:06:02 +08:00
parent 308b9008d1
commit 3147791b6b
20 changed files with 1393 additions and 7 deletions
+5 -1
View File
@@ -52,7 +52,11 @@
"pages/order/editBusinessBicence/index",
"pages/order/editLicenseImg/index",
"pages/order/editInsImg/index",
"pages/order/editOtherImg/index"
"pages/order/editOtherImg/index",
"pages/storeData/index",
"pages/storeData/customerData/index",
"pages/storeData/wechatData/index",
"pages/storeData/orderData/index"
],
"echarts": [
{
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,4 +1,4 @@
const env = "p";
const env = "d";
const version = 1,
+2 -2
View File
@@ -137,7 +137,7 @@
</view>
<!-- 客户数据 -->
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<!-- <view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">客户数据</view>
<view class="absolute right-0 box-middle pt10 pb10 pl20 pr20 bg-ffedeb color-ff4a3a ulib-r10 font-22">累计线索总量 {{cust_total}} 条</view>
@@ -163,7 +163,7 @@
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecPie }}"></ec-canvas>
</view>
</view>
</view>
</view> -->
<!-- 订单数据 -->
<!-- <view class="mt40 inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
+324
View File
@@ -0,0 +1,324 @@
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,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = BarChartData
chart.setOption(option);
chart.on('click',function(e){
console.log(e)
});
return chart;
}
function Pie1Chart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = Pie1ChartData
chart.setOption(option);
chart.on('click',function(e){
console.log(e)
});
return chart;
}
function Pie2Chart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = Pie2ChartData
chart.setOption(option);
chart.on('click',function(e){
console.log(e)
});
return chart;
}
Page({
data: {
imgUrl: _.config.imgUrl,//静态图片路径
isShowKefu:false,
showPie1Chart:false,//是否显示Pie1图表
ecPie1:{},
showPie2Chart:false,//是否显示Pie2图表
ecPie2:{},
showBarChart:false,//是否显示Bar图表
ecBar:{},
},
onLoad: function (options) {
for (let key in options) {
this.setData({
[key]: options[key]
})
}
popularData.getDateLater(0,0).then(res => {
this.setData({
s_date:res[0],
e_date:res[1],
})
})
this.getAppStatisticsHcust()
},
//选择开始日期
changeDate(e){
if(e.currentTarget.dataset.type=="s_date"){
this.setData({
s_date: e.detail.value,
})
}
if(e.currentTarget.dataset.type=="e_date"){
this.setData({
e_date: e.detail.value,
})
}
},
//数据分析-客户数据
getAppStatisticsHcust(){
this.setData({
showPie1Chart:false,
showPie2Chart:false,
})
Pie1ChartData = getPie1Option()
this.setData({
showPie1Chart:true,
['ecPie1.onInit']:Pie1Chart,
})
Pie2ChartData = getPie2Option()
this.setData({
showPie2Chart:true,
['ecPie2.onInit']:Pie2Chart,
})
BarChartData = getBarOption()
this.setData({
showBarChart:true,
['ecBar.onInit']:BarChart,
})
wx.stopPullDownRefresh()
},
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//联系客服
optShowKefu(e) {
this.setData({
isShowKefu:!this.data.isShowKefu,
})
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
//this.getDistributionHome()
},
})
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: 'category',
data: ['张三', '李四', '王五', '赵六', '孙七', '周八', '吴九','郑十']
},
yAxis: {
type: 'value'
},
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',
}
]
};
}
+10
View File
@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "客户数据",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#ff7052",
"backgroundColor": "#ffffff",
"backgroundColorTop": "#ff7052",
"usingComponents": {
"ec-canvas": "../../../ecCanvas/components/ec-canvas/ec-canvas"
}
}
+60
View File
@@ -0,0 +1,60 @@
<view class="container img-top-cover" style="background-image:url({{imgUrl}}storedata/theme.png);">
<view class="text-center pt30 pb30">
<view class="inline-block bg-fff-op20 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750">
<picker class="inline-block" mode="date" value="{{s_date}}" bindchange="changeDate" data-type="s_date">
<view>
<text>{{s_date}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
<text class="pl10 pr10">至</text>
<picker class="inline-block" mode="date" value="{{e_date}}" bindchange="changeDate" data-type="e_date">
<view>
<text>{{e_date}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">客户来源(录入)</view>
</view>
<view class="mt50 mb20 relative height-400 z-index-0">
<view class="absolute wp100 height-400" wx:if="{{showPie1Chart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecPie1 }}"></ec-canvas>
</view>
</view>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">客户来源(进店)</view>
</view>
<view class="mt50 mb20 relative height-400 z-index-0">
<view class="absolute wp100 height-400" wx:if="{{showPie2Chart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecPie2 }}"></ec-canvas>
</view>
</view>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">顾问录入客户</view>
</view>
<view class="mt50 mb20 relative height-500 z-index-0">
<view class="absolute wp100 height-500" wx:if="{{showBarChart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecBar }}"></ec-canvas>
</view>
</view>
</view>
</view>
</view>
<lcb-footer></lcb-footer>
+1
View File
@@ -0,0 +1 @@
/* pages/storeData/index.wxss */
+226
View File
@@ -0,0 +1,226 @@
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 lineChartData;
let FunnelChartData;
function lineChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = lineChartData
chart.setOption(option);
return chart;
}
function FunnelChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = FunnelChartData
chart.setOption(option);
return chart;
}
Page({
data: {
imgUrl: _.config.imgUrl,//静态图片路径
isShowKefu:false,
showFunnelChart:false,//是否显示Funnel图表
ecFunnel:{},
showLineChart:false,//是否显示Line图表
ecLine:{},
},
onLoad: function (options) {
for (let key in options) {
this.setData({
[key]: options[key]
})
}
popularData.getDateLater(0,0).then(res => {
this.setData({
s_date:res[0],
e_date:res[1],
})
})
this.getAppStatisticsHcust()
},
//选择开始日期
changeDate(e){
if(e.currentTarget.dataset.type=="s_date"){
this.setData({
s_date: e.detail.value,
})
}
if(e.currentTarget.dataset.type=="e_date"){
this.setData({
e_date: e.detail.value,
})
}
},
//数据分析-客户数据
getAppStatisticsHcust(){
this.setData({
showFunnelChart:false,
})
FunnelChartData = getFunnelOption()
this.setData({
showFunnelChart:true,
['ecFunnel.onInit']:FunnelChart,
})
lineChartData = getLineOption()
this.setData({
showLineChart:true,
['ecLine.onInit']:lineChart,
})
wx.stopPullDownRefresh()
},
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//联系客服
optShowKefu(e) {
this.setData({
isShowKefu:!this.data.isShowKefu,
})
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
//this.getDistributionHome()
},
})
function getFunnelOption() {
return {
// legend: {
// top: 'bottom',
// data: ['客户量', '到店数', '成交数']
// },
series: [
{
name: 'Expected',
type: 'funnel',
top: '1%',
bottom:'5%',
left: '2%',
width: '80%',
label: {
position: 'right',
formatter: '{b}'
},
labelLine: {
show: false
},
itemStyle: {
opacity: 0.7
},
data: [
{ value: 33.3, name: '成交数(10%)' },
{ value: 66.6, name: '到店数(25%)' },
{ value: 100, name: '客户量' }
]
},
{
name: 'Actual',
type: 'funnel',
top:'1%',
bottom:'5%',
left: '2%',
width: '80%',
maxSize: '80%',
label: {
position: 'inside',
formatter: '{c}',
color: '#000'
},
itemStyle: {
opacity: 0.4,
borderColor: '#fff',
borderWidth:1
},
// emphasis: {
// label: {
// position: 'inside',
// formatter: '{b}: {c}'
// }
// },
data: [
{ value: 20, name: '成交数' },
{ value: 50, name: '到店数' },
{ value:200, name: '客户量' }
],
z: 100
}
]
};
}
function getLineOption() {
return{
tooltip: {
trigger: 'axis'
},
legend: {
top: 'bottom',
data: ['近七日客户数', '近七日订单数',]
},
grid: {
top: '3%',
left: '2%',
right: '5%',
bottom: '20%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['1', '2', '3','4','5','6','7',]
},
yAxis: {
type: 'value'
},
series: [
{
name: '近七日客户数',
type: 'line',
stack: '总量',
data: [20, 30, 50, 60, 66, 70, 73, ],
smooth: true,
},
{
name: '近七日订单数',
type: 'line',
stack: '总量',
data: [10, 15, 22,25, 26, 30, 35,],
smooth: true,
},
]
};
}
+10
View File
@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "门店数据",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#ff7052",
"backgroundColor": "#ffffff",
"backgroundColorTop": "#ff7052",
"usingComponents": {
"ec-canvas": "../../ecCanvas/components/ec-canvas/ec-canvas"
}
}
+101
View File
@@ -0,0 +1,101 @@
<view class="container img-top-cover" style="background-image:url({{imgUrl}}storedata/theme.png);">
<view class="text-center pt30 pb30">
<view class="inline-block bg-fff-op20 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750">
<picker class="inline-block" mode="date" value="{{s_date}}" bindchange="changeDate" data-type="s_date">
<view>
<text>{{s_date}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
<text class="pl10 pr10">至</text>
<picker class="inline-block" mode="date" value="{{e_date}}" bindchange="changeDate" data-type="e_date">
<view>
<text>{{e_date}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
</view>
</view>
<view class="mb40 pl30 pr30 fn-flex text-center color-fff">
<view class="fn-flex-item" bindtap="pushLink" data-url="/pages/storeData/customerData/index">
<view class="inline-block text-left">
<view>
<text class="font-40">9234</text>
<text class="font-28">/8.95w</text>
</view>
<view class="font-22">
<text>客户/进店</text>
<i class="iconfont ml5 icon-gengduo"></i>
</view>
</view>
</view>
<view class="fn-flex-item" bindtap="pushLink" data-url="/pages/storeData/wechatData/index">
<view class="inline-block text-left">
<view>
<text class="font-40">234</text>
<text class="font-28">/8.95w</text>
</view>
<view class="font-22">
<text>企微添加/点亮</text>
<i class="iconfont ml5 icon-gengduo"></i>
</view>
</view>
</view>
<view class="fn-flex-item" bindtap="pushLink" data-url="/pages/storeData/orderData/index">
<view class="inline-block text-left">
<view>
<text class="font-40">934</text>
<text class="font-28">/8.95</text>
</view>
<view class="font-22">
<text>成交/退定</text>
<i class="iconfont ml5 icon-gengduo"></i>
</view>
</view>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="relative inner30 pb60 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">线索转化漏斗</view>
<!-- <picker class="absolute right-0 box-middle" bindchange="changeCity" value="{{cityIndex}}" range="{{cityArray}}">
<view class="pt10 pb10 pl20 pr20 bg-f6 ulib-r10 font-22">
<text>厦门</text>
<text>{{cityArray[cityIndex]}}</text>
<i class="iconfont ml10 icon-xiala color-999"></i>
</view>
</picker> -->
</view>
<view class="mt50 mb20 relative height-400 z-index-0">
<view class="absolute wp100 height-400" wx:if="{{showFunnelChart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecFunnel }}"></ec-canvas>
</view>
</view>
<view class="absolute left-0 bottom-0 mb40 wp100 text-center font-22 color-999">注:时间跨度越大越具参考性</view>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">近一周走势图</view>
<!-- <picker class="absolute right-0 box-middle" bindchange="changeCity" value="{{cityIndex}}" range="{{cityArray}}">
<view class="pt10 pb10 pl20 pr20 bg-f6 ulib-r10 font-22">
<text>厦门</text>
<text>{{cityArray[cityIndex]}}</text>
<i class="iconfont ml10 icon-xiala color-999"></i>
</view>
</picker> -->
</view>
<view class="mt50 mb20 relative height-500 z-index-0">
<view class="absolute wp100 height-500" wx:if="{{showLineChart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecLine }}"></ec-canvas>
</view>
</view>
</view>
</view>
</view>
<lcb-footer></lcb-footer>
+1
View File
@@ -0,0 +1 @@
/* pages/storeData/index.wxss */
+326
View File
@@ -0,0 +1,326 @@
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,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = BarChartData
chart.setOption(option);
chart.on('click',function(e){
console.log(e)
});
return chart;
}
function Pie1Chart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = Pie1ChartData
chart.setOption(option);
chart.on('click',function(e){
console.log(e)
});
return chart;
}
function Pie2Chart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = Pie2ChartData
chart.setOption(option);
chart.on('click',function(e){
console.log(e)
});
return chart;
}
Page({
data: {
imgUrl: _.config.imgUrl,//静态图片路径
isShowKefu:false,
showPie1Chart:false,//是否显示Pie1图表
ecPie1:{},
showPie2Chart:false,//是否显示Pie2图表
ecPie2:{},
showBarChart:false,//是否显示Bar图表
ecBar:{},
},
onLoad: function (options) {
for (let key in options) {
this.setData({
[key]: options[key]
})
}
popularData.getDateLater(0,0).then(res => {
this.setData({
s_date:res[0],
e_date:res[1],
})
})
this.getAppStatisticsHcust()
},
//选择开始日期
changeDate(e){
if(e.currentTarget.dataset.type=="s_date"){
this.setData({
s_date: e.detail.value,
})
}
if(e.currentTarget.dataset.type=="e_date"){
this.setData({
e_date: e.detail.value,
})
}
},
//数据分析-客户数据
getAppStatisticsHcust(){
this.setData({
showPie1Chart:false,
showPie2Chart:false,
})
Pie1ChartData = getPie1Option()
this.setData({
showPie1Chart:true,
['ecPie1.onInit']:Pie1Chart,
})
Pie2ChartData = getPie2Option()
this.setData({
showPie2Chart:true,
['ecPie2.onInit']:Pie2Chart,
})
BarChartData = getBarOption()
this.setData({
showBarChart:true,
['ecBar.onInit']:BarChart,
})
wx.stopPullDownRefresh()
},
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//联系客服
optShowKefu(e) {
this.setData({
isShowKefu:!this.data.isShowKefu,
})
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
//this.getDistributionHome()
},
})
function getPie1Option() {
return {
// tooltip: {
// trigger: 'item',
// formatter: '{b}: {c} ({d}%)'
// },
series: [
{
name: 'Access From',
type: 'pie',
bottom:'10%',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2
},
label: {
show: false,
position: 'center'
},
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 getPie2Option() {
return {
tooltip: {
fontSize:10,
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: '成交数' },
{ value: 77, name: '退定数' },
]
},
{
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: '东风EV' },
{ value: 35, name: '岚图' },
{ value: 30, name: '哪吒' },
{ value: 21, name: '领跑' },
]
},
]
};
}
function getBarOption() {
return{
tooltip: {
trigger: 'axis'
},
grid: {
top: '8%',
left: '5%',
right: '5%',
bottom: '5%',
containLabel: true
},
calculable: true,
xAxis: [
{
type: 'category',
data: ['张三', '李四', '王五', '赵六', '孙七', '周八', '吴九','郑十']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '客户数',
type: 'bar',
data: [
2, 4, 7, 76, 135, 162, 6, 3
],
},
{
name: '订单数',
type: 'bar',
data: [
1, 2, 5, 70, 115.6, 122, 3, 2
],
}
]
};
}
+10
View File
@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "订单数据",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#ff7052",
"backgroundColor": "#ffffff",
"backgroundColorTop": "#ff7052",
"usingComponents": {
"ec-canvas": "../../../ecCanvas/components/ec-canvas/ec-canvas"
}
}
+60
View File
@@ -0,0 +1,60 @@
<view class="container img-top-cover" style="background-image:url({{imgUrl}}storedata/theme.png);">
<view class="text-center pt30 pb30">
<view class="inline-block bg-fff-op20 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750">
<picker class="inline-block" mode="date" value="{{s_date}}" bindchange="changeDate" data-type="s_date">
<view>
<text>{{s_date}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
<text class="pl10 pr10">至</text>
<picker class="inline-block" mode="date" value="{{e_date}}" bindchange="changeDate" data-type="e_date">
<view>
<text>{{e_date}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">订单来源</view>
</view>
<view class="mt50 mb20 relative height-400 z-index-0">
<view class="absolute wp100 height-400" wx:if="{{showPie1Chart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecPie1 }}"></ec-canvas>
</view>
</view>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">品牌分布</view>
</view>
<view class="mt50 mb20 relative height-400 z-index-0">
<view class="absolute wp100 height-400" wx:if="{{showPie2Chart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecPie2 }}"></ec-canvas>
</view>
</view>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">顾问成交情况</view>
</view>
<view class="mt50 mb20 relative height-500 z-index-0">
<view class="absolute wp100 height-500" wx:if="{{showBarChart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecBar }}"></ec-canvas>
</view>
</view>
</view>
</view>
</view>
<lcb-footer></lcb-footer>
+1
View File
@@ -0,0 +1 @@
/* pages/storeData/index.wxss */
+194
View File
@@ -0,0 +1,194 @@
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 Bar1ChartData;
let Bar2ChartData;
let Pie1ChartData;
let Pie2ChartData;
function Bar1Chart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = Bar1ChartData
chart.setOption(option);
chart.on('click',function(e){
console.log(e)
});
return chart;
}
function Bar2Chart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
let option = Bar2ChartData
chart.setOption(option);
chart.on('click',function(e){
console.log(e)
});
return chart;
}
Page({
data: {
imgUrl: _.config.imgUrl,//静态图片路径
isShowKefu:false,
showBar1Chart:false,//是否显示Bar图表
ecBar1:{},
showBar2Chart:false,//是否显示Bar图表
ecBar2:{},
},
onLoad: function (options) {
for (let key in options) {
this.setData({
[key]: options[key]
})
}
popularData.getDateLater(0,0).then(res => {
this.setData({
s_date:res[0],
e_date:res[1],
})
})
this.getAppStatisticsHcust()
},
//选择开始日期
changeDate(e){
if(e.currentTarget.dataset.type=="s_date"){
this.setData({
s_date: e.detail.value,
})
}
if(e.currentTarget.dataset.type=="e_date"){
this.setData({
e_date: e.detail.value,
})
}
},
//数据分析-客户数据
getAppStatisticsHcust(){
this.setData({
})
Bar1ChartData = getBar1Option()
this.setData({
showBar1Chart:true,
['ecBar1.onInit']:Bar1Chart,
})
Bar2ChartData = getBar2Option()
this.setData({
showBar2Chart:true,
['ecBar2.onInit']:Bar2Chart,
})
wx.stopPullDownRefresh()
},
//推送链接
pushLink(e) {
if(e.currentTarget.dataset.url){
_.$router.openUrlScheme(e.currentTarget.dataset.url)
}
},
//联系客服
optShowKefu(e) {
this.setData({
isShowKefu:!this.data.isShowKefu,
})
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
//this.getDistributionHome()
},
})
function getBar1Option() {
return{
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
data: ['张三', '李四', '王五', '赵六', '孙七', '周八', '吴九','郑十']
},
yAxis: {
type: 'value'
},
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',
}
]
};
}
function getBar2Option() {
return{
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
data: ['张三', '李四', '王五', '赵六', '孙七', '周八', '吴九','郑十']
},
yAxis: {
type: 'value'
},
grid: {
top: '5%',
left: '2%',
right: '5%',
bottom: '3%',
containLabel: true
},
series: [
{
data: [20, 20, 10, 20, 20, 20, 25, 2],
type: 'bar',
top: 0,
bottom:'0',
}
]
};
}
+10
View File
@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "企微数据",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#ff7052",
"backgroundColor": "#ffffff",
"backgroundColorTop": "#ff7052",
"usingComponents": {
"ec-canvas": "../../../ecCanvas/components/ec-canvas/ec-canvas"
}
}
+47
View File
@@ -0,0 +1,47 @@
<view class="container img-top-cover" style="background-image:url({{imgUrl}}storedata/theme.png);">
<view class="text-center pt30 pb30">
<view class="inline-block bg-fff-op20 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750">
<picker class="inline-block" mode="date" value="{{s_date}}" bindchange="changeDate" data-type="s_date">
<view>
<text>{{s_date}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
<text class="pl10 pr10">至</text>
<picker class="inline-block" mode="date" value="{{e_date}}" bindchange="changeDate" data-type="e_date">
<view>
<text>{{e_date}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">企微添加好友</view>
</view>
<view class="mt50 mb20 relative height-500 z-index-0">
<view class="absolute wp100 height-500" wx:if="{{showBar1Chart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecBar1 }}"></ec-canvas>
</view>
</view>
</view>
</view>
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<view class="relative">
<view class="font-36">企微添加点亮</view>
</view>
<view class="mt50 mb20 relative height-500 z-index-0">
<view class="absolute wp100 height-500" wx:if="{{showBar2Chart}}">
<ec-canvas class="absolute top-0 bottom-0 left-0 right-0" ec="{{ ecBar2 }}"></ec-canvas>
</view>
</view>
</view>
</view>
</view>
<lcb-footer></lcb-footer>
+1
View File
@@ -0,0 +1 @@
/* pages/storeData/index.wxss */