flat: 消息
This commit is contained in:
@@ -52,6 +52,8 @@ const calendarData = ref([]);
|
||||
const current = ref({});
|
||||
import { Solar, Lunar } from '@/lib/lunar-javascript@1.7.2.js';
|
||||
|
||||
const isRecord = ref(false);
|
||||
const recordNum = ref(4);
|
||||
const pages = reactive({
|
||||
year: 0,
|
||||
month: 0,
|
||||
@@ -63,15 +65,21 @@ onLoad((options) => {
|
||||
date: options?.date || null,
|
||||
};
|
||||
}
|
||||
console.log(options);
|
||||
initPagesDate();
|
||||
addMonth();
|
||||
addMonth();
|
||||
addMonth();
|
||||
if (options.record) {
|
||||
isRecord.value = true;
|
||||
initOldPagesDate();
|
||||
new Array(recordNum.value + 1).fill(null).map(() => {
|
||||
addMonth();
|
||||
});
|
||||
} else {
|
||||
initPagesDate();
|
||||
new Array(recordNum.value).fill(null).map(() => {
|
||||
addMonth();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function backParams() {
|
||||
console.log(isValidDateString(current.value.date));
|
||||
if (isValidDateString(current.value.date)) {
|
||||
navBack({
|
||||
data: current.value,
|
||||
@@ -94,6 +102,7 @@ function isValidDateString(dateStr) {
|
||||
}
|
||||
|
||||
function onScrollBottom() {
|
||||
if (isRecord.value) return;
|
||||
addMonth();
|
||||
}
|
||||
|
||||
@@ -101,10 +110,22 @@ function selectDay(item) {
|
||||
current.value = item;
|
||||
}
|
||||
|
||||
function initOldPagesDate() {
|
||||
const d = new Date();
|
||||
const yue = d.getMonth();
|
||||
if (yue < recordNum.value) {
|
||||
pages.month = 12 + (yue - recordNum.value);
|
||||
pages.year = d.getFullYear() - 1;
|
||||
} else {
|
||||
pages.month = yue - recordNum.value;
|
||||
pages.year = d.getFullYear();
|
||||
}
|
||||
}
|
||||
|
||||
function initPagesDate() {
|
||||
const d = new Date();
|
||||
pages.year = d.getFullYear();
|
||||
pages.month = d.getMonth();
|
||||
pages.year = d.getFullYear();
|
||||
}
|
||||
|
||||
function addMonth() {
|
||||
|
Reference in New Issue
Block a user