From f8f7afceb8bc2d2c21031e44ba08cd83a49b6783 Mon Sep 17 00:00:00 2001 From: lik Date: Sun, 14 Jun 2026 11:46:10 +0800 Subject: [PATCH] tmp --- app.json | 3 +- pages/home/index.js | 8 +- pages/home/index.json | 1 + pages/home/index.wxml | 116 +++++---- pages/home/index.wxss | 346 ++++++++++++++++---------- pages/order/index.js | 5 +- pages/order/index.less | 457 +++++++++++++++++------------------ pages/order/index.wxml | 159 ++++++------ pages/order/orderDetail.js | 232 ++++++++++++++++++ pages/order/orderDetail.json | 6 + pages/order/orderDetail.wxml | 202 ++++++++++++++++ pages/order/orderDetail.wxss | 309 +++++++++++++++++++++++ project.private.config.json | 2 +- utils/request.js | 3 +- 14 files changed, 1340 insertions(+), 509 deletions(-) create mode 100644 pages/order/orderDetail.js create mode 100644 pages/order/orderDetail.json create mode 100644 pages/order/orderDetail.wxml create mode 100644 pages/order/orderDetail.wxss diff --git a/app.json b/app.json index 2926284..fb712ff 100644 --- a/app.json +++ b/app.json @@ -4,7 +4,8 @@ "pages/ai/index", "pages/set/index", "pages/order/index", - "pages/customer/index" + "pages/customer/index", + "pages/order/orderDetail" ], "usingComponents": { "t-toast": "tdesign-miniprogram/toast/toast" diff --git a/pages/home/index.js b/pages/home/index.js index 100bf40..a74f882 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -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(); }, diff --git a/pages/home/index.json b/pages/home/index.json index 8835af0..63ea1ed 100644 --- a/pages/home/index.json +++ b/pages/home/index.json @@ -1,3 +1,4 @@ { + "navigationBarTitleText": "暖橙陪诊", "usingComponents": {} } \ No newline at end of file diff --git a/pages/home/index.wxml b/pages/home/index.wxml index f3d6db3..71b9edb 100644 --- a/pages/home/index.wxml +++ b/pages/home/index.wxml @@ -1,28 +1,44 @@ - - - - - {{todayCount}} - 今日订单 - - - {{pendingCount}} - 待处理 - - - {{completedCount}} - 已完成 + + + + + 您好,管理员 + 今天是 {{today}} - - - 功能菜单 + + + + + {{todayCount}} + 新增用户 + + + {{todayCount}} + 新增预约 + + + {{pendingCount}} + 待处理 + + + {{completedCount}} + 已完成 + + + + + + + + 快捷入口 + - - - {{item.name[0]}} + + + {{item.name[0]}} {{item.name}} @@ -30,40 +46,52 @@ - + 今日订单 - 查看全部 > + + 全部 + + - - - - {{item._id}} - {{statusMap[item.status] || item.status}} + + + + + #{{item._id}} + + {{statusMap[item.status] || item.status}} + - - - 患者 - {{item.patient.name}} + + + + 患者 + {{item.patient.name}} - - 医院 - {{item.hospital.name}} · {{item.hospital.department}} + + 医院 + {{item.hospital.name}} · {{item.hospital.department}} - - 时间 - {{item.schedule.date}} + + 时间 + {{item.schedule.date}} - - 服务 - {{item.escort.serviceName}} - - - 费用 - ¥{{item.payment.totalFee}} + + 服务 + {{item.escort.serviceName}} + + + 服务费用 + ¥{{item.payment.totalFee}} + + + + 暂无今日订单 + diff --git a/pages/home/index.wxss b/pages/home/index.wxss index 0b4bd9c..885b1c5 100644 --- a/pages/home/index.wxss +++ b/pages/home/index.wxss @@ -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; } diff --git a/pages/order/index.js b/pages/order/index.js index dfea30d..1367678 100644 --- a/pages/order/index.js +++ b/pages/order/index.js @@ -152,6 +152,7 @@ Page({ return orders.map(order => ({ ...order, statusText: STATUS_MAP[order.status]?.text || order.status, + patientFirstChar: (order.patient?.name || '?')[0], schedule: { ...order.schedule, dateText: this.formatDate(order.schedule?.date) @@ -250,7 +251,7 @@ Page({ onOrderDetail(e) { const id = e.currentTarget.dataset.id; wx.navigateTo({ - url: `/pages/order/detail?id=${id}` + url: `/pages/order/orderDetail?id=${id}` }); }, @@ -275,7 +276,7 @@ Page({ if (action === 'detail') { wx.navigateTo({ - url: `/pages/order/detail?id=${id}` + url: `/pages/order/orderDetail?id=${id}` }); return; } diff --git a/pages/order/index.less b/pages/order/index.less index 01b8e48..113e144 100644 --- a/pages/order/index.less +++ b/pages/order/index.less @@ -1,42 +1,88 @@ /* pages/order/index.less */ -// 颜色变量 - 参考图浅色社交风格 -@bg-primary: #f5f6fa; -@bg-secondary: #ffffff; -@bg-card: #ffffff; -@accent-primary: #4c6ef5; -@accent-secondary: #6b7aff; -@accent-gradient-start: #4c6ef5; -@accent-gradient-end: #748ffc; -@text-primary: #1a1a2e; -@text-secondary: #6b7280; -@text-muted: #9ca3af; -@border-color: #e5e7eb; -@status-pending: #f59f00; -@status-confirmed: #4c6ef5; -@status-in-progress: #20c997; -@status-completed: #51cf66; -@status-cancelled: #ff6b6b; -@divider-color: #f3f4f6; +@bg: #f7f8fc; +@card: #ffffff; +@dark: #1a1a2e; +@text: #3a3d5c; +@muted: #a0a3bd; +@border: #f0f1f5; +@accent: #667eea; +@accent-end: #764ba2; + +@pending: #e6a23c; +@confirmed: #409eff; +@in-progress: #67c23a; +@completed: #7c5cfc; +@cancelled: #b0b0b0; page { - background-color: @bg-primary; - color: @text-primary; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; + background-color: @bg; } -.order-page { +.page { + min-height: 100vh; display: flex; flex-direction: column; - height: 100vh; - background-color: @bg-primary; + background: @bg; } -// ========== 筛选区域 ========== -.filter-section { +/* === 顶部 === */ +.header { + background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); + padding: 60rpx 40rpx 70rpx; + position: relative; + overflow: hidden; + + &::after { + content: ''; + position: absolute; + top: -80rpx; + right: -60rpx; + width: 280rpx; + height: 280rpx; + border-radius: 50%; + background: rgba(255, 255, 255, 0.03); + } + + &::before { + content: ''; + position: absolute; + bottom: -120rpx; + left: -80rpx; + width: 200rpx; + height: 200rpx; + border-radius: 50%; + background: rgba(255, 255, 255, 0.02); + } +} + +.header-content { + position: relative; + z-index: 1; +} + +.header-title { + display: block; + font-size: 44rpx; + font-weight: 700; + color: #fff; + letter-spacing: 2rpx; + margin-bottom: 12rpx; +} + +.header-sub { + display: block; + font-size: 26rpx; + color: rgba(255, 255, 255, 0.5); + font-weight: 300; + letter-spacing: 1rpx; +} + +/* === 筛选栏 === */ +.filter-bar { + background: @card; padding: 20rpx 0; - background-color: @bg-secondary; - border-bottom: 1rpx solid @border-color; + border-bottom: 1rpx solid @border; } .filter-scroll { @@ -46,69 +92,61 @@ page { .filter-list { display: inline-flex; padding: 0 24rpx; - gap: 20rpx; + gap: 16rpx; } -.filter-item { +.filter-tag { display: inline-flex; align-items: center; - padding: 16rpx 32rpx; - background-color: @bg-primary; - border-radius: 32rpx; - border: 1rpx solid @border-color; - transition: all 0.3s ease; + padding: 12rpx 28rpx; + background: @bg; + border-radius: 28rpx; + font-size: 24rpx; + color: @muted; + border: 1rpx solid transparent; + transition: all 0.25s; &.active { - background: linear-gradient(135deg, @accent-gradient-start, @accent-gradient-end); + background: linear-gradient(135deg, @accent, @accent-end); + color: #fff; border-color: transparent; - box-shadow: 0 4rpx 16rpx rgba(76, 110, 245, 0.25); + box-shadow: 0 4rpx 16rpx rgba(102, 126, 234, 0.3); - .filter-text { - color: #ffffff; - font-weight: 600; - } - - .filter-badge { - background-color: #ffffff; - color: @accent-primary; + .filter-count { + background: rgba(255, 255, 255, 0.25); + color: #fff; } } } -.filter-text { - font-size: 26rpx; - color: @text-secondary; - line-height: 1; -} - -.filter-badge { - display: inline-flex; - align-items: center; - justify-content: center; +.filter-count { min-width: 32rpx; height: 32rpx; padding: 0 8rpx; margin-left: 8rpx; - background-color: @status-cancelled; + background: rgba(0, 0, 0, 0.06); border-radius: 16rpx; font-size: 20rpx; - color: #ffffff; + color: @muted; + display: inline-flex; + align-items: center; + justify-content: center; font-weight: 600; } -// ========== 订单列表区域 ========== -.order-list { +/* === 列表区域 === */ +.list-area { flex: 1; overflow: hidden; } -.order-scroll { +.list-scroll { height: 100%; padding: 0 24rpx; } -.loading-container, -.empty-container { +.loading-box, +.empty-box { display: flex; align-items: center; justify-content: center; @@ -116,239 +154,197 @@ page { } .loading-text { - color: @text-secondary !important; + color: @muted !important; font-size: 26rpx !important; } .empty-text { - color: @text-secondary !important; + color: @muted !important; font-size: 28rpx !important; } -.empty-action { - margin-top: 30rpx; - padding: 16rpx 48rpx; - background: linear-gradient(135deg, @accent-gradient-start, @accent-gradient-end); - color: #ffffff; - font-size: 28rpx; - border-radius: 32rpx; +.empty-btn { + margin-top: 24rpx; + padding: 14rpx 48rpx; + background: linear-gradient(135deg, @accent, @accent-end); + color: #fff; + font-size: 26rpx; + border-radius: 28rpx; display: inline-block; } -// ========== 订单卡片 ========== -.order-cards { +/* === 订单卡片 === */ +.card-list { padding: 24rpx 0 40rpx; } .order-card { - margin-bottom: 24rpx; - background-color: @bg-card; - border-radius: 24rpx; - border: 1rpx solid @border-color; - box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04); + margin-bottom: 20rpx; + background: @card; + border-radius: 20rpx; + box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.04); overflow: hidden; - transition: transform 0.2s ease, box-shadow 0.2s ease; &:active { - transform: scale(0.98); - box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08); + opacity: 0.92; } } -.card-header { +.card-top { display: flex; + justify-content: flex-end; align-items: center; - justify-content: space-between; - padding: 28rpx 28rpx 20rpx; + padding: 20rpx 28rpx 0; } -.order-id { - display: flex; - align-items: center; - gap: 10rpx; -} - -.order-id-text { +.order-no { font-size: 24rpx; - color: @text-muted; + color: @muted; + font-weight: 500; + font-family: 'DIN Alternate', 'Helvetica Neue', monospace; +} + +.status-badge { + font-size: 22rpx; + padding: 6rpx 20rpx; + border-radius: 24rpx; font-weight: 500; } -.status-tag { - display: inline-flex; - align-items: center; - padding: 8rpx 18rpx; - border-radius: 20rpx; - font-size: 22rpx; - font-weight: 600; - - &.pending { - background-color: rgba(245, 159, 0, 0.1); - color: @status-pending; - } - - &.confirmed { - background-color: rgba(76, 110, 245, 0.1); - color: @accent-primary; - } - - &.in_progress { - background-color: rgba(32, 201, 151, 0.1); - color: @status-in-progress; - } - - &.completed { - background-color: rgba(81, 207, 102, 0.1); - color: @status-completed; - } - - &.cancelled { - background-color: rgba(255, 107, 107, 0.1); - color: @status-cancelled; - } +.status-pending { + background: #fff8e6; + color: @pending; } -// ========== 卡片主体 ========== -.card-body { +.status-confirmed { + background: #ecf5ff; + color: @confirmed; +} + +.status-in_progress { + background: #f0f9eb; + color: @in-progress; +} + +.status-completed { + background: #f4f0ff; + color: @completed; +} + +.status-cancelled { + background: #f5f5f5; + color: @cancelled; +} + +/* === 卡片主体 === */ +.card-main { padding: 0 28rpx; } -.patient-row { - margin-bottom: 20rpx; -} - -.patient-info { +.patient-line { display: flex; align-items: center; - gap: 24rpx; + gap: 20rpx; + margin-bottom: 16rpx; } .patient-avatar { - width: 80rpx; - height: 80rpx; - background: linear-gradient(135deg, @accent-gradient-start, @accent-gradient-end); + width: 72rpx; + height: 72rpx; border-radius: 50%; + background: linear-gradient(135deg, @accent, @accent-end); display: flex; align-items: center; justify-content: center; flex-shrink: 0; - box-shadow: 0 4rpx 12rpx rgba(76, 110, 245, 0.25); } -.avatar-text { - font-size: 30rpx; - font-weight: 600; - color: #ffffff; +.avatar-char { + font-size: 28rpx; + font-weight: 700; + color: #fff; } -.patient-detail { +.patient-meta { flex: 1; - display: flex; - flex-direction: column; - gap: 8rpx; } .patient-name-row { display: flex; align-items: center; - gap: 14rpx; + gap: 12rpx; + margin-bottom: 4rpx; } .patient-name { - font-size: 32rpx; + font-size: 30rpx; font-weight: 600; - color: @text-primary; + color: @dark; } -.patient-gender { - font-size: 22rpx; - padding: 4rpx 12rpx; - border-radius: 10rpx; - background-color: rgba(76, 110, 245, 0.1); - color: @accent-primary; +.patient-sex { + font-size: 20rpx; + padding: 2rpx 10rpx; + border-radius: 8rpx; font-weight: 500; &.male { - background-color: rgba(76, 110, 245, 0.1); - color: @accent-primary; + background: rgba(102, 126, 234, 0.1); + color: @accent; } &.female { - background-color: rgba(255, 107, 107, 0.1); - color: @status-cancelled; + background: rgba(234, 102, 150, 0.1); + color: #ea6696; } } .patient-age { - font-size: 24rpx; - color: @text-secondary; - font-weight: 500; + font-size: 22rpx; + color: @muted; } .patient-phone { font-size: 24rpx; - color: @text-muted; + color: @muted; } -.info-divider { +.divider { height: 1rpx; - background-color: @divider-color; - margin: 20rpx 0; + background: @border; + margin: 16rpx 0; } -.info-item { +.info-line { display: flex; - align-items: flex-start; - gap: 14rpx; - margin-bottom: 14rpx; + align-items: baseline; + margin-bottom: 12rpx; } -.info-content { - display: flex; - flex-direction: column; - gap: 6rpx; -} - -.hospital-name { - font-size: 28rpx; - color: @text-primary; - font-weight: 500; -} - -.department-name { +.line-label { font-size: 24rpx; - color: @text-secondary; + color: @muted; + width: 64rpx; + flex-shrink: 0; } -.service-name { +.line-value { font-size: 26rpx; - color: @text-secondary; - font-weight: 500; + color: @text; + flex: 1; } -.time-text { - font-size: 26rpx; - color: @text-secondary; - font-weight: 500; -} - -.attendant-name { - font-size: 26rpx; - color: @text-secondary; - font-weight: 500; -} - -// ========== 卡片底部 ========== -.card-footer { +/* === 卡片底部 === */ +.card-bottom { display: flex; - align-items: center; justify-content: space-between; - padding: 24rpx 28rpx 28rpx; - margin-top: 12rpx; - border-top: 1rpx solid @divider-color; + align-items: center; + padding: 20rpx 28rpx 24rpx; + margin-top: 8rpx; + border-top: 1rpx solid @border; } -.fee-section { +.fee-area { display: flex; align-items: baseline; gap: 8rpx; @@ -356,61 +352,54 @@ page { .fee-label { font-size: 24rpx; - color: @text-muted; + color: @muted; } -.fee-value { - font-size: 38rpx; +.fee-amount { + font-size: 36rpx; font-weight: 700; - color: @status-pending; + color: @dark; + font-family: 'DIN Alternate', 'Helvetica Neue', sans-serif; } -.action-buttons { +.action-area { display: flex; - gap: 16rpx; + gap: 14rpx; } -.btn { - display: inline-flex; - align-items: center; - justify-content: center; - padding: 16rpx 36rpx; - border-radius: 28rpx; - font-size: 26rpx; +.action-btn { + padding: 14rpx 32rpx; + border-radius: 24rpx; + font-size: 24rpx; font-weight: 500; - transition: all 0.2s ease; + transition: all 0.2s; &:active { transform: scale(0.95); - opacity: 0.9; } } -.btn-primary { - background: linear-gradient(135deg, @accent-gradient-start, @accent-gradient-end); - color: #ffffff; - box-shadow: 0 4rpx 16rpx rgba(76, 110, 245, 0.25); +.btn-solid { + background: linear-gradient(135deg, @accent, @accent-end); + color: #fff; + box-shadow: 0 4rpx 16rpx rgba(102, 126, 234, 0.25); } -.btn-secondary { - background-color: @bg-primary; - color: @text-secondary; - border: 1rpx solid @border-color; - - &:active { - background-color: rgba(76, 110, 245, 0.05); - } +.btn-ghost { + background: @bg; + color: @muted; + border: 1rpx solid @border; } -// ========== 加载更多 ========== +/* === 加载更多 === */ .load-more { display: flex; align-items: center; justify-content: center; - padding: 40rpx 20rpx; + padding: 32rpx 20rpx; } .no-more { font-size: 24rpx; - color: @text-muted; + color: @muted; } diff --git a/pages/order/index.wxml b/pages/order/index.wxml index 252a65b..e06ebe4 100644 --- a/pages/order/index.wxml +++ b/pages/order/index.wxml @@ -1,166 +1,143 @@ - + + + + + 订单管理 + 共 {{stats.total}} 个订单 + + - - + + - - {{item.label}} - {{item.count}} + {{item.label}} + {{item.count}} - - + - + - - + + - 刷新试试 + 刷新 - - - + + - - - - 订单 {{item.orderNo || item._id}} - - + + {{item.statusText}} - - - - - {{item.patient.name ? item.patient.name[0] : '患'}} - - - - {{item.patient.name || '未知患者'}} - {{item.patient.sex === 'male' ? '男' : item.patient.sex === 'female' ? '女' : '未知'}} - {{item.patient.age}}岁 - - {{item.patient.mobile || '暂无电话'}} + + + + {{item.patientFirstChar}} + + + + {{item.patient.name || '未知患者'}} + {{item.patient.sex === 'male' ? '男' : item.patient.sex === 'female' ? '女' : ''}} + {{item.patient.age}}岁 + {{item.patient.mobile || '暂无电话'}} - + - - - - - - {{item.hospital.name || '未知医院'}} - {{item.hospital.department}} - - + + + 医院 + {{item.hospital.name || '未知医院'}}{{item.hospital.department ? ' · ' + item.hospital.department : ''}} - - - - - - {{item.escort.serviceName}} - + + 服务 + {{item.escort.serviceName}} - - - - - - {{item.schedule.dateText}} {{item.schedule.startTime || ''}} - + + 时间 + {{item.schedule.dateText}} {{item.schedule.startTime || ''}} - - - - - - 陪诊员:{{item.attendant.name}} - + + 陪诊 + {{item.attendant.name}} - - - 服务费用 - ¥{{item.payment.totalFee || 0}} + + + 费用 + ¥{{item.payment.totalFee || 0}} - - + 取消 - 确认 - 开始服务 - 完成 - 查看详情 diff --git a/pages/order/orderDetail.js b/pages/order/orderDetail.js new file mode 100644 index 0000000..88b7359 --- /dev/null +++ b/pages/order/orderDetail.js @@ -0,0 +1,232 @@ +// pages/order/orderDetail.js +const API = require('../../utils/api.js') + +const STATUS_MAP = { + pending: '待确认', + confirmed: '已确认', + in_progress: '进行中', + completed: '已完成', + cancelled: '已取消' +} + +const STATUS_DESC_MAP = { + pending: '订单已创建,等待确认', + confirmed: '订单已确认,等待服务', + in_progress: '陪诊服务正在进行', + completed: '陪诊服务已完成', + cancelled: '订单已取消' +} + +const PAYMENT_STATUS_MAP = { + unpaid: '未支付', + partial: '部分支付', + paid: '已支付', + refunded: '已退款' +} + +function formatDate(timestamp) { + if (!timestamp) return '' + const date = new Date(timestamp) + const y = date.getFullYear() + const m = String(date.getMonth() + 1).padStart(2, '0') + const d = String(date.getDate()).padStart(2, '0') + return y + '-' + m + '-' + d +} + +function formatTime(timestamp) { + if (!timestamp) return '' + const date = new Date(timestamp) + const h = String(date.getHours()).padStart(2, '0') + const min = String(date.getMinutes()).padStart(2, '0') + return h + ':' + min +} + +function formatDateTime(timestamp) { + if (!timestamp) return '' + return formatDate(timestamp) + ' ' + formatTime(timestamp) +} + +Page({ + data: { + orderId: '', + loaded: false, + // 订单数据 + order: null, + // 格式化后的显示字段 + statusText: '', + statusDesc: '', + patientFirstChar: '', + attendantFirstChar: '', + scheduleDateText: '', + scheduleStartTimeText: '', + scheduleEndTimeText: '', + createtimeText: '', + updatetimeText: '', + paymentStatusText: '', + patientSexText: '', + attendantSexText: '', + sexRequirementText: '', + // 操作按钮配置 + showConfirmBtn: false, + showCancelBtn: false, + showStartBtn: false, + showCompleteBtn: false + }, + + onLoad(options) { + const id = options.id || '' + this.setData({ orderId: id }) + if (id) { + this.loadOrderDetail(id) + } + }, + + onPullDownRefresh() { + if (this.data.orderId) { + this.loadOrderDetail(this.data.orderId).then(() => { + wx.stopPullDownRefresh() + }) + } else { + wx.stopPullDownRefresh() + } + }, + + async loadOrderDetail(id) { + wx.showLoading({ title: '加载中...' }) + try { + const res = await API.escort.getRecordById(id) + wx.hideLoading() + + if (res.code !== 0) { + wx.showToast({ title: res.message || '加载失败', icon: 'none' }) + return + } + + const order = res.data || {} + this.applyOrderData(order) + } catch (err) { + wx.hideLoading() + console.error('加载订单详情失败', err) + wx.showToast({ title: '网络错误', icon: 'none' }) + } + }, + + applyOrderData(order) { + const status = order.status || 'pending' + const patient = order.patient || {} + const attendant = order.attendant || {} + const schedule = order.schedule || {} + const payment = order.payment || {} + const escort = order.escort || {} + const meta = order.meta || {} + + this.setData({ + loaded: true, + order: order, + statusText: STATUS_MAP[status] || status, + statusDesc: STATUS_DESC_MAP[status] || '', + patientFirstChar: (patient.name || '?')[0], + attendantFirstChar: (attendant.name || '?')[0], + scheduleDateText: formatDate(schedule.date), + scheduleStartTimeText: schedule.startTime || '', + scheduleEndTimeText: schedule.endTime || '', + createtimeText: formatDateTime(meta.createtime), + updatetimeText: formatDateTime(meta.updatetime), + paymentStatusText: PAYMENT_STATUS_MAP[payment.status] || payment.status || '未支付', + patientSexText: patient.sex === 'male' ? '男' : patient.sex === 'female' ? '女' : '', + attendantSexText: attendant.sex === 'male' ? '男' : attendant.sex === 'female' ? '女' : '', + sexRequirementText: escort.sexRequirement === 'male' ? '要求男陪诊' : escort.sexRequirement === 'female' ? '要求女陪诊' : '不限', + // 操作按钮 + showConfirmBtn: status === 'pending', + showCancelBtn: status === 'pending', + showStartBtn: status === 'confirmed', + showCompleteBtn: status === 'in_progress' + }) + }, + + // 拨打电话 + callPhone(e) { + const phone = e.currentTarget.dataset.phone + if (!phone) { + wx.showToast({ title: '暂无电话', icon: 'none' }) + return + } + wx.makePhoneCall({ phoneNumber: phone }) + }, + + // 确认订单 + onConfirm() { + wx.showModal({ + title: '确认订单', + content: '确认接受此订单?', + confirmColor: '#4c6ef5', + success: (res) => { + if (res.confirm) { + this.updateStatus('confirmed') + } + } + }) + }, + + // 取消订单 + onCancel() { + wx.showModal({ + title: '取消订单', + content: '确定要取消此订单?', + confirmColor: '#ff6b6b', + success: (res) => { + if (res.confirm) { + this.updateStatus('cancelled') + } + } + }) + }, + + // 开始服务 + onStart() { + wx.showModal({ + title: '开始服务', + content: '确认开始陪诊服务?', + confirmColor: '#4c6ef5', + success: (res) => { + if (res.confirm) { + this.updateStatus('in_progress') + } + } + }) + }, + + // 完成服务 + onComplete() { + wx.showModal({ + title: '完成服务', + content: '确认陪诊服务已完成?', + confirmColor: '#4c6ef5', + success: (res) => { + if (res.confirm) { + this.updateStatus('completed') + } + } + }) + }, + + async updateStatus(newStatus) { + wx.showLoading({ title: '处理中...' }) + try { + const res = await API.escort.updateStatus(this.data.orderId, { status: newStatus }) + wx.hideLoading() + + if (res.code !== 0) { + wx.showToast({ title: res.message || '操作失败', icon: 'none' }) + return + } + + wx.showToast({ title: '操作成功', icon: 'success' }) + this.loadOrderDetail(this.data.orderId) + } catch (err) { + wx.hideLoading() + console.error('更新状态失败', err) + wx.showToast({ title: '网络错误', icon: 'none' }) + } + } +}) diff --git a/pages/order/orderDetail.json b/pages/order/orderDetail.json new file mode 100644 index 0000000..7c62a47 --- /dev/null +++ b/pages/order/orderDetail.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "订单详情", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "usingComponents": {} +} diff --git a/pages/order/orderDetail.wxml b/pages/order/orderDetail.wxml new file mode 100644 index 0000000..ae82f50 --- /dev/null +++ b/pages/order/orderDetail.wxml @@ -0,0 +1,202 @@ + + + + + 加载中... + + + + + + + {{statusText}} + {{statusDesc}} + + + + + + 患者信息 + + + + {{patientFirstChar}} + + + + {{order.patient.name || '未知患者'}} + {{patientSexText}} + {{order.patient.age}}岁 + + + {{order.patient.mobile || '暂无电话'}} + 拨打 + + + + + + 体重 + {{order.patient.weight}}kg + + + 身高 + {{order.patient.height}}cm + + + 身份证号 + {{order.patient.idnumber}} + + + + + + + 就诊信息 + + + 医院 + {{order.hospital.name || '未知医院'}} + + + 地区 + {{order.hospital.province}} + + + 地址 + {{order.hospital.address}} + + + 科室 + {{order.hospital.department}} + + + 医生 + {{order.hospital.doctor}} + + + 病历号 + {{order.hospital.medicalRecordNo}} + + + + + + + 服务信息 + + + 服务类型 + {{order.escort.serviceName}} + + + 性别要求 + {{sexRequirementText}} + + + 预约日期 + {{scheduleDateText}} + + + 开始时间 + {{scheduleStartTimeText}} + + + 结束时间 + {{scheduleEndTimeText}} + + + 服务时长 + {{order.schedule.duration}}分钟 + + + + + + + 陪诊员 + + + + {{attendantFirstChar}} + + + + {{order.attendant.name}} + {{attendantSexText}} + + + {{order.attendant.mobile || '暂无电话'}} + 拨打 + + + + + + + + + 费用信息 + + + 服务费用 + ¥{{order.payment.totalFee || 0}} + + + 已支付 + ¥{{order.payment.paidFee}} + + + 支付状态 + {{paymentStatusText}} + + + + + + + 备注信息 + + + 患者备注 + {{order.notes.patientNote}} + + + 陪诊记录 + {{order.notes.escortNote}} + + + 就诊摘要 + {{order.notes.medicalSummary}} + + + + + + + 订单信息 + + + 订单编号 + {{order._id}} + + + 创建时间 + {{createtimeText}} + + + 更新时间 + {{updatetimeText}} + + + + + + + 取消订单 + 确认订单 + 开始服务 + 完成服务 + + + diff --git a/pages/order/orderDetail.wxss b/pages/order/orderDetail.wxss new file mode 100644 index 0000000..f61987d --- /dev/null +++ b/pages/order/orderDetail.wxss @@ -0,0 +1,309 @@ +/* pages/order/orderDetail.wxss */ + +page { + background-color: #f7f8fc; +} + +.detail-page { + min-height: 100vh; + background: #f7f8fc; + padding-bottom: 120rpx; +} + +.loading-box { + display: flex; + align-items: center; + justify-content: center; + padding: 200rpx 0; +} + +.loading-text { + font-size: 28rpx; + color: #a0a3bd; +} + +/* === 顶部状态栏 === */ +.status-header { + padding: 60rpx 40rpx 80rpx; + position: relative; + overflow: hidden; +} + +.status-header::after { + content: ''; + position: absolute; + top: -60rpx; + right: -40rpx; + width: 240rpx; + height: 240rpx; + border-radius: 50%; + background: rgba(255, 255, 255, 0.03); +} + +.status-header.status-pending { + background: linear-gradient(135deg, #e6a23c 0%, #f5b041 100%); +} + +.status-header.status-confirmed { + background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%); +} + +.status-header.status-in_progress { + background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%); +} + +.status-header.status-completed { + background: linear-gradient(135deg, #7c5cfc 0%, #9b7dff 100%); +} + +.status-header.status-cancelled { + background: linear-gradient(135deg, #b0b0b0 0%, #c0c0c0 100%); +} + +.status-content { + position: relative; + z-index: 1; +} + +.status-text { + display: block; + font-size: 44rpx; + font-weight: 700; + color: #fff; + letter-spacing: 2rpx; + margin-bottom: 12rpx; +} + +.status-desc { + display: block; + font-size: 26rpx; + color: rgba(255, 255, 255, 0.7); + font-weight: 300; +} + +/* === 信息区块 === */ +.info-section { + margin: 24rpx 24rpx 0; +} + +.section-title { + font-size: 30rpx; + font-weight: 700; + color: #1a1a2e; + margin-bottom: 16rpx; + letter-spacing: 1rpx; +} + +.info-card { + background: #ffffff; + border-radius: 20rpx; + padding: 28rpx; + box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.04); +} + +.info-row { + display: flex; + align-items: baseline; + margin-bottom: 16rpx; +} + +.info-row:last-child { + margin-bottom: 0; +} + +.info-label { + font-size: 24rpx; + color: #a0a3bd; + width: 140rpx; + flex-shrink: 0; +} + +.info-value { + font-size: 26rpx; + color: #3a3d5c; + flex: 1; +} + +/* === 患者信息 === */ +.patient-header { + display: flex; + align-items: center; + gap: 20rpx; + margin-bottom: 16rpx; +} + +.patient-avatar { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + background: linear-gradient(135deg, #667eea, #764ba2); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.avatar-text { + font-size: 32rpx; + font-weight: 700; + color: #fff; +} + +.patient-info { + flex: 1; +} + +.patient-name-row { + display: flex; + align-items: center; + gap: 12rpx; + margin-bottom: 6rpx; +} + +.patient-name { + font-size: 32rpx; + font-weight: 600; + color: #1a1a2e; +} + +.patient-sex { + font-size: 22rpx; + padding: 4rpx 12rpx; + border-radius: 10rpx; + font-weight: 500; +} + +.patient-sex.male { + background: rgba(102, 126, 234, 0.1); + color: #667eea; +} + +.patient-sex.female { + background: rgba(234, 102, 150, 0.1); + color: #ea6696; +} + +.patient-age { + font-size: 24rpx; + color: #a0a3bd; +} + +.patient-phone { + font-size: 24rpx; + color: #a0a3bd; +} + +.call-icon { + color: #667eea; + font-weight: 500; +} + +.divider { + height: 1rpx; + background: #f0f1f5; + margin: 16rpx 0; +} + +/* === 陪诊员信息 === */ +.attendant-header { + display: flex; + align-items: center; + gap: 20rpx; +} + +.attendant-avatar { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + background: linear-gradient(135deg, #667eea, #764ba2); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.attendant-info { + flex: 1; + display: flex; + flex-direction: column; + gap: 6rpx; +} + +.attendant-name { + font-size: 30rpx; + font-weight: 600; + color: #1a1a2e; +} + +.attendant-phone { + font-size: 24rpx; + color: #a0a3bd; +} + +/* === 费用信息 === */ +.fee-value { + font-size: 32rpx; + font-weight: 700; + color: #1a1a2e; + font-family: 'DIN Alternate', 'Helvetica Neue', sans-serif; +} + +/* === 备注信息 === */ +.note-block { + margin-bottom: 20rpx; +} + +.note-block:last-child { + margin-bottom: 0; +} + +.note-label { + display: block; + font-size: 24rpx; + color: #a0a3bd; + margin-bottom: 8rpx; + font-weight: 500; +} + +.note-content { + display: block; + font-size: 26rpx; + color: #3a3d5c; + line-height: 1.6; +} + +/* === 底部操作 === */ +.bottom-actions { + position: fixed; + bottom: 0; + left: 0; + right: 0; + background: #ffffff; + padding: 24rpx 32rpx; + padding-bottom: calc(24rpx + env(safe-area-inset-bottom)); + box-shadow: 0 -4rpx 24rpx rgba(0, 0, 0, 0.06); + display: flex; + gap: 20rpx; + z-index: 100; +} + +.action-btn { + flex: 1; + padding: 24rpx 0; + border-radius: 28rpx; + font-size: 28rpx; + font-weight: 600; + text-align: center; +} + +.btn-solid { + background: linear-gradient(135deg, #667eea, #764ba2); + color: #fff; + box-shadow: 0 4rpx 16rpx rgba(102, 126, 234, 0.3); +} + +.btn-ghost { + background: #f7f8fc; + color: #a0a3bd; + border: 1rpx solid #f0f1f5; +} diff --git a/project.private.config.json b/project.private.config.json index 3472505..b136362 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,6 +1,6 @@ { "libVersion": "3.16.1", - "projectname": "wxapp_admin", + "projectname": "wxapp_escort_admin", "condition": {}, "setting": { "urlCheck": false, diff --git a/utils/request.js b/utils/request.js index 2cda7d5..5703a8a 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,7 +1,7 @@ class Request { constructor(baseURL = 'https://api.huashengtec.com') { - //constructor(baseURL = 'http://127.0.0.1:9004') { + //constructor(baseURL = 'http://127.0.0.1:9010') { this.baseURL = baseURL } @@ -13,7 +13,6 @@ class Request { const token = app?.globalData?.user?.security?.token || '' data.appId = 'wxapp-escort-admin' - data.token = token wx.request({ url: url.startsWith('http') ? url : `${this.baseURL}${url}`,