Browse Source

fix(R21): 切换到系统导航栏,移除所有自定义nav-bar fixed定位

dev
cursor 1 day ago
parent
commit
56bed328cd
10 changed files with 83 additions and 108 deletions
  1. +9
    -10
      pages.json
  2. +8
    -11
      pages/chat/chat.vue
  3. +8
    -13
      pages/confirm/confirm.vue
  4. +11
    -12
      pages/index/index.vue
  5. +11
    -14
      pages/menu/menu.vue
  6. +8
    -11
      pages/orders/orders.vue
  7. +11
    -14
      pages/staff/board.vue
  8. +8
    -11
      pages/staff/chat.vue
  9. +8
    -11
      pages/staff/detail.vue
  10. +1
    -1
      pages/staff/login.vue

+ 9
- 10
pages.json View File

@ -1,17 +1,16 @@
{ {
"pages": [ "pages": [
{ "path": "pages/index/index", "style": { "navigationStyle": "custom" } },
{ "path": "pages/menu/menu", "style": { "navigationStyle": "custom" } },
{ "path": "pages/confirm/confirm", "style": { "navigationStyle": "custom" } },
{ "path": "pages/orders/orders", "style": { "navigationStyle": "custom" } },
{ "path": "pages/chat/chat", "style": { "navigationStyle": "custom" } },
{ "path": "pages/staff/login", "style": { "navigationStyle": "custom" } },
{ "path": "pages/staff/board", "style": { "navigationStyle": "custom" } },
{ "path": "pages/staff/detail", "style": { "navigationStyle": "custom" } },
{ "path": "pages/staff/chat", "style": { "navigationStyle": "custom" } }
{ "path": "pages/index/index", "style": { "navigationBarTitleText": "纯瘾大", "navigationStyle": "default" } },
{ "path": "pages/menu/menu", "style": { "navigationBarTitleText": "酒单", "navigationStyle": "default" } },
{ "path": "pages/confirm/confirm", "style": { "navigationBarTitleText": "确认下单", "navigationStyle": "default" } },
{ "path": "pages/orders/orders", "style": { "navigationBarTitleText": "我的订单", "navigationStyle": "default" } },
{ "path": "pages/chat/chat", "style": { "navigationBarTitleText": "聊天", "navigationStyle": "default" } },
{ "path": "pages/staff/login", "style": { "navigationBarTitleText": "员工登录", "navigationStyle": "default" } },
{ "path": "pages/staff/board", "style": { "navigationBarTitleText": "看板", "navigationStyle": "default" } },
{ "path": "pages/staff/detail", "style": { "navigationBarTitleText": "订单详情", "navigationStyle": "default" } },
{ "path": "pages/staff/chat", "style": { "navigationBarTitleText": "聊天", "navigationStyle": "default" } }
], ],
"globalStyle": { "globalStyle": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarTitleText": "纯瘾大", "navigationBarTitleText": "纯瘾大",
"navigationBarBackgroundColor": "#0D0D0D", "navigationBarBackgroundColor": "#0D0D0D",


+ 8
- 11
pages/chat/chat.vue View File

@ -1,8 +1,8 @@
<template> <template>
<view class="page-chat"> <view class="page-chat">
<view class="nav-bar" :style="{ top: statusBarHeight + 'px' }">
<text class="nav-back" @tap="goBack"></text>
<text class="nav-title">💬 调酒师</text>
<view class="top-bar">
<text class="top-back" @tap="goBack"></text>
<text class="top-title">💬 调酒师</text>
<text></text> <text></text>
</view> </view>
@ -33,7 +33,6 @@ export default {
const messages = ref([]) const messages = ref([])
const inputText = ref('') const inputText = ref('')
const scrollToId = ref('') const scrollToId = ref('')
const statusBarHeight = ref(0)
let lastId = 0 let lastId = 0
async function loadMessages() { async function loadMessages() {
@ -67,23 +66,21 @@ export default {
function goBack() { uni.navigateBack() } function goBack() { uni.navigateBack() }
onMounted(() => { onMounted(() => {
const systemInfo = uni.getSystemInfoSync()
statusBarHeight.value = systemInfo.statusBarHeight
loadMessages(); markRead(); startPoll('chat', loadMessages, 5000) loadMessages(); markRead(); startPoll('chat', loadMessages, 5000)
}) })
onUnmounted(() => stopPoll('chat')) onUnmounted(() => stopPoll('chat'))
return { messages, inputText, scrollToId, statusBarHeight, sendMsg, goBack }
return { messages, inputText, scrollToId, sendMsg, goBack }
} }
} }
</script> </script>
<style scoped> <style scoped>
.page-chat{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%} .page-chat{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%}
.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-back{font-size:36rpx;color:var(--text-dim)}
.nav-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.chat-list{flex:1;padding:16rpx 0;margin-top:100rpx}
.top-bar{height:100rpx;display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);flex-shrink:0}
.top-back{font-size:36rpx;color:var(--text-dim)}
.top-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.chat-list{flex:1;padding:16rpx 0}
.chat-input-bar{display:flex;align-items:center;padding:16rpx 24rpx;padding-bottom:calc(16rpx + var(--safe-b));background:var(--bg-card);border-top:1px solid var(--border);gap:16rpx} .chat-input-bar{display:flex;align-items:center;padding:16rpx 24rpx;padding-bottom:calc(16rpx + var(--safe-b));background:var(--bg-card);border-top:1px solid var(--border);gap:16rpx}
.chat-input{flex:1;height:76rpx;background:var(--bg);border-radius:16rpx;padding:0 28rpx;font-size:28rpx;color:var(--text)} .chat-input{flex:1;height:76rpx;background:var(--bg);border-radius:16rpx;padding:0 28rpx;font-size:28rpx;color:var(--text)}
.chat-send{width:104rpx;height:72rpx;border-radius:16rpx;background:var(--blue);color:#fff;border:none;font-size:26rpx;font-weight:700} .chat-send{width:104rpx;height:72rpx;border-radius:16rpx;background:var(--blue);color:#fff;border:none;font-size:26rpx;font-weight:700}


+ 8
- 13
pages/confirm/confirm.vue View File

@ -1,8 +1,8 @@
<template> <template>
<view class="page-confirm"> <view class="page-confirm">
<view class="nav-bar" :style="{ top: statusBarHeight + 'px' }">
<text class="nav-back" @tap="goBack"></text>
<text class="nav-title">确认下单</text>
<view class="top-bar">
<text class="top-back" @tap="goBack"></text>
<text class="top-title">确认下单</text>
<text></text> <text></text>
</view> </view>
@ -56,7 +56,6 @@ export default {
const presets = ref([]) const presets = ref([])
const note = ref('') const note = ref('')
const submitting = ref(false) const submitting = ref(false)
const statusBarHeight = ref(0)
function goBack() { uni.navigateBack() } function goBack() { uni.navigateBack() }
@ -77,21 +76,17 @@ export default {
submitting.value = false submitting.value = false
} }
return { cart, presets, note, submitting, statusBarHeight, goBack, onSubmit }
},
created() {
const systemInfo = uni.getSystemInfoSync()
this.statusBarHeight = systemInfo.statusBarHeight
return { cart, presets, note, submitting, goBack, onSubmit }
} }
} }
</script> </script>
<style scoped> <style scoped>
.page-confirm{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%} .page-confirm{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%}
.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-back{font-size:36rpx;color:var(--text-dim)}
.nav-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.confirm-body{flex:1;padding:0 28rpx;margin-top:100rpx}
.top-bar{height:100rpx;display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);flex-shrink:0}
.top-back{font-size:36rpx;color:var(--text-dim)}
.top-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.confirm-body{flex:1;padding:0 28rpx}
.section{padding:20rpx 0;border-bottom:1px solid var(--border)} .section{padding:20rpx 0;border-bottom:1px solid var(--border)}
.section-title{font-size:28rpx;font-weight:700;color:var(--gold);display:block;margin-bottom:16rpx} .section-title{font-size:28rpx;font-weight:700;color:var(--gold);display:block;margin-bottom:16rpx}
.confirm-item{display:flex;align-items:center;padding:16rpx 0;gap:16rpx} .confirm-item{display:flex;align-items:center;padding:16rpx 0;gap:16rpx}


