From 3781e54a32f62a4889deb319431e31a36659e867 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Fri, 29 May 2026 14:42:38 +0800 Subject: [PATCH] fix(merch detail): fix header style and optimize list toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修正商品详情页头部容器的样式选择器和优先级问题 2. 调整商品数据监听,改为监听商品描述而非整个merch对象 3. 给列表切换逻辑添加防抖处理,避免频繁切换触发过多渲染 4. 新增列表切换的防抖工具函数 --- pages_promotion/merch/detail.vue | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pages_promotion/merch/detail.vue b/pages_promotion/merch/detail.vue index a263376..54dd0c9 100644 --- a/pages_promotion/merch/detail.vue +++ b/pages_promotion/merch/detail.vue @@ -322,20 +322,20 @@ export default { return { headerHeight: 320, screenWidth: uni.getSystemInfoSync().windowWidth, - headerHeightInited: false + headerHeightInited: false, + changeStyleDebounce: null }; }, mixins: [list], watch: { - merch: { + 'merch.desc': { handler() { if (!this.headerHeightInited) { this.$nextTick(() => { this.initHeaderHeight(); }); } - }, - deep: true + } } }, methods: { @@ -358,6 +358,13 @@ export default { } }).exec(); }, 100); + }, + changeListStyle() { + if (this.changeStyleDebounce) clearTimeout(this.changeStyleDebounce); + this.changeStyleDebounce = setTimeout(() => { + this.isList = !this.isList; + this.waterfallflow(0); + }, 50); } }, mounted() { @@ -370,8 +377,8 @@ export default { @import './public/css/list.scss';