fix
Helius
2021-02-20 45fb4b11ad51bb38306765b11a6747402e382cee
hive-app/pages/workbench/stockSearch.vue
@@ -17,38 +17,72 @@
            </view>
            <text class="iconfont iconarrow-backimg light-gray"></text>
         </navigator>
         <view v-if="list.length">
            <uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more>
         </view>
      </view>
   </view>
</template>
<script>
   import searchBar from '../../components/searchBar/index.vue';
   import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
   export default {
      components:{
         uniLoadMore,
         searchBar
      },
      data(){
         return{
            queryKey: '',
            list: []
            list: [],
            loadStatus: 'more',
            pageNum: 1
         }
      },
      onLoad() {
         this.loadList()
      },
      onPullDownRefresh(){
         this.reloadData();
         let timer = setTimeout(function () {
            uni.stopPullDownRefresh();
            clearTimeout(timer);
            timer = null;
         }, 800);
      },
      onReachBottom(){
         this.loadList()
      },
      methods:{
         search(val){
            this.queryKey = val;
         reloadData(){
            this.list = [];
            this.pageNum = 1;
            this.loadStatus = 'more';
            this.loadList();
         },
         search(val){
            this.queryKey = val;
            this.reloadData();
         },
         loadList(){
            if(this.loadStatus!=='more'){
               return;
            }
            this.$httpUtils.request('/api/store/findStoreList', {
               pageNum: 1,
               pageSize: 100,
               pageNum: this.pageNum,
               pageSize: 10,
               queryKey: this.queryKey
            }, 'POST').then((res) => {
               if(res.status == 200){
                  this.list = res.rows;
                  let result = res.rows;
                  if(result.length < 10){
                     this.loadStatus = 'noMore';
                  } else {
                     this.pageNum ++ ;
                     this.loadStatus = 'more';
                  }
                  this.list = this.list.concat(result);
               }
            })
         }