style(home): 预约卡片补充医院并允许长内容换行
首行集中日期、就诊人、服务与状态,医院单独成行;服务、医院与姓名超长时 换行展示而不是截断,详情箭头独立包裹。同步更新首页 UI 测试断言与缺省文案。
This commit is contained in:
+2
-2
@@ -212,8 +212,7 @@ Page({
|
||||
return sorted.slice(0, PENDING_PREVIEW_LIMIT).map((item) => this.formatPendingRecord(item))
|
||||
},
|
||||
|
||||
// 预约摘要只给日期、服务、就诊人与状态;时间与医院由详情页承接。
|
||||
// timeText 仍保留在数据里,供卡片 aria-label 朗读完整预约时间。
|
||||
// 首页摘要保留关键就诊安排,缺少信息时给出可读提示。
|
||||
formatPendingRecord(item) {
|
||||
const date = parseDate(item.schedule?.date)
|
||||
const whenText = date
|
||||
@@ -227,6 +226,7 @@ Page({
|
||||
timeText: item.schedule?.startTime || '时间待定',
|
||||
statusText: status.text,
|
||||
statusTone: status.tone,
|
||||
hospitalName: item.hospital?.name || '医院待定',
|
||||
patientName: item.patient?.name || '待补充',
|
||||
serviceName: item.escort?.serviceName || '陪诊服务'
|
||||
}
|
||||
|
||||
@@ -34,21 +34,20 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 预约摘要只保留日期、服务、就诊人与状态,时间与医院进详情页。 -->
|
||||
<!-- 两行预约摘要:日期、姓名、服务与状态在上,医院在下;长内容自然换行。 -->
|
||||
<view class="pending-section" wx:if="{{pendingRecords.length}}">
|
||||
<text class="pending-heading">当前预约</text>
|
||||
<view class="pending-card" wx:for="{{pendingRecords}}" wx:key="id" data-id="{{item.id}}" bindtap="goToRecordDetail" hover-class="surface-hover" aria-role="button" aria-label="{{item.whenText}} {{item.timeText}},{{item.serviceName}},{{item.statusText}},查看预约详情">
|
||||
<view class="pending-card" wx:for="{{pendingRecords}}" wx:key="id" data-id="{{item.id}}" bindtap="goToRecordDetail" hover-class="surface-hover" aria-role="button" aria-label="{{item.whenText}},就诊人:{{item.patientName}},{{item.serviceName}},{{item.statusText}},{{item.hospitalName}},查看预约详情">
|
||||
<view class="pending-content">
|
||||
<view class="pending-top">
|
||||
<view class="pending-summary">
|
||||
<text class="pending-when">{{item.whenText}}</text>
|
||||
<text class="pending-patient">{{item.patientName}}</text>
|
||||
<text class="pending-service">{{item.serviceName}}</text>
|
||||
<view class="pending-status chip-tone-{{item.statusTone}}">{{item.statusText}}</view>
|
||||
</view>
|
||||
<view class="pending-meta">
|
||||
<text class="pending-service">{{item.serviceName}}</text>
|
||||
<text class="pending-patient">就诊人:{{item.patientName}}</text>
|
||||
</view>
|
||||
<text class="pending-hospital">{{item.hospitalName}}</text>
|
||||
</view>
|
||||
<t-icon name="chevron-right" size="30rpx" color="#6F655C" />
|
||||
<view class="pending-arrow" aria-hidden="true"><t-icon name="chevron-right" size="30rpx" color="#6F655C" /></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
+17
-16
@@ -108,28 +108,29 @@ button.hero-cta.action-hover { background: var(--brand-ink); }
|
||||
}
|
||||
.trust-item { display: flex; align-items: center; gap: 10rpx; }
|
||||
.trust-check { flex-shrink: 0; width: 12rpx; height: 7rpx; margin-top: -4rpx; border-bottom: 2rpx solid var(--brand-ink); border-left: 2rpx solid var(--brand-ink); transform: rotate(-45deg); }
|
||||
.pending-section { padding: 4rpx 0; }
|
||||
.pending-heading { color: var(--muted); font-size: var(--fs-26); }
|
||||
.pending-section { padding: 20rpx 0 0; }
|
||||
.pending-heading { display: block; padding: 0 4rpx; color: var(--muted); font-size: var(--fs-26); line-height: 1.5; }
|
||||
.pending-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
gap: 16rpx;
|
||||
margin-top: 16rpx;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
min-height: 88rpx;
|
||||
border: 2rpx solid var(--line);
|
||||
border-radius: 28rpx;
|
||||
background: var(--white);
|
||||
}
|
||||
.pending-content { flex: 1; min-width: 0; }
|
||||
/* 首行:日期居左强调,状态胶囊靠右;状态色只包文字本身 */
|
||||
.pending-top {
|
||||
/* 日期与姓名便于快速识别预约;服务吸收余量,长内容换行而不截断。 */
|
||||
.pending-summary {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12rpx;
|
||||
margin-bottom: 8rpx;
|
||||
gap: 12rpx 16rpx;
|
||||
}
|
||||
.pending-when { color: var(--brand-ink); font-size: var(--fs-30); font-weight: 600; white-space: nowrap; }
|
||||
.pending-when { max-width: 100%; color: var(--brand-ink); font-size: var(--fs-30); font-weight: 600; line-height: 1.5; overflow-wrap: break-word; }
|
||||
.pending-status {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -144,23 +145,23 @@ button.hero-cta.action-hover { background: var(--brand-ink); }
|
||||
}
|
||||
/* 状态语气档与 recordlist / recorddetail 同一套,色值读 app.wxss 令牌 */
|
||||
.chip-tone-wait { background: var(--status-wait-bg); border-color: var(--status-wait-line); color: var(--status-wait-ink); }
|
||||
.chip-tone-doing { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-strong); }
|
||||
.chip-tone-doing { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
|
||||
.chip-tone-done { background: var(--status-done-bg); border-color: var(--status-done-line); color: var(--status-done-ink); }
|
||||
.chip-tone-cancel { background: var(--status-cancel-bg); border-color: var(--status-cancel-line); color: var(--status-cancel-ink); }
|
||||
.chip-tone-neutral { background: transparent; border-color: var(--sep); color: var(--muted); }
|
||||
/* 第二行:服务名 + 就诊人同行;服务名过长时截断,就诊人完整保留 */
|
||||
.pending-meta { display: flex; align-items: baseline; gap: 12rpx; min-width: 0; }
|
||||
.pending-service {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
max-width: 100%;
|
||||
color: var(--ink);
|
||||
font-size: var(--fs-28);
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
.pending-patient { flex-shrink: 0; color: var(--muted); font-size: var(--fs-24); line-height: 1.5; white-space: nowrap; }
|
||||
.pending-hospital { display: block; margin-top: 12rpx; color: var(--ink-2); font-size: var(--fs-28); line-height: 1.6; word-break: break-all; }
|
||||
.pending-patient { min-width: 0; max-width: 100%; color: var(--ink); font-size: var(--fs-28); font-weight: 600; line-height: 1.5; word-break: break-all; }
|
||||
.pending-arrow { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
|
||||
.section { margin-top: 32rpx; }
|
||||
.section-head {
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
Reference in New Issue
Block a user