Browse Source

feat(R25): 员工入口移到按钮下方+分类智能排序+购物车改马天尼杯

dev
cursor 1 day ago
parent
commit
c319f897c7
2 changed files with 25 additions and 15 deletions
  1. +4
    -7
      pages/index/index.vue
  2. +21
    -8
      pages/menu/menu.vue

+ 4
- 7
pages/index/index.vue View File

@ -21,11 +21,9 @@
<text class="landing-title">就是纯瘾大</text>
<text class="landing-sub">唤醒你的专属调酒师</text>
<button class="btn-primary" @tap="showModal = true">🎫 领取号码牌</button>
</view>
<!-- 员工入口 -->
<view class="staff-link">
<text @tap="goStaffLogin">🔐 员工入口</text>
<view class="staff-link">
<text @tap="goStaffLogin">🔐 员工入口</text>
</view>
</view>
<!-- 号码牌弹窗 (点击按钮才显示) -->
@ -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}
</style>

+ 21
- 8
pages/menu/menu.vue View File

@ -27,7 +27,7 @@
<!-- 底部栏: 红酒杯() + 出餐铃() -->
<view class="bottom-bar">
<view class="wine-glass" @tap="showCart = true">
<text class="glass-icon">🍷</text>
<text class="glass-icon">🍸</text>
<text v-if="cart.totalCount > 0" class="glass-count">{{ cart.totalCount }}</text>
</view>
<view class="press-bell-wrapper" @tap="onBellPress">
@ -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)}
</style>

Loading…
Cancel
Save