hookehuyr

fix

1 <!-- 1 <!--
2 * @Date: 2024-01-16 11:37:10 2 * @Date: 2024-01-16 11:37:10
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-01-24 17:52:56 4 + * @LastEditTime: 2024-01-27 11:26:24
5 * @FilePath: /xysBooking/src/views/bookingList.vue 5 * @FilePath: /xysBooking/src/views/bookingList.vue
6 - * @Description: 文件描述 6 + * @Description: 预约记录列表页
7 --> 7 -->
8 <template> 8 <template>
9 <div class="booking-list-page"> 9 <div class="booking-list-page">
...@@ -57,7 +57,7 @@ const formatDatetime = (data) => { // 格式化日期 ...@@ -57,7 +57,7 @@ const formatDatetime = (data) => { // 格式化日期
57 onMounted(async () => { 57 onMounted(async () => {
58 const { code, data } = await billListAPI({ page: page.value, row_num: limit.value }); 58 const { code, data } = await billListAPI({ page: page.value, row_num: limit.value });
59 if (code) { 59 if (code) {
60 - // 60 + // 格式化数据
61 data.forEach(item => { 61 data.forEach(item => {
62 item.booking_time = item && formatDatetime(item); 62 item.booking_time = item && formatDatetime(item);
63 item.order_time = item.created_time.slice(0, -3); 63 item.order_time = item.created_time.slice(0, -3);
...@@ -70,11 +70,14 @@ const onLoad = async () => { ...@@ -70,11 +70,14 @@ const onLoad = async () => {
70 page.value++; 70 page.value++;
71 const { code, data } = await billListAPI({ page: page.value, row_num: limit.value }); 71 const { code, data } = await billListAPI({ page: page.value, row_num: limit.value });
72 if (code) { 72 if (code) {
73 + // 格式化数据
73 data.forEach(item => { 74 data.forEach(item => {
74 item.booking_time = item && formatDatetime(item); 75 item.booking_time = item && formatDatetime(item);
75 item.order_time = item.created_time.slice(0, -3); 76 item.order_time = item.created_time.slice(0, -3);
76 }); 77 });
78 + // 合并数据
77 bookingList.value = bookingList.value.concat(data); 79 bookingList.value = bookingList.value.concat(data);
80 + // 结束loading状态
78 loading.value = false; 81 loading.value = false;
79 // 数据全部加载完成 82 // 数据全部加载完成
80 if (!data.length) { 83 if (!data.length) {
......
1 <!-- 1 <!--
2 * @Date: 2023-06-21 10:23:09 2 * @Date: 2023-06-21 10:23:09
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-01-26 14:10:42 4 + * @LastEditTime: 2024-01-27 11:19:43
5 * @FilePath: /xysBooking/src/views/index.vue 5 * @FilePath: /xysBooking/src/views/index.vue
6 * @Description: 预约页首页 6 * @Description: 预约页首页
7 --> 7 -->
...@@ -94,7 +94,7 @@ const toMy = () => { // 跳转到我的 ...@@ -94,7 +94,7 @@ const toMy = () => { // 跳转到我的
94 94
95 onMounted(async () => { 95 onMounted(async () => {
96 // TAG: 触发授权页面 96 // TAG: 触发授权页面
97 - await billListAPI(); 97 + await billListAPI({ page: 1, row_num: 1 });
98 }); 98 });
99 99
100 const root = ref(); 100 const root = ref();
......