|
|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="page-staff-board"> |
|
|
<view class="page-staff-board"> |
|
|
<view class="nav-bar"> |
|
|
|
|
|
|
|
|
<view class="nav-bar" :style="{ top: statusBarHeight + 'px' }"> |
|
|
<view class="nav-left"> |
|
|
<view class="nav-left"> |
|
|
<text class="nav-logo">🍸</text> |
|
|
<text class="nav-logo">🍸</text> |
|
|
<text class="nav-brand">纯瘾大</text> |
|
|
<text class="nav-brand">纯瘾大</text> |
|
|
@ -24,7 +24,7 @@ |
|
|
<template #actions> |
|
|
<template #actions> |
|
|
<view class="board-actions"> |
|
|
<view class="board-actions"> |
|
|
<button class="ba-btn ba-gold" @tap="onDetail(o)">📖 详情</button> |
|
|
<button class="ba-btn ba-gold" @tap="onDetail(o)">📖 详情</button> |
|
|
<button v-if="o.status!==3" class="ba-btn ba-blue" @tap="onChat(o)">💬 聊天</button> |
|
|
|
|
|
|
|
|
<button v-if="o.status!==3 && o.status!==2" class="ba-btn ba-blue" @tap="onChat(o)">💬 聊天</button> |
|
|
<button v-if="o.status===0" class="ba-btn ba-gold" @tap="onConfirm(o.id)">✅ 接单</button> |
|
|
<button v-if="o.status===0" class="ba-btn ba-gold" @tap="onConfirm(o.id)">✅ 接单</button> |
|
|
<button v-if="o.status===0" class="ba-btn ba-red" @tap="onCancel(o.id)">❌ 拒单</button> |
|
|
<button v-if="o.status===0" class="ba-btn ba-red" @tap="onCancel(o.id)">❌ 拒单</button> |
|
|
<button v-if="o.status===1" class="ba-btn ba-gold" @tap="onDone(o.id)">✔ 结单</button> |
|
|
<button v-if="o.status===1" class="ba-btn ba-gold" @tap="onDone(o.id)">✔ 结单</button> |
|
|
@ -62,6 +62,7 @@ export default { |
|
|
const recipeVisible = ref(false) |
|
|
const recipeVisible = ref(false) |
|
|
const recipeCardNo = ref('') |
|
|
const recipeCardNo = ref('') |
|
|
const recipeItems = ref([]) |
|
|
const recipeItems = ref([]) |
|
|
|
|
|
const statusBarHeight = ref(0) |
|
|
|
|
|
|
|
|
async function loadOrders() { |
|
|
async function loadOrders() { |
|
|
try { |
|
|
try { |
|
|
@ -94,22 +95,26 @@ export default { |
|
|
function onChat(order) { uni.setStorageSync('chatCardNo', order.cardNo); uni.navigateTo({ url: '/pages/staff/chat' }) } |
|
|
function onChat(order) { uni.setStorageSync('chatCardNo', order.cardNo); uni.navigateTo({ url: '/pages/staff/chat' }) } |
|
|
function onLogout() { staff.logout(); uni.redirectTo({ url: '/pages/staff/login' }) } |
|
|
function onLogout() { staff.logout(); uni.redirectTo({ url: '/pages/staff/login' }) } |
|
|
|
|
|
|
|
|
onMounted(() => { loadOrders(); loadCounts(); startPoll('board', () => { loadOrders(); loadCounts() }, 10000) }) |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
|
const systemInfo = uni.getSystemInfoSync() |
|
|
|
|
|
statusBarHeight.value = systemInfo.statusBarHeight |
|
|
|
|
|
loadOrders(); loadCounts(); startPoll('board', () => { loadOrders(); loadCounts() }, 10000) |
|
|
|
|
|
}) |
|
|
onUnmounted(() => stopPoll('board')) |
|
|
onUnmounted(() => stopPoll('board')) |
|
|
|
|
|
|
|
|
return { staff, tabs, activeTab, orders, counts, recipeVisible, recipeCardNo, recipeItems, switchTab, onConfirm, onCancel, onDone, onDetail, onRecipe, onChat, onLogout } |
|
|
|
|
|
|
|
|
return { staff, tabs, activeTab, orders, counts, recipeVisible, recipeCardNo, recipeItems, statusBarHeight, switchTab, onConfirm, onCancel, onDone, onDetail, onRecipe, onChat, onLogout } |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped> |
|
|
<style scoped> |
|
|
.page-staff-board{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%} |
|
|
.page-staff-board{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%} |
|
|
.nav-bar{height:100rpx;position:sticky;top:0;z-index:100;background:var(--bg);display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);flex-shrink:0} |
|
|
|
|
|
|
|
|
.nav-bar{height:100rpx;position:fixed;top:0;z-index:100;background:var(--bg);display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);width:100%} |
|
|
.nav-left{display:flex;align-items:center;gap:16rpx} |
|
|
.nav-left{display:flex;align-items:center;gap:16rpx} |
|
|
.nav-logo{font-size:44rpx} |
|
|
.nav-logo{font-size:44rpx} |
|
|
.nav-brand{font-size:32rpx;font-weight:900;color:var(--gold)} |
|
|
.nav-brand{font-size:32rpx;font-weight:900;color:var(--gold)} |
|
|
.logout-btn{font-size:26rpx;color:var(--red)} |
|
|
.logout-btn{font-size:26rpx;color:var(--red)} |
|
|
.staff-info{background:var(--bg-card);padding:16rpx 32rpx;font-size:24rpx;color:var(--text-dim);border-bottom:1px solid var(--border)} |
|
|
|
|
|
|
|
|
.staff-info{background:var(--bg-card);padding:16rpx 32rpx;font-size:24rpx;color:var(--text-dim);border-bottom:1px solid var(--border);margin-top:100rpx} |
|
|
.board-tabs{display:flex;border-bottom:1px solid var(--border);background:var(--bg);flex-shrink:0} |
|
|
.board-tabs{display:flex;border-bottom:1px solid var(--border);background:var(--bg);flex-shrink:0} |
|
|
.board-tab{flex:1;padding:24rpx;text-align:center;font-size:26rpx;font-weight:600;color:var(--text-dim);border-bottom:4rpx solid transparent} |
|
|
.board-tab{flex:1;padding:24rpx;text-align:center;font-size:26rpx;font-weight:600;color:var(--text-dim);border-bottom:4rpx solid transparent} |
|
|
.board-tab.active{color:var(--gold);border-bottom-color:var(--gold)} |
|
|
.board-tab.active{color:var(--gold);border-bottom-color:var(--gold)} |
|
|
|