zoukankan      html  css  js  c++  java
  • 小程序上拉加载更多,onReachBottom

    onReachBottom: function () {
    console.log(1)
    var that = this;
    var path = '/listsearch/';
    var datalist=null;
    var url = app.globalData.http_base_url + path;
    // 显示加载图标
    wx.showLoading({
    title: '玩命加载中',
    })
    app.globalData.currentPage ++;
    var _currentPage = app.globalData.currentPage;
    if(that.data.yearselect==undefined){
    var selectyear="None"
    }else{
    var selectyear=that.data.yearselect
    }
    wx.request({
    url:url,
    data:{
    searchdetail:that.data.SearchContent,
    years:selectyear,
    page:_currentPage
    },
    method:'GET',
    success:function(res){
    console.log(res)
    if(res.data.carbonlist.length==0){
    wx.showLoading({
    title: '暂无更多数据',
    })
    }else{
    for (var i = 0; i < res.data.carbonlist.length; i++) {
    that.data.carbonlist.push(res.data.carbonlist[i]);
    }
    console.log(that.data.carbonlist)
    const pushData=that.data.carbonlist
    // 设置数据
    that.setData({
    carbonlist: pushData
    })
    // 隐藏加载框
    }
    wx.hideLoading();

    }
    })
    },

  • 相关阅读:
    基因id转换
    Trinity的分步运行
    免费的稳定的SVN托管的服务器
    游戏化
    一个华裔男孩在美国的成长之路
    你懂USB和Type-C吗
    ios调试小技巧
    swift开发笔记19
    iOS 3DTouch应用
    iCloud实现APP多设备数据同步
  • 原文地址:https://www.cnblogs.com/wjhaaa/p/9936506.html
Copyright © 2011-2022 走看看