diff --git a/.local.config.js b/.local.config.js index 6cebb11..dacc710 100644 --- a/.local.config.js +++ b/.local.config.js @@ -249,7 +249,7 @@ const localDevConfig = ({ // })['2811']; // 本地 // })['5g-317']; // 电磁兼容 // })['5g-351']; // - })['2811']; // 本地 + })['5g-97']; // 本地 // })['5g-248']; // 中瑞 工业称重系统垃圾吊电子秤,首页,图片链接部分的PDF文档打不开 // })['2881']; // 本地 // })['local-2']; // 本地 diff --git a/common/css/goods_detail.scss b/common/css/goods_detail.scss index b8aa6a4..150e464 100644 --- a/common/css/goods_detail.scss +++ b/common/css/goods_detail.scss @@ -135,19 +135,31 @@ bottom: 80rpx; //#endif text-align: center; - line-height: 50rpx; + line-height: calc(var(--hover-nav-media-tab-size, 24rpx) * 2.1); + // 视频/图片切换按钮(2026-10-24): 后台独立可调(与悬浮语言/客服/电话按钮互不干扰)。 + // hover_nav_media_tab_bg_color 未配置 → 原半透明灰 rgba(100,100,100,0.4) + // hover_nav_media_tab_text_color 未配置 → #fff + // hover_nav_media_tab_size 未配置 → 24rpx; 高度/圆角/内边距/间距以 em 随字号联动缩放 + // 选中态保留主题红(全局 .color-base-bg 提供 bg) + 白字。 text { - background: rgba(100, 100, 100, 0.4); - color: #fff; - font-size: $font-size-tag; - line-height: 50rpx; - border-radius: 20rpx; - padding: 0 30rpx; + background: var(--hover-nav-media-tab-bg-color, rgba(100, 100, 100, 0.4)); + color: var(--hover-nav-media-tab-text-color, #fff); + font-size: var(--hover-nav-media-tab-size, 24rpx); + height: 2.1em; + line-height: 2.1em; + border-radius: 0.85em; + padding: 0 1.25em; display: inline-block; + box-sizing: border-box; + + // 选中态: 主题红由全局 .color-base-bg 兜底, 这里只管白字保证对比度 + &.color-base-bg { + color: #fff; + } &:last-child { - margin-left: 40rpx; + margin-left: 1.6em; } } } diff --git a/common/js/theme-override.js b/common/js/theme-override.js index 1d91819..b241433 100644 --- a/common/js/theme-override.js +++ b/common/js/theme-override.js @@ -210,6 +210,19 @@ async function loadAllOverrides() { new Promise((r) => setTimeout(() => r({ code: -1, message: 'timeout' }), REMOTE.requestTimeout || 4000)), ]); + // [临时排查] 打印主题覆写接口实际返回,确认 hover_nav_media_tab_* 是否在 brand 桶 + // 排查完删除即可(全局搜索 THEME-OVERRIDES 定位) + try { + const _byTheme = (res && res.data && res.data.by_theme) || {}; + const _brand = (_byTheme.brand && typeof _byTheme.brand === 'object') ? _byTheme.brand : {}; + const _hoverKeys = Object.keys(_brand).filter(k => k.indexOf('hover_nav') === 0); + console.log('[THEME-OVERRIDES] http code =', res && res.code, + '| by_theme keys =', Object.keys(_byTheme), + '| brand token 数 =', Object.keys(_brand).length, + '| brand.hover_nav keys =', _hoverKeys, + '| hover_nav_media_tab_size =', _brand['hover_nav_media_tab_size']); + } catch (e) { /* 忽略 */ } + if (!res || res.code !== 0 || !res.data) { const reason = !res ? 'network' : (res.code === -1 ? 'timeout' : (res.message || 'bad-response')); setRemoteStatus('fail', { reason, theme: 'all' }); diff --git a/store/index.js b/store/index.js index 0b72eb2..36f9b02 100644 --- a/store/index.js +++ b/store/index.js @@ -538,6 +538,17 @@ const store = new Vuex.Store({ let color = util.colourBlend(theme.main_color, '#ffffff', (i / 10)); themeColor += `--base-color-light-${i}:${color};`; } + // [临时排查] 确认后台 hover_nav_media_tab_* 是否进入 themeStyle 并生成了 CSS 变量 + // 排查完删除即可(全局搜索 THEME-CHECK 定位) + try { + console.log('[THEME-CHECK]', { + bg: theme['hover_nav_media_tab_bg_color'], + text: theme['hover_nav_media_tab_text_color'], + size: theme['hover_nav_media_tab_size'], + hoverNavCount: Object.keys(theme).filter(k => k.indexOf('hover_nav') === 0).length, + sizeVarGenerated: themeColor.indexOf('--hover-nav-media-tab-size') > -1 + }); + } catch (e) { /* 忽略 */ } _themeColorCache = themeColor; _themeColorCacheKey = cacheKey; this.commit('setThemeColor', themeColor);