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
846 B
43 lines
846 B
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.students")({course_id,limit:1000}).then(res=>{
|
|
console.log(res);
|
|
let {students,students_count} = res;
|
|
this.setData({students,students_count});
|
|
})
|
|
}
|
|
}
|
|
})
|