Commit 16f113b2 by 张立顺

功能开发

1 parent c918b564
...@@ -181,11 +181,19 @@ class outputApi { ...@@ -181,11 +181,19 @@ class outputApi {
} }
/** 业务数据指标分析诊断-营收概要 权益会员*/ /** 业务数据指标分析诊断-营收概要 权益会员*/
analysisOverviewVdquotation(data) { 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) { 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 export default outputApi
import * as echarts from '../ec-canvas/echarts'; import * as echarts from '../ec-canvas/echarts'
Component({ Component({
/** /**
...@@ -6,27 +6,27 @@ Component({ ...@@ -6,27 +6,27 @@ Component({
*/ */
properties: { properties: {
chartData: { chartData: {
type: Array, type: Object,
value: () => [] value: {}
},
keys: {
type: Array,
value: ['year', 'sales']
},
tickCount: {
type: Number,
value: 4
},
color: {
type: String,
value: '#3975C6'
} }
// keys: {
// type: Array,
// value: ['year', 'sales']
// },
// tickCount: {
// type: Number,
// value: 4
// },
// color: {
// type: String,
// value: '#3975C6'
// }
}, },
observers: { observers: {
'chartData': function (data) { 'chartData.data': function (data) {
console.log(data, '----------------') console.log(data, 'pie----------------')
this.initData(data) data && this.onInitChart(data)
}, }
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -42,146 +42,135 @@ Component({ ...@@ -42,146 +42,135 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
onInitChart(xData, yData) { onInitChart() {
this.ecComponent && this.ecComponent.init((canvas, width, height, dpr) => { this.ecComponent &&
this.ecComponent.init((canvas, width, height, dpr) => {
const chart = echarts.init(canvas, null, { const chart = echarts.init(canvas, null, {
width: width, width: width,
height: height, height: height,
devicePixelRatio: dpr, devicePixelRatio: dpr
}); })
this.setOption(chart, xData, yData); this.setOption(chart)
return chart; return chart
}) })
}, },
setOption(chart, xData, yData) { setOption(chart) {
let {chartData:diagramList} = this.data let { chartData } = this.data
const abscissaDataList = [],
orderMoneyTotalList = [],
upgradeAveragePriceList = [],
upgradeRateList = []
// const abscissaDataList = [],
// orderMoneyTotalList = [],
// upgradeAveragePriceList = [],
// upgradeRateList = []
diagramList.forEach(element => { // diagramList.forEach(element => {
abscissaDataList.push(element.abscissaData) // abscissaDataList.push(element.abscissaData)
orderMoneyTotalList.push(this.sceneId == 0 ? element.orderMoneyTotal : element.outputValue) // orderMoneyTotalList.push(this.sceneId == 0 ? element.orderMoneyTotal : element.outputValue)
upgradeAveragePriceList.push(this.sceneId == 0 ? element.upgradeAveragePrice : element.avgPrice) // upgradeAveragePriceList.push(this.sceneId == 0 ? element.upgradeAveragePrice : element.avgPrice)
upgradeRateList.push(element.upgradeRate || 0) // upgradeRateList.push(element.upgradeRate || 0)
}); // })
const colors = ['#3582EE', '#35C376', '#FF9D0A'] // const colors = ['#3582EE', '#35C376', '#FF9D0A']
var option = { var option = {
color: colors, title: {
grid: { show: true, //显示策略,默认值true,可选为:true(显示) | false(隐藏)
left: '25%', text: chartData.total + '人', //主标题文本,'\n'指定换行
right: '15%' 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越高约靠顶层。
},
color: ['#5fcf90', '#f56c51', '#5f9cf3', '#ffb13c'],
tooltip: {
trigger: 'item'
}, },
// 滚动设置
dataZoom: [ label: {
{ show: true,
type: 'slider', //隐藏或显示(true)组件 formatter: '{b}\n{c}',
show: false, // alignTo: 'labelLine',
showDetail: false, //是否显示detail,即拖拽时候显示详细数值信息 align: 'right',
startValue: 0, edgeDistance: '10%' // 可以调整文字与饼图边缘的距离
endValue: 5, // rich: {
start: 50, // // d: {
end: 100, // // color: '#fff',
zoomLoxk: true // 是否锁定选择区域(或叫做数据窗口)的大小 // // fontSize: 16,
}, // // lineHeight: 24,
{ // // height: 24
//没有下面这块的话,只能拖动滚动条,鼠标滚轮在区域内不能控制外部滚动条 // // },
type: 'inside', // align: {
zoomOnMouseWheel: false, //滚轮是否触发缩放 // // color: '#5fcf90',
moveOnMouseMove: true, //鼠标滚轮触发滚动 // fontSize: 14,
moveOnMouseWheel: true // // lineHeight: 20,
} // align: 'right'
], // }
legend: { // }
data: ['营业额', '客单价', '转化率'], // textStyle: {
top: 'bottom' // color: '#fff',
}, // align: 'right',
xAxis: [ // fontSize: 14
{ // }
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} 元'
}
}, },
series: [
{ {
type: 'value', name: 'Access From',
name: '客单价', type: 'pie',
position: 'right', radius: ['40%', '70%'],
offset: 1000, labelLine: {
axisLabel: { //设置提示线的长度
formatter: '{value} 元' normal: {
length: 10, //第一条线
length2: 15 //第二条线
} }
}, },
{ emphasis: {
type: 'value', label: {
name: '转化率', show: true,
position: 'right', fontSize: 40,
alignTicks: true, fontWeight: 'bold'
axisLabel: {
formatter: '{value} %'
}
} }
],
series: [
{
name: '营业额',
type: 'bar',
yAxisIndex: 0,
data: orderMoneyTotalList
}, },
{ data: chartData.data
name: '客单价', // [
type: 'bar', // { value: 1048, name: '已预约' },
yAxisIndex: 0, // { value: 735, name: '取消预约' },
data: upgradeAveragePriceList // { value: 580, name: '超时未到店' },
}, // { value: 484, name: '待预约' }
{ // ]
name: '转化率',
type: 'line',
yAxisIndex: 2,
data: upgradeRateList
} }
] ]
}; }
chart.setOption(option) chart.setOption(option)
}, },
//初始化数据 //初始化数据
initData(data) { initData(data) {
const xData = [], // const xData = [],
yData = []; // yData = []
const [x, y] = this.data.keys // const [x, y] = this.data.keys
data.forEach(item => { // data.forEach(item => {
xData.push(item[x]) // xData.push(item[x])
yData.push(item[y]) // yData.push(item[y])
}) // })
this.setData({ // this.setData({
xData, // xData,
yData // yData
}) // })
this.onInitChart(xData, yData) // this.onInitChart(xData, yData)
}, }
}, },
ready() { ready() {
// 获取组件 // 获取组件
this.ecComponent = this.selectComponent('#mychart-dom-bar'); this.ecComponent = this.selectComponent('#mychart-dom-bar')
} }
}) })
/* packageOutput/components/echart/echart.wxss */ /* packageOutput/components/echart/echart.wxss */
// .f2-chart {
// width: 100%;
// height: 500rrpx;
// }
.ec-canvas { .ec-canvas {
width: 670rpx; width: 720rpx;
height: 520rpx; height: 450rpx;
margin-top: -20rpx; // margin-top: -20rpx;
} }
.container { .container {
height: 584rpx; // height: 584rpx;
padding: 20rpx 16rpx 0rpx; padding: 20rpx 16rpx 0rpx;
background-color: #fff; background-color: #fff;
margin-bottom: 20rpx; margin-bottom: 20rpx;
...@@ -26,8 +23,8 @@ ...@@ -26,8 +23,8 @@
.title-tip { .title-tip {
font-weight: 400; font-weight: 400;
font-size: 20rpx; font-size: 24rpx;
color: #999999; color: #333333;
} }
.title-tip-red { .title-tip-red {
...@@ -160,3 +157,70 @@ ...@@ -160,3 +157,70 @@
} }
} }
} }
.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 \ No newline at end of file
<view class="container">
<view class="container">
<view class="title"> <view class="title">
趋势分析 流量情况
<view class="title-tip" v-show="firstOrderDate">业务开展时间:{{ firstOrderDate }}</view> <view class="title-tip">客户领券后的预约情况</view>
</view> </view>
<!-- <view class="" id="bar"></view> --> <!-- <view class="" id="bar"></view> -->
<view class="ec-canvas"> <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>
<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="invalidFlowContainer">
<view class="header">
<view class="title">无效流量</view>
<view class="label">共{{chartData.customerList.lenght}}条客户信息经由跟进人处理为战败客户</view>
</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 \ No newline at end of file
import * as echarts from '../ec-canvas/echarts'; import * as echarts from '../ec-canvas/echarts'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
chartData: { tabIndex: {
type: Array,
value: () => []
},
keys: {
type: Array,
value: ['year', 'sales']
},
tickCount: {
type: Number, type: Number,
value: 4 value: 0
}, },
color: { chartData: {
type: String, type: Array,
value: '#3975C6' value: []
} }
// keys: {
// type: Array,
// value: ['year', 'sales']
// },
// tickCount: {
// type: Number,
// value: 4
// }
// color: {
// type: String,
// value: '#3975C6'
// }
}, },
observers: { observers: {
'chartData': function (data) { chartData: function (data) {
console.log(data, '----------------') console.log(data, '----------------')
this.initData(data) data && data.length && this.initData(data)
}, }
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -42,35 +46,35 @@ Component({ ...@@ -42,35 +46,35 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
onInitChart(xData, yData) { onInitChart() {
this.ecComponent && this.ecComponent.init((canvas, width, height, dpr) => { this.ecComponent &&
this.ecComponent.init((canvas, width, height, dpr) => {
const chart = echarts.init(canvas, null, { const chart = echarts.init(canvas, null, {
width: width, width: width,
height: height, height: height,
devicePixelRatio: dpr, devicePixelRatio: dpr
}); })
this.setOption(chart, xData, yData); this.setOption(chart)
return chart; return chart
}) })
}, },
setOption(chart, xData, yData) { setOption(chart) {
let {chartData:diagramList} = this.data let { chartData: diagramList, tabIndex } = this.data
const abscissaDataList = [], const abscissaDataList = [],
orderMoneyTotalList = [], orderMoneyTotalList = [],
upgradeAveragePriceList = [], upgradeAveragePriceList = [],
upgradeRateList = [] upgradeRateList = []
diagramList.forEach(element => { diagramList.forEach(element => {
abscissaDataList.push(element.abscissaData) abscissaDataList.push(element.abscissaData)
orderMoneyTotalList.push(this.sceneId == 0 ? element.orderMoneyTotal : element.outputValue) // console.log(element.orderMoneyTotal, 'orderMoneyTotal')
upgradeAveragePriceList.push(this.sceneId == 0 ? element.upgradeAveragePrice : element.avgPrice) orderMoneyTotalList.push(tabIndex == 0 ? element.orderMoneyTotal : element.outputValue)
upgradeAveragePriceList.push(tabIndex == 0 ? element.upgradeAveragePrice : element.avgPrice)
upgradeRateList.push(element.upgradeRate || 0) upgradeRateList.push(element.upgradeRate || 0)
}); })
// console.log(orderMoneyTotalList, 'orderMoneyTotalList')
const colors = ['#3582EE', '#35C376', '#FF9D0A'] const colors = ['#3582EE', '#35C376', '#FF9D0A']
var option = { var option = {
color: colors, color: colors,
...@@ -108,7 +112,7 @@ Component({ ...@@ -108,7 +112,7 @@ Component({
axisTick: { axisTick: {
alignWithLabel: true alignWithLabel: true
}, },
data:abscissaDataList|| ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] data: abscissaDataList || ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
} }
], ],
yAxis: [ yAxis: [
...@@ -161,27 +165,27 @@ Component({ ...@@ -161,27 +165,27 @@ Component({
data: upgradeRateList data: upgradeRateList
} }
] ]
}; }
chart.setOption(option) chart.setOption(option)
}, },
//初始化数据 //初始化数据
initData(data) { initData(data) {
const xData = [], // const xData = [],
yData = []; // yData = []
const [x, y] = this.data.keys // const [x, y] = this.data.keys
data.forEach(item => { // data.forEach(item => {
xData.push(item[x]) // xData.push(item[x])
yData.push(item[y]) // yData.push(item[y])
}) // })
this.setData({ // this.setData({
xData, // xData,
yData // yData
}) // })
this.onInitChart(xData, yData) this.onInitChart()
}, }
}, },
ready() { ready() {
// 获取组件 // 获取组件
this.ecComponent = this.selectComponent('#mychart-dom-bar'); this.ecComponent = this.selectComponent('#mychart-dom-bar')
} }
}) })
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
} }
.container { .container {
box-sizing: border-box;
height: 584rpx; height: 584rpx;
padding: 20rpx 16rpx 0rpx; padding: 20rpx 16rpx 0rpx;
background-color: #fff; background-color: #fff;
......
...@@ -8,18 +8,25 @@ Component({ ...@@ -8,18 +8,25 @@ Component({
type: Number, type: Number,
value: 0 value: 0
}, },
revenueData:{ revenueData: {
type:Object, type: Object,
value:{}, value: {},
observer: function (){ observer: function () {
this.initRevenueData() this.initRevenueData()
} }
}, },
chartData:{ chartData: {
type:Object, type: Object,
value:[], value: []
}, },
chartDataPie: {
type: Object,
value: {}
},
customerList: {
type: Object,
value: []
}
}, },
/** /**
...@@ -71,28 +78,13 @@ Component({ ...@@ -71,28 +78,13 @@ Component({
] ]
} }
}, },
attached() { 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)
},
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
initRevenueData (){ initRevenueData() {
// let {revenueData,} // let {revenueData,}
} }
} }
}) })
...@@ -173,6 +173,18 @@ ...@@ -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 { .flex {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -18,26 +18,33 @@ ...@@ -18,26 +18,33 @@
<view class="td"> <view class="td">
<view class="label">较上月</view> <view class="label">较上月</view>
<view class="flex"> <view class="flex">
<view class="{{ revenueData[item.name].revenueToClassMonth}}"> <view class="{{ revenueData[item.name].revenueToClassMonth }}">{{revenueData[item.name].comparedWithLastMonth }}</view>
{{revenueData[item.name].comparedWithLastMonth }} <image
</view> wx:if="{{ revenueData[item.name].revenueToClassMonth }}"
<image wx:if="{{revenueData[item.name].revenueToClassMonth}}" class="icon-up-down" class="icon-up-down"
src="../../images/icon-{{revenueData[item.name].revenueToClassMonth}}.png" /> src="../../images/icon-{{ revenueData[item.name].revenueToClassMonth }}.png"
/>
</view> </view>
</view> </view>
<view class="td"> <view class="td">
<view class="label">较去年</view> <view class="label">较去年</view>
<view class="flex"> <view class="flex">
<view :class="{{revenueData[item.name].revenueToClassYear}}"> <view :class="{{ revenueData[item.name].revenueToClassYear }}">{{revenueData[item.name].comparedWithLastYear }}</view>
{{revenueData[item.name].comparedWithLastYear }}</view> <image
<image wx:if="{{revenueData[item.name].revenueToClassYear}}" class="icon-up-down" wx:if="{{ revenueData[item.name].revenueToClassYear }}"
src="../../images/icon-'{{revenueData[item.name].revenueToClassYear}}.png" /> class="icon-up-down"
src="../../images/icon-'{{ revenueData[item.name].revenueToClassYear }}.png"
/>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<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>
<echart chartData="{{ chartData }}" tickCount="{{ opts.tickCount }}" keys="{{ opts.keys }}"></echart>
<echart-pie chartData="{{ chartData }}" tickCount="{{ opts.tickCount }}" keys="{{ opts.keys }}"></echart-pie>
</view> </view>
\ No newline at end of file \ No newline at end of file
// packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.js // packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.js
import outputApi from '~/api/outputApi/index' import outputApi from '~/api/outputApi/index'
import { tsFormatTime } from '~/utils/format'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -19,39 +20,44 @@ Page({ ...@@ -19,39 +20,44 @@ Page({
width: '30%' width: '30%'
} }
], ],
tabIndx: 1 tabIndx: 0,
chartDataPie: {
data: []
}
}, },
initData() { initData() {
let { tabIndx } = this.data let { tabIndx } = this.data
// tabIndx == 1 ? this.crowdfundingData : // tabIndx == 1 ? this.crowdfundingData :
console.log(tabIndx,'tabIndx'); console.log(tabIndx, 'tabIndx')
this.getAnalysisTendency(tabIndx) this.getAnalysisTendency(tabIndx)
}, },
crowdfundingData() {}, crowdfundingData() {},
getAnalysisTendency(tabIndx) { getAnalysisTendency(tabIndx) {
console.log(tabIndx,'tabIndx'); console.log(tabIndx, 'tabIndx')
let params = { let params = {
isSuper: true, shopMerchantIdList: [44211227],
isSuper: false,
phone: '', phone: '',
dataDimension: tabIndx, dataDimension: tabIndx,
startDate: '2023-08-01', startDate: '2023-08-01',
endDate: '2023-08-21' endDate: '2023-08-22'
} }
// debugger
// 默认是精品升级 取后面接口 // 默认是精品升级 取后面接口
let apiName = outputApi[tabIndx ? 'analysisOverviewVdquotation' : 'analysisOverview'] let apiName = outputApi[tabIndx ? 'analysisOverviewVdquotation' : 'analysisOverview']
let apiNameTendency = outputApi[tabIndx ? 'analysisTendencyVdquotation' : 'analysisTendency'] let apiNameTendency = outputApi[tabIndx ? 'analysisTendencyVdquotation' : 'analysisTendency']
// console.log(apiName);
// console.log(apiNameTendency);
apiName(params).then(res => { apiName(params).then(res => {
console.log(res, 'analysisOverview') // console.log(res, 'analysisOverview')
let revenueData = res let revenueData = res
for (const key in revenueData) { for (const key in revenueData) {
let month = revenueData[key].comparedWithLastMonth let month = revenueData[key].comparedWithLastMonth
let year = revenueData[key].comparedWithLastYear let year = revenueData[key].comparedWithLastYear
// let val3 = revenueData[key].comparedWithLastMonth revenueData[key].revenueToClassMonth = month == null || month == 0 ? '' : month > 0 ? 'up' : 'down'
// let val4 = revenueData[key].comparedWithLastMonth revenueData[key].revenueToClassYear = year == null || year == 0 ? '' : year > 0 ? 'up' : 'down'
revenueData[key].revenueToClassMonth = month == null|| month == 0 ? '': month>0? 'up' : 'down' revenueData[key].comparedWithLastMonth = month == null ? '0%' : Math.abs(month) + '%'
revenueData[key].revenueToClassYear = year == null || year == 0 ? '': year>0? 'up' : 'down' revenueData[key].comparedWithLastYear = year == null ? '0%' : Math.abs(year) + '%'
revenueData[key].comparedWithLastMonth = month == null ? '0%': Math.abs(month) +'%'
revenueData[key].comparedWithLastYear = year == null ? '0%' : Math.abs(year) +'%'
} }
this.setData({ this.setData({
revenueData revenueData
...@@ -63,12 +69,39 @@ Page({ ...@@ -63,12 +69,39 @@ Page({
firstOrderDate: res?.firstOrderDate, firstOrderDate: res?.firstOrderDate,
diagnosticResults: res.diagnosticResults || '', diagnosticResults: res.diagnosticResults || '',
diagramList: res.diagramList || [] diagramList: res.diagramList || []
// this.drawBar(data.diagramList)
}) })
}) })
// 精品升级请求流量接口数据
!tabIndx && this.getTrafficInterfaceData(params)
}, },
onRoute() { 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.getAnalysisTendency(this.data.tabIndx)
// this.getListSelectAccount(sessionId) // this.getListSelectAccount(sessionId)
} }
......
<!--packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml--> <!--packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml-->
<!-- <text>packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml</text> --> <!-- <text>packagesList/packageOutput/pages/openNewBusiness/openNewBusiness.wxml</text> -->
<view class="layout" > <view class="layout">
<view class="titleBox"> <view class="titleBox">
<view class="imgBox" bind:tap="back"> <view class="imgBox" bind:tap="back">
<image src="../../images/blackArrow.png" /> <image src="../../images/blackArrow.png" />
</view> </view>
<view class="navigation-title-text">广西弘泽汽车销售服务…</view> <view class="navigation-title-text">广西弘泽汽车销售服务…</view>
</view> </view>
<tab tab="{{tabList}}" itemWidth="{{'30%'}}" index="{{tabIndx}}" bindclick="changeTabIndx" class="tabContainer" /> <tab tab="{{ tabList }}" itemWidth="{{ '30%' }}" index="{{ tabIndx }}" bindclick="changeTabIndx" class="tabContainer" />
<view class="searchBar"> <view class="searchBar"></view>
<view class="conCom">
</view> <output-echart
<view class="conCom" > class="container"
<output-echart class="container" revenueData="{{revenueData}}" chartData="{{diagramList}}" tabIndex="{{tabIndx}}"></output-echart> revenueData="{{ revenueData }}"
</view> chartData="{{ diagramList }}"
<!-- <output-echart></output-echart> chartDataPie="{{ chartDataPie }}"
tabIndex="{{ tabIndx }}"
customerList="{{ customerList }}"
></output-echart>
</view>
<!-- <output-echart></output-echart>
<output-crowdfund></output-crowdfund> --> <output-crowdfund></output-crowdfund> -->
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -164,3 +164,34 @@ export function deleteSecond(time) { ...@@ -164,3 +164,34 @@ export function deleteSecond(time) {
hour = hour.join(':') hour = hour.join(':')
return `${moth} ${hour}` 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() ...@@ -29,7 +29,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 2 let index = 1
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
...@@ -7,7 +7,7 @@ class Request { ...@@ -7,7 +7,7 @@ class Request {
return this.request('GET', params, returnAll, requestPath) return this.request('GET', params, returnAll, requestPath)
} }
post(params, returnAll = false, requestPath) { post(params, returnAll = false, requestPath) {
console.log(requestPath, 'requestPath') // console.log(requestPath, 'requestPath')
return this.request('POST', params, returnAll, requestPath) return this.request('POST', params, returnAll, requestPath)
} }
async request(RequestMethods, params, returnAll, requestPath = 'scrm') { async request(RequestMethods, params, returnAll, requestPath = 'scrm') {
...@@ -29,6 +29,7 @@ class Request { ...@@ -29,6 +29,7 @@ class Request {
path = requestPath == 'dj' ? `/rop-dj-${projectName}/` : `/rop-scrm-${projectName}/` path = requestPath == 'dj' ? `/rop-dj-${projectName}/` : `/rop-scrm-${projectName}/`
} }
params = this.getData(params, requestPath) params = this.getData(params, requestPath)
// console.log(params,'params');
wx.request({ wx.request({
url: `${domain[requestPath]}${path}router?method=${params.method}`, url: `${domain[requestPath]}${path}router?method=${params.method}`,
data: params, data: params,
...@@ -37,6 +38,7 @@ class Request { ...@@ -37,6 +38,7 @@ class Request {
dataType: 'json', dataType: 'json',
responseType: 'text', responseType: 'text',
success(response) { success(response) {
// console.log(response,'response');
/**业务代码 */ /**业务代码 */
let { let {
data: { code, message }, data: { code, message },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!