|
@@ -2,12 +2,14 @@
|
|
<div class="my-history page p-16">
|
|
<div class="my-history page p-16">
|
|
<template v-if="loading"></template>
|
|
<template v-if="loading"></template>
|
|
<template v-else-if="list.length">
|
|
<template v-else-if="list.length">
|
|
- <ApplyItem
|
|
|
|
- :item="item"
|
|
|
|
- @update="_getMyHistory"
|
|
|
|
- v-for="item in list"
|
|
|
|
- :key="item.applyId"
|
|
|
|
- ></ApplyItem>
|
|
|
|
|
|
+ <van-pull-refresh v-model="pullLoading" @refresh="_getMyHistory(true)">
|
|
|
|
+ <ApplyItem
|
|
|
|
+ :item="item"
|
|
|
|
+ @update="_getMyHistory"
|
|
|
|
+ v-for="item in list"
|
|
|
|
+ :key="item.applyId"
|
|
|
|
+ ></ApplyItem>
|
|
|
|
+ </van-pull-refresh>
|
|
</template>
|
|
</template>
|
|
<div class="vh-100 text-center flex-h-center" v-else>
|
|
<div class="vh-100 text-center flex-h-center" v-else>
|
|
<div>
|
|
<div>
|
|
@@ -28,15 +30,20 @@ import { getMyHistory } from "@/api/user";
|
|
import { useRouter } from "vue-router";
|
|
import { useRouter } from "vue-router";
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const list = ref([]);
|
|
const list = ref([]);
|
|
|
|
+const pullLoading = ref(false);
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
-function _getMyHistory() {
|
|
|
|
|
|
+function _getMyHistory(bool) {
|
|
loading.value = true;
|
|
loading.value = true;
|
|
getMyHistory()
|
|
getMyHistory()
|
|
.then((res) => {
|
|
.then((res) => {
|
|
list.value = res || [];
|
|
list.value = res || [];
|
|
|
|
+ if (bool) {
|
|
|
|
+ showToast("刷新成功");
|
|
|
|
+ }
|
|
})
|
|
})
|
|
.finally(() => {
|
|
.finally(() => {
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
|
+ pullLoading.value = false;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
_getMyHistory();
|
|
_getMyHistory();
|