From f98d25d752027c21fdb6c6d7e0344b2a014ac384 Mon Sep 17 00:00:00 2001 From: cheng <545895878@qq.com> Date: Thu, 20 Aug 2026 22:21:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(record):=20=E5=AE=9E=E7=8E=B0=E5=95=A4?= =?UTF-8?q?=E9=85=92=E5=93=81=E7=89=8C=E5=88=86=E7=BB=84=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=92=8C=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为啤酒类别添加分组tab(全部/国产/国际/麦啤/精酿) - 实现啤酒品牌的两级筛选结构:分组tab + 组内品牌标签 - 添加啤酒品牌实时搜索功能,支持按名称和产品搜索 - 优化品牌标签显示逻辑,同品牌多产品时显示品牌·产品格式 - 添加搜索无结果提示信息 - 更新输入框占位符文字为"搜索或输入其他品牌" - 修复啤酒类别下不应显示"更多"按钮的问题 - 添加啤酒分组标签的样式和交互效果 --- common/constants.js | 77 ++++++++++++++++------------- pages/record/record.vue | 106 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 144 insertions(+), 39 deletions(-) diff --git a/common/constants.js b/common/constants.js index 21b9e15..4583fc8 100644 --- a/common/constants.js +++ b/common/constants.js @@ -39,43 +39,43 @@ export const BRANDS = { ], beer: [ // 国产主流 - { name: '青岛啤酒', product: '经典', degree: 4.3 }, - { name: '青岛啤酒', product: '全麦白啤', degree: 4.7 }, - { name: '青岛啤酒', product: '黑啤', degree: 5.5 }, - { name: '雪花', product: '勇闯天涯', degree: 3.3 }, - { name: '雪花', product: '纯生', degree: 3.6 }, - { name: '雪花', product: 'superX', degree: 4.0 }, - { name: '百威', product: '经典', degree: 5.0 }, - { name: '百威', product: '锦兔', degree: 5.0 }, - { name: '哈尔滨', product: '冰纯', degree: 4.5 }, - { name: '哈尔滨', product: '小麦王', degree: 3.6 }, - { name: '燕京', product: 'U8', degree: 2.5 }, - { name: '燕京', product: '原浆白啤', degree: 4.8 }, - { name: '乌苏', product: '大乌苏', degree: 4.0 }, - { name: '珠江', product: '纯生', degree: 3.6 }, - { name: '泰山', product: '7天原浆', degree: 4.7 }, + { name: '青岛啤酒', product: '经典', degree: 4.3, group: 'domestic' }, + { name: '青岛啤酒', product: '全麦白啤', degree: 4.7, group: 'domestic' }, + { name: '青岛啤酒', product: '黑啤', degree: 5.5, group: 'domestic' }, + { name: '雪花', product: '勇闯天涯', degree: 3.3, group: 'domestic' }, + { name: '雪花', product: '纯生', degree: 3.6, group: 'domestic' }, + { name: '雪花', product: 'superX', degree: 4.0, group: 'domestic' }, + { name: '百威', product: '经典', degree: 5.0, group: 'domestic' }, + { name: '百威', product: '锦兔', degree: 5.0, group: 'domestic' }, + { name: '哈尔滨', product: '冰纯', degree: 4.5, group: 'domestic' }, + { name: '哈尔滨', product: '小麦王', degree: 3.6, group: 'domestic' }, + { name: '燕京', product: 'U8', degree: 2.5, group: 'domestic' }, + { name: '燕京', product: '原浆白啤', degree: 4.8, group: 'domestic' }, + { name: '乌苏', product: '大乌苏', degree: 4.0, group: 'domestic' }, + { name: '珠江', product: '纯生', degree: 3.6, group: 'domestic' }, + { name: '泰山', product: '7天原浆', degree: 4.7, group: 'domestic' }, // 国际品牌 - { name: '喜力', product: '星银', degree: 5.0 }, - { name: '科罗娜', product: 'Extra', degree: 4.5 }, - { name: '嘉士伯', product: '特醇', degree: 5.0 }, - { name: '朝日', product: '超爽', degree: 5.0 }, - { name: '麒麟', product: '一番榨', degree: 5.0 }, - { name: '三得利', product: '高端麦芽', degree: 5.5 }, - { name: '札幌', product: '黑标', degree: 5.0 }, - { name: '虎牌', product: '经典', degree: 5.0 }, - { name: '生力', product: '清爽', degree: 5.0 }, + { name: '喜力', product: '星银', degree: 5.0, group: 'international' }, + { name: '科罗娜', product: 'Extra', degree: 4.5, group: 'international' }, + { name: '嘉士伯', product: '特醇', degree: 5.0, group: 'international' }, + { name: '朝日', product: '超爽', degree: 5.0, group: 'international' }, + { name: '麒麟', product: '一番榨', degree: 5.0, group: 'international' }, + { name: '三得利', product: '高端麦芽', degree: 5.5, group: 'international' }, + { name: '札幌', product: '黑标', degree: 5.0, group: 'international' }, + { name: '虎牌', product: '经典', degree: 5.0, group: 'international' }, + { name: '生力', product: '清爽', degree: 5.0, group: 'international' }, // 德式/白啤 - { name: '福佳', product: '白啤', degree: 4.9 }, - { name: '1664', product: '白啤', degree: 5.0 }, - { name: '柏龙', product: '小麦啤', degree: 5.5 }, - { name: '艾丁格', product: '小麦啤', degree: 5.3 }, + { name: '福佳', product: '白啤', degree: 4.9, group: 'wheat' }, + { name: '1664', product: '白啤', degree: 5.0, group: 'wheat' }, + { name: '柏龙', product: '小麦啤', degree: 5.5, group: 'wheat' }, + { name: '艾丁格', product: '小麦啤', degree: 5.3, group: 'wheat' }, // 精酿 - { name: '鹅岛', product: 'IPA', degree: 5.9 }, - { name: '熊猫精酿', product: '蜂蜜生姜艾尔', degree: 5.0 }, - { name: '京A', product: '工人淡色艾尔', degree: 5.0 }, - { name: '拳击猫', product: 'TKO IPA', degree: 6.5 }, - { name: '高大师', product: '婴儿肥IPA', degree: 5.6 }, - { name: '精酿', product: '自选', degree: 6.0 } + { name: '鹅岛', product: 'IPA', degree: 5.9, group: 'craft' }, + { name: '熊猫精酿', product: '蜂蜜生姜艾尔', degree: 5.0, group: 'craft' }, + { name: '京A', product: '工人淡色艾尔', degree: 5.0, group: 'craft' }, + { name: '拳击猫', product: 'TKO IPA', degree: 6.5, group: 'craft' }, + { name: '高大师', product: '婴儿肥IPA', degree: 5.6, group: 'craft' }, + { name: '精酿', product: '自选', degree: 6.0, group: 'craft' } ], wine: [ { name: '拉菲', product: '传奇', degree: 13 }, @@ -122,6 +122,15 @@ export const BRANDS = { other: [] } +// 啤酒品牌分组tab(record页两级结构:分组tab + 组内品牌标签) +export const BEER_BRAND_GROUPS = [ + { id: 'all', name: '全部' }, + { id: 'domestic', name: '国产' }, + { id: 'international', name: '国际' }, + { id: 'wheat', name: '麦啤' }, + { id: 'craft', name: '精酿' } +] + // 配餐分类 export const FOOD_CATEGORIES = [ { id: 'hotpot', name: '火锅', emoji: '🍲' }, diff --git a/pages/record/record.vue b/pages/record/record.vue index e7eb7cb..df7341b 100644 --- a/pages/record/record.vue +++ b/pages/record/record.vue @@ -46,6 +46,24 @@ 品牌 + + + + {{ tab.name }} + + - {{ brandList.filter(b => b.name === brand.name).length > 1 ? brand.name + '·' + brand.product : brand.name }} + {{ getBrandTagLabel(brand) }} - - + + + 没找到相关啤酒,可直接在下方输入品牌 + + + {{ showAllBrands ? '收起 ▴' : '更多 ▾' }} @@ -66,7 +88,7 @@ @@ -320,7 +342,7 @@