直接上干货

api.addEventListener({
            name: 'scrolltobottom',
            extra: {
                threshold: 0
            }
        }, function(ret, err) {
          index += 1;
          var data = {
              categoryId: 0,
              pageNum: index,
              pageSize: 10
          }
          ajaxRequest('/api/Shop/GoodsListFromCategory?', 'get', data, true, function(ret) {
              if (ret.code == 200) {
                if (ret.res.data.count == 0) {
                  toast("没有更多数据了!")
                }else {
                  main.list = main.list.concat(ret.res.data.list);
                }
              } else {
                  toast(ret.res.msg)
              }
          })
        });