Merge branch 'dev_test' into dev_20230829_change

This commit is contained in:
zyn
2023-12-01 16:57:04 +08:00
7 changed files with 287 additions and 22 deletions
@@ -17,17 +17,6 @@
</div>
</template>
<!-- 除上拉和下拉之外的loading -->
<van-loading
v-if="loading && !pullDownLoading && !pullUpLoading"
class="pageLoading"
type="spinner"
size="16px"
text-size="12px"
color="#3170A8"
style="text-align: center"
>加载中...</van-loading>
<slot></slot>
<!-- 上拉加载 -->
@@ -40,12 +29,23 @@
color="#3170A8"
style="text-align: center"
>加载中...</van-loading>
<template v-else>
<template v-else-if="!loading">
<div v-if="isShowAll" style="font-size: 12px;text-align: center;color: #999">已加载全部数据</div>
<van-empty v-if="isEmpty" description="暂无数据" />
</template>
</template>
</div>
<!-- 除上拉和下拉之外的loading -->
<van-loading
v-if="loading && !pullDownLoading && !pullUpLoading"
class="pageLoading"
type="spinner"
size="16px"
text-size="12px"
color="#3170A8"
style="text-align: center"
>加载中...</van-loading>
</div>
</template>
@@ -129,6 +129,10 @@ export default {
},
watch: {
data() {
if (this.data.length === 0) {
this.scrollTo(0,0)
this.isEmpty = true
}
this.refreshScroll()
}
},
@@ -191,6 +195,7 @@ export default {
// 下拉刷新回调
async pullingDownHandler () {
this.showPullDownText('pullDownLoading')
this.hidePullUpText()
// 从第一页获取数据
await this.getDataHandler(1)
@@ -201,8 +206,7 @@ export default {
},
showPullUpText () {
this.isEmpty = false
this.isShowAll = false
this.hidePullUpText()
if (this.data.length === 0) {
this.isEmpty = true
} else {
@@ -211,6 +215,10 @@ export default {
}
}
},
hidePullUpText () {
this.isEmpty = false
this.isShowAll = false
},
showPullDownText (key) {
this.isEnterThreshold = false
this.isLeaveThreshold = false