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.
|
|
|
const app = getApp();
|
|
|
|
|
|
|
|
Component({
|
|
|
|
properties: {
|
|
|
|
course_id: Number,
|
|
|
|
id_: Number,
|
|
|
|
refresh: {
|
|
|
|
type: Number,
|
|
|
|
observer: function (r) {
|
|
|
|
if (r) {
|
|
|
|
|
|
|
|
this.refresh();
|
|
|
|
this.setData({ refresh: false });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data: {
|
|
|
|
list: [{ text: "全部", order: "" }, { text: "未发布", order: 0 }, { text: "提交中", order: 1 }, { text: "补交中", order: 2 }, { text: "已截止", order: 5 }]
|
|
|
|
},
|
|
|
|
attached() {
|
|
|
|
this.refresh();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onSwitchNav({ detail: { current, value } }) {
|
|
|
|
|
|
|
|
if (!this.options)
|
|
|
|
this.options = {};
|
|
|
|
this.options.order = value.order;
|
|
|
|
this.refresh();
|
|
|
|
},
|
|
|
|
refresh() {
|
|
|
|
let { course_id } = this.data;
|
|
|
|
;
|
|
|
|
app.api("courses.homework_commons")({ ...this.options, course_id, type: 4 })
|
|
|
|
.then(res => {
|
|
|
|
;
|
|
|
|
this.setData({ homeworks: res.homeworks });
|
|
|
|
}).catch(e => {
|
|
|
|
app.showError(e);
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|