Commit 00d1515c by 姜雷

修改获取接口

parent cf9efeed
......@@ -18,6 +18,7 @@ Page({
areaName: '',
areaList: [],
growthList: [],
activateList: [],
registerCount: 0,
customerCount: 0,
activeCount: 0,
......@@ -86,12 +87,12 @@ Page({
...entity,
};
statisticsFetch({
url: '/dcxy/reportInfo/queryReportList',
url: '/dcxy/reportInfo/boss/queryReportList',
data: reqBody,
})
.then(res => {
console.log(res);
const { customerCount, dayVos, activeCount } = res.data;
const { customerCount, dayVos, activeCount, dayAcs } = res.data;
let dayList = new Array(31)
.fill({
count: 0,
......@@ -103,12 +104,43 @@ Page({
for (let index = 0; index < oList.length; index++) {
const element = oList[index];
let daysIndex = Number(element.days.slice(-2));
if (dayList[daysIndex - 1].count) {
dayList[daysIndex - 1] = {
...dayList[daysIndex - 1],
count: dayList[daysIndex - 1].count + element.count,
};
} else {
dayList[daysIndex - 1] = {
...dayList[daysIndex - 1],
count: element.count,
};
}
}
}
let activateList = new Array(31)
.fill({
count: 0,
})
.map((v, idx) => ({ ...v, days: idx + 1 }));
if (dayAcs && dayAcs.length) {
let oList = dayAcs;
for (let index = 0; index < oList.length; index++) {
const element = oList[index];
let daysIndex = Number(element.days.slice(-2));
if (activateList[daysIndex - 1].count) {
activateList[daysIndex - 1] = {
...activateList[daysIndex - 1],
count: activateList[daysIndex - 1].count + element.count,
};
} else {
activateList[daysIndex - 1] = {
...activateList[daysIndex - 1],
count: element.count,
};
}
}
}
let registerCount = dayVos.reduce(
(total, current) => (total += current.count),
0,
......@@ -116,6 +148,7 @@ Page({
console.log('dayList:', dayList);
this.setData!({
growthList: dayList,
activateList: activateList,
registerCount: registerCount,
customerCount: customerCount ? customerCount : 0,
activeCount: activeCount ? activeCount : 0,
......
......@@ -37,7 +37,7 @@
<view class="userGrowth-title-text">用户活跃</view>
</view>
<view class="userGrowth-canvas">
<user-activity-chart dataList="{{growthList}}" month="{{month}}" />
<user-activity-chart dataList="{{activateList}}" month="{{month}}" />
</view>
</view>
</view>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment