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