task#6524 下拉刷新
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
|
||||
<div class="main_wrap">
|
||||
<div class="top_bg">
|
||||
<div class="title">报备中心</div>
|
||||
@ -55,9 +56,7 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<report-list-item :report-list.sync="reportList" @getReport="getReportHandler" />
|
||||
|
||||
<van-popup ref="addReportModal" v-model="addReportShow" :close-on-click-overlay="false" closeable duration="0" round position="bottom">
|
||||
<div class="dialog_wrap">
|
||||
<img class="add_report_bg" src="@/assets/report/add_report_bg.png" alt="">
|
||||
@ -122,6 +121,7 @@
|
||||
/>
|
||||
</van-popup>
|
||||
</div>
|
||||
</van-pull-refresh>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -154,6 +154,7 @@
|
||||
userOrderCode: '',
|
||||
driverId: '',
|
||||
clickFlag: true,
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
@ -178,6 +179,18 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onRefresh() {
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
await this.getReportList();
|
||||
await this.getDetail();
|
||||
await this.getRecordList();
|
||||
await this.scrollToBottom();
|
||||
} finally {
|
||||
this.isLoading = false; // 结束加载状态
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
// 添加滚动方法
|
||||
scrollToBottom() {
|
||||
this.$nextTick(() => {
|
||||
@ -528,4 +541,7 @@
|
||||
::v-deep .van-popup__close-icon {
|
||||
color: #0F458E;
|
||||
}
|
||||
::v-deep .van-pull-refresh {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user