Commit 2eaa48dc authored by linxin's avatar linxin

add接口分页-合同还款

parent 102406b7
......@@ -86,6 +86,8 @@ export default {
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.pagenum = 1
vm.lists = []
vm.getList()
})
},
......@@ -155,6 +157,7 @@ export default {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) {
......
......@@ -8,7 +8,7 @@
</h-header>
<h-content v-if="data!==null" class="pay-content">
<scroll ref="scroll" :updateData="[lists]" :pullUp="true">
<scroll ref="scroll" :updateData="[lists]" :pullUp="true" @pullingUp="getList">
<div v-for="(item,index) in lists" :key="index" class="contract-item">
<div class="header">
<img src="@/assets/contractRepayment/contract.png" alt="">
......@@ -46,6 +46,7 @@ export default {
data () {
return {
// data: null, 无记录时
pagenum: 1,
lists: [],
}
},
......@@ -62,6 +63,8 @@ export default {
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.name === 'HomePage') {
vm.pagenum = 1
vm.lists = []
vm.getList()
}
})
......@@ -72,15 +75,34 @@ export default {
let url = process.env.basePath + 'con_repayment_list_query'
let param = {
user_phone: window.localStorage.getItem('user_phone'),
pagesize: 10,
pagenum: vm.pagenum,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.lists = res.lists
if (res.listst.length >= 0 && res.lists.length < 10) {
let returnData = []
returnData = res.lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(false)
}
// vm.lists = res.lists
// if (res.listst.length >= 0 && res.lists.length < 10) {
// vm.$refs.scroll.update(true)
// }
} else {
hlsPopup.showLongCenter(res.message)
}
......
......@@ -168,6 +168,7 @@ export default {
vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index])
})
vm.pagenum++
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment