提交更新

parent b830be2d
...@@ -143,8 +143,8 @@ ...@@ -143,8 +143,8 @@
</view> </view>
<view class="school-report-context-card-two-calendar"> <view class="school-report-context-card-two-calendar">
<van-calendar :formatter="formatter" :min-date="minDate" :max-date="maxDate" <van-calendar :formatter="formatter" :min-date="minDate" :max-date="maxDate"
:default-date="minDate" :show-title="false" :show-subtitle="false" :default-date="minDate" :show-title="false" :show-subtitle="false" :show-mark="false"
:show-mark="false" :poppable="false" :show-confirm="false" :style="{ height: '575rpx' }" :poppable="false" :show-confirm="false" :style="{ height: '575rpx' }"
@select="dateSelect" /> @select="dateSelect" />
</view> </view>
<view class="school-report-context-card-two-details"> <view class="school-report-context-card-two-details">
...@@ -450,15 +450,53 @@ ...@@ -450,15 +450,53 @@
} }
}, },
mounted() { mounted() {
if(new Date().getTime()<=new Date('2022/06/30').getTime()){ this.queryIsDredgeMember().then(() => {
this.isOpen=true; if (this.isOpen) {
this.memberInfo.invalidDateStr='2022年6月30日'; this.queryMemberValidTime().then(e => {
this.memberInfo.differDay=dayjs('2022/06/30').diff(dayjs(),'day'); if (new Date(this.memberInfo.invalidDate).getTime() <= new Date('2022/06/30')
this.containerHeight = 4200; .getTime()) {
}else{ this.isOpen = true;
this.queryIsDredgeMember(); this.memberInfo.invalidDateStr = '2022年6月30日';
} this.memberInfo.differDay = dayjs('2022/06/30').diff(dayjs(), 'day');
// this.queryIsDredgeMember(); this.containerHeight = 4200;
this.queryStudentConsumerPreference(1).then(e => this.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this.reportTypeIndex));
} else {
this.queryIsDredgeMember(1).then(() => {
if (this.isOpen) {
this.queryStudentConsumerPreference(1).then(e => this
.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this
.reportTypeIndex));
} else {
this.queryStudentConsumerPreference();
this.queryDayConsumerTrend();
}
});
}
})
} else {
if (new Date().getTime() <= new Date('2022/06/30').getTime()) {
this.isOpen = true;
this.memberInfo.invalidDateStr = '2022年6月30日';
this.memberInfo.differDay = dayjs('2022/06/30').diff(dayjs(), 'day');
this.containerHeight = 4200;
this.queryStudentConsumerPreference(1).then(e => this.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this.reportTypeIndex));
} else {
this.queryIsDredgeMember(1).then(() => {
if (this.isOpen) {
this.queryStudentConsumerPreference(1).then(e => this.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this
.reportTypeIndex));
} else {
this.queryStudentConsumerPreference();
this.queryDayConsumerTrend();
}
});
}
}
});
let tmpArr = [] let tmpArr = []
// 获取时间 // 获取时间
for (let i = 0; i <= 11; i++) { for (let i = 0; i <= 11; i++) {
...@@ -477,13 +515,6 @@ ...@@ -477,13 +515,6 @@
this.maxDate = new Date(this.dataRangeArr[this.dataRangeIndex].endDate); this.maxDate = new Date(this.dataRangeArr[this.dataRangeIndex].endDate);
this.diningSituations.diningSituationsRequestDate = this.dataRangeArr[this.dataRangeIndex].startDate; this.diningSituations.diningSituationsRequestDate = this.dataRangeArr[this.dataRangeIndex].startDate;
this.diningSituations.diningSituationsDate = this.formatDate(this.minDate); this.diningSituations.diningSituationsDate = this.formatDate(this.minDate);
if (this.isOpen) {
this.queryStudentConsumerPreference(1).then(e => this.piechart());
this.queryDayConsumerTrend(1).then(e => this.linechart(this.reportTypeIndex));
} else {
this.queryStudentConsumerPreference();
this.queryDayConsumerTrend();
}
this.queryCampusStudentInfo(); this.queryCampusStudentInfo();
this.queryNotRepastDetails(this.diningSituations.diningSituationsRequestDate, this.diningSituations this.queryNotRepastDetails(this.diningSituations.diningSituationsRequestDate, this.diningSituations
.diningSituationsRequestDate, 1); .diningSituationsRequestDate, 1);
...@@ -1011,7 +1042,7 @@ ...@@ -1011,7 +1042,7 @@
} }
}, },
// 是否开通消费报告 // 是否开通消费报告
async queryIsDredgeMember() { async queryIsDredgeMember(num) {
try { try {
let data = await this.$http.get({ let data = await this.$http.get({
url: gHost + url: gHost +
...@@ -1030,12 +1061,14 @@ ...@@ -1030,12 +1061,14 @@
return return
} }
this.isOpen = data.obj.status; this.isOpen = data.obj.status;
if (this.isOpen) { if (num == 1) {
this.queryMemberValidTime(); if (this.isOpen) {
this.containerHeight = 4200; this.queryMemberValidTime();
} else { this.containerHeight = 4200;
this.queryMemberConsumerAmount(); } else {
this.containerHeight = 2340; this.queryMemberConsumerAmount();
this.containerHeight = 2340;
}
} }
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
...@@ -1097,6 +1130,7 @@ ...@@ -1097,6 +1130,7 @@
return return
} }
this.memberInfo.differDay = data.obj.differDay; this.memberInfo.differDay = data.obj.differDay;
this.memberInfo.invalidDate = data.obj.invalidDate;
let month = data.obj.invalidDate.slice(5, 6) == 0 ? data let month = data.obj.invalidDate.slice(5, 6) == 0 ? data
.obj.invalidDate.slice(6, 7) : data.obj .obj.invalidDate.slice(6, 7) : data.obj
.invalidDate.slice(5, 7); .invalidDate.slice(5, 7);
...@@ -1122,10 +1156,10 @@ ...@@ -1122,10 +1156,10 @@
console.log('skip success') console.log('skip success')
}, },
fail: function fail(_fail) { fail: function fail(_fail) {
console.warn(_fail); console.warn(_fail);
uni.showModal({ uni.showModal({
content: JSON.stringify(_fail) content: JSON.stringify(_fail)
}); });
} }
}); });
}, },
...@@ -1432,22 +1466,23 @@ ...@@ -1432,22 +1466,23 @@
.school-report-context-card-two-calendar { .school-report-context-card-two-calendar {
height: 575rpx; height: 575rpx;
width: 690rpx;
/deep/ .van-calendar__weekdays{
/deep/ .van-calendar__weekdays {
background: #F7FAF8; background: #F7FAF8;
} }
/deep/ .van-calendar__weekday{ /deep/ .van-calendar__weekday {
text-align: left; text-align: left;
padding-left: 30rpx; padding-left: 30rpx;
box-sizing: border-box; box-sizing: border-box;
} }
/deep/ .van-calendar__weekday:first-of-type{ /deep/ .van-calendar__weekday:first-of-type {
color: rgba(0, 0, 0, 0.25); color: rgba(0, 0, 0, 0.25);
} }
/deep/ .van-calendar__weekday:last-of-type{ /deep/ .van-calendar__weekday:last-of-type {
color: rgba(0, 0, 0, 0.25); color: rgba(0, 0, 0, 0.25);
} }
...@@ -1746,7 +1781,7 @@ ...@@ -1746,7 +1781,7 @@
#consumer-trend-line { #consumer-trend-line {
position: absolute; position: absolute;
top: 120rpx; top: 120rpx;
z-index:100; z-index: 100;
} }
.consumer-trend-line-icon { .consumer-trend-line-icon {
......
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