hookehuyr

fix(OrdersPage): 修复订单列表为空时的显示逻辑

修复当订单列表为空时,无数据提示和列表同时显示的问题。现在当订单列表为空时,只显示无数据提示。

chore: 更新组件类型声明文件
添加新的Vant组件类型声明
...@@ -31,9 +31,14 @@ declare module 'vue' { ...@@ -31,9 +31,14 @@ declare module 'vue' {
31 UserAgreement: typeof import('./components/ui/UserAgreement.vue')['default'] 31 UserAgreement: typeof import('./components/ui/UserAgreement.vue')['default']
32 VanActionSheet: typeof import('vant/es')['ActionSheet'] 32 VanActionSheet: typeof import('vant/es')['ActionSheet']
33 VanButton: typeof import('vant/es')['Button'] 33 VanButton: typeof import('vant/es')['Button']
34 + VanCalendar: typeof import('vant/es')['Calendar']
34 VanCellGroup: typeof import('vant/es')['CellGroup'] 35 VanCellGroup: typeof import('vant/es')['CellGroup']
35 VanCheckbox: typeof import('vant/es')['Checkbox'] 36 VanCheckbox: typeof import('vant/es')['Checkbox']
37 + VanCol: typeof import('vant/es')['Col']
38 + VanConfigProvider: typeof import('vant/es')['ConfigProvider']
39 + VanDatePicker: typeof import('vant/es')['DatePicker']
36 VanDialog: typeof import('vant/es')['Dialog'] 40 VanDialog: typeof import('vant/es')['Dialog']
41 + VanDivider: typeof import('vant/es')['Divider']
37 VanEmpty: typeof import('vant/es')['Empty'] 42 VanEmpty: typeof import('vant/es')['Empty']
38 VanField: typeof import('vant/es')['Field'] 43 VanField: typeof import('vant/es')['Field']
39 VanForm: typeof import('vant/es')['Form'] 44 VanForm: typeof import('vant/es')['Form']
...@@ -41,10 +46,15 @@ declare module 'vue' { ...@@ -41,10 +46,15 @@ declare module 'vue' {
41 VanImage: typeof import('vant/es')['Image'] 46 VanImage: typeof import('vant/es')['Image']
42 VanImagePreview: typeof import('vant/es')['ImagePreview'] 47 VanImagePreview: typeof import('vant/es')['ImagePreview']
43 VanList: typeof import('vant/es')['List'] 48 VanList: typeof import('vant/es')['List']
49 + VanLoading: typeof import('vant/es')['Loading']
50 + VanNavBar: typeof import('vant/es')['NavBar']
51 + VanOverlay: typeof import('vant/es')['Overlay']
44 VanPicker: typeof import('vant/es')['Picker'] 52 VanPicker: typeof import('vant/es')['Picker']
53 + VanPickerGroup: typeof import('vant/es')['PickerGroup']
45 VanPopup: typeof import('vant/es')['Popup'] 54 VanPopup: typeof import('vant/es')['Popup']
46 VanProgress: typeof import('vant/es')['Progress'] 55 VanProgress: typeof import('vant/es')['Progress']
47 VanRate: typeof import('vant/es')['Rate'] 56 VanRate: typeof import('vant/es')['Rate']
57 + VanRow: typeof import('vant/es')['Row']
48 VanSwipe: typeof import('vant/es')['Swipe'] 58 VanSwipe: typeof import('vant/es')['Swipe']
49 VanSwipeItem: typeof import('vant/es')['SwipeItem'] 59 VanSwipeItem: typeof import('vant/es')['SwipeItem']
50 VanTab: typeof import('vant/es')['Tab'] 60 VanTab: typeof import('vant/es')['Tab']
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
36 36
37 <!-- 订单列表 --> 37 <!-- 订单列表 -->
38 <van-list 38 <van-list
39 + v-if="orders.length"
39 v-model:loading="loading" 40 v-model:loading="loading"
40 :finished="finished" 41 :finished="finished"
41 finished-text="没有更多了" 42 finished-text="没有更多了"
...@@ -96,7 +97,7 @@ ...@@ -96,7 +97,7 @@
96 </van-list> 97 </van-list>
97 98
98 <!-- 无数据提示 --> 99 <!-- 无数据提示 -->
99 - <div v-if="!loading && orders.length === 0" class="flex flex-col items-center justify-center py-12"> 100 + <div v-else class="flex flex-col items-center justify-center py-12">
100 <svg xmlns="http://www.w3.org/2000/svg" class="h-16 w-16 text-gray-300" fill="none" viewBox="0 0 24 24" stroke="currentColor"> 101 <svg xmlns="http://www.w3.org/2000/svg" class="h-16 w-16 text-gray-300" fill="none" viewBox="0 0 24 24" stroke="currentColor">
101 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" /> 102 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
102 </svg> 103 </svg>
......