Commit 08b7ecdb authored by zhengke's avatar zhengke

no message

parent f84927b8
......@@ -35,14 +35,25 @@
</view>
</view>
</view>
<van-empty description="暂无数据" v-if="dataList.length === 0" />
<scroll-view
:scroll-top="0"
scroll-y="true"
class="scroll-box"
@scrolltolower="lower"
v-if="dataList.length > 0"
>
<operation v-if="tabNme=='作业情况'"></operation>
<studentList v-if="tabNme=='学生列表'"></studentList>
<examList v-if="tabNme=='考试信息'"></examList>
<examList v-if="tabNme=='考试信息'" :dataList="dataList"></examList>
<Loadmore :state="pageState" />
</scroll-view>
</view>
</view>
</template>
<script>
import Loadmore from "@/components/loadmore.vue";
import courseCard from '@/components/index/workSituation/courseCard'
import operation from '@/components/index/workSituation/operation'
import studentList from '@/components/index/workSituation/studentList'
......@@ -75,7 +86,8 @@
courseCard,
operation,
studentList,
examList
examList,
Loadmore
},
setup(props) {
let {
......@@ -87,7 +99,16 @@
{name:'作业情况',num:5},
{name:'考试信息',num:18},
],
tabNme:'考试信息'
tabNme:'考试信息',
Msg:{
PageIndex: 1,
PageSize: 10,
ExamName:''
},
pageCount: 0,
timer: null, //防抖
dataList:[],
pageState: "more"
});
let methods = {
......@@ -98,7 +119,89 @@
},
toggleTitle(t) {
data.tabNme = t
if(this.tabNme=='学生列表'){
this.GetExamStuList()
}else if(this.tabNme=='作业情况'){
}else{
this.getExamPageList()
}
},
//获取学生列表
GetExamStuList(){
proxy.$request("/Exam/GetExamStuList", data.Msg).then(res => {
if(res){
if (data.timer) data.timer = null;
if (data.Msg.PageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...res.Data.PageData, ...data.dataList];
}
data.pageCount = res.Data.PageCount;
if (data.Msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
}
})
},
//获取作业情况列表
getExamPageList(){
proxy.$request("/Exam/GetExamPageList", data.Msg).then(res => {
if(res){
if (data.timer) data.timer = null;
if (data.Msg.PageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...res.Data.PageData, ...data.dataList];
}
data.pageCount = res.Data.PageCount;
if (data.Msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
}
})
},
//获取考试信息列表
getExamPageList(){
proxy.$request("/Exam/GetExamPageList", data.Msg).then(res => {
if(res){
if (data.timer) data.timer = null;
if (data.Msg.PageIndex === 1) {
data.dataList = res.Data.PageData;
} else {
data.dataList = [...res.Data.PageData, ...data.dataList];
}
data.pageCount = res.Data.PageCount;
if (data.Msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
}
})
},
lower(e) {
if (data.Msg.PageIndex < data.pageCount) {
data.pageState = "loading";
data.Msg.PageIndex++;
if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => {
if(this.tabNme=='学生列表'){
this.GetExamStuList()
}else if(this.tabNme=='作业情况'){
}else{
this.getExamPageList()
}
}, 1000);
} else {
data.pageState = "none";
}
},
};
onMounted(() => {
......@@ -114,6 +217,13 @@
},
onShow() {
this.userData = uni.getStorageSync('userInfo');
if(this.tabNme=='学生列表'){
this.GetExamStuList()
}else if(this.tabNme=='作业情况'){
}else{
this.getExamPageList()
}
},
onShareAppMessage() {
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment