<template>
  <div class="kitchen-orders-page">
    <!-- 厨房端 - 订单接收页（需WebSocket + 语音播报） -->
    <h2>厨房订单接收</h2>
    <p>待实现：参考HTML原型 kitchen-orders.html</p>
    <p>关键功能：WebSocket实时接收、Web Speech API语音播报</p>
  </div>
</template>

<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
import hotelWS from '@/utils/websocket'

onMounted(() => {
  console.log('KitchenOrders mounted')
  // TODO: 连接WebSocket
  // hotelWS.connect(token, handleMessage, handleError)
})

onUnmounted(() => {
  // TODO: 断开WebSocket
  // hotelWS.disconnect()
})

function handleMessage(event) {
  const message = JSON.parse(event.data)
  console.log('收到消息:', message)
}

function handleError(error) {
  console.error('WebSocket错误:', error)
}
</script>

<style scoped>
.kitchen-orders-page {
  padding: 20px;
}
</style>
