Commit 16f113b2 by 张立顺

功能开发

1 parent c918b564
......@@ -181,11 +181,19 @@ class outputApi {
}
/** 业务数据指标分析诊断-营收概要 权益会员*/
analysisOverviewVdquotation(data) {
return api.post({method:'dj.api.smartcarlife.data.analysis.Vdquotation.overview',...data } , false, 'dj')
return api.post({ method: 'dj.api.smartcarlife.data.analysis.Vdquotation.overview', ...data }, false, 'dj')
}
/** 业务数据指标分析诊断-趋势分析 权益会员*/
analysisTendencyVdquotation(data) {
return api.post({method:'dj.api.smartcarlife.data.Vdquotation.analysis.tendency',...data } ,false, 'dj')
return api.post({ method: 'dj.api.smartcarlife.data.Vdquotation.analysis.tendency', ...data }, false, 'dj')
}
/** 业务数据指标分析诊断-流量情况*/
analysisInviteRecord(data) {
return api.post({ method: 'dj.api.smartcarlife.data.analysis.inviteRecord.count', ...data }, false, 'dj')
}
/** 业务数据指标分析诊断-无效流量(战败订单)*/
analysisNotUpgradePage(data) {
return api.post({ method: 'dj.api.smartcarlife.data.analysis.notUpgrade.page', ...data }, false, 'dj')
}
}
export default outputApi
import * as echarts from '../ec-canvas/echarts';
import * as echarts from '../ec-canvas/echarts'
Component({
/**
......@@ -6,27 +6,27 @@ Component({
*/
properties: {
chartData: {
type: Array,
value: () => []
},
keys: {
type: Array,
value: ['year', 'sales']
},
tickCount: {
type: Number,
value: 4
},
color: {
type: String,
value: '#3975C6'
type: Object,
value: {}
}
// keys: {
// type: Array,
// value: ['year', 'sales']
// },
// tickCount: {
// type: Number,
// value: 4
// },
// color: {
// type: String,
// value: '#3975C6'
// }
},
observers: {
'chartData': function (data) {
console.log(data, '----------------')
this.initData(data)
},
'chartData.data': function (data) {
console.log(data, 'pie----------------')
data && this.onInitChart(data)
}
},
/**
* 组件的初始数据
......@@ -42,146 +42,135 @@ Component({
* 组件的方法列表
*/
methods: {
onInitChart(xData, yData) {
this.ecComponent && this.ecComponent.init((canvas, width, height, dpr) => {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr,
});
this.setOption(chart, xData, yData);
return chart;
})
onInitChart() {
this.ecComponent &&
this.ecComponent.init((canvas, width, height, dpr) => {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr
})
this.setOption(chart)
return chart
})
},
setOption(chart, xData, yData) {
let {chartData:diagramList} = this.data
const abscissaDataList = [],
orderMoneyTotalList = [],
upgradeAveragePriceList = [],
upgradeRateList = []
setOption(chart) {
let { chartData } = this.data
// const abscissaDataList = [],
// orderMoneyTotalList = [],
// upgradeAveragePriceList = [],
// upgradeRateList = []
diagramList.forEach(element => {
abscissaDataList.push(element.abscissaData)
orderMoneyTotalList.push(this.sceneId == 0 ? element.orderMoneyTotal : element.outputValue)
upgradeAveragePriceList.push(this.sceneId == 0 ? element.upgradeAveragePrice : element.avgPrice)
upgradeRateList.push(element.upgradeRate || 0)
});
// diagramList.forEach(element => {
// abscissaDataList.push(element.abscissaData)
// orderMoneyTotalList.push(this.sceneId == 0 ? element.orderMoneyTotal : element.outputValue)
// upgradeAveragePriceList.push(this.sceneId == 0 ? element.upgradeAveragePrice : element.avgPrice)
// upgradeRateList.push(element.upgradeRate || 0)
// })
const colors = ['#3582EE', '#35C376', '#FF9D0A']
// const colors = ['#3582EE', '#35C376', '#FF9D0A']
var option = {
color: colors,
grid: {
left: '25%',
right: '15%'
title: {
show: true, //显示策略,默认值true,可选为:true(显示) | false(隐藏)
text: chartData.total + '人', //主标题文本,'\n'指定换行
x: 'center', //水平安放位置,默认为'left',可选为:'center' | 'left' | 'right' | {number}(x坐标,单位px)
y: 'center', //垂直安放位置,默认为top,可选为:'top' | 'bottom' | 'center' | {number}(y坐标,单位px)
textAlign: null, //水平对齐方式,默认根据x设置自动调整,可选为: left' | 'right' | 'center
padding: 5, //标题内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距
// itemGap: 10, //主副标题纵向间隔,单位px,默认为10
textStyle: {
//主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"}
fontFamily: 'PingFangSC-Medium, Verdana, sans...',
fontSize: 14,
fontStyle: 'normal',
color: '#333333',
fontWeight: '600'
},
zlevel: 0, //一级层叠控制。默认0,每一个不同的zlevel将产生一个独立的canvas,相同zlevel的组件或图标将在同一个canvas上渲染。zlevel越高越靠顶层,canvas对象增多会消耗更多的内存和性能,并不建议设置过多的zlevel,大部分情况可以通过二级层叠控制z实现层叠控制。
z: 6 //二级层叠控制,默认6,同一个canvas(相同zlevel)上z越高约靠顶层。
},
// 滚动设置
dataZoom: [
{
type: 'slider', //隐藏或显示(true)组件
show: false,
showDetail: false, //是否显示detail,即拖拽时候显示详细数值信息
startValue: 0,
endValue: 5,
start: 50,
end: 100,
zoomLoxk: true // 是否锁定选择区域(或叫做数据窗口)的大小
},
{
//没有下面这块的话,只能拖动滚动条,鼠标滚轮在区域内不能控制外部滚动条
type: 'inside',
zoomOnMouseWheel: false, //滚轮是否触发缩放
moveOnMouseMove: true, //鼠标滚轮触发滚动
moveOnMouseWheel: true
}
],
legend: {
data: ['营业额', '客单价', '转化率'],
top: 'bottom'
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data:abscissaDataList|| ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
}
],
yAxis: [
{
type: 'value',
name: '营业额',
position: 'left',
alignTicks: true,
offset: -5,
axisLabel: {
formatter: '{value} 元'
}
},
{
type: 'value',
name: '客单价',
position: 'right',
offset: 1000,
axisLabel: {
formatter: '{value} 元'
}
},
{
type: 'value',
name: '转化率',
position: 'right',
alignTicks: true,
axisLabel: {
formatter: '{value} %'
color: ['#5fcf90', '#f56c51', '#5f9cf3', '#ffb13c'],
tooltip: {
trigger: 'item'
},
label: {
show: true,
formatter: '{b}\n{c}',
// alignTo: 'labelLine',
align: 'right',
edgeDistance: '10%' // 可以调整文字与饼图边缘的距离
// rich: {
// // d: {
// // color: '#fff',
// // fontSize: 16,
// // lineHeight: 24,
// // height: 24
// // },
// align: {
// // color: '#5fcf90',
// fontSize: 14,
// // lineHeight: 20,
// align: 'right'
// }
// }
// textStyle: {
// color: '#fff',
// align: 'right',
// fontSize: 14
// }
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
labelLine: {
//设置提示线的长度
normal: {
length: 10, //第一条线
length2: 15 //第二条线
}
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
data: chartData.data
// [
// { value: 1048, name: '已预约' },
// { value: 735, name: '取消预约' },
// { value: 580, name: '超时未到店' },
// { value: 484, name: '待预约' }
// ]
}
]
}
}
],
series: [
{
name: '营业额',
type: 'bar',
yAxisIndex: 0,
data: orderMoneyTotalList
},
{
name: '客单价',
type: 'bar',
yAxisIndex: 0,
data: upgradeAveragePriceList
},
{
name: '转化率',
type: 'line',
yAxisIndex: 2,
data: upgradeRateList
}
]
};
chart.setOption(option)
},
//初始化数据
initData(data) {
const xData = [],
yData = [];
const [x, y] = this.data.keys
data.forEach(item => {
xData.push(item[x])
yData.push(item[y])
})
this.setData({
xData,
yData
})
this.onInitChart(xData, yData)
},
// const xData = [],
// yData = []
// const [x, y] = this.data.keys
// data.forEach(item => {
// xData.push(item[x])
// yData.push(item[y])
// })
// this.setData({
// xData,
// yData
// })
// this.onInitChart(xData, yData)
}
},
ready() {
// 获取组件
this.ecComponent = this.selectComponent('#mychart-dom-bar');
this.ecComponent = this.selectComponent('#mychart-dom-bar')
}
})
\ No newline at end of file
})
/* packageOutput/components/echart/echart.wxss */
// .f2-chart {
// width: 100%;
// height: 500rrpx;
// }
.ec-canvas {
width: 670rpx;
height: 520rpx;
margin-top: -20rpx;
width: 720rpx;
height: 450rpx;
// margin-top: -20rpx;
}
.container {
height: 584rpx;
// height: 584rpx;
padding: 20rpx 16rpx 0rpx;
background-color: #fff;
margin-bottom: 20rpx;
......@@ -26,8 +23,8 @@
.title-tip {
font-weight: 400;
font-size: 20rpx;
color: #999999;
font-size: 24rpx;
color: #333333;
}
.title-tip-red {
......@@ -159,4 +156,71 @@
height: 40rpx;
}
}
}
.invalidFlowContainer {
box-sizing: border-box;
border-top: 1rpx solid #e4e6ee;
padding: 20rpx 16rpx 24rpx;
margin-top: 40rpx;
.header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 32rpx;
.label {
font-size: 24rpx;
color: #333333;
}
}
.customer {
box-sizing: border-box;
width: 100%;
padding: 24rpx;
font-weight: 400;
font-size: 24rpx;
color: #666666;
background: #F7F9FA;
border: 2rpx solid #F3F8FA;
border-radius: 16rpx;
margin-bottom: 24rpx;
.header {
display: flex;
align-items: center;
justify-content: space-between;
.name {
font-weight: 600;
font-size: 28rpx;
color: #333333;
}
}
.item {
display: flex;
margin-top: 16rpx;
.label {
width: 100rpx;
margin-right: 24rpx;
}
}
}
}
.arrow {
width: 40rpx;
height: 40rpx;
margin: 0 auto;
.img {
width: 100%;
height: 100%;
}
}
\ No newline at end of file
<view class="container">
<view class="title">
趋势分析
<view class="title-tip" v-show="firstOrderDate">业务开展时间:{{ firstOrderDate }}</view>
</view>
<!-- <view class="" id="bar"></view> -->
<view class="ec-canvas">
<ec-canvas class=" echart-box" id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ec }}" force-use-old-canvas="true"></ec-canvas>
</view>
</view>
<view class="container">
<view class="title">
流量情况
<view class="title-tip">客户领券后的预约情况</view>
</view>
<!-- <view class="" id="bar"></view> -->
<view class="ec-canvas">
<ec-canvas class="echart-box" id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ec }}" force-use-old-canvas="true"></ec-canvas>
</view>
<view class="invalidFlowContainer">
<view class="header">
<view class="title">无效流量</view>
<view class="label">共{{chartData.customerList.lenght}}条客户信息经由跟进人处理为战败客户</view>
</view>
<view class="customer" wx:for="{{ chartData.customerList }}" wx:key="index">
<view class="header">
<view class="name">{{item.customer.customerName}}</view>
<view class="date">{{item.orderTime}}</view>
</view>
<!-- followUpPerson -->
<view class="item">
<view class="label">跟进人</view>
<view class="name">{{item.employeeName}}|{{item.advanceUserName}}</view>
</view>
<!-- reasonContainer -->
<view class="item">
<view class="label">拒升理由</view>
<view class="result">{{item.customer.refusalReason}}</view>
</view>
</view>
<view class="arrow">
<image class="img" src="../../images/arrowIcon.png"></image>
</view>
</view>
</view>
\ No newline at end of file
import * as echarts from '../ec-canvas/echarts';
import * as echarts from '../ec-canvas/echarts'
Component({
/**
* 组件的属性列表
*/
properties: {
chartData: {
type: Array,
value: () => []
},
keys: {
type: Array,
value: ['year', 'sales']
},
tickCount: {
tabIndex: {
type: Number,
value: 4
value: 0
},
color: {
type: String,
value: '#3975C6'
chartData: {
type: Array,
value: []
}
// keys: {
// type: Array,
// value: ['year', 'sales']
// },
// tickCount: {
// type: Number,
// value: 4
// }
// color: {
// type: String,
// value: '#3975C6'
// }
},
observers: {
'chartData': function (data) {
chartData: function (data) {
console.log(data, '----------------')
this.initData(data)
},
data && data.length && this.initData(data)
}
},
/**
* 组件的初始数据
......@@ -42,35 +46,35 @@ Component({
* 组件的方法列表
*/
methods: {
onInitChart(xData, yData) {
this.ecComponent && this.ecComponent.init((canvas, width, height, dpr) => {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr,
});
this.setOption(chart, xData, yData);
return chart;
})
onInitChart() {
this.ecComponent &&
this.ecComponent.init((canvas, width, height, dpr) => {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr
})
this.setOption(chart)
return chart
})
},
setOption(chart, xData, yData) {
let {chartData:diagramList} = this.data
const abscissaDataList = [],
orderMoneyTotalList = [],
upgradeAveragePriceList = [],
upgradeRateList = []
setOption(chart) {
let { chartData: diagramList, tabIndex } = this.data
diagramList.forEach(element => {
abscissaDataList.push(element.abscissaData)
orderMoneyTotalList.push(this.sceneId == 0 ? element.orderMoneyTotal : element.outputValue)
upgradeAveragePriceList.push(this.sceneId == 0 ? element.upgradeAveragePrice : element.avgPrice)
upgradeRateList.push(element.upgradeRate || 0)
});
const abscissaDataList = [],
orderMoneyTotalList = [],
upgradeAveragePriceList = [],
upgradeRateList = []
diagramList.forEach(element => {
abscissaDataList.push(element.abscissaData)
// console.log(element.orderMoneyTotal, 'orderMoneyTotal')
orderMoneyTotalList.push(tabIndex == 0 ? element.orderMoneyTotal : element.outputValue)
upgradeAveragePriceList.push(tabIndex == 0 ? element.upgradeAveragePrice : element.avgPrice)
upgradeRateList.push(element.upgradeRate || 0)
})
// console.log(orderMoneyTotalList, 'orderMoneyTotalList')
const colors = ['#3582EE', '#35C376', '#FF9D0A']
var option = {
color: colors,
......@@ -78,110 +82,110 @@ Component({
left: '25%',
right: '15%'
},
// 滚动设置
dataZoom: [
{
type: 'slider', //隐藏或显示(true)组件
show: false,
showDetail: false, //是否显示detail,即拖拽时候显示详细数值信息
startValue: 0,
endValue: 5,
start: 50,
end: 100,
zoomLoxk: true // 是否锁定选择区域(或叫做数据窗口)的大小
},
{
//没有下面这块的话,只能拖动滚动条,鼠标滚轮在区域内不能控制外部滚动条
type: 'inside',
zoomOnMouseWheel: false, //滚轮是否触发缩放
moveOnMouseMove: true, //鼠标滚轮触发滚动
moveOnMouseWheel: true
}
],
legend: {
data: ['营业额', '客单价', '转化率'],
top: 'bottom'
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data:abscissaDataList|| ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
}
],
yAxis: [
{
type: 'value',
name: '营业额',
position: 'left',
alignTicks: true,
offset: -5,
axisLabel: {
formatter: '{value} 元'
}
},
{
type: 'value',
name: '客单价',
position: 'right',
offset: 1000,
axisLabel: {
formatter: '{value} 元'
}
},
{
type: 'value',
name: '转化率',
position: 'right',
alignTicks: true,
axisLabel: {
formatter: '{value} %'
// 滚动设置
dataZoom: [
{
type: 'slider', //隐藏或显示(true)组件
show: false,
showDetail: false, //是否显示detail,即拖拽时候显示详细数值信息
startValue: 0,
endValue: 5,
start: 50,
end: 100,
zoomLoxk: true // 是否锁定选择区域(或叫做数据窗口)的大小
},
{
//没有下面这块的话,只能拖动滚动条,鼠标滚轮在区域内不能控制外部滚动条
type: 'inside',
zoomOnMouseWheel: false, //滚轮是否触发缩放
moveOnMouseMove: true, //鼠标滚轮触发滚动
moveOnMouseWheel: true
}
],
legend: {
data: ['营业额', '客单价', '转化率'],
top: 'bottom'
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: abscissaDataList || ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
}
],
yAxis: [
{
type: 'value',
name: '营业额',
position: 'left',
alignTicks: true,
offset: -5,
axisLabel: {
formatter: '{value} 元'
}
},
{
type: 'value',
name: '客单价',
position: 'right',
offset: 1000,
axisLabel: {
formatter: '{value} 元'
}
},
{
type: 'value',
name: '转化率',
position: 'right',
alignTicks: true,
axisLabel: {
formatter: '{value} %'
}
}
],
series: [
{
name: '营业额',
type: 'bar',
yAxisIndex: 0,
data: orderMoneyTotalList
},
{
name: '客单价',
type: 'bar',
yAxisIndex: 0,
data: upgradeAveragePriceList
},
{
name: '转化率',
type: 'line',
yAxisIndex: 2,
data: upgradeRateList
}
]
}
}
],
series: [
{
name: '营业额',
type: 'bar',
yAxisIndex: 0,
data: orderMoneyTotalList
},
{
name: '客单价',
type: 'bar',
yAxisIndex: 0,
data: upgradeAveragePriceList
},
{
name: '转化率',
type: 'line',
yAxisIndex: 2,
data: upgradeRateList
}
]
};
chart.setOption(option)
},
//初始化数据
initData(data) {
const xData = [],
yData = [];
const [x, y] = this.data.keys
data.forEach(item => {
xData.push(item[x])
yData.push(item[y])
})
this.setData({
xData,
yData
})
this.onInitChart(xData, yData)
},
// const xData = [],
// yData = []
// const [x, y] = this.data.keys
// data.forEach(item => {
// xData.push(item[x])
// yData.push(item[y])
// })
// this.setData({
// xData,
// yData
// })
this.onInitChart()
}
},
ready() {
// 获取组件
this.ecComponent = this.selectComponent('#mychart-dom-bar');
this.ecComponent = this.selectComponent('#mychart-dom-bar')
}
})
\ No newline at end of file
})
......@@ -10,6 +10,7 @@
}
.container {
box-sizing: border-box;
height: 584rpx;
padding: 20rpx 16rpx 0rpx;
background-color: #fff;
......
......@@ -8,18 +8,25 @@ Component({
type: Number,
value: 0
},
revenueData:{
type:Object,
value:{},
observer: function (){
revenueData: {
type: Object,
value: {},
observer: function () {
this.initRevenueData()
}
},
chartData:{
type:Object,
value:[],
chartData: {
type: Object,
value: []
},
chartDataPie: {
type: Object,
value: {}
},
customerList: {
type: Object,
value: []
}
},
/**
......@@ -71,28 +78,13 @@ Component({
]
}
},
attached() {
// setTimeout(() => {
// this.setData({
// chartData: [
// { abscissaValue: '2023-08-11', ordinateValue: 0 },
// { abscissaValue: '2023-08-12', ordinateValue: 0 },
// { abscissaValue: '2023-08-13', ordinateValue: 0 },
// { abscissaValue: '2023-08-14', ordinateValue: 0 },
// { abscissaValue: '2023-08-15', ordinateValue: 0 },
// { abscissaValue: '2023-08-16', ordinateValue: 9574 },
// { abscissaValue: '2023-08-17', ordinateValue: 0 }
// ]
// })
// }, 400)
},
attached() {},
/**
* 组件的方法列表
*/
methods: {
initRevenueData (){
initRevenueData() {
// let {revenueData,}
}
}
})
......@@ -173,6 +173,18 @@
}
}
.resultContainer {
padding: 20rpx 16rpx 40rpx;
background-image: linear-gradient(0deg, #f8fbff 0%, #eff5fe 100%);
border-radius: 16rpx;
.content {
font-weight: 400;
font-size: 24rpx;
color: #333333;
}
}
.flex {
display: flex;
align-items: center;
......
......@@ -13,31 +13,38 @@
<view wx:for="{{ tabIndex? revenueFormData.equityList: revenueFormData.membraneList }}" wx:key="index" class="flex row">
<view class="td">
<view class="label">{{ item.label }}</view>
<view class="num">{{filter.filterItemName(item,revenueData)}}</view>
<view class="num">{{filter.filterItemName(item,revenueData)}}</view>
</view>
<view class="td">
<view class="label">较上月</view>
<view class="flex">
<view class="{{ revenueData[item.name].revenueToClassMonth}}">
{{revenueData[item.name].comparedWithLastMonth }}
</view>
<image wx:if="{{revenueData[item.name].revenueToClassMonth}}" class="icon-up-down"
src="../../images/icon-{{revenueData[item.name].revenueToClassMonth}}.png" />
</view>
<view class="{{ revenueData[item.name].revenueToClassMonth }}">{{revenueData[item.name].comparedWithLastMonth }}</view>
<image
wx:if="{{ revenueData[item.name].revenueToClassMonth }}"
class="icon-up-down"
src="../../images/icon-{{ revenueData[item.name].revenueToClassMonth }}.png"
/>
</view>
</view>
<view class="td">
<view class="label">较去年</view>
<view class="flex">
<view :class="{{revenueData[item.name].revenueToClassYear}}">
{{revenueData[item.name].comparedWithLastYear }}</view>
<image wx:if="{{revenueData[item.name].revenueToClassYear}}" class="icon-up-down"
src="../../images/icon-'{{revenueData[item.name].revenueToClassYear}}.png" />
</view>
<view :class="{{ revenueData[item.name].revenueToClassYear }}">{{revenueData[item.name].comparedWithLastYear }}</view>
<image
wx:if="{{ revenueData[item.name].revenueToClassYear }}"
class="icon-up-down"
src="../../images/icon-'{{ revenueData[item.name].revenueToClassYear }}.png"
/>
</view>
</view>
</view>
</view>
</view>
<echart chartData="{{ chartData }}" tickCount="{{ opts.tickCount }}" keys="{{ opts.keys }}"></echart>
<echart-pie chartData="{{ chartData }}" tickCount="{{ opts.tickCount }}" keys="{{ opts.keys }}"></echart-pie>
<echart chartData="{{ chartData }}" tickCount="{{ opts.tickCount }}" keys="{{ opts.keys }}" tabIndex="{{ tabIndex }}"></echart>
<echart-pie chartData="{{ chartDataPie }}" customerList="{{ customerList }}" tickCount="{{ opts.tickCount }}" keys="{{ opts.keys }}"></echart-pie>
<!-- v-if="diagnosticResults && sceneId != 1" -->
<view class="resultContainer">
<view class="title">诊断结果</view>
<view class="content">诊断结果诊断结果诊断结果{{ diagnosticResults }}</view>
</view>
</view>
\ No newline at end of file
// packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.js
import outputApi from '~/api/outputApi/index'
import { tsFormatTime } from '~/utils/format'
Page({
/**
* 页面的初始数据
......@@ -19,39 +20,44 @@ Page({
width: '30%'
}
],
tabIndx: 1
tabIndx: 0,
chartDataPie: {
data: []
}
},
initData() {
let { tabIndx } = this.data
// tabIndx == 1 ? this.crowdfundingData :
console.log(tabIndx,'tabIndx');
this.getAnalysisTendency(tabIndx)
// tabIndx == 1 ? this.crowdfundingData :
console.log(tabIndx, 'tabIndx')
this.getAnalysisTendency(tabIndx)
},
crowdfundingData() {},
getAnalysisTendency(tabIndx) {
console.log(tabIndx,'tabIndx');
console.log(tabIndx, 'tabIndx')
let params = {
isSuper: true,
shopMerchantIdList: [44211227],
isSuper: false,
phone: '',
dataDimension: tabIndx,
startDate: '2023-08-01',
endDate: '2023-08-21'
endDate: '2023-08-22'
}
// debugger
// 默认是精品升级 取后面接口
let apiName = outputApi[tabIndx ? 'analysisOverviewVdquotation' : 'analysisOverview']
let apiNameTendency = outputApi[tabIndx ? 'analysisTendencyVdquotation' : 'analysisTendency']
// console.log(apiName);
// console.log(apiNameTendency);
apiName(params).then(res => {
console.log(res, 'analysisOverview')
// console.log(res, 'analysisOverview')
let revenueData = res
for (const key in revenueData) {
let month = revenueData[key].comparedWithLastMonth
let year = revenueData[key].comparedWithLastYear
// let val3 = revenueData[key].comparedWithLastMonth
// let val4 = revenueData[key].comparedWithLastMonth
revenueData[key].revenueToClassMonth = month == null|| month == 0 ? '': month>0? 'up' : 'down'
revenueData[key].revenueToClassYear = year == null || year == 0 ? '': year>0? 'up' : 'down'
revenueData[key].comparedWithLastMonth = month == null ? '0%': Math.abs(month) +'%'
revenueData[key].comparedWithLastYear = year == null ? '0%' : Math.abs(year) +'%'
let month = revenueData[key].comparedWithLastMonth
let year = revenueData[key].comparedWithLastYear
revenueData[key].revenueToClassMonth = month == null || month == 0 ? '' : month > 0 ? 'up' : 'down'
revenueData[key].revenueToClassYear = year == null || year == 0 ? '' : year > 0 ? 'up' : 'down'
revenueData[key].comparedWithLastMonth = month == null ? '0%' : Math.abs(month) + '%'
revenueData[key].comparedWithLastYear = year == null ? '0%' : Math.abs(year) + '%'
}
this.setData({
revenueData
......@@ -63,12 +69,39 @@ Page({
firstOrderDate: res?.firstOrderDate,
diagnosticResults: res.diagnosticResults || '',
diagramList: res.diagramList || []
// this.drawBar(data.diagramList)
})
})
// 精品升级请求流量接口数据
!tabIndx && this.getTrafficInterfaceData(params)
},
getTrafficInterfaceData(params) {
outputApi.analysisInviteRecord(params).then(res => {
console.log(res, 'analysisInviteRecord')
let { expireReachCount, hadInvitedCount, notInvitedCount, cancelInvitedCount } = res
this.setData({
['chartDataPie.data']: [
{ value: hadInvitedCount, name: '已预约' },
{ value: cancelInvitedCount, name: '取消预约' },
{ value: expireReachCount, name: '超时未到店' },
{ value: notInvitedCount, name: '待预约' }
],
['chartDataPie.total']: hadInvitedCount + cancelInvitedCount + expireReachCount + notInvitedCount
})
})
outputApi.analysisNotUpgradePage({ ...params, shopMerchantId: params.shopMerchantIdList.join(''), pageSize: 100, pageNum: 1 }).then(res => {
console.log(res, 'analysisNotUpgradePage')
let { list } = res
list.forEach(item => {
item.orderTime = tsFormatTime(item.orderTime)
})
this.setData({
// analysisNotUpgradePage: res,
['chartDataPie.customerList']: res.list
})
})
},
onRoute() {
this.getAnalysisTendency(this.data.tabIndx)
// this.getListSelectAccount(sessionId)
}
......
<!--packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml-->
<!-- <text>packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml</text> -->
<view class="layout" >
<view class="titleBox">
<view class="layout">
<view class="titleBox">
<view class="imgBox" bind:tap="back">
<image src="../../images/blackArrow.png" />
</view>
<view class="navigation-title-text">广西弘泽汽车销售服务…</view>
</view>
<tab tab="{{tabList}}" itemWidth="{{'30%'}}" index="{{tabIndx}}" bindclick="changeTabIndx" class="tabContainer" />
<view class="searchBar">
</view>
<view class="conCom" >
<output-echart class="container" revenueData="{{revenueData}}" chartData="{{diagramList}}" tabIndex="{{tabIndx}}"></output-echart>
</view>
<!-- <output-echart></output-echart>
<tab tab="{{ tabList }}" itemWidth="{{ '30%' }}" index="{{ tabIndx }}" bindclick="changeTabIndx" class="tabContainer" />
<view class="searchBar"></view>
<view class="conCom">
<output-echart
class="container"
revenueData="{{ revenueData }}"
chartData="{{ diagramList }}"
chartDataPie="{{ chartDataPie }}"
tabIndex="{{ tabIndx }}"
customerList="{{ customerList }}"
></output-echart>
</view>
<!-- <output-echart></output-echart>
<output-crowdfund></output-crowdfund> -->
</view>
</view>
\ No newline at end of file
......@@ -164,3 +164,34 @@ export function deleteSecond(time) {
hour = hour.join(':')
return `${moth} ${hour}`
}
/**
* 时间戳转化为年 月 日 时 分 秒
* ts: 传入时间戳
* format:返回格式,支持自定义,但参数必须与formateArr里保持一致
*/
export function tsFormatTime(timestamp, format) {
format = format || 'Y-M-D h:m:s'
const formateArr = ['Y', 'M', 'D', 'h', 'm', 's']
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
let returnArr = []
let date = new Date(timestamp)
let year = date.getFullYear()
let month = date.getMonth() + 1
let day = date.getDate()
let hour = date.getHours()
let minute = date.getMinutes()
let second = date.getSeconds()
returnArr.push(year, month, day, hour, minute, second)
returnArr = returnArr.map(formatNumber)
for (var i in returnArr) {
format = format.replace(formateArr[i], returnArr[i])
}
return format
}
......@@ -29,7 +29,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false
const release = false
let index = 2
let index = 1
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
......
......@@ -7,7 +7,7 @@ class Request {
return this.request('GET', params, returnAll, requestPath)
}
post(params, returnAll = false, requestPath) {
console.log(requestPath, 'requestPath')
// console.log(requestPath, 'requestPath')
return this.request('POST', params, returnAll, requestPath)
}
async request(RequestMethods, params, returnAll, requestPath = 'scrm') {
......@@ -29,6 +29,7 @@ class Request {
path = requestPath == 'dj' ? `/rop-dj-${projectName}/` : `/rop-scrm-${projectName}/`
}
params = this.getData(params, requestPath)
// console.log(params,'params');
wx.request({
url: `${domain[requestPath]}${path}router?method=${params.method}`,
data: params,
......@@ -37,6 +38,7 @@ class Request {
dataType: 'json',
responseType: 'text',
success(response) {
// console.log(response,'response');
/**业务代码 */
let {
data: { code, message },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!