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
+47 -38
View File
@@ -9,12 +9,6 @@
@accent: #1abc9c;
@accent-end: #17c3a5;
@pending: #e6a23c;
@confirmed: #409eff;
@in-progress: #67c23a;
@completed: #7c5cfc;
@cancelled: #b0b0b0;
page {
background-color: @bg;
color: @dark;
@@ -26,13 +20,16 @@ page {
display: flex;
flex-direction: column;
background: @bg;
padding: 24rpx 24rpx 0;
box-sizing: border-box;
}
/* === 顶部 === */
/* === 顶部home 同款翡翠绿圆角卡片) === */
.header {
background: linear-gradient(135deg, #2dd36f 0%, #17c3a5 100%);
box-shadow: 0 8rpx 24rpx rgba(23, 195, 165, 0.25);
padding: 60rpx 40rpx 70rpx;
background: linear-gradient(135deg, #29b785 0%, #1a8a63 100%);
border-radius: 28rpx;
box-shadow: 0 12rpx 32rpx rgba(26, 138, 99, 0.25);
padding: 36rpx 32rpx;
position: relative;
overflow: hidden;
display: flex;
@@ -69,7 +66,7 @@ page {
.header-title {
display: block;
font-size: 44rpx;
font-size: 36rpx;
font-weight: 700;
color: #fff;
letter-spacing: 2rpx;
@@ -78,8 +75,8 @@ page {
.header-sub {
display: block;
font-size: 26rpx;
color: rgba(255, 255, 255, 0.5);
font-size: 22rpx;
color: rgba(255, 255, 255, 0.65);
font-weight: 300;
letter-spacing: 1rpx;
}
@@ -98,9 +95,7 @@ page {
/* === 筛选栏 === */
.filter-bar {
background: @card;
padding: 20rpx 0;
border-bottom: 1rpx solid @border;
padding: 24rpx 0 0;
}
.filter-scroll {
@@ -117,11 +112,12 @@ page {
display: inline-flex;
align-items: center;
padding: 12rpx 28rpx;
background: @bg;
background: #ffffff;
border-radius: 28rpx;
font-size: 24rpx;
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;
&.active {
@@ -160,17 +156,27 @@ page {
.list-scroll {
height: 100%;
padding: 0 24rpx;
}
.loading-box,
.empty-box {
.loading-box {
display: flex;
align-items: center;
justify-content: center;
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 {
color: @muted !important;
font-size: 26rpx !important;
@@ -200,11 +206,14 @@ page {
margin-bottom: 20rpx;
background: @card;
border-radius: 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
overflow: hidden;
border: 1rpx solid rgba(31, 61, 56, 0.06);
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 {
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;
justify-content: flex-end;
align-items: center;
padding: 20rpx 28rpx 0;
margin-bottom: 12rpx;
}
.order-no {
@@ -225,38 +234,38 @@ page {
.status-badge {
font-size: 22rpx;
padding: 6rpx 20rpx;
border-radius: 24rpx;
border-radius: 30rpx;
font-weight: 500;
}
.status-pending {
background: #fff8e6;
color: @pending;
background: #fdf3e0;
color: #d99a2b;
}
.status-confirmed {
background: #ecf5ff;
color: @confirmed;
background: #e9f1f8;
color: #5c88a8;
}
.status-in_progress {
background: #f0f9eb;
color: @in-progress;
background: #e6f4ee;
color: #43a08a;
}
.status-completed {
background: #f4f0ff;
color: @completed;
background: #efedf6;
color: #8a7bb5;
}
.status-cancelled {
background: #f5f5f5;
color: @cancelled;
color: #b0b0b0;
}
/* === 卡片主体 === */
.card-main {
padding: 0 28rpx;
padding: 0;
}
.patient-line {
@@ -357,8 +366,8 @@ page {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 28rpx 24rpx;
margin-top: 8rpx;
padding: 20rpx 0 4rpx;
margin-top: 16rpx;
border-top: 1rpx solid @border;
}
+8 -7
View File
@@ -43,19 +43,19 @@ page {
}
.status-header.status-pending {
background: linear-gradient(135deg, #e6a23c 0%, #f5b041 100%);
background: linear-gradient(135deg, #f0b352 0%, #d99a2b 100%);
}
.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 {
background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%);
background: linear-gradient(135deg, #55b39c 0%, #43a08a 100%);
}
.status-header.status-completed {
background: linear-gradient(135deg, #7c5cfc 0%, #9b7dff 100%);
background: linear-gradient(135deg, #9a8ac4 0%, #8a7bb5 100%);
}
.status-header.status-cancelled {
@@ -112,9 +112,10 @@ page {
.info-card {
background: #ffffff;
border-radius: 8rpx;
padding: 28rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
border-radius: 24rpx;
border: 1rpx solid rgba(31, 61, 56, 0.06);
padding: 28rpx 32rpx;
box-shadow: 0 6rpx 20rpx rgba(31, 61, 56, 0.07);
}
.info-row {
+49 -5
View File
@@ -11,8 +11,8 @@ Page({
isEdit: false,
form: {
hospital: { name: '', department: '', doctor: '' },
schedule: { date: '' },
escort: { serviceName: '' },
schedule: { date: '', startTime: '08:30' },
escort: { serviceId: -1, serviceName: '' },
payment: { totalFee: '' },
notes: { patientNote: '' }
},
@@ -24,6 +24,7 @@ Page({
profileList: [],
filteredProfiles: [],
profileKeyword: '',
serviceOptions: [],
today: '',
submitting: false
},
@@ -37,6 +38,7 @@ Page({
const now = new Date()
const today = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`
this.setData({ today })
this.loadServices()
if (options && options.orderId) {
// 编辑模式
@@ -176,8 +178,14 @@ Page({
department: (order.hospital && order.hospital.department) || '',
doctor: (order.hospital && order.hospital.doctor) || ''
},
schedule: { date: this.formatDate(order.schedule && order.schedule.date) },
escort: { serviceName: (order.escort && order.escort.serviceName) || '' },
schedule: {
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: {
totalFee: order.payment && order.payment.totalFee ? String(order.payment.totalFee) : '',
paid: !!(order.payment && order.payment.status === 'paid')
@@ -242,6 +250,39 @@ Page({
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: {
date: form.schedule.date,
startTime: form.schedule.startTime || '',
duration: 60
},
escort: {
serviceId: -1,
serviceId: form.escort.serviceId || -1,
serviceName: form.escort.serviceName
},
payment: {
@@ -337,6 +379,8 @@ Page({
'hospital.department': form.hospital.department,
'hospital.doctor': form.hospital.doctor,
'schedule.date': form.schedule.date,
'schedule.startTime': form.schedule.startTime || '',
'escort.serviceId': form.escort.serviceId || -1,
'escort.serviceName': form.escort.serviceName,
'payment.totalFee': form.payment.totalFee ? Number(form.payment.totalFee) : 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 {
background: #ffffff;
border-radius: 24rpx;
border: 1rpx solid rgba(31, 61, 56, 0.06);
padding: 28rpx 32rpx;
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 {
@@ -147,7 +148,7 @@ page {
display: flex;
align-items: center;
padding: 24rpx 0;
border-bottom: 1rpx solid #f0f0f2;
border-bottom: 1rpx solid #f0f1f5;
}
.picker-item:last-child {
@@ -211,25 +212,45 @@ page {
}
.section {
background: #ffffff;
border-radius: 24rpx;
padding: 0 32rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
margin-bottom: 32rpx;
}
/* home 同款绿色竖条标题 */
.section-title {
font-size: 32rpx;
font-weight: 700;
position: relative;
font-size: 30rpx;
font-weight: 600;
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 {
display: flex;
align-items: center;
min-height: 96rpx;
border-bottom: 1rpx solid #f0f0f2;
border-bottom: 1rpx solid #f0f1f5;
}
.field:last-child {
+57 -40
View File
@@ -39,58 +39,75 @@
<!-- 就诊信息 -->
<view class="section">
<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">
<text class="field-label">医院</text>
<input class="field-input" placeholder="请输入医院名称" value="{{form.hospital.name}}" data-key="hospital.name" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">科室</text>
<input class="field-input" placeholder="请输入科室" value="{{form.hospital.department}}" data-key="hospital.department" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">科室</text>
<input class="field-input" placeholder="请输入科室" value="{{form.hospital.department}}" data-key="hospital.department" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">医生姓名</text>
<input class="field-input" placeholder="请输入医生姓名(选填)" value="{{form.hospital.doctor}}" data-key="hospital.doctor" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">医生姓名</text>
<input class="field-input" placeholder="请输入医生姓名(选填)" value="{{form.hospital.doctor}}" data-key="hospital.doctor" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">就诊日期</text>
<picker class="field-picker" mode="date" value="{{form.schedule.date}}" start="{{today}}" bindchange="onDateChange">
<view class="field-value {{form.schedule.date ? '' : 'placeholder'}}">
{{form.schedule.date || '请选择就诊日期'}}
<text class="arrow"></text>
</view>
</picker>
</view>
<view class="field">
<text class="field-label">就诊日期</text>
<picker class="field-picker" mode="date" value="{{form.schedule.date}}" start="{{today}}" bindchange="onDateChange">
<view class="field-value {{form.schedule.date ? '' : 'placeholder'}}">
{{form.schedule.date || '请选择就诊日期'}}
<text class="arrow"></text>
</view>
</picker>
<view class="field">
<text class="field-label">开始时间</text>
<picker class="field-picker" mode="time" value="{{form.schedule.startTime}}" bindchange="onTimeChange">
<view class="field-value {{form.schedule.startTime ? '' : 'placeholder'}}">
{{form.schedule.startTime || '请选择开始时间(选填)'}}
<text class="arrow"></text>
</view>
</picker>
</view>
</view>
</view>
<!-- 服务信息 -->
<view class="section">
<view class="section-title">服务信息</view>
<view class="field">
<text class="field-label">服务名称</text>
<input class="field-input" placeholder="请输入服务名称" value="{{form.escort.serviceName}}" data-key="escort.serviceName" bindinput="onInput" />
</view>
<view class="field">
<text class="field-label">费用(元)</text>
<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 class="info-card">
<view class="field">
<text class="field-label">服务名称</text>
<picker class="field-picker" mode="selector" range="{{serviceOptions}}" range-key="title" bindchange="onServiceChange">
<view class="field-value {{form.escort.serviceName ? '' : 'placeholder'}}">
{{form.escort.serviceName || '请选择服务'}}
<text class="arrow"></text>
</view>
</picker>
</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 class="field">
<text class="field-label">费用(元)</text>
<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>