下拉加载更多,用concat拼装打印出数据了,但是不显示出来?
发布于 4 年前 作者 pshen 14114 次浏览 来自 问答
 var list = this.data.listData;       
        let self=this;               
        var pageid = self.data.page + 1;
        console.log(pageid);
        wx.request({
            url: http_url,
            method: 'GET',
            data: {
                keywordself.data.keyword,
                pagepageid
                
            },
           
            success: function(res){                
               
                if (res.data.code == 1) {
                   
                         self.setData({
                            page:pageid,
                            
                        });    
                        console.log(res.data.data);                  
                       var listnew = list.concat(res.data.data);
                        self.setData({                            
                            listData:listnew,
                        });
                       
                         
                     }
                

            }
        })

下拉加载更多,用concat拼装,列表一直显示第一页的数据,打印出数据每一页的数据了

1 回复
打印的listnew 是 多页数据?
回到顶部