Bläddra i källkod

feat: admin-h5 列表与数据展示页统一下拉刷新

pages.json 为 21 个数据页开启 enablePullDownRefresh,各页注册
onPullDownRefresh 钩子重新拉取数据后停止刷新动画;分账记录页主体为
内嵌 scroll-view,改用其自带 refresher;订单列表原无效的模板事件
@pullDownRefresh 改为正规钩子。
skyline 2 dagar sedan
förälder
incheckning
6daae1d659

+ 41 - 21
admin-h5/src/pages.json

@@ -18,57 +18,66 @@
     {
       "path": "pages/order/list",
       "style": {
-        "navigationBarTitleText": "订单列表"
+        "navigationBarTitleText": "订单列表",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/order/detail",
       "style": {
         "navigationBarTitleText": "订单详情",
-        "navigationStyle": "custom"
+        "navigationStyle": "custom",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/device/list",
       "style": {
-        "navigationBarTitleText": "设备列表"
+        "navigationBarTitleText": "设备列表",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/device/detail",
       "style": {
         "navigationBarTitleText": "设备详情",
-        "navigationStyle": "custom"
+        "navigationStyle": "custom",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/finance/index",
       "style": {
-        "navigationBarTitleText": "财务管理"
+        "navigationBarTitleText": "财务管理",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/finance/withdraw",
       "style": {
-        "navigationBarTitleText": "提现管理"
+        "navigationBarTitleText": "提现管理",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/finance/refund",
       "style": {
-        "navigationBarTitleText": "退款清单"
+        "navigationBarTitleText": "退款清单",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/finance/refund-detail",
       "style": {
-        "navigationBarTitleText": "退款详情"
+        "navigationBarTitleText": "退款详情",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/finance/settlement",
       "style": {
-        "navigationBarTitleText": "结算记录"
+        "navigationBarTitleText": "结算记录",
+        "enablePullDownRefresh": true
       }
     },
     {
@@ -80,13 +89,15 @@
     {
       "path": "pages/statistics/index",
       "style": {
-        "navigationBarTitleText": "数据统计"
+        "navigationBarTitleText": "数据统计",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/parking-coupon-record/list",
       "style": {
-        "navigationBarTitleText": "停车券发放记录"
+        "navigationBarTitleText": "停车券发放记录",
+        "enablePullDownRefresh": true
       }
     },
     {
@@ -100,14 +111,16 @@
       "path": "pages/setting/rate-config",
       "style": {
         "navigationBarTitleText": "平台费率配置",
-        "navigationStyle": "custom"
+        "navigationStyle": "custom",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/setting/device-config",
       "style": {
         "navigationBarTitleText": "设备配置",
-        "navigationStyle": "custom"
+        "navigationStyle": "custom",
+        "enablePullDownRefresh": true
       }
     },
     {
@@ -134,44 +147,51 @@
     {
       "path": "pages/station/list",
       "style": {
-        "navigationBarTitleText": "站点清单"
+        "navigationBarTitleText": "站点清单",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/station/detail",
       "style": {
         "navigationBarTitleText": "站点详情",
-        "navigationStyle": "custom"
+        "navigationStyle": "custom",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/user/list",
       "style": {
-        "navigationBarTitleText": "用户列表"
+        "navigationBarTitleText": "用户列表",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/system/feedback",
       "style": {
-        "navigationBarTitleText": "反馈上报"
+        "navigationBarTitleText": "反馈上报",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/system/notice",
       "style": {
-        "navigationBarTitleText": "系统公告"
+        "navigationBarTitleText": "系统公告",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/system/log",
       "style": {
-        "navigationBarTitleText": "操作日志"
+        "navigationBarTitleText": "操作日志",
+        "enablePullDownRefresh": true
       }
     },
     {
       "path": "pages/system/dict",
       "style": {
-        "navigationBarTitleText": "数据字典"
+        "navigationBarTitleText": "数据字典",
+        "enablePullDownRefresh": true
       }
     }
   ],
@@ -206,4 +226,4 @@
       }
     ]
   }
-}
+}

+ 10 - 0
admin-h5/src/pages/device/detail.vue

@@ -158,6 +158,7 @@
 
 <script setup>
 import { ref, onMounted, computed } from 'vue'
+import { onPullDownRefresh } from '@dcloudio/uni-app'
 import { getDeviceDetail, stopDevice, queryDeviceHardwareInfo } from '../../api/device.js'
 import { formatTime, showToast, fmtDictName, getDictColor, copyText } from '../../utils/index.js'
 import dictUtil, { loadDicts } from '../../utils/dict.js'
@@ -287,6 +288,15 @@ const refreshDeviceInfo = () => {
   loadHardwareInfo()
 }
 
+// 下拉刷新:重新加载设备详情与硬件信息
+onPullDownRefresh(async () => {
+  try {
+    await refreshDeviceInfo()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const goBack = () => {
   uni.navigateBack()
 }

+ 10 - 1
admin-h5/src/pages/device/list.vue

@@ -132,7 +132,7 @@
 <script setup>
 import CustomTabBar from '../../components/CustomTabBar.vue'
 import { ref, onMounted, computed } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getDeviceList, stopDevice, getDeviceConfigList, batchModifyDeviceConfig } from '../../api/device.js'
 import { getStationList } from '../../api/station.js'
 import { showToast, storage, fmtDictName, getDictColor, copyText } from '../../utils/index.js'
@@ -236,6 +236,15 @@ const loadMore = () => {
 
 onReachBottom(() => loadMore())
 
+// 下拉刷新:重新加载当前站点设备列表
+onPullDownRefresh(async () => {
+  try {
+    await loadDeviceList()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const handleSearch = () => loadDeviceList()
 
 const viewDeviceDetail = (deviceId) => {

+ 10 - 1
admin-h5/src/pages/finance/index.vue

@@ -169,7 +169,7 @@
 <script setup>
 import CustomTabBar from '../../components/CustomTabBar.vue'
 import { ref, onMounted } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getStationAccounts, getSplitRecords } from '../../api/finance.js'
 import { getDashboardData } from '../../api/stat.js'
 import { formatTime, showToast, formatAmount, storage, fmtDictName, getDictColor } from '../../utils/index.js'
@@ -287,6 +287,15 @@ onReachBottom(() => {
   loadMoreSplitRecords()
 })
 
+// 下拉刷新:财务概览、站点账户、分账记录一并刷新
+onPullDownRefresh(async () => {
+  try {
+    await Promise.all([loadFinanceData(), loadStationAccounts(), loadSplitRecords()])
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const handleTabChange = (index) => {
   activeTab.value = index
 }

+ 14 - 1
admin-h5/src/pages/finance/refund-detail.vue

@@ -103,7 +103,7 @@
 
 <script setup>
 import { ref, onMounted, computed } from 'vue'
-import { onLoad } from '@dcloudio/uni-app'
+import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getRefundDetail, processRefund } from '../../api/finance.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
 import { loadDicts } from '../../utils/dict.js'
@@ -111,6 +111,7 @@ import { loadDicts } from '../../utils/dict.js'
 const detail = ref({})
 const loading = ref(true)
 const processing = ref(false)
+const outRefundNo = ref('')
 
 const statusColor = computed(() => {
   return getDictColor('RefundLog.status', detail.value.status) || '#666666'
@@ -174,10 +175,22 @@ const loadDetail = async (outRefundNo) => {
 
 onLoad((options) => {
   if (options && options.outRefundNo) {
+    outRefundNo.value = options.outRefundNo
     loadDetail(options.outRefundNo)
   }
 })
 
+// 下拉刷新:重新加载退款详情
+onPullDownRefresh(async () => {
+  try {
+    if (outRefundNo.value) {
+      await loadDetail(outRefundNo.value)
+    }
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 onMounted(async () => {
   await loadDicts()
 })

+ 10 - 1
admin-h5/src/pages/finance/refund.vue

@@ -123,7 +123,7 @@
 
 <script setup>
 import { ref, onMounted, computed } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getRefundLogs, processRefund, batchProcessRefund } from '../../api/finance.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
 import dictUtil, { loadDicts } from '../../utils/dict.js'
@@ -244,6 +244,15 @@ onReachBottom(() => {
   loadMore()
 })
 
+// 下拉刷新:重新加载退款清单
+onPullDownRefresh(async () => {
+  try {
+    await loadData()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const handleSearch = () => {
   loadData()
 }

+ 10 - 1
admin-h5/src/pages/finance/settlement.vue

@@ -183,7 +183,7 @@
 
 <script setup>
 import { ref, onMounted, computed } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getSettlementRecords } from '../../api/finance.js'
 import { getStationList } from '../../api/station.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
@@ -288,6 +288,15 @@ onReachBottom(() => {
   loadMore()
 })
 
+// 下拉刷新:站点筛选与结算记录一并刷新
+onPullDownRefresh(async () => {
+  try {
+    await Promise.all([loadStations(), loadData()])
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const handleSearch = () => {
   loadData()
 }

+ 15 - 1
admin-h5/src/pages/finance/split-record.vue

@@ -36,7 +36,10 @@
       class="split-scroll"
       scroll-y
       @scrolltolower="loadMore"
-      lower-threshold="80">
+      lower-threshold="80"
+      refresher-enabled
+      :refresher-triggered="refresherTriggered"
+      @refresherrefresh="onRefresh">
       <view class="split-list" v-if="list.length > 0">
         <view class="split-item" v-for="(item, index) in list" :key="index">
           <view class="item-header">
@@ -220,6 +223,17 @@ const handleSearch = () => {
   loadData()
 }
 
+// 下拉刷新(scroll-view 自带 refresher)
+const refresherTriggered = ref(false)
+const onRefresh = async () => {
+  refresherTriggered.value = true
+  try {
+    await loadData()
+  } finally {
+    refresherTriggered.value = false
+  }
+}
+
 onMounted(async () => {
   await loadDicts()
   loadStations()

+ 10 - 1
admin-h5/src/pages/finance/withdraw.vue

@@ -133,7 +133,7 @@
 
 <script setup>
 import { ref, computed, onMounted } from 'vue'
-import { onLoad } from '@dcloudio/uni-app'
+import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getWithdrawnRecords, reviewWithdrawn, applyWithdrawn, getStationAccounts } from '../../api/finance.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor } from '../../utils/index.js'
 import dictUtil, { loadDicts } from '../../utils/dict.js'
@@ -254,6 +254,15 @@ const loadWithdrawRecords = async (isLoadMore = false) => {
   }
 }
 
+// 下拉刷新:账户余额与提现记录一并刷新
+onPullDownRefresh(async () => {
+  try {
+    await Promise.all([loadAccountData(), loadWithdrawRecords()])
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const handleApplyWithdraw = async () => {
   try {
     await applyWithdrawn({

+ 10 - 0
admin-h5/src/pages/order/detail.vue

@@ -140,6 +140,7 @@
 
 <script setup>
 import { ref, onMounted, computed } from 'vue'
+import { onPullDownRefresh } from '@dcloudio/uni-app'
 import { getOrderDetail, handleRefund as refundApi } from '../../api/order.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor, copyText } from '../../utils/index.js'
 import dictUtil, { loadDicts } from '../../utils/dict.js'
@@ -278,6 +279,15 @@ const goBack = () => {
   uni.navigateBack()
 }
 
+// 下拉刷新:重新加载订单详情
+onPullDownRefresh(async () => {
+  try {
+    await loadOrderDetail()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 // 页面加载时获取订单ID并加载详情
 onMounted(async () => {
   await loadDicts()

+ 4 - 4
admin-h5/src/pages/order/list.vue

@@ -1,5 +1,5 @@
 <template>
-  <view class="order-list-container" @pullDownRefresh="onPullDownRefresh">
+  <view class="order-list-container">
     <!-- 搜索栏 -->
     <view class="search-bar">
       <view class="search-input-wrapper">
@@ -161,7 +161,7 @@
 <script setup>
 import CustomTabBar from '../../components/CustomTabBar.vue'
 import { ref, onMounted, reactive } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getOrderList, handleRefund as refundApi } from '../../api/order.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor, copyText } from '../../utils/index.js'
 import dictUtil, { loadDicts } from '../../utils/dict.js'
@@ -359,10 +359,10 @@ const isRefundStatus = (status) => {
 
 
 // 下拉刷新处理函数
-const onPullDownRefresh = () => {
+onPullDownRefresh(() => {
   // 重新加载数据,不使用加载更多模式
   loadOrderList(false)
-}
+})
 </script>
 
 <style scoped>

+ 10 - 1
admin-h5/src/pages/parking-coupon-record/list.vue

@@ -81,7 +81,7 @@
 
 <script setup>
 import { ref, onMounted } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getParkingCouponRecordList } from '../../api/parkingCouponRecord.js'
 import { formatTime } from '../../utils/index.js'
 
@@ -156,6 +156,15 @@ onReachBottom(() => {
   loadMore()
 })
 
+// 下拉刷新:重新加载发放记录
+onPullDownRefresh(async () => {
+  try {
+    await loadData()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const handleStatusChange = (status) => {
   activeStatus.value = status
   loadData()

+ 10 - 1
admin-h5/src/pages/setting/device-config.vue

@@ -47,7 +47,7 @@
 
 <script setup>
 import { ref } from 'vue'
-import { onShow } from '@dcloudio/uni-app'
+import { onShow, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getDeviceConfigList } from '../../api/device.js'
 import { showToast } from '../../utils/index.js'
 
@@ -87,6 +87,15 @@ onShow(() => {
   loadDeviceConfigs()
 })
 
+// 下拉刷新:重新加载设备配置列表
+onPullDownRefresh(async () => {
+  try {
+    await loadDeviceConfigs()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 // 导航到添加配置页面
 const navigateToAddConfig = () => {
   uni.navigateTo({

+ 10 - 0
admin-h5/src/pages/setting/rate-config.vue

@@ -45,6 +45,7 @@
 
 <script setup>
 import { ref, onMounted } from 'vue'
+import { onPullDownRefresh } from '@dcloudio/uni-app'
 import { getPlatformFeeRateList } from '../../api/rate.js'
 import { showToast } from '../../utils/index.js'
 
@@ -96,6 +97,15 @@ const goBack = () => {
 onMounted(() => {
   loadRateConfigs()
 })
+
+// 下拉刷新:重新加载费率模板列表
+onPullDownRefresh(async () => {
+  try {
+    await loadRateConfigs()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
 </script>
 
 <style scoped>

+ 14 - 1
admin-h5/src/pages/station/detail.vue

@@ -139,7 +139,7 @@
 
 <script setup>
 import { ref } from 'vue'
-import { onLoad } from '@dcloudio/uni-app'
+import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getStationDetail } from '../../api/station.js'
 import { formatTime, fmtDictName, getDictColor } from '../../utils/index.js'
 import { loadDicts } from '../../utils/dict.js'
@@ -147,16 +147,29 @@ import { loadDicts } from '../../utils/dict.js'
 const loading = ref(true)
 const detail = ref(null)
 const stationName = ref('')
+const stationId = ref('')
 
 onLoad(async (options) => {
   await loadDicts()
   const id = options.id || ''
   stationName.value = decodeURIComponent(options.name || '')
   if (id) {
+    stationId.value = id
     loadDetail(id)
   }
 })
 
+// 下拉刷新:重新加载站点详情
+onPullDownRefresh(async () => {
+  try {
+    if (stationId.value) {
+      await loadDetail(stationId.value)
+    }
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const goBack = () => {
   uni.navigateBack()
 }

+ 10 - 1
admin-h5/src/pages/station/list.vue

@@ -96,7 +96,7 @@
 
 <script setup>
 import { ref, onMounted, computed } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getStationList } from '../../api/station.js'
 import { formatTime, fmtDictName, getDictColor } from '../../utils/index.js'
 import dictUtil, { loadDicts } from '../../utils/dict.js'
@@ -176,6 +176,15 @@ onReachBottom(() => {
   loadMore()
 })
 
+// 下拉刷新:重新加载站点清单
+onPullDownRefresh(async () => {
+  try {
+    await loadData()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const handleSearch = () => {
   loadData()
 }

+ 10 - 1
admin-h5/src/pages/statistics/index.vue

@@ -209,7 +209,7 @@
 
 <script setup>
 import { ref, computed, onMounted } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getDailyStatList, getMonthlyStatList, getDailyStatAggregate } from '../../api/stat.js'
 import { getStationList } from '../../api/station.js'
 import { formatTime, showToast, formatAmount } from '../../utils/index.js'
@@ -381,6 +381,15 @@ onReachBottom(() => {
   loadMore()
 })
 
+// 下拉刷新:站点筛选、汇总与统计列表一并刷新
+onPullDownRefresh(async () => {
+  try {
+    await Promise.all([loadStations(), loadData()])
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const handleSearch = () => {
   loadData()
 }

+ 10 - 0
admin-h5/src/pages/system/dict.vue

@@ -149,6 +149,7 @@
 
 <script setup>
 import { ref, onMounted } from 'vue'
+import { onPullDownRefresh } from '@dcloudio/uni-app'
 import { getDataDictList, saveOrUpdateDict } from '../../api/dict.js'
 import { showToast } from '../../utils/index.js'
 
@@ -312,6 +313,15 @@ const handleSave = async () => {
 }
 
 onMounted(() => loadData())
+
+// 下拉刷新:按当前搜索条件重新加载字典
+onPullDownRefresh(async () => {
+  try {
+    await loadData(searchCode.value.trim())
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
 </script>
 
 <style scoped>

+ 10 - 1
admin-h5/src/pages/system/feedback.vue

@@ -64,7 +64,7 @@
 
 <script setup>
 import { ref, onMounted, computed } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getFeedbackList } from '../../api/system.js'
 import { formatTime, fmtDictName, getDictColor } from '../../utils/index.js'
 import dictUtil, { loadDicts } from '../../utils/dict.js'
@@ -127,6 +127,15 @@ const loadData = async (isLoadMore = false) => {
 const loadMore = () => { if (hasMore.value && !loading.value && loadMoreStatus.value !== 'loading') loadData(true) }
 
 onReachBottom(() => { loadMore() })
+
+// 下拉刷新:重新加载反馈列表
+onPullDownRefresh(async () => {
+  try {
+    await loadData()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
 const handleStatusChange = (status) => { activeStatus.value = status; loadData() }
 
 const viewDetail = (item) => {

+ 10 - 1
admin-h5/src/pages/system/log.vue

@@ -53,7 +53,7 @@
 
 <script setup>
 import { ref, onMounted } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getOptLogList } from '../../api/system.js'
 import { formatTime, showToast } from '../../utils/index.js'
 
@@ -108,6 +108,15 @@ const loadData = async (isLoadMore = false) => {
 const loadMore = () => { if (hasMore.value && !loading.value && loadMoreStatus.value !== 'loading') loadData(true) }
 
 onReachBottom(() => { loadMore() })
+
+// 下拉刷新:重新加载操作日志
+onPullDownRefresh(async () => {
+  try {
+    await loadData()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
 const handleSearch = () => loadData()
 
 onMounted(() => loadData())

+ 10 - 1
admin-h5/src/pages/system/notice.vue

@@ -47,7 +47,7 @@
 
 <script setup>
 import { ref, onMounted } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getNoticeList } from '../../api/system.js'
 import { formatTime, fmtDictName, getDictColor } from '../../utils/index.js'
 import { loadDicts } from '../../utils/dict.js'
@@ -111,6 +111,15 @@ const loadMore = () => { if (hasMore.value && !loading.value && loadMoreStatus.v
 
 onReachBottom(() => { loadMore() })
 
+// 下拉刷新:重新加载公告列表
+onPullDownRefresh(async () => {
+  try {
+    await loadData()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const viewDetail = (item) => {
   uni.showModal({
     title: item.title || '公告详情',

+ 10 - 1
admin-h5/src/pages/user/list.vue

@@ -233,7 +233,7 @@
 
 <script setup>
 import { ref, onMounted } from 'vue'
-import { onReachBottom } from '@dcloudio/uni-app'
+import { onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
 import { getAppUserList, lockUser, unlockUser, getUserLockRecords } from '../../api/user.js'
 import { applyRefund } from '../../api/finance.js'
 import { formatTime, showToast, formatAmount, fmtDictName, getDictColor, copyText } from '../../utils/index.js'
@@ -324,6 +324,15 @@ onReachBottom(() => {
   loadMore()
 })
 
+// 下拉刷新:重新加载用户列表
+onPullDownRefresh(async () => {
+  try {
+    await loadData()
+  } finally {
+    uni.stopPullDownRefresh()
+  }
+})
+
 const handleSearch = () => {
   loadData()
 }