ソースを参照

feat(订单详情): 启用下拉刷新并添加相关逻辑

在订单详情页面启用下拉刷新功能,并添加对应的刷新逻辑。当用户下拉时会重新加载订单详情和收据列表数据,完成后显示刷新成功提示。同时为通话记录类型添加监听,当类型为'call'时自动加载通话记录。
Yannay 1 ヶ月 前
コミット
519e29d350
共有3 個のファイルを変更した16 個の追加1 個の削除を含む
  1. 1 1
      pages.json
  2. 5 0
      pages/orderDetailRefactored/components/PageOne.vue
  3. 10 0
      pages/orderDetailRefactored/index.vue

+ 1 - 1
pages.json

@@ -261,7 +261,7 @@
261 261
 			"path": "pages/orderDetailRefactored/index",
262 262
 			"style": {
263 263
 				"navigationBarTitleText": "",
264
-				"enablePullDownRefresh": false,
264
+				"enablePullDownRefresh": true,
265 265
 				"navigationStyle": "custom"
266 266
 			}
267 267
 		},

+ 5 - 0
pages/orderDetailRefactored/components/PageOne.vue

@@ -164,6 +164,11 @@ export default {
164 164
     }
165 165
   },
166 166
   watch: {
167
+    recordType(newVal) {
168
+      if (newVal === 'call') {
169
+        this.loadCallRecords()
170
+      }
171
+    },
167 172
     currentReceipt: {
168 173
       handler(newVal) {
169 174
         if (newVal && newVal.id) {

+ 10 - 0
pages/orderDetailRefactored/index.vue

@@ -158,6 +158,16 @@ export default {
158 158
     this.loadOrderDetail()
159 159
     this.loadReceiptList()
160 160
   },
161
+  onPullDownRefresh() {
162
+    // 下拉刷新时重新加载所有数据
163
+    Promise.all([
164
+      this.loadOrderDetail(),
165
+      this.loadReceiptList()
166
+    ]).finally(() => {
167
+      uni.stopPullDownRefresh()
168
+      uni.$u.toast('刷新成功')
169
+    })
170
+  },
161 171
   methods: {
162 172
     /**
163 173
      * 初始化参数