From 8c7bd3985eb352cbb8cef29bab1906686ea23457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Tue, 16 Aug 2022 14:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/storeData/customerData/index.js | 2 + pages/storeData/orderData/index.js | 216 +++++++++++++------------- pages/storeData/orderData/index.wxml | 16 +- 3 files changed, 118 insertions(+), 116 deletions(-) diff --git a/pages/storeData/customerData/index.js b/pages/storeData/customerData/index.js index f9563dc..60cff2b 100644 --- a/pages/storeData/customerData/index.js +++ b/pages/storeData/customerData/index.js @@ -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, }) diff --git a/pages/storeData/orderData/index.js b/pages/storeData/orderData/index.js index 501e87e..56c2565 100644 --- a/pages/storeData/orderData/index.js +++ b/pages/storeData/orderData/index.js @@ -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: '退定' }, ] }, { diff --git a/pages/storeData/orderData/index.wxml b/pages/storeData/orderData/index.wxml index a9dd6fc..ac08e59 100644 --- a/pages/storeData/orderData/index.wxml +++ b/pages/storeData/orderData/index.wxml @@ -24,9 +24,10 @@ - - - + + + + {{pie1Bottom}} @@ -37,10 +38,11 @@ {{Pie2title}} - - - - + + + + + {{pie2Bottom}}