123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <template>
- <view class="score">
- <!-- 搜索 -->
- <view class="mb5 stfixed">
- <!-- :tablist="tablist" -->
- <search @getSearch="getSearch"></search>
- </view>
- <da-list :roles="roles" :datalist='list' :wtdt="wtdt" :datype="datype" @getDetail='getDetail'></da-list>
- </view>
- </template>
- <script>
- import {getDeptList} from "@/api/mine/mine.js"
- import {getscoreListFn} from "@/api/mine/score.js"
- import daList from "@/mine/components/list/list.vue"
- import search from "@/mine/components/search/search.vue"
- export default {
- data(){
- return{
- sucimg:require("@/mine/static/score/ncheck.png"),
- wtdt:'',
- datype:3,
- reachflag:true,
- list:[],
- roles:this.$store.state.user.choseroles,
- tablist:[],
- schoolId:'',
- pageSize:10,
- pageNum:1,
- }
- },
- components:{
- daList,search
- },
- onUnload() {
- uni.$off('refreshscorelist')
- },
- onLoad: function() {
- uni.$on('refreshscorelist', (e) => {
- this.reachflag = true;
- this.pageNum = 1;
- this.list = [];
- this.getscoreListFn();
- })
- this.getscoreListFn()
- },
- onReachBottom() {
- if (this.reachflag) {
- this.pageNum++
- this.getscoreListFn()
- }
- },
- methods:{
- getSearch(e){
- this.scoreTime=e;
- this.reachflag = true;
- this.pageNum = 1;
- this.list = [];
- this.getscoreListFn();
- },
- getscoreListFn(){
- var params={
- pageSize:this.pageSize,
- pageNum:this.pageNum,
- }
- if(this.scoreTime){
- params.scoreTime=this.scoreTime
- }
- var role=this.$store.state.user.choseroles;
- if(role!='school'){
- params['params[role]']=role
- }
-
- getscoreListFn(params).then(res=>{
- if(res.code==200){
- if (res.rows.length < this.pageSize) {
- this.reachflag = false
- this.wtdt = '到底了~';
- } else {
- var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
- if (num < res.total) {
- this.reachflag = true
- this.wtdt = '上拉加载更多'
- } else {
- this.reachflag = false
- this.wtdt = '到底了~';
- }
- }
- if (this.pageNum == 1) {
- this.list = res.rows;
- } else {
- this.list = this.list.concat(res.rows)
- }
- }else{
- this.$toast(res.msg)
- }
- })
- },
- getclassListFn(id){
- var that=this;
- getDeptList(id).then(res=>{
- if(res.code==200){
- that.tablist = res.data.map(v => {
- return {
- className: v.deptName,
- classId: v.deptId,
- schoolId:v.parentId
- }
- })
- that.classId=res.data[0].deptId;
- that.formdata.subjectClassId=that.classId;
- that.formdata.subjectClass=res.data[0].deptName;
- that.schoolId=res.data[0].parentId;
- that.dataflag=true;
- that.getCourselistFn()
- }else{
- that.$toast(res.msg)
- }
- })
- },
- getDetail(id){
- this.$tab.navigateTo('/mine/pages/release/details?id='+id)
- },
- },
-
- }
- </script>
- <style lang="scss" scoped>
- .stfixed{position: fixed;left: 0;top: 0;right: 0;background-color: #f1f1f1;z-index: 2;}
- .score{padding: 110rpx 36rpx 20rpx;}
- </style>
|