|
@@ -118,14 +118,22 @@ Page({
|
|
}
|
|
}
|
|
//获取班级列表
|
|
//获取班级列表
|
|
wx.request({
|
|
wx.request({
|
|
- url: host + '/api/wx/class/list?subject_item0=' + list[0].name,
|
|
|
|
|
|
+ url: host + '/api/wx/class/list' ,
|
|
method: 'GET',
|
|
method: 'GET',
|
|
|
|
+ data:{
|
|
|
|
+ subject_item0: subject_item[0],
|
|
|
|
+ subject_item1: subject_item[1],
|
|
|
|
+ subject_item2: subject_item[2]
|
|
|
|
+ },
|
|
success: res => {
|
|
success: res => {
|
|
- let classes = res.data.data[0].classes, class_=0
|
|
|
|
- for(let i=0;i<classes.length;i++){
|
|
|
|
- if (classes[i].cid == data.class_id){
|
|
|
|
- class_=i
|
|
|
|
- }
|
|
|
|
|
|
+ let class_ = 0;
|
|
|
|
+ if (res.data.data.length>0){
|
|
|
|
+ let classes = res.data.data[0].classes;
|
|
|
|
+ for(let i=0;i<classes.length;i++){
|
|
|
|
+ if (classes[i].cid == data.class_id){
|
|
|
|
+ class_=i
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.setData({
|
|
this.setData({
|
|
classList: classes,
|
|
classList: classes,
|
|
@@ -166,7 +174,6 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
getClass(){
|
|
getClass(){
|
|
- console.log()
|
|
|
|
let category = this.data.category>=0 ? this.data.categoryArray[this.data.category].name:'',
|
|
let category = this.data.category>=0 ? this.data.categoryArray[this.data.category].name:'',
|
|
subject = this.data.subject >= 0 ? this.data.subjectArray[this.data.subject].name : ''
|
|
subject = this.data.subject >= 0 ? this.data.subjectArray[this.data.subject].name : ''
|
|
wx.request({
|
|
wx.request({
|