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, }, };