店铺数据

This commit is contained in:
老叶
2022-08-16 14:39:06 +08:00
parent 3e40bd1d04
commit 8c7bd3985e
3 changed files with 118 additions and 116 deletions
+2
View File
@@ -234,6 +234,7 @@ Page({
Pie1ChartData.series[0].data = res.data.pie1.series_data_1
Pie1ChartData.series[1].data = res.data.pie1.series_data_2
this.setData({
pie1noData:false,
showPie1Chart:true,
['ecPie1.onInit']:Pie1Chart,
})
@@ -308,6 +309,7 @@ Page({
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,
})
+107 -109
View File
@@ -44,7 +44,7 @@ function Pie2Chart(canvas, width, height, dpr) {
let option = Pie2ChartData
chart.setOption(option);
chart.on('click',function(e){
_.eventBus.emit("pinpai",e.name)
//_.eventBus.emit("pinpai",e.name)
});
return chart;
}
@@ -77,94 +77,94 @@ Page({
this.getAppBizStats_order()
//消息通讯 是否显示授权用户信息按钮
_.eventBus.on("pinpai", this, function(res){
this.setData({
showPie2Chart:false,
})
// //消息通讯 是否显示授权用户信息按钮
// _.eventBus.on("pinpai", this, function(res){
// this.setData({
// showPie2Chart:false,
// })
Pie2ChartData = {
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: []
},
{
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 = {
// 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: []
// },
// {
// 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 = this.data.pie2.series_data
if(res == '成交数'){
Pie2ChartData.series[1].data = this.data.pie2.series_data_1
}
else if(res == '退定数'){
Pie2ChartData.series[1].data = this.data.pie2.series_data_2
}
// Pie2ChartData.series[0].data = this.data.pie2.series_data
// if(res == '成交'){
// Pie2ChartData.series[1].data = this.data.pie2.series_data_1
// }
// else if(res == '退定'){
// Pie2ChartData.series[1].data = this.data.pie2.series_data_2
// }
this.setData({
showPie2Chart:true,
['ecPie2.onInit']:Pie2Chart,
})
})
// this.setData({
// showPie2Chart:true,
// ['ecPie2.onInit']:Pie2Chart,
// })
// })
},
//生命周期函数--监听页面卸载
onUnload: function () {
//卸载消息通讯 是否显示授权用户信息
_.eventBus.remove('pinpai',this);
},
// //生命周期函数--监听页面卸载
// onUnload: function () {
// //卸载消息通讯 是否显示授权用户信息
// _.eventBus.remove('pinpai',this);
// },
//选择日期
@@ -259,11 +259,15 @@ Page({
})
}else{
Pie1ChartData = {
tooltip: {
trigger: 'item',
formatter: '{b}: {c} ({d}%)'
},
series: [
{
name: 'Access From',
type: 'pie',
bottom:'10%',
bottom:'15%',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
itemStyle: {
@@ -313,8 +317,10 @@ Page({
Pie1ChartData.series[0].data = res.data.pie1.series_data
this.setData({
pie1noData:false,
showPie1Chart:true,
['ecPie1.onInit']:Pie1Chart,
pie1Bottom:res.data.pie1.bottom,
})
}
@@ -326,7 +332,6 @@ Page({
}else{
Pie2ChartData = {
tooltip: {
fontSize:10,
trigger: 'item',
formatter: '{b}: {c} ({d}%)'
},
@@ -334,21 +339,18 @@ Page({
{
name: 'Access From',
type: 'pie',
selectedMode: 'single',
radius: [0, '30%'],
bottom:'15%',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2
},
label: {
position: 'inner',
fontSize: 10
show: false,
position: 'center'
},
labelLine: {
show: false
},
data: []
},
{
name: 'Access From',
type: 'pie',
radius: ['45%', '65%'],
labelLine: {
fontSize:5,
length:10
@@ -381,20 +383,16 @@ Page({
}
},
data: []
},
}
]
};
Pie2ChartData.series[0].data = res.data.pie2.series_data
if(res.data.pie2.series_data[0].name=='成交数'){
Pie2ChartData.series[1].data = res.data.pie2.series_data_1
}else if(res.data.pie2.series_data[0].name=='退定数'){
Pie2ChartData.series[1].data = res.data.pie2.series_data_2
}
Pie2ChartData.series[0].data = res.data.pie2.series_data_1
this.setData({
pie2noData:false,
showPie2Chart:true,
['ecPie2.onInit']:Pie2Chart,
pie2:res.data.pie2,
pie2Bottom:res.data.pie2.bottom,
//pie2:res.data.pie2,
})
}
@@ -534,8 +532,8 @@ function getPie2Option() {
show: false
},
data: [
{ value: 258, name:'成交',selected:true},
{ value: 77, name: '退定' },
{ value: 258, name:'成交',selected:true},
{ value: 77, name: '退定' },
]
},
{
+9 -7
View File
@@ -24,9 +24,10 @@
</view>
<lcb-listmore isNoData='{{pie1noData}}' noDataMsg='暂无数据'></lcb-listmore>
<view class="mt50 mb20 relative height-400 z-index-0" wx:if="{{!pie1noData}}">
<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 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 class="absolute left-0 bottom-0 right-0 text-center font-22 color-888">{{pie1Bottom}}</view>
</view>
</view>
</view>
@@ -37,10 +38,11 @@
<view class="font-36">{{Pie2title}}</view>
</view>
<lcb-listmore isNoData='{{pie2noData}}' noDataMsg='暂无数据'></lcb-listmore>
<view class="mt50 mb20 relative height-400 z-index-0" wx:if="{{!pie2noData}}">
<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 class="mt50 mb20 relative height-400 z-index-0" wx:if="{{!pie2noData}}">
<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 class="absolute left-0 bottom-0 right-0 text-center font-22 color-888">{{pie2Bottom}}</view>
</view>
</view>
</view>