[银保app] 保单列表分页请求优化

This commit is contained in:
DESKTOP-AFPHKHF\PC
2022-12-26 14:33:13 +08:00
committed by liu.xiaofeng@ebiz-digits.com
parent f4c5aa0875
commit f8d418985e

View File

@@ -23,7 +23,7 @@
</div> </div>
<!-- 卡片列表 --> <!-- 卡片列表 -->
<div v-if="filpolicyListDTOList != ''" style="overflow:hidden"> <div v-if="filpolicyListDTOList != ''" style="overflow:hidden">
<!-- <van-list v-model="loading" :finished="finished" :finished-text="noContentTip" @load="onLoad"> --> <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="YBpolicyListAgent">
<div class="cardList" v-for="(item, index) in filpolicyListDTOList" :key="index"> <div class="cardList" v-for="(item, index) in filpolicyListDTOList" :key="index">
<div :class="[item.orderStatus == 1 ? 'topbackground1' : 'topbackground2']"> <div :class="[item.orderStatus == 1 ? 'topbackground1' : 'topbackground2']">
<!-- 字左边小对号图片 --> <!-- 字左边小对号图片 -->
@@ -59,7 +59,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- </van-list> --> </van-list>
</div> </div>
<van-popup v-model="showSideBar" position="right" style="width: 80%; height: 100%" :overlay-style="{ opacity: 0.7 }"> <van-popup v-model="showSideBar" position="right" style="width: 80%; height: 100%" :overlay-style="{ opacity: 0.7 }">
<div class="state-content"> <div class="state-content">
@@ -174,8 +174,12 @@ export default {
stateName: '', // 保单状态 stateName: '', // 保单状态
bankChannel: '', // 渠道名称 bankChannel: '', // 渠道名称
visitSuccess: '', // 回访成功 visitSuccess: '', // 回访成功
visitFinish: '' // 回访完成 visitFinish: '', // 回访完成
} pageSize:10,
pageNo:0,
},
loading: false,
finished: false,
} }
}, },
created() { created() {
@@ -192,7 +196,7 @@ export default {
message: '加载中……' message: '加载中……'
}) })
this.getAgentInfo() this.getAgentInfo()
this.YBpolicyListAgent() this.YBpolicyListAgent()
// 筛选按钮的点击事件 // 筛选按钮的点击事件
window.appCallBack = this.appCallBack window.appCallBack = this.appCallBack
@@ -255,14 +259,29 @@ export default {
YBpolicyListAgent() { YBpolicyListAgent() {
let that = this let that = this
console.log('我是log') console.log('我是log')
if(!that.finished){
that.params.pageNo++
}
YBpolicyListAgent(that.params).then((res) => { YBpolicyListAgent(that.params).then((res) => {
console.log(res, '我是res') console.log(res, '我是res')
if (res.result == 0) { if (res.result == 0) {
that.policyListDTOList = res.policyListDTOList // that.policyListDTOList = res.policyListDTOList
that.filpolicyListDTOList = res.policyListDTOList // that.filpolicyListDTOList = res.policyListDTOList
console.log(this.policyListDTOList, 'data里的policyListDTOList') // console.log(this.policyListDTOList, 'data里的policyListDTOList')
// this.YBpolicyListAgent()
if( res.policyListDTOList.length == 0 ){
this.finished = true
this.loading= false
// that.filpolicyListDTOList = []
}else{
that.filpolicyListDTOList = that.filpolicyListDTOList.concat(res.policyListDTOList)
that.finished = false
this.loading= false
}
} else { } else {
that.filpolicyListDTOList = '' that.$toast(res.resultMessage)
this.finished = true
this.loading= false
} }
}) })
}, },