高峰期进入中转页

parent a73c6a26
......@@ -806,7 +806,7 @@
</view>
</view>
</view>
<view v-else class="nodata">
<view v-else class="nodata" @click="nodataClick">
<view class="nodataImg">
<img style="width: 100%"
src="https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/images/purchaseChart.gif" />
......@@ -942,38 +942,63 @@
},
containerHeight: '',
pubTalkSummaryHeight: 525,
pubTalkNoopenHeight:1260
pubTalkNoopenHeight: 1260,
isnodataClick: false
}
},
mounted() {
// if (this.isPeakPeriod()) {
// this.showReport = false;
// return
// }
this.showReport = true;
// 有无消费报告入口
if (new Date().getTime() <= new Date('2022/06/30').getTime()) {
this.isService = true;
} else {
this.init()
},
methods: {
init() {
if (this.isPeakPeriod() && !this.isnodataClick) {
this.showReport = false;
return
}
this.showReport = true;
// 有无消费报告入口
if (new Date().getTime() <= new Date('2022/06/30').getTime()) {
this.isService = true;
} else {
this.queryMemberServcieItem().then(() => {
if (this.queryMemberServcieItemList.length) {
this.isService = this.queryMemberServcieItemList.indexOf(1002) == -1 ? false : true;
}
})
}
// 有无进出校、公话入口
this.queryMemberServcieItem().then(() => {
if (this.queryMemberServcieItemList.length) {
this.isService = this.queryMemberServcieItemList.indexOf(1002) == -1 ? false : true;
this.isAttendanceService = this.queryMemberServcieItemList.indexOf(3002) == -1 ? false :
true;
this.isPubTalkService = this.queryMemberServcieItemList.indexOf(2002) == -1 ? false : true;
}
})
}
// 有无进出校、公话入口
this.queryMemberServcieItem().then(() => {
if (this.queryMemberServcieItemList.length) {
this.isAttendanceService = this.queryMemberServcieItemList.indexOf(3002) == -1 ? false : true;
this.isPubTalkService = this.queryMemberServcieItemList.indexOf(2002) == -1 ? false : true;
}
})
// 消费报告
this.queryIsDredgeMember(1002).then(() => {
if (this.isOpen) {
this.queryMemberValidTime(1002).then(e => {
if (new Date(this.memberInfo.invalidDate).getTime() <= new Date('2022/06/30')
.getTime()) {
// 消费报告
this.queryIsDredgeMember(1002).then(() => {
if (this.isOpen) {
this.queryMemberValidTime(1002).then(e => {
if (new Date(this.memberInfo.invalidDate).getTime() <= new Date('2022/06/30')
.getTime()) {
this.isOpen = true;
this.flag = 0;
this.memberInfo.invalidDateStr = '2022年6月30日';
this.memberInfo.differDay = dayjs('2022/06/30').diff(dayjs(), 'day') + 1;
this.containerHeight = 4200;
this.queryConsumerSummaryAmount(1).then(e => this.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this
.reportTypeIndex));
} else {
this.queryIsDredgeMember(1002, 1).then(() => {
this.queryConsumerSummaryAmount(1).then(e => this
.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this
.reportTypeIndex));
});
}
})
} else {
if (new Date().getTime() <= new Date('2022/06/30').getTime()) {
this.isOpen = true;
this.flag = 0;
this.memberInfo.invalidDateStr = '2022年6月30日';
......@@ -983,71 +1008,54 @@
this.queryDayConsumerTrend(1).then(e => this.linechart(this.reportTypeIndex));
} else {
this.queryIsDredgeMember(1002, 1).then(() => {
this.queryConsumerSummaryAmount(1).then(e => this
.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this
.reportTypeIndex));
this.queryConsumerSummaryAmount();
this.queryDayConsumerTrend();
});
}
}
});
let tmpArr = []
// 获取时间
for (let i = 1; i <= 11; i++) {
let startWeek = dayjs().subtract(i, 'month').startOf('month');
let endWeek = dayjs().$d.getTime() > dayjs().subtract(i, 'month').endOf('month').$d.getTime() ? dayjs()
.subtract(i, 'month').endOf('month') : dayjs();
tmpArr.push({
week: (startWeek.format("YYYY/MM/DD")) + '~' + (endWeek.format("YYYY/MM/DD")),
weekstr: (startWeek.format("MM/DD")) + '~' + (endWeek.format("MM/DD")),
startDate: startWeek.format("YYYY-MM-DD"),
endDate: endWeek.format("YYYY-MM-DD")
})
} else {
if (new Date().getTime() <= new Date('2022/06/30').getTime()) {
this.isOpen = true;
this.flag = 0;
this.memberInfo.invalidDateStr = '2022年6月30日';
this.memberInfo.differDay = dayjs('2022/06/30').diff(dayjs(), 'day') + 1;
this.containerHeight = 4200;
this.queryConsumerSummaryAmount(1).then(e => this.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this.reportTypeIndex));
}
this.dataRangeArr = tmpArr
this.minDate = new Date(this.dataRangeArr[this.dataRangeIndex].startDate);
this.maxDate = new Date(this.dataRangeArr[this.dataRangeIndex].endDate);
this.diningSituations.diningSituationsRequestDate = this.dataRangeArr[this.dataRangeIndex].startDate;
this.diningSituations.diningSituationsDate = this.formatDate(this.minDate);
this.attendanceSituations.attendanceDate = this.formatDate(this.minDate);
this.queryCampusStudentInfo();
let tmpDate = this.formatDateTwo(this.minDate);
this.queryNotRepastDetails(this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this
.dataRangeIndex].endDate).then(() => {
if (this.diningSituations.notRepastDetailsDTOS) {
let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate ===
tmpDate)[
0];
this.diningSituations.notRepastDetails = today;
} else {
this.queryIsDredgeMember(1002, 1).then(() => {
this.queryConsumerSummaryAmount();
this.queryDayConsumerTrend();
});
this.diningSituations.notRepastDetails = {};
}
}
});
let tmpArr = []
// 获取时间
for (let i = 1; i <= 11; i++) {
let startWeek = dayjs().subtract(i, 'month').startOf('month');
let endWeek = dayjs().$d.getTime() > dayjs().subtract(i, 'month').endOf('month').$d.getTime() ? dayjs()
.subtract(i, 'month').endOf('month') : dayjs();
tmpArr.push({
week: (startWeek.format("YYYY/MM/DD")) + '~' + (endWeek.format("YYYY/MM/DD")),
weekstr: (startWeek.format("MM/DD")) + '~' + (endWeek.format("MM/DD")),
startDate: startWeek.format("YYYY-MM-DD"),
endDate: endWeek.format("YYYY-MM-DD")
})
}
this.dataRangeArr = tmpArr
this.minDate = new Date(this.dataRangeArr[this.dataRangeIndex].startDate);
this.maxDate = new Date(this.dataRangeArr[this.dataRangeIndex].endDate);
this.diningSituations.diningSituationsRequestDate = this.dataRangeArr[this.dataRangeIndex].startDate;
this.diningSituations.diningSituationsDate = this.formatDate(this.minDate);
this.attendanceSituations.attendanceDate = this.formatDate(this.minDate);
this.queryCampusStudentInfo();
let tmpDate = this.formatDateTwo(this.minDate);
this.queryNotRepastDetails(this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this
.dataRangeIndex].endDate).then(() => {
if (this.diningSituations.notRepastDetailsDTOS) {
let today = this.diningSituations.notRepastDetailsDTOS.filter(e => e.repastDate === tmpDate)[
0];
this.diningSituations.notRepastDetails = today;
} else {
this.diningSituations.notRepastDetails = {};
}
});
this.getPubTalkReport(1);
},
methods: {
// 当天6:30 ~ 9:00,11:30 ~ 12:00, 17:30 ~ 19:00属于高峰期
});
this.getPubTalkReport();
},
// 当天11:00 ~ 13:00属于高峰期
isPeakPeriod() {
let first = this.timeIn("06:30:00", "09:00:00");
let second = this.timeIn("11:00:00", "12:00:00");
let three = this.timeIn("17:30:00", "19:00:00");
console.log(first, "first", second, "second", three, "three");
return first || second || three;
let first = this.timeIn("11:00:00", "13:00:00");
return first;
},
nodataClick: function() {
this.isnodataClick = true
this.init()
},
/*在某段时间内*/
timeIn(s, e) {
......@@ -1139,22 +1147,20 @@
this.memberInfo.differDay = '';
this.memberInfo.invalidDateStr = '';
this.memberInfo.leastAmount = '';
this.queryIsDredgeMember(2002).then(e => {
if (this.isPubTalkOpen) {
this.getPubTalkReport().then(() => {
this.getPubTalkReport().then(() => {
this.queryIsDredgeMember(2002).then(e => {
if (this.isPubTalkOpen) {
this.$nextTick(() => {
this.callNumberBarchart();
this.callDurationBarchart();
this.leaveMessageBarchart();
})
})
} else {
this.getPubTalkReport().then(() => {
} else {
this.$nextTick(() => {
this.callNumberBarchart();
})
})
}
}
})
})
}
}
......@@ -1972,7 +1978,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}
},
// 获取公话报告
async getPubTalkReport(num) {
async getPubTalkReport() {
try {
let data = await this.$http.post({
url: gHost +
......@@ -1992,14 +1998,12 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
return
}
this.pubTalkReport = data.data || {};
if (num == 1) {
if (!this.pubTalkReport.talkText5 && !this.pubTalkReport.talkText9) {
this.pubTalkSummaryHeight = 275;
} else if (this.pubTalkReport.talkText5 && !this.pubTalkReport.talkText9) {
this.pubTalkSummaryHeight = 387;
} else {
this.pubTalkSummaryHeight = 525;
}
if (!this.pubTalkReport.talkText5 && !this.pubTalkReport.talkText9) {
this.pubTalkSummaryHeight = 275;
} else if (this.pubTalkReport.talkText5 && !this.pubTalkReport.talkText9) {
this.pubTalkSummaryHeight = 387;
} else {
this.pubTalkSummaryHeight = 525;
}
} catch (e) {
//TODO handle the exception
......@@ -2111,13 +2115,13 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}
switch (serviceItemCode) {
case 1002:
this.isOpen = data.obj.status;
this.isOpen = data.obj && data.obj.status || false;
if (!this.isOpen) {
this.flag = 1;
}
break;
case 2002:
this.isPubTalkOpen = data.obj.status;
this.isPubTalkOpen = data.obj && data.obj.status || false;
if (this.isPubTalkOpen) {
this.queryMemberValidTime(serviceItemCode);
this.containerHeight = 2765 + this.pubTalkSummaryHeight;
......@@ -2125,12 +2129,12 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
} else {
this.queryMemberConsumerAmount(serviceItemCode);
this.containerHeight = 1605 + this.pubTalkSummaryHeight;
this.pubTalkNoopenHeight=735+this.pubTalkSummaryHeight;
this.pubTalkNoopenHeight = 735 + this.pubTalkSummaryHeight;
this.flag = 3;
}
break;
case 3002:
this.isAttendanceOpen = data.obj.status;
this.isAttendanceOpen = data.obj && data.obj.status || false;
if (this.isAttendanceOpen) {
this.queryMemberValidTime(serviceItemCode);
this.containerHeight = 2762;
......@@ -3205,8 +3209,8 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 40rpx;
.attendance-report-time-txt{
.attendance-report-time-txt {
width: 56rpx;
}
......@@ -3246,14 +3250,14 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}
}
}
.attendance-report-time-details {
width: 212rpx;
display: flex;
align-items: center;
justify-content: flex-end;
margin: 0 0 11rpx;
.attendance-report-time-details-item {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
......@@ -3265,7 +3269,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
display: flex;
justify-content: flex-end;
}
.attendance-report-time-details-icon {
width: 21rpx;
height: 12rpx;
......@@ -3273,7 +3277,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// margin-left: 30rpx;
}
}
}
.attendance-report-details-img-item {
......@@ -3286,6 +3290,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
.attendance-report-details-img-box {
width: 155rpx;
height: 95rpx;
image {
width: 100%;
height: 100%;
......
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