王飞
2025-03-07 c5e49c10499435802a6551b98772f95660c6f85a
components/data-list/data-list.vue
@@ -5,7 +5,7 @@
      :style="[dataListStyle]"
      @touchmove.stop.prevent
   >
   <u-search class="searchbg" shape="true" bg-color="rgba(255, 255, 255, 0.5)" placeholder="请输入名称" :show-action="false" v-model="keyword" @search="searchxinxi"
   <u-search class="searchbg" shape="true" bg-color="rgba(255, 255, 255, 0.5)" :placeholder="place" :show-action="false" v-model="keyword" @search="searchxinxi"
               :style="{top: topheight+'px',position: 'absolute',width: width,right: '5%'}"></u-search>
      <scroll-view
         class="scroll-view"
@@ -127,6 +127,7 @@
   },
   data() {
      return {
         place:'请输入编号',
         keyword:'',
         topheight:55,
         list: [], // 数据列表
@@ -174,6 +175,11 @@
      }
   },
   mounted() {
      if (this.width=='90%') {
         this.place = '请输入名称'
      }else{
         this.place = '请输入编号'
      }
       this.topheight=this.vuex_custom_bar_height+15
      this.handleInit();
   },
@@ -192,8 +198,7 @@
         });
      },
      // 刷新数据
      searchxinxi() {
         console.log(555555555);
      searchxinxi() {
         const params = {
            current: this.page,
            size: this.size,
@@ -230,7 +235,7 @@
         this.currentPage = this.page;
         this.currentSize = this.size;
         this.$emit('refresh', { page: this.currentPage, size: this.currentSize, objectid:this.keyword}, res => {
            console.log(res.list);
            this.autoLoad = true;
            this.pullingDown = false;
            this.pullDownHeight = 0;
@@ -261,7 +266,7 @@
      // 计算高度
      computedHeight() {
         this.getRect('.data-list-components').then(res => {
            console.log(res);
            // #ifdef H5
            this.componentsHeight = `calc(100vh - ${res.top}px - var(--window-top))`; 
            // #endif
@@ -273,8 +278,6 @@
               this.handleAutoLoadData();  
            });
         });
         console.log(444444444);
         console.log(this.componentsHeight);
      },
      // 自动加载数据
      async handleAutoLoadData() {
@@ -282,6 +285,7 @@
            const components = await this.getRect('.data-list-components');
            const scrolList = await this.getRect('.scroll-list');
            if (scrolList.height <= components.height) {
               this.loadData();
            } else {
               this.autoLoad = false;