+ 11
- 12
pages/index/index.vue View File

@ -1,11 +1,11 @@
<template> <template>
<view class="page-index"> <view class="page-index">
<view class="nav-bar" :style="{ top: navBarHeight + 'px' }">
<view class="nav-left">
<text class="nav-logo">🍸</text>
<text class="nav-brand">纯瘾大</text>
<view class="top-bar">
<view class="top-left">
<text class="top-logo">🍸</text>
<text class="top-brand">纯瘾大</text>
</view> </view>
<view class="nav-right">
<view class="top-right">
<text class="my-btn" @tap="goMyOrders">我的</text> <text class="my-btn" @tap="goMyOrders">我的</text>
</view> </view>
</view> </view>
@ -76,7 +76,6 @@ export default {
const generated = ref(false) const generated = ref(false)
const inputNo = ref('') const inputNo = ref('')
const cardNo = ref('') const cardNo = ref('')
const navBarHeight = ref(44) //
let navTimer = null let navTimer = null
function goMenu() { function goMenu() {
@ -122,18 +121,18 @@ export default {
function goMyOrders() { uni.navigateTo({ url: '/pages/orders/orders' }) } function goMyOrders() { uni.navigateTo({ url: '/pages/orders/orders' }) }
function goStaffLogin() { uni.navigateTo({ url: '/pages/staff/login' }) } function goStaffLogin() { uni.navigateTo({ url: '/pages/staff/login' }) }
return { showModal, generated, inputNo, cardNo, navBarHeight, onGenerate, onCheck, onMaskTap, goMyOrders, goStaffLogin }
return { showModal, generated, inputNo, cardNo, onGenerate, onCheck, onMaskTap, goMyOrders, goStaffLogin }
} }
} }
</script> </script>
<style scoped> <style scoped>
.page-index{height:calc(100vh - 44px);display:flex;flex-direction:column;background:var(--bg);width:100%}
.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-logo{font-size:44rpx}
.nav-brand{font-size:40rpx;font-weight:900;color:var(--gold);letter-spacing:4rpx}
.page-index{height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%}
.top-bar{height:100rpx;display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);flex-shrink:0}
.top-left{display:flex;align-items:center;gap:16rpx}
.top-logo{font-size:44rpx}
.top-brand{font-size:40rpx;font-weight:900;color:var(--gold);letter-spacing:4rpx}
.my-btn{font-size:26rpx;color:var(--gold);font-weight:600} .my-btn{font-size:26rpx;color:var(--gold);font-weight:600}
.landing-bg{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;overflow:hidden;background:radial-gradient(ellipse at center,#1A1A1A 0%,var(--bg) 70%);padding:40rpx} .landing-bg{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;overflow:hidden;background:radial-gradient(ellipse at center,#1A1A1A 0%,var(--bg) 70%);padding:40rpx}


+ 11
- 14
pages/menu/menu.vue View File

@ -1,12 +1,12 @@
<template> <template>
<view class="page-menu"> <view class="page-menu">
<view class="nav-bar" :style="{ top: statusBarHeight + 'px' }">
<view class="nav-left">
<text class="nav-logo">🍸</text>
<text class="nav-brand">纯瘾大</text>
<view class="top-bar">
<view class="top-left">
<text class="top-logo">🍸</text>
<text class="top-brand">纯瘾大</text>
<text v-if="card.cardNo" class="card-badge">🎫 {{ card.cardNo }}</text> <text v-if="card.cardNo" class="card-badge">🎫 {{ card.cardNo }}</text>
</view> </view>
<view class="nav-right">
<view class="top-right">
<text class="my-btn" @tap="goMyOrders">我的</text> <text class="my-btn" @tap="goMyOrders">我的</text>
</view> </view>
</view> </view>
@ -87,7 +87,6 @@ export default {
const showCart = ref(false) const showCart = ref(false)
const bellPressed = ref(false) const bellPressed = ref(false)
const bellWaving = ref(false) const bellWaving = ref(false)
const statusBarHeight = ref(0)
async function loadCategories() { async function loadCategories() {
try { try {
@ -129,26 +128,24 @@ export default {
function goMyOrders() { uni.navigateTo({ url: '/pages/orders/orders' }) } function goMyOrders() { uni.navigateTo({ url: '/pages/orders/orders' }) }
onMounted(async () => { onMounted(async () => {
const systemInfo = uni.getSystemInfoSync()
statusBarHeight.value = systemInfo.statusBarHeight
await loadCategories() await loadCategories()
await loadProducts('all') await loadProducts('all')
}) })
return { card, cart, categories, activeCate, products, showCart, bellPressed, bellWaving, statusBarHeight, onCateChange, onAddToCart, onBellPress, onGoConfirm, goMyOrders }
return { card, cart, categories, activeCate, products, showCart, bellPressed, bellWaving, onCateChange, onAddToCart, onBellPress, onGoConfirm, goMyOrders }
} }
} }
</script> </script>
<style scoped> <style scoped>
.page-menu{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%} .page-menu{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%}
.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-logo{font-size:44rpx}
.nav-brand{font-size:40rpx;font-weight:900;color:var(--gold);letter-spacing:4rpx}
.top-bar{height:100rpx;display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);flex-shrink:0}
.top-left{display:flex;align-items:center;gap:16rpx}
.top-logo{font-size:44rpx}
.top-brand{font-size:40rpx;font-weight:900;color:var(--gold);letter-spacing:4rpx}
.card-badge{background:linear-gradient(135deg,var(--gold-dark),var(--gold));color:#1A1A1A;padding:10rpx 24rpx;border-radius:28rpx;font-weight:800;font-size:26rpx;letter-spacing:6rpx;animation:card-appear-top .5s ease} .card-badge{background:linear-gradient(135deg,var(--gold-dark),var(--gold));color:#1A1A1A;padding:10rpx 24rpx;border-radius:28rpx;font-weight:800;font-size:26rpx;letter-spacing:6rpx;animation:card-appear-top .5s ease}
.my-btn{font-size:26rpx;color:var(--gold);font-weight:600} .my-btn{font-size:26rpx;color:var(--gold);font-weight:600}
.menu-scroll{flex:1;margin-top:100rpx}
.menu-scroll{flex:1}
.product-grid{padding:16rpx 20rpx} .product-grid{padding:16rpx 20rpx}
.empty-state{display:flex;flex-direction:column;align-items:center;padding:120rpx 0} .empty-state{display:flex;flex-direction:column;align-items:center;padding:120rpx 0}
.empty-icon{font-size:112rpx;opacity:.3} .empty-icon{font-size:112rpx;opacity:.3}


+ 8
- 11
pages/orders/orders.vue View File

@ -1,8 +1,8 @@
<template> <template>
<view class="page-orders"> <view class="page-orders">
<view class="nav-bar" :style="{ top: statusBarHeight + 'px' }">
<text class="nav-back" @tap="goBack"></text>
<text class="nav-title">我的订单</text>
<view class="top-bar">
<text class="top-back" @tap="goBack"></text>
<text class="top-title">我的订单</text>
<text></text> <text></text>
</view> </view>
@ -41,7 +41,6 @@ export default {
setup() { setup() {
const card = useCardStore() const card = useCardStore()
const orders = ref([]) const orders = ref([])
const statusBarHeight = ref(0)
async function loadOrders() { async function loadOrders() {
try { try {
@ -70,23 +69,21 @@ export default {
function goMenu() { uni.navigateBack() } function goMenu() { uni.navigateBack() }
onMounted(() => { onMounted(() => {
const systemInfo = uni.getSystemInfoSync()
statusBarHeight.value = systemInfo.statusBarHeight
loadOrders(); checkUnread(); startPoll('orders', loadOrders, 15000); startPoll('ordersUnread', checkUnread, 10000) loadOrders(); checkUnread(); startPoll('orders', loadOrders, 15000); startPoll('ordersUnread', checkUnread, 10000)
}) })
onUnmounted(() => { stopPoll('orders'); stopPoll('ordersUnread') }) onUnmounted(() => { stopPoll('orders'); stopPoll('ordersUnread') })
return { card, orders, statusBarHeight, onRemind, onChat, goBack, goMenu }
return { card, orders, onRemind, onChat, goBack, goMenu }
} }
} }
</script> </script>
<style scoped> <style scoped>
.page-orders{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%} .page-orders{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%}
.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-back{font-size:36rpx;color:var(--text-dim)}
.nav-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.orders-body{flex:1;padding:20rpx;margin-top:100rpx}
.top-bar{height:100rpx;display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);flex-shrink:0}
.top-back{font-size:36rpx;color:var(--text-dim)}
.top-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.orders-body{flex:1;padding:20rpx}
.card-actions{display:flex;gap:16rpx;padding-top:16rpx} .card-actions{display:flex;gap:16rpx;padding-top:16rpx}
.action-btn{padding:12rpx 28rpx;border-radius:24rpx;font-size:24rpx;font-weight:600;border:none;position:relative} .action-btn{padding:12rpx 28rpx;border-radius:24rpx;font-size:24rpx;font-weight:600;border:none;position:relative}
.action-remind{background:rgba(255,59,59,.15);color:var(--red)} .action-remind{background:rgba(255,59,59,.15);color:var(--red)}


+ 11
- 14
pages/staff/board.vue View File

@ -1,11 +1,11 @@
<template> <template>
<view class="page-staff-board"> <view class="page-staff-board">
<view class="nav-bar" :style="{ top: statusBarHeight + 'px' }">
<view class="nav-left">
<text class="nav-logo">🍸</text>
<text class="nav-brand">纯瘾大</text>
<view class="top-bar">
<view class="top-left">
<text class="top-logo">🍸</text>
<text class="top-brand">纯瘾大</text>
</view> </view>
<view class="nav-right">
<view class="top-right">
<text class="logout-btn" @tap="onLogout">退出</text> <text class="logout-btn" @tap="onLogout">退出</text>
</view> </view>
</view> </view>
@ -62,7 +62,6 @@ 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 {
@ -96,25 +95,23 @@ export default {
function onLogout() { staff.logout(); uni.redirectTo({ url: '/pages/staff/login' }) } function onLogout() { staff.logout(); uni.redirectTo({ url: '/pages/staff/login' }) }
onMounted(() => { onMounted(() => {
const systemInfo = uni.getSystemInfoSync()
statusBarHeight.value = systemInfo.statusBarHeight
loadOrders(); loadCounts(); startPoll('board', () => { loadOrders(); loadCounts() }, 10000) loadOrders(); loadCounts(); startPoll('board', () => { loadOrders(); loadCounts() }, 10000)
}) })
onUnmounted(() => stopPoll('board')) onUnmounted(() => stopPoll('board'))
return { staff, tabs, activeTab, orders, counts, recipeVisible, recipeCardNo, recipeItems, statusBarHeight, switchTab, onConfirm, onCancel, onDone, onDetail, onRecipe, onChat, onLogout }
return { staff, tabs, activeTab, orders, counts, recipeVisible, recipeCardNo, recipeItems, 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: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-logo{font-size:44rpx}
.nav-brand{font-size:32rpx;font-weight:900;color:var(--gold)}
.top-bar{height:100rpx;display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);flex-shrink:0}
.top-left{display:flex;align-items:center;gap:16rpx}
.top-logo{font-size:44rpx}
.top-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);margin-top:100rpx}
.staff-info{background:var(--bg-card);padding:16rpx 32rpx;font-size:24rpx;color:var(--text-dim);border-bottom:1px solid var(--border)}
.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)}


+ 8
- 11
pages/staff/chat.vue View File

@ -1,8 +1,8 @@
<template> <template>
<view class="page-staff-chat"> <view class="page-staff-chat">
<view class="nav-bar" :style="{ top: statusBarHeight + 'px' }">
<text class="nav-back" @tap="goBack"></text>
<text class="nav-title">💬 客人对话</text>
<view class="top-bar">
<text class="top-back" @tap="goBack"></text>
<text class="top-title">💬 客人对话</text>
<text></text> <text></text>
</view> </view>
@ -34,7 +34,6 @@ export default {
const messages = ref([]) const messages = ref([])
const inputText = ref('') const inputText = ref('')
const scrollToId = ref('') const scrollToId = ref('')
const statusBarHeight = ref(0)
let lastId = 0 let lastId = 0
async function loadMessages() { async function loadMessages() {
@ -68,23 +67,21 @@ export default {
function goBack() { uni.navigateBack() } function goBack() { uni.navigateBack() }
onMounted(() => { onMounted(() => {
const systemInfo = uni.getSystemInfoSync()
statusBarHeight.value = systemInfo.statusBarHeight
loadMessages(); markRead(); startPoll('staffChat', loadMessages, 5000) loadMessages(); markRead(); startPoll('staffChat', loadMessages, 5000)
}) })
onUnmounted(() => stopPoll('staffChat')) onUnmounted(() => stopPoll('staffChat'))
return { cardNo, messages, inputText, scrollToId, statusBarHeight, sendMsg, goBack }
return { cardNo, messages, inputText, scrollToId, sendMsg, goBack }
} }
} }
</script> </script>
<style scoped> <style scoped>
.page-staff-chat{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%} .page-staff-chat{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%}
.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-back{font-size:36rpx;color:var(--text-dim)}
.nav-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.chat-list{flex:1;padding:16rpx 0;margin-top:100rpx}
.top-bar{height:100rpx;display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);flex-shrink:0}
.top-back{font-size:36rpx;color:var(--text-dim)}
.top-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.chat-list{flex:1;padding:16rpx 0}
.chat-input-bar{display:flex;align-items:center;padding:16rpx 24rpx;padding-bottom:calc(16rpx + var(--safe-b));background:var(--bg-card);border-top:1px solid var(--border);gap:16rpx} .chat-input-bar{display:flex;align-items:center;padding:16rpx 24rpx;padding-bottom:calc(16rpx + var(--safe-b));background:var(--bg-card);border-top:1px solid var(--border);gap:16rpx}
.chat-input{flex:1;height:76rpx;background:var(--bg);border-radius:16rpx;padding:0 28rpx;font-size:28rpx;color:var(--text)} .chat-input{flex:1;height:76rpx;background:var(--bg);border-radius:16rpx;padding:0 28rpx;font-size:28rpx;color:var(--text)}
.chat-send{width:104rpx;height:72rpx;border-radius:16rpx;background:var(--blue);color:#fff;border:none;font-size:26rpx;font-weight:700} .chat-send{width:104rpx;height:72rpx;border-radius:16rpx;background:var(--blue);color:#fff;border:none;font-size:26rpx;font-weight:700}


+ 8
- 11
pages/staff/detail.vue View File

@ -1,8 +1,8 @@
<template> <template>
<view class="page-staff-detail"> <view class="page-staff-detail">
<view class="nav-bar" :style="{ top: statusBarHeight + 'px' }">
<text class="nav-back" @tap="goBack"></text>
<text class="nav-title">订单详情</text>
<view class="top-bar">
<text class="top-back" @tap="goBack"></text>
<text class="top-title">订单详情</text>
<text></text> <text></text>
</view> </view>
@ -55,7 +55,6 @@ export default {
setup() { setup() {
const order = ref(null) const order = ref(null)
const orderId = ref(0) const orderId = ref(0)
const statusBarHeight = ref(0)
const statusLabel = computed(() => order.value ? ORDER_STATUS[order.value.status]?.label : '') const statusLabel = computed(() => order.value ? ORDER_STATUS[order.value.status]?.label : '')
const statusColor = computed(() => order.value ? ORDER_STATUS[order.value.status]?.color : '') const statusColor = computed(() => order.value ? ORDER_STATUS[order.value.status]?.color : '')
@ -68,11 +67,9 @@ export default {
function onChat() { uni.setStorageSync('chatCardNo', order.value.cardNo); uni.navigateTo({ url: '/pages/staff/chat' }) } function onChat() { uni.setStorageSync('chatCardNo', order.value.cardNo); uni.navigateTo({ url: '/pages/staff/chat' }) }
function goBack() { uni.navigateBack() } function goBack() { uni.navigateBack() }
return { order, statusLabel, statusColor, statusBarHeight, orderId, loadDetail, onConfirm, onDone, onChat, goBack }
return { order, statusLabel, statusColor, orderId, loadDetail, onConfirm, onDone, onChat, goBack }
}, },
onLoad(options) { onLoad(options) {
const systemInfo = uni.getSystemInfoSync()
this.statusBarHeight = systemInfo.statusBarHeight
this.orderId = parseInt(options.id) || 0 this.orderId = parseInt(options.id) || 0
this.loadDetail() this.loadDetail()
} }
@ -81,10 +78,10 @@ export default {
<style scoped> <style scoped>
.page-staff-detail{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%} .page-staff-detail{min-height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%}
.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-back{font-size:36rpx;color:var(--text-dim)}
.nav-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.detail-body{flex:1;padding:28rpx;margin-top:100rpx}
.top-bar{height:100rpx;display:flex;align-items:center;justify-content:space-between;padding:0 28rpx;border-bottom:1px solid var(--border);flex-shrink:0}
.top-back{font-size:36rpx;color:var(--text-dim)}
.top-title{font-size:32rpx;font-weight:800;color:var(--gold)}
.detail-body{flex:1;padding:28rpx}
.detail-card{background:var(--bg-card);border-radius:var(--radius);padding:32rpx;margin-bottom:24rpx;border:1px solid var(--border)} .detail-card{background:var(--bg-card);border-radius:var(--radius);padding:32rpx;margin-bottom:24rpx;border:1px solid var(--border)}
.detail-row{display:flex;justify-content:space-between;padding:10rpx 0;font-size:28rpx;color:var(--text)} .detail-row{display:flex;justify-content:space-between;padding:10rpx 0;font-size:28rpx;color:var(--text)}
.section-title{font-size:28rpx;font-weight:700;color:var(--gold);display:block;margin-bottom:20rpx} .section-title{font-size:28rpx;font-weight:700;color:var(--gold);display:block;margin-bottom:20rpx}


+ 1
- 1
pages/staff/login.vue View File

@ -61,7 +61,7 @@ export default {
<style scoped> <style scoped>
.page-staff-login{height:calc(100vh - 44px);display:flex;flex-direction:column;background:var(--bg);width:100%}
.page-staff-login{height:100vh;display:flex;flex-direction:column;background:var(--bg);width:100%}
.login-container{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80rpx 64rpx} .login-container{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80rpx 64rpx}
.login-logo{font-size:120rpx;animation:float 3s ease-in-out infinite} .login-logo{font-size:120rpx;animation:float 3s ease-in-out infinite}
.login-title{font-size:44rpx;font-weight:800;color:var(--gold);margin:24rpx 0 8rpx} .login-title{font-size:44rpx;font-weight:800;color:var(--gold);margin:24rpx 0 8rpx}


Loading…
Cancel
Save