feat: check if user have courses on the weekend(#1)

- 檢查是否有週末的課,若有則設定flag
- 未更動前端表格
This commit is contained in:
snsd0805 2020-09-17 15:30:43 +08:00
parent db8bedb52a
commit 8d571063e9

View File

@ -18,6 +18,7 @@ var courseTable = {
data: function(){ data: function(){
return { return {
'courses': {}, 'courses': {},
'existWeekend': false
} }
}, },
methods: { methods: {
@ -37,8 +38,17 @@ var courseTable = {
watch: { watch: {
'select_c': function(){ 'select_c': function(){
this.courses = {} this.courses = {}
var weekendLock = false
for(var c of this.select_c){ for(var c of this.select_c){
this.courses[c.time] = c.name this.courses[c.time] = c.name
if(c.time[0]==6 || c.time[0]==7){
weekendLock = true
}
}
if(weekendLock){
this.existWeekend = true
} }
} }
}, },