This commit is contained in:
lik
2026-06-14 11:46:10 +08:00
parent 894a9881d7
commit f8f7afceb8
14 changed files with 1340 additions and 509 deletions

View File

@@ -3,6 +3,7 @@ const API = require('../../utils/api.js')
Page({
data: {
today: '',
todayCount: 0,
pendingCount: 0,
completedCount: 0,
@@ -10,9 +11,7 @@ Page({
{ icon: '/images/icon_order.png', name: '订单管理', url: '/pages/order/index' },
{ icon: '/images/icon_patient.png', name: '患者管理', url: '/pages/patient/index' },
{ icon: '/images/icon_escort.png', name: '陪诊员管理', url: '/pages/escort/index' },
{ icon: '/images/icon_schedule.png', name: '排班管理', url: '/pages/schedule/index' },
{ icon: '/images/icon_stats.png', name: '数据统计', url: '/pages/stats/index' },
{ icon: '/images/icon_setting.png', name: '系统设置', url: '/pages/setting/index' }
{ icon: '/images/icon_schedule.png', name: '排班管理', url: '/pages/schedule/index' }
],
todayOrders: [],
statusMap: {
@@ -38,6 +37,9 @@ Page({
},
onLoad(options) {
const now = new Date();
const today = now.toISOString().substring(0, 10);
this.setData({ today });
this.getTodayOrders();
this.getStats();
},

View File

@@ -1,3 +1,4 @@
{
"navigationBarTitleText": "暖橙陪诊",
"usingComponents": {}
}

View File

@@ -1,28 +1,44 @@
<!--pages/home/index.wxml-->
<view class="container">
<!-- 顶部统计卡片 -->
<view class="stats-section">
<view class="stats-card">
<text class="stats-num">{{todayCount}}</text>
<text class="stats-label">今日订单</text>
</view>
<view class="stats-card">
<text class="stats-num">{{pendingCount}}</text>
<text class="stats-label">待处理</text>
</view>
<view class="stats-card">
<text class="stats-num">{{completedCount}}</text>
<text class="stats-label">已完成</text>
<view class="page">
<!-- 顶部问候 -->
<view class="header">
<view class="greeting">
<text class="greeting-text">您好,管理员</text>
<text class="greeting-sub">今天是 {{today}}</text>
</view>
</view>
<!-- 功能菜单 -->
<view class="menu-section">
<view class="section-title">功能菜单</view>
<!-- 数据统计 -->
<view class="stats-container">
<view class="stats-grid">
<view class="stat-card">
<view class="stat-value">{{todayCount}}</view>
<view class="stat-label">新增用户</view>
</view>
<view class="stat-card">
<view class="stat-value">{{todayCount}}</view>
<view class="stat-label">新增预约</view>
</view>
<view class="stat-card">
<view class="stat-value">{{pendingCount}}</view>
<view class="stat-label">待处理</view>
</view>
<view class="stat-card">
<view class="stat-value">{{completedCount}}</view>
<view class="stat-label">已完成</view>
</view>
</view>
</view>
<!-- 功能入口 -->
<view class="section">
<view class="section-header">
<text class="section-title">快捷入口</text>
</view>
<view class="menu-grid">
<view class="menu-item" wx:for="{{menuList}}" wx:key="index" bindtap="navigateTo" data-url="{{item.url}}">
<view class="menu-icon">
<text class="icon-text">{{item.name[0]}}</text>
<view class="menu-card" wx:for="{{menuList}}" wx:key="index" bindtap="navigateTo" data-url="{{item.url}}">
<view class="menu-icon-wrap">
<text class="menu-icon-text">{{item.name[0]}}</text>
</view>
<text class="menu-name">{{item.name}}</text>
</view>
@@ -30,40 +46,52 @@
</view>
<!-- 今日订单 -->
<view class="order-section">
<view class="section">
<view class="section-header">
<text class="section-title">今日订单</text>
<text class="view-all" bindtap="viewAllOrders">查看全部 ></text>
<view class="view-all" bindtap="viewAllOrders">
<text>全部</text>
<text class="arrow">→</text>
</view>
</view>
<view class="order-list">
<view class="order-item" wx:for="{{todayOrders}}" wx:key="_id">
<view class="order-header">
<text class="order-id">{{item._id}}</text>
<text class="order-status status-{{item.status}}">{{statusMap[item.status] || item.status}}</text>
<view class="order-list" wx:if="{{todayOrders.length > 0}}">
<view class="order-card" wx:for="{{todayOrders}}" wx:key="_id">
<view class="order-top">
<text class="order-no">#{{item._id}}</text>
<view class="status-tag status-{{item.status}}">
<text>{{statusMap[item.status] || item.status}}</text>
</view>
</view>
<view class="order-info">
<view class="info-row">
<text class="info-label">患者</text>
<text class="info-value">{{item.patient.name}}</text>
<view class="order-body">
<view class="order-row">
<text class="row-label">患者</text>
<text class="row-value">{{item.patient.name}}</text>
</view>
<view class="info-row">
<text class="info-label">医院</text>
<text class="info-value">{{item.hospital.name}} · {{item.hospital.department}}</text>
<view class="order-row">
<text class="row-label">医院</text>
<text class="row-value">{{item.hospital.name}} · {{item.hospital.department}}</text>
</view>
<view class="info-row">
<text class="info-label">时间</text>
<text class="info-value">{{item.schedule.date}}</text>
<view class="order-row">
<text class="row-label">时间</text>
<text class="row-value">{{item.schedule.date}}</text>
</view>
<view class="info-row">
<text class="info-label">服务</text>
<text class="info-value">{{item.escort.serviceName}}</text>
</view>
<view class="info-row">
<text class="info-label">费用</text>
<text class="info-value fee-value">¥{{item.payment.totalFee}}</text>
<view class="order-row">
<text class="row-label">服务</text>
<text class="row-value">{{item.escort.serviceName}}</text>
</view>
</view>
<view class="order-footer">
<text class="fee-label">服务费用</text>
<text class="fee-value">¥{{item.payment.totalFee}}</text>
</view>
</view>
</view>
<view class="empty-state" wx:else>
<text class="empty-text">暂无今日订单</text>
</view>
</view>
</view>

View File

@@ -1,106 +1,106 @@
/* pages/home/index.wxss */
.container {
padding: 20rpx;
background-color: #f5f6fa;
.page {
min-height: 100vh;
background: #f7f8fc;
padding-bottom: 40rpx;
}
/* 统计卡片 */
.stats-section {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
/* === 顶部问候 === */
.header {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
padding: 60rpx 40rpx 80rpx;
position: relative;
overflow: hidden;
}
.stats-card {
flex: 1;
background: #fff;
border-radius: 16rpx;
padding: 30rpx 0;
margin: 0 10rpx;
text-align: center;
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
.header::after {
content: '';
position: absolute;
top: -60rpx;
right: -40rpx;
width: 280rpx;
height: 280rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.03);
}
.stats-card:first-child {
margin-left: 0;
.header::before {
content: '';
position: absolute;
bottom: -100rpx;
right: 80rpx;
width: 200rpx;
height: 200rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.02);
}
.stats-card:last-child {
margin-right: 0;
.greeting {
position: relative;
z-index: 1;
}
.stats-num {
.greeting-text {
display: block;
font-size: 48rpx;
font-weight: 600;
color: #2c3e50;
margin-bottom: 8rpx;
}
.stats-label {
display: block;
font-size: 26rpx;
color: #7f8c8d;
}
/* 功能菜单 */
.menu-section {
background: #fff;
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
}
.section-title {
font-size: 32rpx;
font-weight: 600;
color: #2c3e50;
margin-bottom: 24rpx;
}
.menu-grid {
display: flex;
flex-wrap: wrap;
}
.menu-item {
width: 25%;
display: flex;
flex-direction: column;
align-items: center;
padding: 20rpx 0;
}
.menu-icon {
width: 88rpx;
height: 88rpx;
background: #e8f4fd;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 44rpx;
font-weight: 700;
color: #ffffff;
letter-spacing: 2rpx;
margin-bottom: 12rpx;
}
.icon-text {
font-size: 36rpx;
color: #3498db;
font-weight: 600;
}
.menu-name {
.greeting-sub {
display: block;
font-size: 26rpx;
color: #555;
color: rgba(255, 255, 255, 0.5);
font-weight: 300;
letter-spacing: 1rpx;
}
/* 今日订单 */
.order-section {
background: #fff;
border-radius: 16rpx;
padding: 30rpx;
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
/* === 数据统计 === */
.stats-container {
margin: -40rpx 30rpx 0;
position: relative;
z-index: 2;
}
.stats-grid {
display: flex;
gap: 16rpx;
}
.stat-card {
flex: 1;
background: #ffffff;
border-radius: 20rpx;
padding: 28rpx 16rpx;
text-align: center;
box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.06);
transition: transform 0.2s;
}
.stat-value {
display: block;
font-size: 48rpx;
font-weight: 700;
color: #1a1a2e;
line-height: 1.2;
margin-bottom: 8rpx;
font-family: 'DIN Alternate', 'Helvetica Neue', sans-serif;
}
.stat-label {
display: block;
font-size: 22rpx;
color: #a0a3bd;
font-weight: 400;
letter-spacing: 1rpx;
}
/* === 通用 Section === */
.section {
margin: 32rpx 30rpx 0;
}
.section-header {
@@ -110,99 +110,183 @@
margin-bottom: 24rpx;
}
.section-header .section-title {
margin-bottom: 0;
.section-title {
font-size: 32rpx;
font-weight: 700;
color: #1a1a2e;
letter-spacing: 1rpx;
}
.view-all {
font-size: 26rpx;
color: #3498db;
display: flex;
align-items: center;
gap: 6rpx;
font-size: 24rpx;
color: #a0a3bd;
}
.view-all .arrow {
font-size: 28rpx;
color: #a0a3bd;
}
/* === 功能菜单 === */
.menu-grid {
display: flex;
gap: 16rpx;
}
.menu-card {
flex: 1;
background: #ffffff;
border-radius: 20rpx;
padding: 32rpx 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 16rpx;
box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.04);
}
.menu-icon-wrap {
width: 80rpx;
height: 80rpx;
border-radius: 20rpx;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
}
.menu-icon-text {
font-size: 32rpx;
font-weight: 700;
color: #ffffff;
}
.menu-name {
font-size: 24rpx;
color: #5a5d7a;
font-weight: 500;
}
/* === 订单列表 === */
.order-list {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.order-item {
background: #f8f9fa;
border-radius: 12rpx;
padding: 24rpx;
.order-card {
background: #ffffff;
border-radius: 20rpx;
padding: 28rpx 32rpx;
box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.04);
}
.order-header {
.order-top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
padding-bottom: 20rpx;
border-bottom: 1rpx solid #f0f1f5;
}
.order-id {
font-size: 26rpx;
color: #7f8c8d;
}
.order-status {
.order-no {
font-size: 24rpx;
padding: 4rpx 16rpx;
border-radius: 8rpx;
color: #a0a3bd;
font-weight: 500;
font-family: 'DIN Alternate', 'Helvetica Neue', monospace;
}
.status-tag {
font-size: 22rpx;
padding: 6rpx 20rpx;
border-radius: 30rpx;
font-weight: 500;
}
.status-pending {
background: #fff3e0;
color: #f39c12;
}
.status-in_progress {
background: #e8f5e9;
color: #27ae60;
background: #fff8e6;
color: #e6a23c;
}
.status-confirmed {
background: #e3f2fd;
color: #2980b9;
background: #ecf5ff;
color: #409eff;
}
.status-pending {
background: #fff3e0;
color: #f39c12;
.status-in_progress {
background: #f0f9eb;
color: #67c23a;
}
.status-completed {
background: #f3e5f5;
color: #8e44ad;
background: #f4f0ff;
color: #7c5cfc;
}
.status-cancelled {
background: #fafafa;
color: #95a5a6;
background: #f5f5f5;
color: #b0b0b0;
}
.order-info {
.order-body {
padding: 20rpx 0;
display: flex;
flex-direction: column;
gap: 10rpx;
gap: 14rpx;
}
.info-row {
.order-row {
display: flex;
align-items: center;
align-items: baseline;
}
.info-label {
font-size: 26rpx;
color: #95a5a6;
width: 80rpx;
.row-label {
font-size: 24rpx;
color: #a0a3bd;
width: 72rpx;
flex-shrink: 0;
}
.info-value {
font-size: 28rpx;
color: #2c3e50;
.row-value {
font-size: 26rpx;
color: #3a3d5c;
flex: 1;
}
.order-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 20rpx;
border-top: 1rpx solid #f0f1f5;
}
.fee-label {
font-size: 24rpx;
color: #a0a3bd;
}
.fee-value {
color: #e74c3c;
font-weight: 600;
font-size: 34rpx;
font-weight: 700;
color: #1a1a2e;
font-family: 'DIN Alternate', 'Helvetica Neue', sans-serif;
}
/* === 空状态 === */
.empty-state {
background: #ffffff;
border-radius: 20rpx;
padding: 80rpx 0;
text-align: center;
box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.04);
}
.empty-text {
font-size: 28rpx;
color: #c0c3d4;
font-weight: 400;
}