Commit 2eaa48dc authored by linxin's avatar linxin

add接口分页-合同还款

parent 102406b7
...@@ -86,6 +86,8 @@ export default { ...@@ -86,6 +86,8 @@ export default {
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
next(vm => { next(vm => {
vm.pagenum = 1
vm.lists = []
vm.getList() vm.getList()
}) })
}, },
...@@ -155,6 +157,7 @@ export default { ...@@ -155,6 +157,7 @@ export default {
vum.forEach(returnData, function (data, index, array) { vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index]) vm.lists.push(array[index])
}) })
vm.pagenum++
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length === 10) { } else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) { vum.forEach(returnData, function (data, index, array) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</h-header> </h-header>
<h-content v-if="data!==null" class="pay-content"> <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 v-for="(item,index) in lists" :key="index" class="contract-item">
<div class="header"> <div class="header">
<img src="@/assets/contractRepayment/contract.png" alt=""> <img src="@/assets/contractRepayment/contract.png" alt="">
...@@ -46,6 +46,7 @@ export default { ...@@ -46,6 +46,7 @@ export default {
data () { data () {
return { return {
// data: null, 无记录时 // data: null, 无记录时
pagenum: 1,
lists: [], lists: [],
} }
}, },
...@@ -62,6 +63,8 @@ export default { ...@@ -62,6 +63,8 @@ export default {
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
next(vm => { next(vm => {
if (from.name === 'HomePage') { if (from.name === 'HomePage') {
vm.pagenum = 1
vm.lists = []
vm.getList() vm.getList()
} }
}) })
...@@ -72,15 +75,34 @@ export default { ...@@ -72,15 +75,34 @@ export default {
let url = process.env.basePath + 'con_repayment_list_query' let url = process.env.basePath + 'con_repayment_list_query'
let param = { let param = {
user_phone: window.localStorage.getItem('user_phone'), user_phone: window.localStorage.getItem('user_phone'),
pagesize: 10,
pagenum: vm.pagenum,
} }
hlsPopup.showLoading('请稍候') hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) { vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.lists = res.lists let returnData = []
if (res.listst.length >= 0 && res.lists.length < 10) { returnData = res.lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true) 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 { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
......
...@@ -168,6 +168,7 @@ export default { ...@@ -168,6 +168,7 @@ export default {
vum.forEach(returnData, function (data, index, array) { vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index]) vm.lists.push(array[index])
}) })
vm.pagenum++
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length === 10) { } else if (returnData.length === 10) {
vum.forEach(returnData, function (data, index, array) { 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