数据二级

This commit is contained in:
老叶
2023-06-14 15:33:32 +08:00
parent 9dd8f5e358
commit 89dd5b800b
6 changed files with 199 additions and 98 deletions
+5 -5
View File
@@ -34,7 +34,7 @@ function Pie1Chart(canvas, width, height, dpr) {
let obj = {}
obj.type = 1
obj.id = e.data.id
_.eventBus.emit("stats",obj)
_.eventBus.emit("customerstats",obj)
}
});
return chart;
@@ -53,7 +53,7 @@ function Pie2Chart(canvas, width, height, dpr) {
let obj = {}
obj.type = 0
obj.id = e.data.id
_.eventBus.emit("stats",obj)
_.eventBus.emit("customerstats",obj)
}
});
return chart;
@@ -89,8 +89,8 @@ Page({
let that = this
//消息通讯 是否显示授权用户信息按钮
_.eventBus.on("stats", this, function(res){
let url = '/pages/storeData/subData/index?type=' + res.type + '&id=' + res.id + '&s_date=' + that.data.s_date + '&e_date=' + that.data.e_date + '&current_date=' + that.data.current_date
_.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 + '&current_date=' + that.data.current_date
_.$router.openUrlScheme(url)
})
@@ -99,7 +99,7 @@ Page({
//生命周期函数--监听页面卸载
onUnload: function () {
//卸载消息通讯 是否显示授权用户信息
_.eventBus.remove('stats',this);
_.eventBus.remove("customerstats",this);
},
//选择日期
+12 -7
View File
@@ -34,7 +34,7 @@ function Pie1Chart(canvas, width, height, dpr) {
let obj = {}
obj.type = 2
obj.id = e.data.id
_.eventBus.emit("stats",obj)
_.eventBus.emit("orderstats",obj)
}
});
return chart;
@@ -49,12 +49,10 @@ function Pie2Chart(canvas, width, height, dpr) {
let option = Pie2ChartData
chart.setOption(option);
chart.on('click',function(e){
_.eventBus.emit("stats",e.name)
if(e.data.id>0){
let obj = {}
obj.type = 3
obj.id = e.data.id
_.eventBus.emit("stats",obj)
_.eventBus.emit("orderstats",obj)
}
});
return chart;
@@ -90,9 +88,16 @@ Page({
let that = this
//消息通讯 是否显示授权用户信息按钮
_.eventBus.on("stats", this, function(res){
let url = '/pages/storeData/subData/index?type=' + res.type + '&id=' + res.id + '&s_date=' + that.data.s_date + '&e_date=' + that.data.e_date + '&current_date=' + that.data.current_date
_.eventBus.on("orderstats", this, function(res){
let url = '/pages/storeData/subData/index'
if(res.type == 2){
url = url+'?from=customer&type=' + res.type + '&id=' + res.id + '&s_date=' + that.data.s_date + '&e_date=' + that.data.e_date + '&current_date=' + that.data.current_date
}else{
url = url+'?from=order&id=' + res.id + '&s_date=' + that.data.s_date + '&e_date=' + that.data.e_date + '&current_date=' + that.data.current_date
}
_.$router.openUrlScheme(url)
})
},
@@ -100,7 +105,7 @@ Page({
//生命周期函数--监听页面卸载
onUnload: function () {
//卸载消息通讯 是否显示授权用户信息
_.eventBus.remove('stats',this);
_.eventBus.remove("orderstats",this);
},
+171 -83
View File
@@ -32,7 +32,7 @@ Page({
[key]: options[key]
})
}
this.getAppBizStats_customer_pid()
this.getAppBizStats()
},
@@ -65,7 +65,7 @@ Page({
})
}
else{
this.getAppBizStats_customer_pid()
this.getAppBizStats()
}
}
if(e.currentTarget.dataset.type=="e_date"){
@@ -94,109 +94,197 @@ Page({
})
}
else{
this.getAppBizStats_customer_pid()
this.getAppBizStats()
}
}
},
//订单数据
getAppBizStats_customer_pid(){
getAppBizStats(){
this.setData({
showPie1Chart:false,
})
let params = {};
params['type'] = this.data.type;
if(this.data.type){
params['type'] = this.data.type;
}
params['id'] = this.data.id;
params['s_time'] = this.data.s_date;
params['e_time'] = this.data.e_date;
_.apiQuery.getAppBizStats_customer_pid(params).then(res => {
wx.setNavigationBarTitle({
title: res.data.title
})
if(this.data.from=='customer'){
_.apiQuery.getAppBizStats_customer_pid(params).then(res => {
// this.setData({
// Pie1title:res.data.title,
// })
if(res.data.series_data.length==0){
this.setData({
pie1noData:true,
wx.setNavigationBarTitle({
title: res.data.title
})
}else{
Pie1ChartData = {
tooltip: {
trigger: 'item',
formatter: '{b}: {c} ({d}%)'
},
series: [
{
name: 'Access From',
type: 'pie',
bottom:'15%',
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: []
}
]
};
Pie1ChartData.series[0].data = res.data.series_data
this.setData({
pie1noData:false,
showPie1Chart:true,
['ecPie1.onInit']:Pie1Chart,
})
}
wx.stopPullDownRefresh()
// this.setData({
// Pie1title:res.data.title,
// })
if(res.data.series_data.length==0){
this.setData({
pie1noData:true,
})
}else{
Pie1ChartData = {
tooltip: {
trigger: 'item',
formatter: '{b}: {c} ({d}%)'
},
series: [
{
name: 'Access From',
type: 'pie',
bottom:'15%',
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: []
}
]
};
Pie1ChartData.series[0].data = res.data.series_data
this.setData({
pie1noData:false,
showPie1Chart:true,
['ecPie1.onInit']:Pie1Chart,
})
}
wx.stopPullDownRefresh()
});
}else if(this.data.from=='order'){
_.apiQuery.getAppBizStats_order_series(params).then(res => {
});
wx.setNavigationBarTitle({
title: res.data.title
})
// this.setData({
// Pie1title:res.data.title,
// })
if(res.data.series_data.length==0){
this.setData({
pie1noData:true,
})
}else{
Pie1ChartData = {
tooltip: {
trigger: 'item',
formatter: '{b}: {c} ({d}%)'
},
series: [
{
name: 'Access From',
type: 'pie',
bottom:'15%',
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: []
}
]
};
Pie1ChartData.series[0].data = res.data.series_data
this.setData({
pie1noData:false,
showPie1Chart:true,
['ecPie1.onInit']:Pie1Chart,
})
}
wx.stopPullDownRefresh()
});
}
},
//页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh: function () {
this.getAppBizStats_customer_pid()
this.getAppBizStats()
},
})
+2 -2
View File
@@ -19,9 +19,9 @@
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
<!-- <view class="relative">
<view class="relative">
<view class="font-36">{{Pie1title}}</view>
</view> -->
</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}}">