This commit is contained in:
@@ -1,54 +1,49 @@
|
|||||||
<template>
|
<template>
|
||||||
<text class="icon" :class="'icon-' + name" :style="iconStyle">{{ iconChar }}</text>
|
<view class="icon-box" :style="{ width: size + 'rpx', height: size + 'rpx' }">
|
||||||
|
<text :style="{ fontSize: (size * 0.6) + 'rpx', color: color }">{{ iconChar }}</text>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Element UI 风格图标(使用更专业的 Unicode 符号)
|
|
||||||
const icons = {
|
const icons = {
|
||||||
home: '⌂',
|
home: '🏠',
|
||||||
user: '👤',
|
user: '👤',
|
||||||
chart: '📈',
|
chart: '📈',
|
||||||
product: '📦',
|
product: '📦',
|
||||||
add: '+',
|
add: '+',
|
||||||
search: '🔎',
|
search: '🔍',
|
||||||
order: '📝',
|
order: '📋',
|
||||||
edit: '✎',
|
edit: '✏️',
|
||||||
check: '✓',
|
check: '✅',
|
||||||
close: '✕',
|
close: '✕',
|
||||||
stock: '📦',
|
stock: '🏭',
|
||||||
alert: '⚠',
|
alert: '⚠️',
|
||||||
in: '↓',
|
in: '⬇️',
|
||||||
out: '↑',
|
out: '⬆️',
|
||||||
customer: '👥',
|
customer: '👥',
|
||||||
money: '💴',
|
money: '💰',
|
||||||
logout: '↪',
|
logout: '↪️',
|
||||||
right: '›',
|
right: '→',
|
||||||
left: '‹',
|
left: '←',
|
||||||
down: '▽',
|
down: '⬇',
|
||||||
lock: '🔒',
|
lock: '🔒',
|
||||||
calendar: '📅',
|
calendar: '📅',
|
||||||
setting: '⚙',
|
setting: '⚙️',
|
||||||
wechat: '💬',
|
wechat: '💬',
|
||||||
cash: '💵',
|
cash: '💵',
|
||||||
alipay: '💙',
|
alipay: '💙',
|
||||||
plus: '+',
|
plus: '➕',
|
||||||
flow: '↔'
|
flow: '📊'
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Icon',
|
name: 'Icon',
|
||||||
props: {
|
props: {
|
||||||
name: { type: String, required: true },
|
name: { type: String, required: true },
|
||||||
size: { type: [Number, String], default: 32 },
|
size: { type: [Number, String], default: 48 },
|
||||||
color: { type: String, default: '' }
|
color: { type: String, default: '' }
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
iconStyle() {
|
|
||||||
const style = {}
|
|
||||||
if (this.size) style.fontSize = typeof this.size === 'number' ? `${this.size}rpx` : this.size
|
|
||||||
if (this.color) style.color = this.color
|
|
||||||
return style
|
|
||||||
},
|
|
||||||
iconChar() {
|
iconChar() {
|
||||||
return icons[this.name] || '•'
|
return icons[this.name] || '•'
|
||||||
}
|
}
|
||||||
@@ -57,10 +52,9 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.icon {
|
.icon-box {
|
||||||
font-family: system-ui, -apple-system, sans-serif;
|
display: flex;
|
||||||
display: inline-block;
|
align-items: center;
|
||||||
text-align: center;
|
justify-content: center;
|
||||||
line-height: 1;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,253 +1,192 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page">
|
<view class="page">
|
||||||
<!-- 顶部欢迎区域 -->
|
<!-- 顶部欢迎区 -->
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view class="welcome-section">
|
<view class="user-info">
|
||||||
<text class="welcome-text">欢迎回来</text>
|
<text class="greeting">{{ greeting }}</text>
|
||||||
<text class="username">{{ userInfo.username || '用户' }}</text>
|
<text class="username" v-if="username">{{ username }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="role-badge" :class="roleClass">
|
<view class="logout-btn" @click="logout" v-if="isLoggedIn">
|
||||||
<Icon name="user" :size="24" color="#667eea" />
|
<text>退出</text>
|
||||||
<text class="role-text">{{ roleText }}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 快捷操作 - 管理员/销售 -->
|
<!-- 统计概览 -->
|
||||||
<view class="stats-card" v-if="!isCustomer && !isGuest">
|
<view class="stats-section" v-if="isAdmin || isSales">
|
||||||
<view class="card-header">
|
<view class="stat-card">
|
||||||
<text class="card-title">今日概览</text>
|
<text class="stat-value">{{ stats.todayOrders }}</text>
|
||||||
|
<text class="stat-label">今日订单</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="stats-grid">
|
<view class="stat-card">
|
||||||
<view class="stat-item">
|
<text class="stat-value">¥{{ stats.todayAmount }}</text>
|
||||||
<view class="stat-icon order-icon">
|
<text class="stat-label">今日销售额</text>
|
||||||
<Icon name="order" :size="40" color="#667eea" />
|
</view>
|
||||||
</view>
|
<view class="stat-card">
|
||||||
<view class="stat-info">
|
<text class="stat-value">{{ stats.totalCustomers }}</text>
|
||||||
<text class="stat-value">{{ stats.orderCount || 0 }}</text>
|
<text class="stat-label">客户数</text>
|
||||||
<text class="stat-label">今日订单</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="stat-item">
|
|
||||||
<view class="stat-icon money-icon">
|
|
||||||
<Icon name="money" :size="40" color="#fa8c16" />
|
|
||||||
</view>
|
|
||||||
<view class="stat-info">
|
|
||||||
<text class="stat-value">¥{{ stats.actualAmount || 0 }}</text>
|
|
||||||
<text class="stat-label">今日销售额</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="stat-item">
|
|
||||||
<view class="stat-icon alert-icon">
|
|
||||||
<Icon name="alert" :size="40" color="#ff4d4f" />
|
|
||||||
</view>
|
|
||||||
<view class="stat-info">
|
|
||||||
<text class="stat-value">{{ stats.stockAlerts || 0 }}</text>
|
|
||||||
<text class="stat-label">库存预警</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 功能菜单 -->
|
<!-- 订单相关 -->
|
||||||
<view class="menu-section">
|
<view class="menu-section">
|
||||||
<!-- 订单相关 -->
|
|
||||||
<text class="section-title">订单</text>
|
<text class="section-title">订单</text>
|
||||||
<view class="menu-grid">
|
<view class="menu-grid">
|
||||||
<!-- 管理员菜单 -->
|
|
||||||
<template v-if="isAdmin">
|
<template v-if="isAdmin">
|
||||||
<view class="menu-card" @click="goTo('/pages/order/create')">
|
<view class="menu-item" @click="goTo('/pages/order/create')">
|
||||||
<Icon name="edit" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #e8f4ff;">
|
||||||
<text class="menu-card-title">创建订单</text>
|
<text style="color: #1890ff;">📝</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">创建订单</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-card" @click="goToTab('/pages/order/list')">
|
<view class="menu-item" @click="goToTab('/pages/order/list')">
|
||||||
<Icon name="order" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #f6ffed;">
|
||||||
<text class="menu-card-title">订单列表</text>
|
<text style="color: #52c41a;">📋</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">订单列表</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-card" @click="goTo('/pages/order/search')">
|
<view class="menu-item" @click="goTo('/pages/order/search')">
|
||||||
<Icon name="search" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #fff7e6;">
|
||||||
<text class="menu-card-title">订单查询</text>
|
<text style="color: #fa8c16;">🔍</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">订单查询</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-card" @click="goTo('/pages/order/return')">
|
<view class="menu-item" @click="goTo('/pages/order/return')">
|
||||||
<Icon name="right" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #fff1f0;">
|
||||||
<text class="menu-card-title">退货</text>
|
<text style="color: #ff4d4f;">↩</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">退货</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- 销售菜单 -->
|
|
||||||
<template v-else-if="isSales">
|
<template v-else-if="isSales">
|
||||||
<view class="menu-card" @click="goTo('/pages/order/create')">
|
<view class="menu-item" @click="goTo('/pages/order/create')">
|
||||||
<Icon name="edit" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #e8f4ff;">
|
||||||
<text class="menu-card-title">创建订单</text>
|
<text style="color: #1890ff;">📝</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">创建订单</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-card" @click="goToTab('/pages/order/list')">
|
<view class="menu-item" @click="goToTab('/pages/order/list')">
|
||||||
<Icon name="order" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #f6ffed;">
|
||||||
<text class="menu-card-title">订单列表</text>
|
<text style="color: #52c41a;">📋</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">订单列表</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- 顾客菜单 -->
|
|
||||||
<template v-else-if="isCustomer">
|
<template v-else-if="isCustomer">
|
||||||
<view class="menu-card" @click="goToTab('/pages/order/list')">
|
<view class="menu-item" @click="goToTab('/pages/order/list')">
|
||||||
<Icon name="order" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #f6ffed;">
|
||||||
<text class="menu-card-title">我的订单</text>
|
<text style="color: #52c41a;">📋</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">我的订单</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 管理相关 -->
|
<!-- 管理相关 -->
|
||||||
<text class="section-title" style="margin-top: 30rpx;">管理</text>
|
<view class="menu-section" v-if="isAdmin || isSales">
|
||||||
|
<text class="section-title">管理</text>
|
||||||
<view class="menu-grid">
|
<view class="menu-grid">
|
||||||
<!-- 管理员菜单 -->
|
|
||||||
<template v-if="isAdmin">
|
<template v-if="isAdmin">
|
||||||
<view class="menu-card" @click="goTo('/pages/product/manage')">
|
<view class="menu-item" @click="goTo('/pages/product/manage')">
|
||||||
<Icon name="product" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #f9f0ff;">
|
||||||
<text class="menu-card-title">商品管理</text>
|
<text style="color: #722ed1;">📦</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">商品管理</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-card" @click="goTo('/pages/category/index')">
|
<view class="menu-item" @click="goTo('/pages/category/index')">
|
||||||
<Icon name="setting" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #fff0f6;">
|
||||||
<text class="menu-card-title">种类管理</text>
|
<text style="color: #eb2f96;">📂</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">种类管理</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-card" @click="goStock()">
|
<view class="menu-item" @click="goStock()">
|
||||||
<Icon name="stock" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #e6f7ff;">
|
||||||
<text class="menu-card-title">库存管理</text>
|
<text style="color: #13c2c2;">🏭</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">库存管理</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-card" @click="goTo('/pages/stock/in')">
|
<view class="menu-item" @click="goTo('/pages/stock/in')">
|
||||||
<Icon name="plus" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #fff7e6;">
|
||||||
<text class="menu-card-title">入库</text>
|
<text style="color: #fa8c16;">➕</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">入库</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-card" @click="goTo('/pages/stock/flow')">
|
<view class="menu-item" @click="goTo('/pages/stock/flow')">
|
||||||
<Icon name="flow" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #f6ffed;">
|
||||||
<text class="menu-card-title">库存流水</text>
|
<text style="color: #52c41a;">📊</text>
|
||||||
|
</view>
|
||||||
|
<text class="menu-text">库存流水</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- 销售菜单 -->
|
|
||||||
<template v-else-if="isSales">
|
<template v-else-if="isSales">
|
||||||
<view class="menu-card" @click="goTo('/pages/product/list')">
|
<view class="menu-item" @click="goTo('/pages/product/list')">
|
||||||
<Icon name="product" :size="36" color="#667eea" />
|
<view class="menu-icon" style="background: #f9f0ff;">
|
||||||
<text class="menu-card-title">商品浏览</text>
|
<text style="color: #722ed1;">📦</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
<text class="menu-text">商品浏览</text>
|
||||||
<!-- 顾客菜单 -->
|
|
||||||
<template v-else-if="isCustomer">
|
|
||||||
<view class="menu-card" @click="goTo('/pages/product/list')">
|
|
||||||
<Icon name="product" :size="36" color="#667eea" />
|
|
||||||
<text class="menu-card-title">商品浏览</text>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<!-- 游客菜单 -->
|
|
||||||
<template v-else-if="isGuest">
|
|
||||||
<view class="guest-card" @click="goTo('/pages/login/index')">
|
|
||||||
<Icon name="user" :size="80" color="#667eea" />
|
|
||||||
<text class="guest-text">点击登录</text>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 提示区域 -->
|
<!-- 商品浏览(顾客) -->
|
||||||
<view class="tips-section" v-if="isCustomer">
|
<view class="menu-section" v-if="isCustomer">
|
||||||
<view class="tip-card">
|
<text class="section-title">商品</text>
|
||||||
<text class="tip-title">温馨提示</text>
|
<view class="menu-grid">
|
||||||
<view class="tip-list">
|
<view class="menu-item" @click="goTo('/pages/product/list')">
|
||||||
<text class="tip-item">• 您可以浏览商品</text>
|
<view class="menu-icon" style="background: #f9f0ff;">
|
||||||
<text class="tip-item">• 您可以查看半年内的订单</text>
|
<text style="color: #722ed1;">📦</text>
|
||||||
<text class="tip-item">• 如需下单,请联系销售人员</text>
|
</view>
|
||||||
|
<text class="menu-text">商品浏览</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="tips-section" v-if="isGuest">
|
<!-- 游客登录 -->
|
||||||
<view class="tip-card">
|
<view class="guest-section" v-if="isGuest">
|
||||||
<text class="tip-title">欢迎使用</text>
|
<view class="guest-card" @click="goTo('/pages/login/index')">
|
||||||
<view class="tip-list">
|
<text class="guest-icon">👤</text>
|
||||||
<text class="tip-item">• 请登录后使用完整功能</text>
|
<text class="guest-text">点击登录</text>
|
||||||
<text class="tip-item">• 登录后可浏览商品和查看订单</text>
|
<text class="guest-hint">登录后可使用更多功能</text>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 退出登录 -->
|
|
||||||
<view class="logout-section" v-if="!isGuest">
|
|
||||||
<button class="logout-btn" @click="logout">
|
|
||||||
<Icon name="logout" :size="32" color="#667eea" style="margin-right: 10rpx" />
|
|
||||||
退出登录
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import authApi from '@/api/auth'
|
import { isAdmin, isSales, isCustomer, isGuest, isLoggedIn, getUsername } from '@/utils/auth'
|
||||||
import orderApi from '@/api/order'
|
|
||||||
import productApi from '@/api/product'
|
|
||||||
import { getRole, isAdmin, isSales, isCustomer as checkIsCustomer, isGuest as checkIsGuest, canManageProduct, canCreateOrder, canViewStats } from '@/utils/auth'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
userInfo: {},
|
username: '',
|
||||||
role: 'guest',
|
greeting: '',
|
||||||
isAdmin: false,
|
|
||||||
isSales: false,
|
|
||||||
isCustomer: false,
|
|
||||||
isGuest: false,
|
|
||||||
stats: {
|
stats: {
|
||||||
orderCount: 0,
|
todayOrders: 0,
|
||||||
actualAmount: 0,
|
todayAmount: '0',
|
||||||
stockAlerts: 0
|
totalCustomers: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
roleText() {
|
isAdmin() { return isAdmin() },
|
||||||
if (this.isAdmin) return '管理员'
|
isSales() { return isSales() },
|
||||||
if (this.isSales) return '销售员'
|
isCustomer() { return isCustomer() },
|
||||||
if (this.isCustomer) return '顾客'
|
isGuest() { return isGuest() },
|
||||||
return '游客'
|
isLoggedIn() { return isLoggedIn() }
|
||||||
},
|
|
||||||
roleClass() {
|
|
||||||
if (this.isAdmin) return 'admin'
|
|
||||||
if (this.isCustomer) return 'customer'
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onShow() {
|
||||||
this.role = getRole()
|
this.username = getUsername() || ''
|
||||||
this.isAdmin = isAdmin()
|
this.setGreeting()
|
||||||
this.isSales = isSales()
|
|
||||||
this.isCustomer = checkIsCustomer()
|
|
||||||
this.isGuest = checkIsGuest()
|
|
||||||
this.loadUserInfo()
|
|
||||||
if (canViewStats()) {
|
|
||||||
this.loadStats()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadUserInfo() {
|
setGreeting() {
|
||||||
const localRole = uni.getStorageSync('role')
|
const hour = new Date().getHours()
|
||||||
if (localRole) {
|
if (hour < 6) this.greeting = '凌晨好'
|
||||||
this.userInfo = {
|
else if (hour < 12) this.greeting = '上午好'
|
||||||
username: localRole === 'admin' ? '管理员' : '顾客',
|
else if (hour < 14) this.greeting = '中午好'
|
||||||
role: localRole
|
else if (hour < 18) this.greeting = '下午好'
|
||||||
}
|
else this.greeting = '晚上好'
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const userInfo = await authApi.getCurrentUser()
|
|
||||||
this.userInfo = userInfo
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async loadStats() {
|
|
||||||
try {
|
|
||||||
const today = new Date().toISOString().split('T')[0]
|
|
||||||
const stats = await orderApi.getStatistics({ startDate: today })
|
|
||||||
this.stats.orderCount = stats.orderCount || 0
|
|
||||||
this.stats.actualAmount = stats.actualAmount || 0
|
|
||||||
const alerts = await productApi.getStockAlerts()
|
|
||||||
this.stats.stockAlerts = alerts ? alerts.length : 0
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
goTo(url) {
|
goTo(url) {
|
||||||
uni.navigateTo({ url })
|
uni.navigateTo({ url })
|
||||||
@@ -258,16 +197,17 @@ export default {
|
|||||||
goStock() {
|
goStock() {
|
||||||
uni.navigateTo({ url: '/pages/stock/list' })
|
uni.navigateTo({ url: '/pages/stock/list' })
|
||||||
},
|
},
|
||||||
async logout() {
|
logout() {
|
||||||
try {
|
uni.showModal({
|
||||||
await authApi.logout()
|
title: '退出登录',
|
||||||
} catch (e) {
|
content: '确定要退出登录吗?',
|
||||||
console.error(e)
|
success: (res) => {
|
||||||
}
|
if (res.confirm) {
|
||||||
uni.removeStorageSync('token')
|
uni.clearStorageSync()
|
||||||
uni.removeStorageSync('userId')
|
uni.reLaunch({ url: '/pages/index/index' })
|
||||||
uni.removeStorageSync('role')
|
}
|
||||||
uni.reLaunch({ url: '/pages/login/index' })
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -276,7 +216,7 @@ export default {
|
|||||||
<style>
|
<style>
|
||||||
.page {
|
.page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #f5f5f5;
|
background: #f7f8fa;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,107 +224,52 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 40rpx 20rpx;
|
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.welcome-section {
|
.user-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.welcome-text {
|
.greeting {
|
||||||
font-size: 28rpx;
|
font-size: 26rpx;
|
||||||
color: rgba(255, 255, 255, 0.8);
|
color: #999;
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.username {
|
.username {
|
||||||
font-size: 48rpx;
|
font-size: 36rpx;
|
||||||
font-weight: bold;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.role-badge {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 12rpx 24rpx;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
background: rgba(255, 255, 255, 0.2);
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.role-badge.admin {
|
|
||||||
background: rgba(255, 215, 0, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.role-badge.customer {
|
|
||||||
background: rgba(255, 255, 255, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.role-text {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #fff;
|
|
||||||
margin-left: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-card {
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-header {
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-title {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-grid {
|
.logout-btn {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
background: #f0f0f0;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-item {
|
.stat-card {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
background: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
.stat-icon {
|
padding: 24rpx;
|
||||||
width: 80rpx;
|
margin: 0 8rpx;
|
||||||
height: 80rpx;
|
text-align: center;
|
||||||
border-radius: 20rpx;
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-right: 16rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-icon {
|
|
||||||
background: #e6f7ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.money-icon {
|
|
||||||
background: #fff7e6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.alert-icon {
|
|
||||||
background: #fff1f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-info {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-value {
|
.stat-value {
|
||||||
|
display: block;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #333;
|
color: #333;
|
||||||
@@ -393,7 +278,7 @@ export default {
|
|||||||
.stat-label {
|
.stat-label {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-top: 4rpx;
|
margin-top: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-section {
|
.menu-section {
|
||||||
@@ -401,183 +286,77 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #fff;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
|
||||||
|
|
||||||
.menu-grid {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 手机端 - 等间距布局 */
|
|
||||||
.menu-grid {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card {
|
|
||||||
width: 18%;
|
|
||||||
aspect-ratio: 1;
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
margin: 8rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 6rpx;
|
|
||||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card:active {
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card-title {
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: #333;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-top: 6rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
.menu-card {
|
|
||||||
width: 15%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card:active {
|
|
||||||
transform: scale(0.98);
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card-icon {
|
|
||||||
width: 50rpx;
|
|
||||||
height: 50rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-bottom: 6rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card-icon.blue {
|
|
||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card-icon.green {
|
|
||||||
background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card-icon.orange {
|
|
||||||
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card-icon.red {
|
|
||||||
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card-icon.purple {
|
|
||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-card-title {
|
|
||||||
color: #333;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-bottom: 8rpx;
|
margin-bottom: 20rpx;
|
||||||
|
padding-left: 10rpx;
|
||||||
|
border-left: 6rpx solid #1890ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-card-desc {
|
.menu-grid {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
gap: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item {
|
||||||
|
width: calc(25% - 15rpx);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 24rpx 10rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-icon {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 40rpx;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-text {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #999;
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.guest-section {
|
||||||
|
margin-top: 100rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guest-card {
|
.guest-card {
|
||||||
width: 100%;
|
background: #fff;
|
||||||
background: rgba(255, 255, 255, 0.2);
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
border-radius: 24rpx;
|
border-radius: 24rpx;
|
||||||
padding: 60rpx;
|
padding: 60rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border: 2rpx dashed rgba(255, 255, 255, 0.5);
|
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
.guest-icon {
|
.guest-icon {
|
||||||
margin-bottom: 20rpx;
|
font-size: 100rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guest-text {
|
.guest-text {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #fff;
|
color: #333;
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.guest-desc {
|
.guest-hint {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: rgba(255, 255, 255, 0.7);
|
color: #999;
|
||||||
}
|
margin-top: 16rpx;
|
||||||
|
|
||||||
.tips-section {
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tip-card {
|
|
||||||
background: rgba(255, 255, 255, 0.2);
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
border-radius: 24rpx;
|
|
||||||
padding: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tip-title {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #fff;
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tip-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tip-item {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: rgba(255, 255, 255, 0.8);
|
|
||||||
line-height: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout-section {
|
|
||||||
padding: 0 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout-btn {
|
|
||||||
width: 100%;
|
|
||||||
background: rgba(255, 255, 255, 0.2);
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
border: 2rpx solid rgba(255, 255, 255, 0.3);
|
|
||||||
border-radius: 50rpx;
|
|
||||||
padding: 24rpx;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout-btn:active {
|
|
||||||
background: rgba(255, 255, 255, 0.3);
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user