This commit is contained in:
lik
2026-09-09 17:37:43 +08:00
parent e7b27888e3
commit efa0df5a76
9 changed files with 200 additions and 106 deletions
+4 -1
View File
@@ -155,7 +155,10 @@ Page({
.slice(0, 10) .slice(0, 10)
.map(item => { .map(item => {
const d = new Date(item.schedule.date); const d = new Date(item.schedule.date);
item.schedule.date = `${d.getMonth() + 1}${d.getDate()} ${pad(d.getHours())}:${pad(d.getMinutes())}`; const dateText = `${d.getMonth() + 1}${d.getDate()}`;
item.schedule.date = item.schedule.startTime
? `${dateText} ${item.schedule.startTime}`
: `${dateText} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
return item; return item;
}); });
this.setData({ recentOrders: records }); this.setData({ recentOrders: records });
+2 -1
View File
@@ -1,7 +1,7 @@
/* pages/home/index.wxss */ /* pages/home/index.wxss */
page { page {
background: #f5f6fa; background: #ededed;
color: #1a1a2e; color: #1a1a2e;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
} }
@@ -10,6 +10,7 @@ page {
min-height: 100vh; min-height: 100vh;
box-sizing: border-box; box-sizing: border-box;
padding: 24rpx 24rpx 64rpx; padding: 24rpx 24rpx 64rpx;
background-color: transparent;
} }
/* === 头部信息卡(翡翠绿实底) === */ /* === 头部信息卡(翡翠绿实底) === */
+47 -38
View File
@@ -9,12 +9,6 @@
@accent: #1abc9c; @accent: #1abc9c;
@accent-end: #17c3a5; @accent-end: #17c3a5;
@pending: #e6a23c;
@confirmed: #409eff;
@in-progress: #67c23a;
@completed: #7c5cfc;
@cancelled: #b0b0b0;
page { page {
background-color: @bg; background-color: @bg;
color: @dark; color: @dark;
@@ -26,13 +20,16 @@ page {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: @bg; background: @bg;
padding: 24rpx 24rpx 0;
box-sizing: border-box;
} }
/* === 顶部 === */ /* === 顶部home 同款翡翠绿圆角卡片) === */
.header { .header {
background: linear-gradient(135deg, #2dd36f 0%, #17c3a5 100%); background: linear-gradient(135deg, #29b785 0%, #1a8a63 100%);
box-shadow: 0 8rpx 24rpx rgba(23, 195, 165, 0.25); border-radius: 28rpx;
padding: 60rpx 40rpx 70rpx; box-shadow: 0 12rpx 32rpx rgba(26, 138, 99, 0.25);
padding: 36rpx 32rpx;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
@@ -69,7 +66,7 @@ page {
.header-title { .header-title {
display: block; display: block;
font-size: 44rpx; font-size: 36rpx;
font-weight: 700; font-weight: 700;
color: #fff; color: #fff;
letter-spacing: 2rpx; letter-spacing: 2rpx;
@@ -78,8 +75,8 @@ page {
.header-sub { .header-sub {
display: block; display: block;
font-size: 26rpx; font-size: 22rpx;
color: rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.65);
font-weight: 300; font-weight: 300;
letter-spacing: 1rpx; letter-spacing: 1rpx;
} }
@@ -98,9 +95,7 @@ page {
/* === 筛选栏 === */ /* === 筛选栏 === */
.filter-bar { .filter-bar {
background: @card; padding: 24rpx 0 0;
padding: 20rpx 0;
border-bottom: 1rpx solid @border;
} }
.filter-scroll { .filter-scroll {
@@ -117,11 +112,12 @@ page {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
padding: 12rpx 28rpx; padding: 12rpx 28rpx;
background: @bg; background: #ffffff;
border-radius: 28rpx; border-radius: 28rpx;
font-size: 24rpx; font-size: 24rpx;
color: @muted; color: @muted;
border: 1rpx solid transparent; border: 1rpx solid rgba(31, 61, 56, 0.06);
box-shadow: 0 4rpx 12rpx rgba(31, 61, 56, 0.05);
transition: all 0.25s; transition: all 0.25s;
&.active { &.active {
@@ -160,17 +156,27 @@ page {
.list-scroll { .list-scroll {
height: 100%; height: 100%;
padding: 0 24rpx;
} }
.loading-box, .loading-box {
.empty-box {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 200rpx 40rpx; padding: 200rpx 40rpx;
} }
.empty-box {
margin-top: 24rpx;
background: @card;
border-radius: 24rpx;
border: 1rpx solid rgba(31, 61, 56, 0.06);
box-shadow: 0 6rpx 20rpx rgba(31, 61, 56, 0.07);
padding: 64rpx 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
.loading-text { .loading-text {
color: @muted !important; color: @muted !important;
font-size: 26rpx !important; font-size: 26rpx !important;
@@ -200,11 +206,14 @@ page {
margin-bottom: 20rpx; margin-bottom: 20rpx;
background: @card; background: @card;
border-radius: 24rpx; border-radius: 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04); border: 1rpx solid rgba(31, 61, 56, 0.06);
overflow: hidden; box-shadow: 0 6rpx 20rpx rgba(31, 61, 56, 0.07);
padding: 24rpx 32rpx;
transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s cubic-bezier(0.32, 0.72, 0, 1);
&:active { &:active {
opacity: 0.92; transform: scale(0.98);
box-shadow: 0 4rpx 12rpx rgba(31, 61, 56, 0.08);
} }
} }
@@ -212,7 +221,7 @@ page {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
padding: 20rpx 28rpx 0; margin-bottom: 12rpx;
} }
.order-no { .order-no {
@@ -225,38 +234,38 @@ page {
.status-badge { .status-badge {
font-size: 22rpx; font-size: 22rpx;
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
border-radius: 24rpx; border-radius: 30rpx;
font-weight: 500; font-weight: 500;
} }
.status-pending { .status-pending {
background: #fff8e6; background: #fdf3e0;
color: @pending; color: #d99a2b;
} }
.status-confirmed { .status-confirmed {
background: #ecf5ff; background: #e9f1f8;
color: @confirmed; color: #5c88a8;
} }
.status-in_progress { .status-in_progress {
background: #f0f9eb; background: #e6f4ee;
color: @in-progress; color: #43a08a;
} }
.status-completed { .status-completed {
background: #f4f0ff; background: #efedf6;
color: @completed; color: #8a7bb5;
} }
.status-cancelled { .status-cancelled {
background: #f5f5f5; background: #f5f5f5;
color: @cancelled; color: #b0b0b0;
} }
/* === 卡片主体 === */ /* === 卡片主体 === */
.card-main { .card-main {
padding: 0 28rpx; padding: 0;
} }
.patient-line { .patient-line {
@@ -357,8 +366,8 @@ page {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 20rpx 28rpx 24rpx; padding: 20rpx 0 4rpx;
margin-top: 8rpx; margin-top: 16rpx;
border-top: 1rpx solid @border; border-top: 1rpx solid @border;
} }
+8 -7
View File
@@ -43,19 +43,19 @@ page {
} }
.status-header.status-pending { .status-header.status-pending {
background: linear-gradient(135deg, #e6a23c 0%, #f5b041 100%); background: linear-gradient(135deg, #f0b352 0%, #d99a2b 100%);
} }
.status-header.status-confirmed { .status-header.status-confirmed {
background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%); background: linear-gradient(135deg, #74a3c4 0%, #5c88a8 100%);
} }
.status-header.status-in_progress { .status-header.status-in_progress {
background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%); background: linear-gradient(135deg, #55b39c 0%, #43a08a 100%);
} }
.status-header.status-completed { .status-header.status-completed {
background: linear-gradient(135deg, #7c5cfc 0%, #9b7dff 100%); background: linear-gradient(135deg, #9a8ac4 0%, #8a7bb5 100%);
} }
.status-header.status-cancelled { .status-header.status-cancelled {
@@ -112,9 +112,10 @@ page {
.info-card { .info-card {
background: #ffffff; background: #ffffff;
border-radius: 8rpx; border-radius: 24rpx;
padding: 28rpx; border: 1rpx solid rgba(31, 61, 56, 0.06);
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04); padding: 28rpx 32rpx;
box-shadow: 0 6rpx 20rpx rgba(31, 61, 56, 0.07);
} }
.info-row { .info-row {
+49 -5
View File
@@ -11,8 +11,8 @@ Page({
isEdit: false, isEdit: false,
form: { form: {
hospital: { name: '', department: '', doctor: '' }, hospital: { name: '', department: '', doctor: '' },
schedule: { date: '' }, schedule: { date: '', startTime: '08:30' },
escort: { serviceName: '' }, escort: { serviceId: -1, serviceName: '' },
payment: { totalFee: '' }, payment: { totalFee: '' },
notes: { patientNote: '' } notes: { patientNote: '' }
}, },
@@ -24,6 +24,7 @@ Page({
profileList: [], profileList: [],
filteredProfiles: [], filteredProfiles: [],
profileKeyword: '', profileKeyword: '',
serviceOptions: [],
today: '', today: '',
submitting: false submitting: false
}, },
@@ -37,6 +38,7 @@ Page({
const now = new Date() const now = new Date()
const today = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}` const today = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`
this.setData({ today }) this.setData({ today })
this.loadServices()
if (options && options.orderId) { if (options && options.orderId) {
// 编辑模式 // 编辑模式
@@ -176,8 +178,14 @@ Page({
department: (order.hospital && order.hospital.department) || '', department: (order.hospital && order.hospital.department) || '',
doctor: (order.hospital && order.hospital.doctor) || '' doctor: (order.hospital && order.hospital.doctor) || ''
}, },
schedule: { date: this.formatDate(order.schedule && order.schedule.date) }, schedule: {
escort: { serviceName: (order.escort && order.escort.serviceName) || '' }, date: this.formatDate(order.schedule && order.schedule.date),
startTime: (order.schedule && order.schedule.startTime) || '08:30'
},
escort: {
serviceId: (order.escort && order.escort.serviceId) || -1,
serviceName: (order.escort && order.escort.serviceName) || ''
},
payment: { payment: {
totalFee: order.payment && order.payment.totalFee ? String(order.payment.totalFee) : '', totalFee: order.payment && order.payment.totalFee ? String(order.payment.totalFee) : '',
paid: !!(order.payment && order.payment.status === 'paid') paid: !!(order.payment && order.payment.status === 'paid')
@@ -242,6 +250,39 @@ Page({
this.setData({ 'form.schedule.date': e.detail.value }) this.setData({ 'form.schedule.date': e.detail.value })
}, },
/**
* 开始时间选择
*/
onTimeChange(e) {
this.setData({ 'form.schedule.startTime': e.detail.value })
},
/**
* 加载陪诊服务列表(供服务名称下拉选择)
*/
loadServices() {
API.resource.getServices()
.then(res => {
if (res.code !== 0) return
this.setData({ serviceOptions: (res.data && res.data.services) || [] })
})
.catch(err => {
console.error('获取服务列表失败', err)
})
},
/**
* 服务名称选择:同时记录服务ID与服务名称
*/
onServiceChange(e) {
const svc = this.data.serviceOptions[Number(e.detail.value)]
if (!svc) return
this.setData({
'form.escort.serviceId': svc.id,
'form.escort.serviceName': svc.title
})
},
/** /**
* 是否已支付切换 * 是否已支付切换
*/ */
@@ -289,10 +330,11 @@ Page({
}, },
schedule: { schedule: {
date: form.schedule.date, date: form.schedule.date,
startTime: form.schedule.startTime || '',
duration: 60 duration: 60
}, },
escort: { escort: {
serviceId: -1, serviceId: form.escort.serviceId || -1,
serviceName: form.escort.serviceName serviceName: form.escort.serviceName
}, },
payment: { payment: {
@@ -337,6 +379,8 @@ Page({
'hospital.department': form.hospital.department, 'hospital.department': form.hospital.department,
'hospital.doctor': form.hospital.doctor, 'hospital.doctor': form.hospital.doctor,
'schedule.date': form.schedule.date, 'schedule.date': form.schedule.date,
'schedule.startTime': form.schedule.startTime || '',
'escort.serviceId': form.escort.serviceId || -1,
'escort.serviceName': form.escort.serviceName, 'escort.serviceName': form.escort.serviceName,
'payment.totalFee': form.payment.totalFee ? Number(form.payment.totalFee) : 0, 'payment.totalFee': form.payment.totalFee ? Number(form.payment.totalFee) : 0,
'payment.paidFee': form.payment.paid ? (form.payment.totalFee ? Number(form.payment.totalFee) : 0) : 0, 'payment.paidFee': form.payment.paid ? (form.payment.totalFee ? Number(form.payment.totalFee) : 0) : 0,
+32 -11
View File
@@ -20,9 +20,10 @@ page {
.profile-brief { .profile-brief {
background: #ffffff; background: #ffffff;
border-radius: 24rpx; border-radius: 24rpx;
border: 1rpx solid rgba(31, 61, 56, 0.06);
padding: 28rpx 32rpx; padding: 28rpx 32rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04); box-shadow: 0 6rpx 20rpx rgba(31, 61, 56, 0.07);
} }
.brief-tags { .brief-tags {
@@ -147,7 +148,7 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 24rpx 0; padding: 24rpx 0;
border-bottom: 1rpx solid #f0f0f2; border-bottom: 1rpx solid #f0f1f5;
} }
.picker-item:last-child { .picker-item:last-child {
@@ -211,25 +212,45 @@ page {
} }
.section { .section {
background: #ffffff; margin-bottom: 32rpx;
border-radius: 24rpx;
padding: 0 32rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
} }
/* home 同款绿色竖条标题 */
.section-title { .section-title {
font-size: 32rpx; position: relative;
font-weight: 700; font-size: 30rpx;
font-weight: 600;
color: #1a1a1a; color: #1a1a1a;
padding: 28rpx 0 12rpx; margin-bottom: 16rpx;
margin-left: 20rpx;
letter-spacing: 1rpx;
&::before {
content: '';
position: absolute;
left: -20rpx;
top: 50%;
transform: translateY(-50%);
width: 8rpx;
height: 28rpx;
border-radius: 4rpx;
background: linear-gradient(180deg, #2dd36f, #17c3a5);
}
}
.info-card {
background: #ffffff;
border-radius: 24rpx;
border: 1rpx solid rgba(31, 61, 56, 0.06);
padding: 8rpx 32rpx;
box-shadow: 0 6rpx 20rpx rgba(31, 61, 56, 0.07);
} }
.field { .field {
display: flex; display: flex;
align-items: center; align-items: center;
min-height: 96rpx; min-height: 96rpx;
border-bottom: 1rpx solid #f0f0f2; border-bottom: 1rpx solid #f0f1f5;
} }
.field:last-child { .field:last-child {
+57 -40
View File
@@ -39,58 +39,75 @@
<!-- 就诊信息 --> <!-- 就诊信息 -->
<view class="section"> <view class="section">
<view class="section-title">就诊信息</view> <view class="section-title">就诊信息</view>
<view class="info-card">
<view class="field">
<text class="field-label">医院</text>
<input class="field-input" placeholder="请输入医院名称" value="{{form.hospital.name}}" data-key="hospital.name" bindinput="onInput" />
</view>
<view class="field"> <view class="field">
<text class="field-label">医院</text> <text class="field-label">科室</text>
<input class="field-input" placeholder="请输入医院名称" value="{{form.hospital.name}}" data-key="hospital.name" bindinput="onInput" /> <input class="field-input" placeholder="请输入科室" value="{{form.hospital.department}}" data-key="hospital.department" bindinput="onInput" />
</view> </view>
<view class="field"> <view class="field">
<text class="field-label">科室</text> <text class="field-label">医生姓名</text>
<input class="field-input" placeholder="请输入科室" value="{{form.hospital.department}}" data-key="hospital.department" bindinput="onInput" /> <input class="field-input" placeholder="请输入医生姓名(选填)" value="{{form.hospital.doctor}}" data-key="hospital.doctor" bindinput="onInput" />
</view> </view>
<view class="field"> <view class="field">
<text class="field-label">医生姓名</text> <text class="field-label">就诊日期</text>
<input class="field-input" placeholder="请输入医生姓名(选填)" value="{{form.hospital.doctor}}" data-key="hospital.doctor" bindinput="onInput" /> <picker class="field-picker" mode="date" value="{{form.schedule.date}}" start="{{today}}" bindchange="onDateChange">
</view> <view class="field-value {{form.schedule.date ? '' : 'placeholder'}}">
{{form.schedule.date || '请选择就诊日期'}}
<text class="arrow"></text>
</view>
</picker>
</view>
<view class="field"> <view class="field">
<text class="field-label">就诊日期</text> <text class="field-label">开始时间</text>
<picker class="field-picker" mode="date" value="{{form.schedule.date}}" start="{{today}}" bindchange="onDateChange"> <picker class="field-picker" mode="time" value="{{form.schedule.startTime}}" bindchange="onTimeChange">
<view class="field-value {{form.schedule.date ? '' : 'placeholder'}}"> <view class="field-value {{form.schedule.startTime ? '' : 'placeholder'}}">
{{form.schedule.date || '请选择就诊日期'}} {{form.schedule.startTime || '请选择开始时间(选填)'}}
<text class="arrow"></text> <text class="arrow"></text>
</view> </view>
</picker> </picker>
</view>
</view> </view>
</view> </view>
<!-- 服务信息 --> <!-- 服务信息 -->
<view class="section"> <view class="section">
<view class="section-title">服务信息</view> <view class="section-title">服务信息</view>
<view class="info-card">
<view class="field"> <view class="field">
<text class="field-label">服务名称</text> <text class="field-label">服务名称</text>
<input class="field-input" placeholder="请输入服务名称" value="{{form.escort.serviceName}}" data-key="escort.serviceName" bindinput="onInput" /> <picker class="field-picker" mode="selector" range="{{serviceOptions}}" range-key="title" bindchange="onServiceChange">
</view> <view class="field-value {{form.escort.serviceName ? '' : 'placeholder'}}">
{{form.escort.serviceName || '请选择服务'}}
<view class="field"> <text class="arrow"></text>
<text class="field-label">费用(元)</text> </view>
<input class="field-input" type="digit" placeholder="请输入服务费用" value="{{form.payment.totalFee}}" data-key="payment.totalFee" bindinput="onInput" /> </picker>
</view>
<view class="field">
<text class="field-label">是否已支付</text>
<view class="field-switch">
<text class="switch-label {{form.payment.paid ? 'paid' : 'unpaid'}}">{{form.payment.paid ? '已支付' : '未支付'}}</text>
<switch checked="{{form.payment.paid}}" color="#17c3a5" bindchange="onPaidChange" />
</view> </view>
</view>
<view class="field field-textarea"> <view class="field">
<text class="field-label">备注</text> <text class="field-label">费用(元)</text>
<textarea class="field-area" placeholder="请输入备注信息(选填)" value="{{form.notes.patientNote}}" data-key="notes.patientNote" bindinput="onInput" /> <input class="field-input" type="digit" placeholder="请输入服务费用" value="{{form.payment.totalFee}}" data-key="payment.totalFee" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">是否已支付</text>
<view class="field-switch">
<text class="switch-label {{form.payment.paid ? 'paid' : 'unpaid'}}">{{form.payment.paid ? '已支付' : '未支付'}}</text>
<switch checked="{{form.payment.paid}}" color="#17c3a5" bindchange="onPaidChange" />
</view>
</view>
<view class="field field-textarea">
<text class="field-label">备注</text>
<textarea class="field-area" placeholder="请输入备注信息(选填)" value="{{form.notes.patientNote}}" data-key="notes.patientNote" bindinput="onInput" />
</view>
</view> </view>
</view> </view>
-2
View File
@@ -15,9 +15,7 @@ Page({
menuList: [ menuList: [
{ icon: 'user', title: '个人资料', url: '/pages/me/index' }, { icon: 'user', title: '个人资料', url: '/pages/me/index' },
{ icon: 'notification', title: '消息通知', url: '' }, { icon: 'notification', title: '消息通知', url: '' },
{ icon: 'lock-on', title: '账号安全', url: '' },
{ icon: 'help-circle', title: '帮助中心', url: '' }, { icon: 'help-circle', title: '帮助中心', url: '' },
{ icon: 'info-circle', title: '关于我们', url: '' },
] ]
}, },
+1 -1
View File
@@ -1,5 +1,5 @@
page { page {
background: linear-gradient(180deg, #eaf6f1 0%, #f5f6fa 360rpx); background: #ededed;
color: #1a1a2e; color: #1a1a2e;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
} }