Kaynağa Gözat

日历组件bug修复

dev01 1 yıl önce
ebeveyn
işleme
cd18f4be19

+ 6 - 1
src/components/common/xx-calendar/xx-calendar.js

@@ -34,6 +34,10 @@ Component({
       type: Number,
       value: new Date().getMonth() + 1,
     },
+    nowYear: {
+      type: Number,
+      value: new Date().getFullYear(),
+    },
     nowMonth: {
       type: Number,
       value: new Date().getMonth() + 1,
@@ -106,6 +110,7 @@ Component({
     /** 获取当月日期 */
     getNowMonthDays(year, month) {
       let {
+        nowYear,
         nowMonth,
         nowDay,
       } = this.data
@@ -132,7 +137,7 @@ Component({
           time,
           color: -1,
           day: newdate,
-          isNowMonthDay: (month == nowMonth && i == nowDay) ? "isNowMonthDay" : ""
+          isNowMonthDay: (year == nowYear && month == nowMonth && i == nowDay) ? "isNowMonthDay" : ""
         });
       }
       // this.data.use_date_arr.forEach(el => {

+ 1 - 0
src/pages/punchClock/punchClocks.jsx

@@ -316,6 +316,7 @@ class PunchClocks extends Component {
                       use_date_arr={dateList}
                       year={year}
                       month={month}
+                      nowYear={year}
                       nowMonth={month}
                       nowDay={day}
                       onselectdate={(v) => {

+ 1 - 0
src/pages/reclockin/index.jsx

@@ -271,6 +271,7 @@ class ReClockin extends Component {
                   use_date_arr={dateList}
                   year={this.state.year}
                   month={this.state.month}
+                  nowYear={this.state.year}
                   nowMonth={this.state.month}
                   nowDay={this.state.date}
                   onselectdate={(v) => {