<ul class="content">
<li>
<van-pull-refresh v-model="isDownLoading" @refresh="onDownRefresh">
<van-list
v-model="isUpLoading"
:finished="finished"
:immediate-check="false"
:offset="offset"
:finished-text="txts"
@load="onLoadList"
>
<div v-if="tableList.length > 0" class="allcontent">
<div
v-for="(item, index) in tableList"
:key="index"
class="item"
@click="goApply(item)"
>
<van-row>
<van-col span="12"> 名称:{{ item.name }} </van-col>
<van-col span="12"> 规格:{{ item.specifications }} </van-col>
</van-row>
<van-row>
<van-col span="12"> 纯度: {{ item.purity }}</van-col>
<van-col span="12"> 浓度: {{ item.concentration }}</van-col>
</van-row>
</div>
</div>
</van-list>
</van-pull-refresh>
</li>
</ul>
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10,
deposit: null,
number: null,
category: null,
},
tableList: [],
isDownLoading: false,
isUpLoading: false,
finished: false,
offset: 10,
txts: "没有更多了",
}
}
listTaccount() {
this.$request(this.$Api.listTaccount, this.queryParams, "get")
.then((res) => {
this.total = res.total;
var rows = res.rows;
if (rows == null || rows.length === 0) {
this.tableList = rows;
this.txts = "暂无数据";
this.finished = true;
return;
}
if (rows.length < this.queryParams.pageSize) {
this.finished = true;
}
if (this.queryParams.pageNum == 1) {
this.tableList = rows;
} else {
this.tableList = this.tableList.concat(rows);
console.log("hhhhhh");
}
if (this.tableList.length >= res.total) {
this.finished = true;
} else {
this.finished = false;
}
})
.catch((e) => {
console.log(e);
})
.finally(() => {
this.isDownLoading = false;
this.isUpLoading = false;
});
},
onDownRefresh() {
console.log("下拉");
this.tableList = [];
this.queryParams.pageNum = 1;
this.finished = true;
this.listTaccount();
},
onLoadList() {
console.log("上拉");
this.queryParams.pageNum++;
this.listTaccount();
},```