소스 검색

修复消息管理分页问题

凉纪 2 년 전
부모
커밋
e175112b12
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 4
      src/views/menu/message/index.vue

+ 9 - 4
src/views/menu/message/index.vue

@@ -14,7 +14,8 @@
         :pullup="pullup"
         class="wrapper"
         ref="wrapper">
-        <van-cell-group  v-for="(v,i) in dataList">
+        <van-empty v-if="!dataList.length" description="暂无数据" />
+        <van-cell-group v-else v-for="(v,i) in dataList">
           <van-cell class="list-item" :title="v.title" :label="v.content" @click="clickItem(v)">
             <template #right-icon>
               <i  class="point-icon" :class="{'active':v.isRead}" />
@@ -83,7 +84,7 @@ export default {
       query:{
         type:1,
         pageNum:1,
-        pageSize:1,
+        pageSize:10,
       },
       pullup:true,
       message:null,
@@ -146,7 +147,6 @@ export default {
           this.total = res.total;
           if(this.dataList.length < res.total) {
             this.dataList = [...this.dataList,...res.rows] ;
-            console.log(123,'123')
             this.pullup = true;
             this.query.pageNum++;
           }
@@ -163,7 +163,12 @@ export default {
           this.$toast('已加载完毕');
           return
         }
-        this.dataList = res.rows;
+        this.total = res.total;
+        if(this.dataList.length < res.total) {
+          this.dataList = [...this.dataList,...res.rows] ;
+          this.pullup = true;
+          this.query.pageNum++;
+        }
       })
     }
   }