|
|
@ -1,19 +1,28 @@ |
|
|
|
<template> |
|
|
|
<view class="class-list"> |
|
|
|
<picker> |
|
|
|
<view class="cl-bar"><text>12</text></view> |
|
|
|
<picker disabled> |
|
|
|
<view class="cl-bar"><text>{{optionsQuery.course_name || '-'}}</text></view> |
|
|
|
</picker> |
|
|
|
<view class="cl-list"> |
|
|
|
<view class="cl-item" v-for="i in 10" :key="i"> |
|
|
|
<view class="cl-item" v-for="(e, i) in classList" :key="i"> |
|
|
|
<view class="ci-name"> |
|
|
|
<view>二班</view> |
|
|
|
<view :class="[i==2?'active':'']">已成班</view> |
|
|
|
<view>{{ e.class_name }}</view> |
|
|
|
<view :class="[ e.class_status == 1? '' : 'active']"> |
|
|
|
{{ |
|
|
|
e.class_status == 0 ? '未成班' : |
|
|
|
e.class_status == 1 ? '已成班' : '-' |
|
|
|
}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="ci-line"><text>学员人数:</text>10人</view> |
|
|
|
<view class="ci-line"><text>学员人数:</text>{{ e.total_member }}人</view> |
|
|
|
<view class="ci-btns"> |
|
|
|
<view hover-class="hover-active">点名</view> |
|
|
|
<view hover-class="hover-active">学员</view> |
|
|
|
<view hover-class="hover-active">作业</view> |
|
|
|
<view hover-class="hover-active" @click="toStudentLst(e)">学员</view> |
|
|
|
|
|
|
|
<block v-if="e.class_status == 1 || true"> |
|
|
|
<view hover-class="hover-active">点名</view> |
|
|
|
<view hover-class="hover-active">作业</view> |
|
|
|
</block> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -21,8 +30,46 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { API } from '../../../js/api'; |
|
|
|
import { servers } from '../../../js/server'; |
|
|
|
import util from '../../../utils/util' |
|
|
|
export default { |
|
|
|
data(){ |
|
|
|
return { |
|
|
|
optionsQuery: {}, |
|
|
|
classList: [], |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
let _query = util.jsonPar(options.query); |
|
|
|
this.optionsQuery = _query; |
|
|
|
|
|
|
|
console.warn(_query); |
|
|
|
this.getClassList(_query.course_id) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
toStudentLst(e){ |
|
|
|
let { optionsQuery } = this; |
|
|
|
let _query = { |
|
|
|
...optionsQuery, |
|
|
|
class_id: e.id, |
|
|
|
class_name: e.class_name, |
|
|
|
} |
|
|
|
util.routeTo(`/pages/course/student_list/student_list?query=${util.jsonStr(_query)}`, 'nT'); |
|
|
|
}, |
|
|
|
getClassList( course_id ){ |
|
|
|
servers.get({ |
|
|
|
url: API.course.getClassList, |
|
|
|
data: { course_id }, |
|
|
|
failMsg: '加载失败!' |
|
|
|
}) |
|
|
|
.then(res=>{ |
|
|
|
let _list = res || []; |
|
|
|
this.classList = _list; |
|
|
|
console.warn(res); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|