This commit is contained in:
小鱼开发
2024-07-04 14:57:29 +08:00
parent 584d915412
commit 35b87e6cba
14 changed files with 238 additions and 165 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
const env = "p";
const env = "d";
const version = 1,
+6 -6
View File
@@ -19,12 +19,12 @@ Component({
"activeIcon": "tab-home-ac",
"title": "首页",
},
// {
// "url": "/pages/dataAnalysis/index",
// "icon": "tab-dataAnalysis",
// "activeIcon": "tab-dataAnalysis-ac",
// "title": "数据分析",
// },
{
"url": "/pages/dataAnalysis/index",
"icon": "tab-dataAnalysis",
"activeIcon": "tab-dataAnalysis-ac",
"title": "数据分析",
},
{
"url": "/pages/mine/index?source=channel",
"icon": "tab-mine",
+4 -4
View File
@@ -38,7 +38,7 @@ Page({
deallist:'',
hoursTip:'',
isShowProfile:true,//是否显示授权用户信息按钮
propvince_id:'',//默认省
province_id:'',//默认省
},
onLoad(options) {
@@ -145,10 +145,10 @@ Page({
let areaArr = []
// let cur_index = []
area_list.forEach((item,index) => {
if(item.propvince_id==area_id[0]){
if(item.province_id==area_id[0]){
item.children.forEach((it,idx)=>{
if(it.city_id==area_id[1]){
// cur_index = [item.propvince_id,it.city_id]
// cur_index = [item.province_id,it.city_id]
this.setData({
areaIndex: [index,idx]
})
@@ -198,7 +198,7 @@ Page({
//20240526选择地区
changeArea(e){
this.setData({
province_id:this.data.area_list[e.detail.value[0]]['propvince_id'],
province_id:this.data.area_list[e.detail.value[0]]['province_id'],
city_id:this.data.area_list[e.detail.value[0]].children[e.detail.value[1]].city_id,
areaIndex: e.detail.value,
})
+78 -23
View File
@@ -32,6 +32,12 @@ function Pie1Chart(canvas, width, height, dpr) {
chart.setOption(option);
chart.on('click',function(e){
console.log(e)
if(e.data.id>0){
let obj = {}
obj.type = 1
obj.id = e.data.id
_.eventBus.emit("customerstats",obj)
}
});
return chart;
}
@@ -88,34 +94,82 @@ Page({
})
}
this.getAppCity()
this.getAppArea()
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 + '&current_date=' + that.data.current_date
_.$router.openUrlScheme(url)
})
},
//获取系统配置城市
getAppCity(){
_.apiQuery.getAppCity().then(res => {
this.setData({
city_id:this.data.city_id?this.data.city_id:res.data.default,
})
let cityArray = []
res.data.list.forEach((item,index) => {
cityArray.push(item.name)
if(item.city_id==this.data.city_id){
this.setData({
cityIndex:index,
})
}
})
this.setData({
cityArray:cityArray,
cityList:res.data.list,
})
this.getAppStatisticsStats_customer()
//20240526 获取系统配置城市省市
getAppArea(){
_.apiQuery.getAppCityLists().then(res => {
let area_list = res.data.area_list
let area_id = res.data.default_area_id
let areaArr = []
// let cur_index = []
area_list.forEach((item,index) => {
if(item.province_id==area_id[0]){
item.children.forEach((it,idx)=>{
if(it.city_id==area_id[1]){
// cur_index = [item.province_id,it.city_id]
this.setData({
areaIndex: [index,idx]
})
areaArr = [area_list,area_list[index].children]
return;
}
})
}
});
this.setData({
area_id: area_id,
area_list: area_list,
areaArr: areaArr,
province_id:area_id[0],
city_id:area_id[1]
})
this.getAppStatisticsStats_customer()
});
},
//生命周期函数--监听页面卸载
onUnload: function () {
//卸载消息通讯 是否显示授权用户信息
_.eventBus.remove("customerstats",this);
},
//选择城市
changeArea(e) {
this.setData({
province_id:this.data.area_list[e.detail.value[0]]['province_id'],
city_id:this.data.area_list[e.detail.value[0]].children[e.detail.value[1]].city_id,
areaIndex: e.detail.value,
})
this.getAppStatisticsStats_customer()
},
//20240526地区联动
columnChangeArea(e){
let multiData = this.data.area_list;
let multiIndex = this.data.areaIndex;
let columnIndex = e.detail.column;
let columnValue = e.detail.value;
multiIndex[columnIndex] = columnValue;
this.setData({
areaArr: [
multiData,
multiData[multiIndex[0]].children
],
})
},
//选择日期
@@ -192,6 +246,7 @@ Page({
let params = {};
params['type'] = this.data.type;
params['province_id'] = this.data.province_id;
params['city_id'] = this.data.city_id;
params['s_time'] = this.data.s_date;
params['e_time'] = this.data.e_date;
+1 -1
View File
@@ -1,5 +1,5 @@
{
"navigationBarTitleText": "订单数据",
"navigationBarTitleText": "数据看板",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#ff7052",
"backgroundColor": "#ffffff",
+6 -4
View File
@@ -1,9 +1,9 @@
<view class="container img-top-cover" style="background-image:url({{imgUrl}}storedata/theme.png);">
<view class="text-center pt20 pb40 pl30 pr30 fn-clear">
<view class="fn-fl bg-fff-op20 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750">
<picker bindchange="changeCity" value="{{cityIndex}}" range="{{cityArray}}">
<picker mode="multiSelector" bindchange="changeArea" bindcolumnchange="columnChangeArea" value="{{areaIndex}}" range="{{areaArr}}" range-key="name">
<view>
<text>{{cityArray[cityIndex]}}</text>
<text>{{area_list[areaIndex[0]].name}}-{{area_list[areaIndex[0]].children[areaIndex[1]].name}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
@@ -31,12 +31,13 @@
<view class="font-36">{{Pie1title}}</view>
</view>
<lcb-listmore isNoData='{{pie1noData}}' noDataMsg='暂无数据'></lcb-listmore>
<view class="mt50 mb20 relative height-600 z-index-0" wx:if="{{!pie1noData}}">
<view class="mb20 relative height-600 z-index-0" wx:if="{{!pie1noData}}">
<view class="absolute wp100 height-600" 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 class="text-center font-22 color-f9394d" wx:if="{{showPie1Chart}}">点击分类卡片查看具体数据</view>
</view>
</view>
@@ -50,7 +51,8 @@
<view class="absolute wp100 height-600" 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 class="absolute left-0 bottom-0 right-0 text-center font-22 color-888" >{{pie2Bottom}}</view-->
<view class="text-center font-22 color-f9394d" wx:if='{{!pie1noData}}'>点击分类卡片查看具体数据</view>
</view>
</view>
</view>
+51 -21
View File
@@ -57,36 +57,62 @@ Page({
current_date:res[1],
})
this.getAppCity()
this.getAppArea()
})
},
//获取系统配置城市
getAppCity(){
_.apiQuery.getAppCity().then(res => {
let cityArray = []
res.data.list.forEach((item,index) => {
cityArray.push(item.name)
if(item.city_id==res.data.default){
this.setData({
cityIndex:index,
//20240526 获取系统配置城市省市
getAppArea(){
_.apiQuery.getAppCityLists().then(res => {
let area_list = res.data.area_list
let area_id = res.data.default_area_id
let areaArr = []
// let cur_index = []
area_list.forEach((item,index) => {
if(item.province_id==area_id[0]){
item.children.forEach((it,idx)=>{
if(it.city_id==area_id[1]){
// cur_index = [item.province_id,it.city_id]
this.setData({
areaIndex: [index,idx]
})
areaArr = [area_list,area_list[index].children]
return;
}
})
}
})
});
this.setData({
city_id:res.data.default,
cityArray:cityArray,
cityList:res.data.list,
area_id: area_id,
area_list: area_list,
areaArr: areaArr,
province_id:area_id[0],
city_id:area_id[1]
})
this.getAppStatisticsStats()
this.getAppStatisticsStats_days()
});
},
//20240526地区联动
columnChangeArea(e){
let multiData = this.data.area_list;
let multiIndex = this.data.areaIndex;
let columnIndex = e.detail.column;
let columnValue = e.detail.value;
multiIndex[columnIndex] = columnValue;
this.setData({
areaArr: [
multiData,
multiData[multiIndex[0]].children
],
})
},
//选择日期
changeDate(e){
if(e.currentTarget.dataset.type=="s_date"){
@@ -157,6 +183,7 @@ Page({
})
let params = {};
params['province_id'] = this.data.province_id;
params['city_id'] = this.data.city_id;
params['s_time'] = this.data.s_date;
params['e_time'] = this.data.e_date;
@@ -239,6 +266,7 @@ Page({
})
let params = {};
params['province_id'] = this.data.province_id;
params['city_id'] = this.data.city_id;
params['days'] = this.data.daysIndex == 0?'7':'30';
_.apiQuery.getAppStatisticsStats_days(params).then(res => {
@@ -282,9 +310,10 @@ Page({
wx.stopPullDownRefresh()
});
},
//选择天数
changeDays(e) {
this.setData({
@@ -314,10 +343,11 @@ Page({
},
//选择城市
changeCity(e) {
changeArea(e) {
this.setData({
city_id:this.data.cityList[e.detail.value].city_id,
cityIndex: e.detail.value
province_id:this.data.area_list[e.detail.value[0]]['province_id'],
city_id:this.data.area_list[e.detail.value[0]].children[e.detail.value[1]].city_id,
areaIndex: e.detail.value,
})
this.getAppStatisticsStats()
this.getAppStatisticsStats_days()
+7 -17
View File
@@ -1,9 +1,9 @@
<view class="container img-top-cover" style="background-image:url({{imgUrl}}storedata/theme.png);">
<view class="text-center pt20 pb40 pl30 pr30 fn-clear">
<view class="fn-fl bg-fff-op20 pt5 pb5 pl20 pr20 font-22 color-fff ulib-r750">
<picker bindchange="changeCity" value="{{cityIndex}}" range="{{cityArray}}">
<picker mode="multiSelector" bindchange="changeArea" bindcolumnchange="columnChangeArea" value="{{areaIndex}}" range="{{areaArr}}" range-key="name">
<view>
<text>{{cityArray[cityIndex]}}</text>
<text>{{area_list[areaIndex[0]].name}}-{{area_list[areaIndex[0]].children[areaIndex[1]].name}}</text>
<i class="iconfont ml5 icon-xuanze"></i>
</view>
</picker>
@@ -27,12 +27,12 @@
<view class="mt10 mb40 pl30 pr30 fn-flex text-center color-fff">
<block wx:for='{{tabs}}' wx:key='index'>
<view class="fn-flex-item" bindtap="pushLink" data-url="{{item.url}}&city_id={{city_id}}&s_date={{s_date}}&e_date={{e_date}}&current_date={{current_date}}">
<view class="fn-flex-item" bindtap="pushLink" data-url="{{item.url}}&province_id={{province_id}}&s_date={{s_date}}&e_date={{e_date}}&current_date={{current_date}}">
<view class="inline-block text-left">
<view class="text-center">
<text class="font-40">{{item.value_1}}</text>
</view>
<view class="pt10 font-22">
<view class="pt10 pl20 font-22">
<text>{{item.title}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</view>
@@ -43,16 +43,6 @@
<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">{{funneltitle}}</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>
@@ -89,9 +79,9 @@
<view slot="content">
<view class="inner40 pt50 pb50 line-height-18 font-26 color-666" style="width:520rpx;">
<view class="text-center">
<text wx:if="{{tipIndex==0}}">发生在时间周期内的\n [客户建档] / [进店客户]</text>
<text wx:elif="{{tipIndex==1}}">发生在时间周期内的\n [企微添加好友] / [企微好友完善手机号码]</text>
<text wx:elif="{{tipIndex==2}}">发生在时间周期内的\n [下定订单] / [退款订单]</text>
<text wx:if="{{tipIndex==0}}">发生在时间周期内的\n [客户建档] / [客户进店] </text>
<text wx:elif="{{tipIndex==1}}">发生在时间周期内的\n [微信添加] </text>
<text wx:elif="{{tipIndex==2}}">发生在时间周期内的\n [下定订单] </text>
</view>
</view>
<view class="bts-1-eb text-center font-32 color-666">
+1 -1
View File
@@ -15,7 +15,7 @@
</view>
</view>
</view>
<view wx:if="{{0}}" class="mb30 pt40 pb40 bg-fff box-shadow-000-10-10 ulib-r10 text-center">
<view class="mb30 pt40 pb40 bg-fff box-shadow-000-10-10 ulib-r10 text-center">
<view class="pl20 pr20 fn-flex font-22 color-666">
<view class="relative fn-flex-item" bindtap="pushLink" data-url="/pages/inventory/list/index">
<view class="absolute peg-tip box-center ml30 bg-f9394d bds-2-fff img-24x24 text-center font-18 color-fff ulib-r750 z-index-1" wx:if="{{pandianNum}}"><text class="absolute box-center-middle">{{pandianNum}}</text></view>
+73 -73
View File
@@ -184,7 +184,7 @@ Page({
this.setData({
Pie1title:res.data.pie1.title,
Pie2title:res.data.pie2.title,
//Pie2title:res.data.pie2.title,
Bartitle:res.data.bar.title,
})
@@ -264,79 +264,79 @@ Page({
}
// 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: []
},
]
};
// 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,
})
}
// 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,
// })
// }
//BarChartData = getBarOption()
BarChartData = {
+2 -2
View File
@@ -32,7 +32,7 @@
</view>
</view>
<view class="mb30 pl30 pr30">
<!--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">{{Pie2title}}</view>
@@ -45,7 +45,7 @@
</view>
<view class="text-center font-22 color-f9394d" wx:if='{{!pie2noData}}'>点击分类卡片查看具体数据</view>
</view>
</view>
</view-->
<view class="mb30 pl30 pr30">
<view class="inner30 pt40 bg-fff box-shadow-000-10-10 ulib-r10">
+3 -7
View File
@@ -21,14 +21,10 @@
<block wx:for='{{tabs}}' wx:key='index'>
<view class="fn-flex-item">
<view class="inline-block text-left">
<view bindtap="optShowTip" data-index="{{index}}">
<view class="inline-block relative">
<text class="font-40">{{item.value_1}}</text>
<text class="font-28">{{item.value_2}}</text>
<i class="absolute font-24 iconfont icon-ziyuan" style="top:-10rpx;right:-20rpx;"></i>
</view>
<view class="text-center">
<text class="font-40">{{item.value_1}}</text>
</view>
<view class="pt10 font-22" bindtap="pushLink" data-url="{{item.url}}?s_date={{s_date}}&e_date={{e_date}}&current_date={{current_date}}">
<view class="pt10 font-22 pl20" bindtap="pushLink" data-url="{{item.url}}?s_date={{s_date}}&e_date={{e_date}}&current_date={{current_date}}">
<text>{{item.title}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</view>
+3 -3
View File
@@ -122,9 +122,9 @@ Page({
title: res.data.title
})
// this.setData({
// Pie1title:res.data.title,
// })
this.setData({
Pie1title:res.data.title,
})
if(res.data.series_data.length==0){
this.setData({
pie1noData:true,
+2 -2
View File
@@ -23,8 +23,8 @@
<view class="font-36">{{Pie1title}}</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}}">
<view class="mt50 mb20 relative height-500 z-index-0" wx:if="{{!pie1noData}}">
<view class="absolute wp100 height-600" 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>