|
|
@@ -1,5 +1,4 @@
|
|
|
// pages/clock/clock-tongji/calendar/calendar.js
|
|
|
-let first = true
|
|
|
Component({
|
|
|
/**
|
|
|
* 组件的属性列表
|
|
|
@@ -86,13 +85,10 @@ Component({
|
|
|
})
|
|
|
}
|
|
|
if (month === this.data.defaultMonth && i === this.data.defaultDate) {
|
|
|
- if (first) {
|
|
|
- first = false
|
|
|
- this.setData({
|
|
|
- selectedIndex: index - 1,
|
|
|
- blue: index - 1,
|
|
|
- })
|
|
|
- }
|
|
|
+ this.setData({
|
|
|
+ selectedIndex: index - 1,
|
|
|
+ blue: index - 1,
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -122,7 +118,11 @@ Component({
|
|
|
this.setData({
|
|
|
calendarDays: list,
|
|
|
selectedIndex: index,
|
|
|
- selectedDay: list[index]
|
|
|
+ selectedDay: list[index],
|
|
|
+ selectedIndex: index,
|
|
|
+ blue: index,
|
|
|
+ defaultMonth: list[index].month,
|
|
|
+ defaultDate: list[index].date
|
|
|
})
|
|
|
}
|
|
|
},
|