|
|
@@ -15,22 +15,22 @@
|
|
|
</view>
|
|
|
<view style="width: 100%;margin-top: 20rpx;">
|
|
|
<view v-for="(item, index) in swiperItem.dayStudyList" :key="index" class="date_num">
|
|
|
- <view v-if="item.color == 0" @click="itemClick(item,index)" class="date_num_color0" :class="{active_color:item.date == activeDate}" v-show="item.date > 0">
|
|
|
+ <view v-if="item.color == 0" @click="itemClick(item,index,swiperItem)" class="date_num_color0" :class="{active_color:(swiperItem.year+'-'+swiperItem.month+'-'+item.date) == activeDate}" v-show="item.date > 0">
|
|
|
{{ item.date }}
|
|
|
<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
|
|
|
<view v-if="item.dot" class="date_dot"></view>
|
|
|
</view>
|
|
|
- <view v-if="item.color == 1" @click="itemClick(item,index)" class="date_num_color1" :class="{active_color:item.date == activeDate}">
|
|
|
+ <view v-if="item.color == 1" @click="itemClick(item,index,swiperItem)" class="date_num_color1" :class="{active_color:(swiperItem.year+'-'+swiperItem.month+'-'+item.date) == activeDate}">
|
|
|
{{ item.date }}
|
|
|
<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
|
|
|
<view v-if="item.dot" class="date_dot"></view>
|
|
|
</view>
|
|
|
- <view v-if="item.color == 2" @click="itemClick(item,index)" class="date_num_color2" :class="{active_color:item.date == activeDate}">
|
|
|
+ <view v-if="item.color == 2" @click="itemClick(item,index,swiperItem)" class="date_num_color2" :class="{active_color:(swiperItem.year+'-'+swiperItem.month+'-'+item.date) == activeDate}">
|
|
|
{{ item.date }}
|
|
|
<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
|
|
|
<view v-if="item.dot" class="date_dot"></view>
|
|
|
</view>
|
|
|
- <view v-if="item.color == 3" @click="itemClick(item,index)" class="date_num_color3" :class="{active_color:item.date == activeDate}">
|
|
|
+ <view v-if="item.color == 3" @click="itemClick(item,index,swiperItem)" class="date_num_color3" :class="{active_color:(swiperItem.year+'-'+swiperItem.month+'-'+item.date) == activeDate}">
|
|
|
{{ item.date }}
|
|
|
<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
|
|
|
<view v-if="item.dot" class="date_dot"></view>
|
|
|
@@ -250,18 +250,18 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- itemClick(item,index) {
|
|
|
+ itemClick(item,index,swiperItem) {
|
|
|
// console.log(item)
|
|
|
- this.activeDate = item.date;
|
|
|
- this.workList = this.getStudyCourseByDay();
|
|
|
+ this.activeDate = `${swiperItem.year}-${swiperItem.month}-${item.date}`;
|
|
|
+ this.workList = this.getStudyCourseByDay(swiperItem);
|
|
|
},
|
|
|
/**
|
|
|
* 根据选中日期获取需要学习的课程
|
|
|
*/
|
|
|
- getStudyCourseByDay() {
|
|
|
+ getStudyCourseByDay(swiperItem) {
|
|
|
let courseList = [];
|
|
|
- this.showDayList.forEach(day => {
|
|
|
- if(day.date == this.activeDate) {
|
|
|
+ swiperItem.dayStudyList.forEach(day => {
|
|
|
+ if(`${swiperItem.year}-${swiperItem.month}-${day.date}` == this.activeDate) {
|
|
|
if(day.daySectionList) {
|
|
|
day.daySectionList.forEach(section => {
|
|
|
this.listItem.goodsVos.forEach(vos => {
|
|
|
@@ -273,7 +273,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+ console.log(courseList)
|
|
|
return courseList;
|
|
|
},
|
|
|
planNow(){
|
|
|
@@ -334,7 +334,7 @@ export default {
|
|
|
this.haveNextMonth = false;
|
|
|
this.havePreviousMonth = false;
|
|
|
this.calendarStudyVo = {}
|
|
|
- this.workList = this.getStudyCourseByDay();
|
|
|
+ // this.workList = this.getStudyCourseByDay();
|
|
|
// this.workList = this.listItem.goodsVos;
|
|
|
if (this.listItem !== undefined) {
|
|
|
for (let i = 0; i < this.listItem.calendarStudyVo.length; i++) {
|
|
|
@@ -380,18 +380,41 @@ export default {
|
|
|
swiper.dayStudyList.unshift({ date: 0 });
|
|
|
}
|
|
|
|
|
|
+ let date = new Date();
|
|
|
+ let num = date.getDate();
|
|
|
+ //如果不是当前月,默认显示第一周
|
|
|
+ if ((date.getMonth() + 1) != this.calendarStudyVo.month) {
|
|
|
+ num = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ let todayIndex;
|
|
|
+ let todayItem;
|
|
|
+
|
|
|
for (let i = 0; i < swiper.dayStudyList.length; i++) {
|
|
|
let item = swiper.dayStudyList[i];
|
|
|
item.color = 0;
|
|
|
|
|
|
+ if (item.date == num) {
|
|
|
+ if (date.getMonth() + 1 == swiper.month) {
|
|
|
+ item.color = 3;
|
|
|
+ }
|
|
|
+ todayIndex = i;
|
|
|
+ todayItem = item;
|
|
|
+ }
|
|
|
+
|
|
|
if (item.perform == 1) {
|
|
|
item.color = 1;
|
|
|
}
|
|
|
if (item.perform == 2) {
|
|
|
item.color = 2;
|
|
|
}
|
|
|
+
|
|
|
+ let today = this.$method.getDate(); //获取当前日期
|
|
|
+ let currentTime = this.$method.TimeTotimestamp(today.replace('-','/'))
|
|
|
+ let dateTime = this.$method.TimeTotimestamp(`${swiper.year}/${swiper.month}/${item.date}`)
|
|
|
+
|
|
|
item.note = item.studyCourseKnob;
|
|
|
- if (item.note > 0) {
|
|
|
+ if ((item.note > 0) && (dateTime >= currentTime)) {
|
|
|
item.dot = true;
|
|
|
}
|
|
|
}
|