Browse Source

修改下拉加载

master
邓宏 2 years ago
parent
commit
b186adff6a
  1. 34
      pages/massif/collectList.vue

34
pages/massif/collectList.vue

@ -54,7 +54,7 @@
<view class="container flex">
<d-search v-model="searchVal.search" @search="clean();search()"/>
<scroll-view scroll-y>
<scroll-view scroll-y @scrolltolower="search">
<view class="card" v-for="(v,k) in list" :key="k" @click="toSpecs(v)">
<view class="name">
<text>{{v.goodsType}}</text> <text>{{v.substanceName}}</text> <text class="plant-youbian"/>
@ -76,7 +76,7 @@ export default {
baseId: this.$store.state.plantBaseInfoId,
pageNo:1,
flagGroupBy:'y',
pageSize:6,
pageSize:7,
search:"",
},
list:[],
@ -95,21 +95,23 @@ export default {
this.searchVal.pageNo=1
},
async search(){
var res=await request("/api/Inventory/queryCollectingList",{
method:"post",
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.records)
this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取领用农资失败!",
showCancel:false,
if(this.total==0 || this.list.length<this.total){
var res=await request("/api/Inventory/queryCollectingList",{
method:"post",
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.records)
this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取领用农资失败!",
showCancel:false,
})
}
}
},
toSpecs(e){

Loading…
Cancel
Save