|
@@ -1,22 +1,48 @@
|
|
|
<template>
|
|
|
<div class="my-history page p-16">
|
|
|
- <ApplyItem
|
|
|
- :item="item"
|
|
|
- @update="_getMyHistory"
|
|
|
- v-for="item in list"
|
|
|
- :key="item.applyId"
|
|
|
- ></ApplyItem>
|
|
|
+ <template v-if="loading"></template>
|
|
|
+ <template v-else-if="list.length">
|
|
|
+ <ApplyItem
|
|
|
+ :item="item"
|
|
|
+ @update="_getMyHistory"
|
|
|
+ v-for="item in list"
|
|
|
+ :key="item.applyId"
|
|
|
+ ></ApplyItem>
|
|
|
+ </template>
|
|
|
+ <div class="vh-100 text-center flex-h-center" v-else>
|
|
|
+ <div>
|
|
|
+ <NoData>
|
|
|
+ <template #img>
|
|
|
+ <img src="../assets/imgs/no_data.png" />
|
|
|
+ </template>
|
|
|
+ 当前无考试预约订单</NoData
|
|
|
+ >
|
|
|
+ <div class="cus-btn flex-h-center" @click="toReservation">去预约</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script name="MyHistory" setup>
|
|
|
import { ref } from "vue";
|
|
|
import { getMyHistory } from "@/api/user";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
+const router = useRouter();
|
|
|
const list = ref([]);
|
|
|
+const loading = ref(false);
|
|
|
function _getMyHistory() {
|
|
|
- getMyHistory().then((res) => {
|
|
|
- list.value = res || [];
|
|
|
- });
|
|
|
+ loading.value = true;
|
|
|
+ getMyHistory()
|
|
|
+ .then((res) => {
|
|
|
+ list.value = res || [];
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
}
|
|
|
_getMyHistory();
|
|
|
+
|
|
|
+function toReservation() {
|
|
|
+ router.push({ name: "Reservation" });
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="less" scoped></style>
|