fei.wang
2025-04-30 722da005a5ec126bedf752ac6bd5c5c7f6172155
components/data-list/data-list.vue
@@ -47,7 +47,9 @@
               </view>
            </view>
         </view>
         <!-- <page-pagination :total="pagep.totalp" layout="total,first,prev,page,next,last,limit,jumper"></page-pagination> -->
      </scroll-view>
      <page-pagination style="position:absolute; zIndex: 9999 " :total="pagep.totalp" layout="total,first,prev,page,next,last,limit,jumper" @change="change" @sizeChange="sizeChange"></page-pagination>
   </view>
</template>
@@ -95,7 +97,7 @@
      },
      size: {
         type: [Number, String],
         default: 15
         default: 10
      },
      loading: {
         type: Boolean,
@@ -127,6 +129,11 @@
   },
   data() {
      return {
         pagep: {
            totalp: 0,
            pageSizep: 10,
            currentPagep: 2
         },
         place:'请输入编号',
         keyword:'',
         topheight:55,
@@ -184,6 +191,38 @@
      this.handleInit();
   },
   methods: {
      change(currentPage, type) { // 当前页改变
         this.pagep.currentPagep = currentPage;
         console.log("点击了" + type + ",当前页:" + currentPage);
      uni.showLoading({
         title: '加载中'
      });
         this.waiting = true;
         this.$emit('load', { page: this.pagep.currentPagep, size: this.pagep.pageSizep }, res => {
            setTimeout(function () {
               uni.hideLoading();
            }, 1500);
            this.waiting = false;
            this.loadingMask = false;
            this.list = res.list;
            this.total = res.total;
            this.pagep.totalp = res.total;
            this.currentPage++;
            this.handleComputeData();
            this.computedHeight();
         });
      },
      sizeChange(pageSize) { // 每页条数改变
         this.pagep.pageSizep = pageSize;
         console.log("每页", pageSize, "条");
      },
      changeTotal() { // 更改总条数
         this.pagep.totalp = 555
      },
      changeCurrentPage() { // 更改当前页
         this.pagep.currentPagep = 3
      },
      // 数据加载
      loadData() {
         this.waiting = true;
@@ -192,6 +231,7 @@
            this.loadingMask = false;
            this.list = res.list;
            this.total = res.total;
            this.pagep.totalp = res.total;
            this.currentPage++;
            this.handleComputeData();
            this.computedHeight();
@@ -241,6 +281,7 @@
            this.pullDownHeight = 0;
            this.list = res.list;
            this.total = res.total;
            this.pagep.totalp = res.total;
            this.currentPage++;
            this.handleComputeData();
            this.computedHeight();
@@ -257,6 +298,7 @@
            this.pullDownHeight = 0;
            this.list = res.list;
            this.total = res.total;
            this.pagep.totalp = res.total;
            this.currentPage++;
            this.handleComputeData();
            this.computedHeight();
@@ -268,10 +310,10 @@
         this.getRect('.data-list-components').then(res => {
            
            // #ifdef H5
            this.componentsHeight = `calc(100vh - ${res.top}px - var(--window-top))`;
            this.componentsHeight = `calc(100vh - ${res.top-200}px - var(--window-top))`;
            // #endif
            // #ifndef H5
            this.componentsHeight = `${this.vuex_custom_index_height-100}px`;
            this.componentsHeight = `${this.vuex_custom_index_height-168}px`;
            // #endif
            this.autoLoad = true;
            this.$nextTick(() => {