Commit fb316ae7 authored by youjie's avatar youjie

no message

parent 1a06ce29
......@@ -80,7 +80,7 @@
</scroll-view>
</view>
<view class="addPlan-buttom">
<view @click="addClassSubmit">
<view @click="back">
添加完毕
</view>
</view>
......@@ -145,7 +145,6 @@
{name:'第二节',
StartTime:'11:10',
EndTime:"12:40",
DetailsId:"",
id:2,list:[]},
{name:'第三节',
StartTime:'13:30',
......@@ -173,24 +172,39 @@
},
// 选择
checked(item,i,index){
i.DetailsId = !i.DetailsId
let data = {
Date: i.Date,
StartTime:item.StartTime,
EndTime: item.EndTime,
DetailsId: i.DetailsId
if(i.DetailsId){
let data = {
DetailsId: i.DetailsId
}
methods.Cancel(data)
}else{
let data = {
Date: i.SubDate,
StartTime:item.StartTime,
EndTime: item.EndTime,
DetailsId: i.DetailsId
}
methods.addClassSubmit(data)
}
methods.addClassSubmit(data)
data.classList.forEach((items)=>{
items.list = []
})
},
// 取消
Cancel(data){
proxy.$request("/LeaveStudent/RemovePlanAppointment", data).then(res => {
if (res.Code == 1) {
methods.GetPlanTime()
}
})
},
// 新增
addClassSubmit(data){
proxy.$request("/LeaveStudent/SetPlanAppointment", data).then(res => {
if (res.Code == 1) {
console.log(res)
methods.GetPlanTime()
}
})
return
this.back()
},
// 获取可预约时间范围
GetPlanTime(){
......@@ -209,51 +223,29 @@
}
data.titleList.push(datas)
})
data.lessonList = []
data.lessonList = res.Data
data.lessonList.forEach((item,index)=>{
let DetailsId = ""
item.TimeList.forEach((s,indexk)=>{
DetailsId = s.DetailsId
})
data.classList.forEach((items,indexs)=>{
let datas = {
status:false,
Date:"",
DetailsId:""
}
items.list.push(datas)
items.list.forEach((i,keys)=>{
if(index==0&&keys==0){
i.Date = item.DateStr
i.DetailsId = DetailsId
}if(index==1&&keys==1){
i.Date = item.DateStr
i.DetailsId = DetailsId
}if(index==2&&keys==2){
i.Date = item.DateStr
i.DetailsId = DetailsId
}if(index==3&&keys==33){
i.Date = item.DateStr
i.DetailsId = DetailsId
}if(index==4&&keys==4){
i.Date = item.DateStr
i.DetailsId = DetailsId
}if(index==5&&keys==5){
i.Date = item.DateStr
i.DetailsId = DetailsId
}if(index==6&&keys==6){
i.Date = item.DateStr
i.DetailsId = DetailsId
item.TimeList.forEach((itemT,indexT)=>{
if(indexs==0&&indexT==0){
items.list.push(itemT)
}if(indexs==1&&indexT==1){
items.list.push(itemT)
}if(indexs==2&&indexT==2){
items.list.push(itemT)
}if(indexs==3&&indexT==3){
items.list.push(itemT)
}if(indexs==4&&indexT==4){
items.list.push(itemT)
}if(indexs==5&&indexT==5){
items.list.push(itemT)
}
})
})
})
})
// console.log(data.classList)
console.log(data.classList)
uni.hideLoading()
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment