refactor: favorites tab (#1177)

* refactor: favorites tab

* rm useless characters
This commit is contained in:
pa
2025-03-11 23:26:26 +09:00
committed by GitHub
parent 3cbe0a7047
commit 7a449ad383
21 changed files with 2154 additions and 1317 deletions
+15 -9
View File
@@ -164,7 +164,7 @@
);
},
isNextDayBtnDisabled() {
return dayjs(this.selectedDate).isSame(dayjs(), 'day');
return dayjs(this.selectedDate).isSame(this.allDateOfActivityArray[0], 'day');
},
isPrevDayBtnDisabled() {
return dayjs(this.selectedDate).isSame(
@@ -535,18 +535,24 @@
// options - start
changeSelectedDateFromBtn(isNext = false) {
if (!this.allDateOfActivityArray || this.allDateOfActivityArray.length === 0) {
return;
}
const idx = this.allDateOfActivityArray.findIndex((date) => date.isSame(this.selectedDate, 'day'));
if (idx !== -1) {
if (isNext) {
if (idx - 1 < this.allDateOfActivityArray.length) {
this.selectedDate = this.allDateOfActivityArray[idx - 1];
this.reloadData();
}
} else if (idx + 1 >= 0) {
this.selectedDate = this.allDateOfActivityArray[idx + 1];
const newIdx = isNext ? idx - 1 : idx + 1;
if (newIdx >= 0 && newIdx < this.allDateOfActivityArray.length) {
this.selectedDate = this.allDateOfActivityArray[newIdx];
this.reloadData();
return;
}
}
this.selectedDate = isNext
? this.allDateOfActivityArray[this.allDateOfActivityArray.length - 1]
: this.allDateOfActivityArray[0];
this.reloadData();
},
getDatePickerDisabledDate(time) {
if (
@@ -730,7 +736,7 @@
return;
}
entries.forEach((entry) => {
if (entry.isIntersecting) {
if (entry.isIntersecting && this.$refs.activityDetailChartRef[index]) {
this.$refs.activityDetailChartRef[index].initEcharts();
this.intersectionObservers[index].unobserve(entry.target);
}