<view class="table_header" wx:for="{{ hisrecord }}" wx:key="index">
<view class="td" style='width:150rpx;background-color:white; color:black'>{{item.title}}</view>
<view class="td">{{item.allnum}}</view>
<view class="td">{{item.lastnum}}</view>
<view class="td" wx:if="{{item.addyn=='Y'}}">是</view>
<view class="td" wx:if="{{item.addyn=='N'}}">否</view>
</view>
===================================================
hisrecord:this.data.hisrecord.concat(res.data)
如果改成这样拼接数据,但也只是不断显示前20条数据,想要显示所有数据应该怎么弄呢?
pageData:{skip:0},
getshow:function(callback){
if(!callback)
{
callback=res=>{}
}
db.collection("kinds").skip(this.pageData.skip).where({useyn:'Y'}).get().then(res => {
this.setData({
//hisrecord:this.data.hisrecord.concat(res.data)
hisrecord:res.data
}),res=>{
this.pageData.skip=this.pageData.skip+20
callback()
}
})
},
onPullDownRefresh:function()
{
this.getshow(res=>{
wx.stopPullDownRefresh();
this.pageData.skip=0;
});
},
onReachBottom:function()
{
this.getshow();
console.log('ssf')
},