Commit 6870e34f by 李伟康

分页增加加载

1 parent 99982d8c
......@@ -79,7 +79,11 @@
</div>
<template v-if="type == 0">
<div class="bottom flex">
<img class="icon-img-wh" :src="require(`@/assets/images/coupon/icon-${attrToIcon[item.discountType]}.png`)" alt="">
<img
class="icon-img-wh"
:src="require(`@/assets/images/coupon/icon-${attrToIcon[item.discountType]}.png`)"
alt=""
>
<div class="name">
<template v-if="tabIndex == 0">
核销时间: {{new Date(item.verificationTime).format('yyyy/MM/dd')}}
......@@ -94,7 +98,10 @@
</div>
</template>
</template>
<div v-else-if="type == 0 && item.discountType == 7" class="type-3">
<div
v-else-if="type == 0 && item.discountType == 7"
class="type-3"
>
<div class="item">
<div class="title flex">
{{item.phone}}
......@@ -151,7 +158,11 @@
<template v-else>不限次数</template>
</template>
</div> -->
<img class="icon-img-wh" :src="require(`@/assets/images/coupon/icon-${attrToIcon[item.discountType]}.png`)" alt="">
<img
class="icon-img-wh"
:src="require(`@/assets/images/coupon/icon-${attrToIcon[item.discountType]}.png`)"
alt=""
>
<div class="name">{{tabIndex == 0?'核销时间':'购买时间'}}:{{new Date(tabIndex == 0 ?item.verificationTime:item.receiveTime).format('yyyy/MM/dd')}}</div>
</div>
</div>
......@@ -451,12 +462,17 @@ export default {
onReachBottom () {
let { total, pageNum, list } = this
this.$refs.scrollView.loading = false
if (list.length == total || Math.ceil(total / 10) < pageNum) {
if (list.length == total) {
this.$refs.scrollView.finished = true
return
}
this.pageNum = pageNum + 1
this.getList()
if (Math.ceil(total / 10) > pageNum) {
this.showLoading()
this.pageNum = pageNum + 1
this.getList()
} else {
this.$refs.scrollView.finished = true
}
},
scan () {
// let resultStr = 't=1&c=3510671342174081024'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!