<ul class="scoreUl">
<li class="clear" v-for="item ,index in dataArr">
<div class="scoreText">
<p class="scoreNum">{{item.orderno}}</p>
<p class="scoreExplain" v-show="item.state==7">{{item.rejectreason}}</p>
<p class="scoreExplain">积分:+{{item.earnpoints}}</p>
<p class='scoreTime'>{{item.created}}</p>
</div>
<div class="scoreExamine" v-show="item.state==1" style="color:darkred;">待审核
</div>
</li>
</ul>
点击加载更多时,根据你的参数请求数据
addMore:function(){
this.pageNo=parseInt(this.pageNo)+1;
// alert(this.pageNo);
const that =this;
if(this.totalPage< this.pageNo){
this.pageNo=this.totalPage;
this.add_show=false;//隐藏加载更多
}else{
this.$http.get(productPath + '/h5/order/photoScoreList?pageNo='+ this.pageNo + "&pageSize=" + this.pageSize).then(function(res){
if(res.data.code==0){
const array= res.data.data;
console.log(array);
that.dataArr= that.dataArr.concat(array);//组合,,这个地方是关键
if(that.totalPage<= that.pageNo){
that.add_show=false;//隐藏加载更多
}else{
that.add_show=true;//加载更多
}
Indicator.close();//关闭上传中的方法
}else{
alert(res.data.msg);
}
},function(){
alert("请求失败");
})
}
}
原理就是
var
a=[1,2,3],b=[4,5,6];
var
c=a.concat(b);
console.log(c);
// 1,2,3,4,5,6
console.log(a);
// 1,2,3 不改变本身
希望能够帮到你哦
祝工作顺利,身体健康