快乐的昕的电脑
2025-10-31 31ab39a665b9d44a1465b0c86715f8d076fb9b8e
components/machine.vue
@@ -177,13 +177,31 @@
                    if (res && res.data && res.data.tbBillList) {
                        this.$showMessage("呼叫成功");
                         //或者方法3:使用 uni.navigateBack 再跳转回来(如果是从其他页面跳转过来的)
                         uni.navigateBack({
                             delta: 1,
                             success: () => {
                                 // 可以在这里重新跳转到当前页面
                             }
                         });
                        // 关键修改:清空 flag 的值
                        this.flag = -1; // 或者根据业务需求设置为其他初始值
                        // 方案1:使用uni-app的页面刷新方法
                        // 方法1:触发下拉刷新(如果页面支持)
                        if (uni.startPullDownRefresh) {
                            uni.startPullDownRefresh();
                            // 2秒后停止刷新
                            setTimeout(() => {
                                uni.stopPullDownRefresh();
                            }, 2000);
                        }
                        // 方法2:重新调用页面的onLoad方法(推荐)
                        const pages = getCurrentPages();
                        const currentPage = pages[pages.length - 1];
                        if (currentPage && currentPage.onLoad) {
                            // 保存当前页面参数
                            const pageOptions = currentPage.options || {};
                            // 重新加载页面数据
                            currentPage.onLoad(pageOptions);
                        }
                        // 方法3:同时刷新组件数据
                        this.findByOrderId();
                    } else {
                        this.$showMessage("呼叫失败");