From e98cc1b4aaae7f3933b31f4f8603c53b4bd5b9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B2=A9?= Date: Tue, 29 Jul 2025 08:52:28 +0800 Subject: [PATCH] 1 --- package.json | 2 +- src/pages/search/search.vue | 49 ++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 8b55ed63..55dffad4 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build:app-plus:dev": "uni build -p app-plus --mode development", "build:app-plus:sit": "uni build -p app-plus --mode sit", "build:app-plus:uat": "uni build -p app-plus --mode uat", - "build:app-plus": "uni build -p app-plus", + "build:app-plus:prod": "uni build -p app-plus", "build:h5": "uni build" }, "dependencies": { diff --git a/src/pages/search/search.vue b/src/pages/search/search.vue index 47c3cfe4..1f7fecd7 100644 --- a/src/pages/search/search.vue +++ b/src/pages/search/search.vue @@ -57,12 +57,24 @@ const tagRefs = ref([]) // 用于存储所有history_item的引用 import { getCurrentInstance, - computed + computed, + watch } from 'vue'; const { proxy } = getCurrentInstance() // 获取当前组件实例 - + const currentHeight = ref(0); // 动态高度(单位:px) + const visibleCount = ref(0) + const hiddenHistorySearchList = ref([]); + // 展开或者关闭 + const show_all_history_fun = async () => { + show_all_history.value = !show_all_history.value + } + const show_all_history = ref(false) + const historyList = computed(() => show_all_history.value ? hiddenHistorySearchList.value : hiddenHistorySearchList + .value.slice(0, visibleCount.value)); + + onShow(() => { const historySearchList = ['房贷审批', '小微贷条件', '对公开户', '反洗钱指引', '盗刷处理', '小微贷条件', '征信解读'] if (historySearchList) { @@ -87,10 +99,6 @@ } }) - const visibleCount = ref(0) - const historyList = computed(() => show_all_history.value ? hiddenHistorySearchList.value : hiddenHistorySearchList - .value.slice(0, visibleCount.value)); - const calculateLayout = (widths) => { const gap = 12; // 项之间的间距 const expandBtnWidth = 80 @@ -128,22 +136,19 @@ visibleCount.value = row1Count + row2Count; }).exec(); } - // 展开或者关闭 - const show_all_history_fun = () => { - show_all_history.value = !show_all_history.value - console.log(show_all_history.value); - } - const show_all_history = ref(false) + import { ref, watchEffect, - nextTick + nextTick, + onMounted } from 'vue'; import common from '@/common/common.js' import { onShow } from '@dcloudio/uni-app'; + // 静态样式配置 const fixedCustomStyles = { backgroundColor: "#ffffff", @@ -158,22 +163,11 @@ } const inputValue = ref(''); - const hiddenHistorySearchList = ref([]); + const measureRef = ref(null) const measureItems = ref([]) - - // onShow(() => { - // const historySearchList = ['房贷审批', '对公开户', '反洗钱指引', '盗刷处理', '小微贷条件', '征信解读'] - // if (historySearchList) { - // hiddenHistorySearchList.value.push(...historySearchList) - // nextTick(() => { - // console.log('111'); - // }) - // } - - // })