Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问SerchBar如何实现下拉刷新? #329

Open
lyndon1115 opened this issue Feb 21, 2021 · 0 comments
Open

请问SerchBar如何实现下拉刷新? #329

lyndon1115 opened this issue Feb 21, 2021 · 0 comments

Comments

@lyndon1115
Copy link

lyndon1115 commented Feb 21, 2021

Do you want to request a feature or report a bug (建议还是bug) ?
建议
What is the current behavior? (现有状况)
let currentPage = null
let totalPage = null
` search: function (value) {
if(!currentPage) currentPage = 1;
searchValue = value;

  return new Promise((resolve, reject) => {
      //setTimeout(() => {
          wx.request({
            url: getApp().data.basePath + '/search-' + value + '-1-' + currentPage + '.htm',
            success: (data) => {
              console.log('search', data.data);
              totalPage = data.data.message.totalpage;
              console.log('search searchResultList before', searchResultList);
              console.log('search searchResultList threadlist', searchResultList);
              if(searchResultList)
                searchResultList = searchResultList.concat(data.data.message.threadlist);
              else searchResultList = data.data.message.threadlist;
              console.log('search searchResultList after', searchResultList);
              resolve(searchResultList)
            }
          })
     // }, 200)
  })

},
onReachBottom () {
console.log('onReachBottom currentPage ', currentPage);
console.log('onReachBottom totalPage ', totalPage);
var that = this;
if (currentPage && totalPage) {
if( currentPage < totalPage){
currentPage += currentPage;
that.search.then(that.search(searchValue));
}
}`
搜索结果分页,第一次搜索结果为前10,上拉(onReachBottom)以后出发请求第二页搜索结果,然后追加展示。但是现在追加结果没有反应。
What is the expected behavior? (应有状况)
第二页搜索结果追加到搜索结果列表。
Which versions of React-weui, weui, and which OS and device are affected by this issue? (React-weui版本 weui版本 机型和系统)
全机型。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant