From c319f897c7405498d67b5a96a53d291bfec8a907 Mon Sep 17 00:00:00 2001 From: cursor Date: Tue, 9 Jun 2026 04:53:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(R25):=20=E5=91=98=E5=B7=A5=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E7=A7=BB=E5=88=B0=E6=8C=89=E9=92=AE=E4=B8=8B=E6=96=B9?= =?UTF-8?q?+=E5=88=86=E7=B1=BB=E6=99=BA=E8=83=BD=E6=8E=92=E5=BA=8F+?= =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=94=B9=E9=A9=AC=E5=A4=A9=E5=B0=BC?= =?UTF-8?q?=E6=9D=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 11 ++++------- pages/menu/menu.vue | 29 +++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index bac8fe2..11b0208 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -21,11 +21,9 @@ 就是纯瘾大 唤醒你的专属调酒师 - - - - - 🔐 员工入口 + + 🔐 员工入口 + @@ -143,7 +141,7 @@ export default { .btn-primary{width:440rpx;height:96rpx;border-radius:24rpx;background:linear-gradient(135deg,var(--gold-dark),var(--gold),var(--gold-light));color:#1A1A1A;border:none;font-size:32rpx;font-weight:800;display:flex;align-items:center;justify-content:center;box-shadow:0 8rpx 40rpx rgba(245,166,35,.35)} /* 员工入口 */ -.staff-link{padding:4rpx 20rpx;text-align:center;flex-shrink:0} +.staff-link{margin-top:24rpx;text-align:center} .staff-link text{color:var(--text-muted);font-size:22rpx;letter-spacing:2rpx} /* 号码牌弹窗 */ @@ -165,4 +163,3 @@ export default { .card-divider{text-align:center;color:var(--text-muted);font-size:24rpx;margin:20rpx 0;position:relative} .modal-footer{padding:0 36rpx 40rpx} - diff --git a/pages/menu/menu.vue b/pages/menu/menu.vue index 8838478..1c0af47 100644 --- a/pages/menu/menu.vue +++ b/pages/menu/menu.vue @@ -27,7 +27,7 @@ - 🍷 + 🍸 {{ cart.totalCount }} @@ -92,15 +92,27 @@ export default { try { const res = await get(API.MENU_CATEGORIES) if (Array.isArray(res)) { - // 智能排序:全部 + 鸡尾酒优先,其余按后端顺序 - const cocktail = res.filter(c => c.includes('鸡尾酒')) - const others = res.filter(c => !c.includes('鸡尾酒')) - const sorted = ['all', ...cocktail, ...others] + // 智能排序:全部 + 鸡尾酒 + 限定特调 + 嗨棒 + 其他 + const priority = ['鸡尾酒', '限定特调', '嗨棒'] + const matched = [] + const rest = [] + for (const c of res) { + if (priority.some(k => c.includes(k))) matched.push(c) + else rest.push(c) + } + // 按 priority 顺序排列 matched + matched.sort((a, b) => { + const ai = priority.findIndex(k => a.includes(k)) + const bi = priority.findIndex(k => b.includes(k)) + return ai - bi + }) + const sorted = ['all', ...matched, ...rest] categories.value = sorted // 默认选中鸡尾酒;没有则选全部 - if (cocktail.length > 0) { - activeCate.value = cocktail[0] - await loadProducts(cocktail[0]) + const cocktail = sorted.find(c => c.includes('鸡尾酒')) + if (cocktail) { + activeCate.value = cocktail + await loadProducts(cocktail) } else { await loadProducts('all') } @@ -197,3 +209,4 @@ export default { .cart-footer{padding:24rpx 40rpx 40rpx;flex-shrink:0} .next-btn{width:100%;height:96rpx;border-radius:28rpx;background:linear-gradient(135deg,var(--orange),var(--red));color:#fff;border:none;font-size:32rpx;font-weight:800;box-shadow:0 8rpx 40rpx rgba(255,107,53,.35)} +