From 7b6863f3f1b6d9bf21499a5a5076e783d46526c9 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Fri, 5 Sep 2025 17:27:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=BC=80=E5=85=B3=EF=BC=8C=E6=98=AF=E7=9A=84=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E5=8A=A0=E8=BD=BD=E5=99=A8=E4=B8=8D=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=95=B0=E6=8D=AE=EF=BC=8C=E8=80=8C=E6=98=AF?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87=E6=9B=B4=E6=96=B0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=8F=82=E6=95=B0=E5=90=8E=EF=BC=8C=E5=86=8D=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=EF=BC=8C=E9=81=BF=E5=85=8D=E4=BA=86mixins=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=85=88=E6=89=A7=E8=A1=8C=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E6=94=B6=E4=B8=8D=E5=88=B0this.formedId=E7=9A=84?= =?UTF-8?q?=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composables/winB_Pagination.js | 8 ++++++-- pages/future/future.vue | 7 +++++-- utils/request.js | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/composables/winB_Pagination.js b/composables/winB_Pagination.js index 94985c7..76dfea4 100644 --- a/composables/winB_Pagination.js +++ b/composables/winB_Pagination.js @@ -5,6 +5,7 @@ * @param {Object} options.defaultParams - 默认查询参数 * @param {string} options.mode - 分页模式:'loadMore' 或 'pager' * @param {number} options.pageSize - 每页数量 + * @param {boolean} options.autoLoad - 是否在创建时自动加载数据,默认为true * @returns {Object} Vue组件选项对象 */ export function createPagination(options = {}) { @@ -13,6 +14,7 @@ export function createPagination(options = {}) { defaultParams = {}, mode = "loadMore", pageSize = 10, + autoLoad = true, // 新增参数,控制是否自动加载 } = options; return { @@ -207,8 +209,10 @@ export function createPagination(options = {}) { }, created() { - // 初始化时加载第一页数据 - this.winB_GetList(); + // 只有在 autoLoad 为 true 时才自动加载数据 + if (autoLoad) { + this.winB_GetList(); + } }, }; } diff --git a/pages/future/future.vue b/pages/future/future.vue index c0838c9..3f31f45 100644 --- a/pages/future/future.vue +++ b/pages/future/future.vue @@ -153,6 +153,7 @@ export default { fetchData: getProjectSchedule, mode: "loadMore", pageSize: 2, + autoLoad: false, // 设置为 false,不自动加载 }), ], data() { @@ -165,6 +166,7 @@ export default { selectedIndex: 0, customAmount: "", payAmount: "", + formedId: null, // 添加 formedId 到 data 中 projectDetails: { // createBy: null, @@ -207,7 +209,7 @@ export default { // templeId: "12", // title: "施工情况01232", // content: - // "

施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02...

", + // "

施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02...

", // status: "1", // templeName: "寒山寺", // createTime: "2025-07-09 13:50:57", @@ -231,10 +233,11 @@ export default { if (options) { console.log("接收到的参数:", options.formedId); this.formedId = options.formedId; + // 更新参数并首次执行数据加载 + this.winB_UpdateParams({ formedId: this.formedId }); } // 页面加载时获取数据 this.loadPageData(); - this.winB_GetList(); }, methods: { // 加载页面数据 diff --git a/utils/request.js b/utils/request.js index 166bf41..610e05c 100644 --- a/utils/request.js +++ b/utils/request.js @@ -17,18 +17,18 @@ import { const ENV_CONFIG = { develop: { // 开发环境 - baseUrl: "http://192.168.2.58:4501", + baseUrl: "http://192.168.2.58:4502", //baseUrl: "https://testlu.chuangtewl.com/prod-api", appId: 1, }, trial: { // 体验版 - baseUrl: "http://192.168.2.58:4501", + baseUrl: "http://192.168.2.58:4502", appId: 1, }, release: { // 正式版 - baseUrl: "http://192.168.2.58:4501", + baseUrl: "http://192.168.2.58:4502", appId: 1, }, };