|
@@ -37,7 +37,7 @@ export default {
|
|
|
originLesson: [],
|
|
|
today: {},
|
|
|
arrange: [],
|
|
|
- classid: '',
|
|
|
+ classids: '',
|
|
|
classInfo: {},
|
|
|
locationList: [],
|
|
|
};
|
|
@@ -48,9 +48,8 @@ export default {
|
|
|
let todate = this.getDate();
|
|
|
this.$set(this.today, `date`, todate);
|
|
|
this.$set(this.today, `day`, today);
|
|
|
-
|
|
|
if (this.user !== undefined) {
|
|
|
- this.$set(this, `classid`, this.user.classid);
|
|
|
+ this.$set(this, `classids`, sessionStorage.getItem('classid'));
|
|
|
this.searchInfo();
|
|
|
}
|
|
|
},
|
|
@@ -60,16 +59,15 @@ export default {
|
|
|
...lesson({ lessionInfo: 'fetch', lessionlist: 'query' }),
|
|
|
// 查询课程详情
|
|
|
async searchInfo() {
|
|
|
+ let classid = this.classids;
|
|
|
const res = await this.classesInfo(this.classid);
|
|
|
if (res.errcode == '0') this.$set(this, `classInfo`, res.data);
|
|
|
- let classid = sessionStorage.getItem('classid');
|
|
|
const result = await this.lessionlist({ classid });
|
|
|
let lessones = {};
|
|
|
for (const val of result.data) {
|
|
|
lessones = val;
|
|
|
}
|
|
|
var lesson = lessones.lessons.find(item => item.date === this.getDate());
|
|
|
- console.log(lesson);
|
|
|
this.$set(this, `lesson`, lesson);
|
|
|
// 获取课程开始-结束日期
|
|
|
this.$set(this, `originLesson`, lessones.lessons);
|
|
@@ -138,7 +136,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['user']),
|
|
|
+ ...mapState(['user', 'classid']),
|
|
|
},
|
|
|
mounted() {
|
|
|
this.title = this.$route.meta.title;
|