You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
877 B
43 lines
877 B
5 years ago
|
const app = getApp();
|
||
|
Component({
|
||
|
properties: {
|
||
|
course_id: Number,
|
||
|
id_: Number,
|
||
|
course_identity:Number,
|
||
|
refresh: {
|
||
|
type: Number,
|
||
|
observer: function (r) {
|
||
|
if (r) {
|
||
|
console.log("observer refresh")
|
||
|
this.refresh();
|
||
|
this.setData({ refresh: false });
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
|
||
|
data: {
|
||
|
|
||
|
},
|
||
|
attached(){
|
||
|
let {course_id, course_identity} = this.data;
|
||
|
let ext = {course_id, course_identity};
|
||
|
this.setData({ext});
|
||
|
this.refresh();
|
||
|
},
|
||
|
|
||
|
methods: {
|
||
|
onChoose(e){
|
||
|
console.log(e);
|
||
|
},
|
||
|
refresh(){
|
||
|
let {course_id} = this.data;
|
||
|
app.api("weapps.courses.teachers")({course_id,limit:1000}).then(res=>{
|
||
|
console.log(res);
|
||
|
let {teacher_list:teachers,teacher_list_size:teachers_count} = res;
|
||
|
this.setData({teachers,teachers_count});
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
})
|