From 4f35752e33dcae1c84b025c49240ea94908c87cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A6=86=E9=92=B1=E8=90=BD=E5=B0=BD=E6=A7=BF=E8=8A=B1?= =?UTF-8?q?=E7=A8=80?= <2675540038@qq.com> Date: Thu, 6 Feb 2025 10:35:27 +0800 Subject: [PATCH] 111 --- public/static/js/index.js | 7 ++++++- src/view/home/index.vue | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/public/static/js/index.js b/public/static/js/index.js index f986132..5f86eab 100644 --- a/public/static/js/index.js +++ b/public/static/js/index.js @@ -107,7 +107,11 @@ $(function () { viewSelect: "month", initialDate: getDate("day"), }).on("show", function (ev) { - displayDate(month); + let dateStr = month; + let parts = dateStr.split('-'); + let newDateStr = `${parts[0]}-${parts[1].padStart(2, '0')}`; + console.log('000000000000',newDateStr); + displayDate(newDateStr); //$(".datetimepicker-days th.switch").addClass("disabled"); }).on('changeDate', function (ev) { var date = new Date(ev.date.valueOf()); @@ -491,6 +495,7 @@ function getPaper(date) { //需要黑色显示的日期数组 function displayDate(date) { + console.log('-----',date); var data = getPaper(date); var day = 1, count = 0, count2 = 0; $(".datetimepicker-days .day").each(function (i) { diff --git a/src/view/home/index.vue b/src/view/home/index.vue index 398f345..e3c2409 100644 --- a/src/view/home/index.vue +++ b/src/view/home/index.vue @@ -306,8 +306,13 @@ export default { sessionStorage.setItem('DateListH5', JSON.stringify(response.data.data)); sessionStorage.setItem('DateIndexH5', resIndex); console.log(response.data.data[resIndex]); - this.datetime = this.getCurrentDateFormatted(response.data.data[resIndex].datetime); - document.title = '《今日固始》电子版-' + this.datetime; + if(activeDate == ''){ + this.datetime = this.getCurrentDateFormatted(response.data.data[resIndex].datetime); + document.title = '《今日固始》电子版-' + this.datetime; + }else{ + document.title = '《今日固始》电子版-' +storageTimeYear + "年" + this.getMd(storageTimeMonth)+"月"+this.getMd(storageTimeDay)+"日"; + } + this.getBm(); }) .catch(error => console.error('Error loading the JSON file:', error))