优化了页面;增加了陪诊师页面

This commit is contained in:
lik
2026-10-06 21:57:12 +08:00
parent 509a10e4f1
commit f655c906f5
17 changed files with 671 additions and 56 deletions
+2 -1
View File
@@ -4,7 +4,8 @@
"pages/ai/aichat",
"pages/escort/itemdetail",
"pages/escort/itemlist",
"pages/escort/attendantlist",
"pages/attendant/attendantlist",
"pages/attendant/attendantdetail",
"pages/escort/recordlist",
"pages/escort/agreement",
"pages/escort/recorddetail",
+4 -2
View File
@@ -20,7 +20,7 @@
**`t-icon` 的 `name` 必须命中 tdesign 图标名表**(`miniprogram_npm/tdesign-miniprogram/icon/icon.wxss` 里的 `.t-icon-{name}`),写错不报错、只是渲染为空:`list` 并不存在(只有 `list-numbered`、`list-bug` 等),`info-circle`、`error-circle`、`user-business`、`chart-bar` 等均存在。
迁移进度:`home/index`、`escort/itemlist`、`escort/guide` 三页副本已删;`itemdetail`、`attendantlist`、`mine/contact` 三页仍各带副本(停在旧值 `#C2410C`),待重构时按同一方式删。
迁移进度:`home/index`、`escort/itemlist`、`escort/guide`、`attendant/*` 副本已删;`itemdetail`、`mine/contact` 两页仍各带副本(停在旧值 `#C2410C`),待重构时按同一方式删。
### 2.1 第一色:暖橙色阶
@@ -132,6 +132,8 @@
已完成(2026-10-06):`mine/about.wxss` 已按本节并入暖橙体系——灰金 `#D4A853`、亮橙 `#FF8500`、冷灰底 `#F5F5F5`、品牌区与印记的两处渐变、6×28rpx 的渐变竖条全部换掉:底色转 `--paper`,印记转 `--brand-strong` + `--shadow-cta`(白色线稿需深底),竖条转 8×34rpx 实色 `--brand-strong`。同页两处违规一并修正:`.icp` 由 22rpx 提到 24rpx(硬约束 1 最小字号),元信息与标签统一 `--muted`、正文统一 `--ink-2`。死代码 `.version`(页面已无版本号展示)删除。白卡按 §2.3 补 2rpx `--line` 发丝边 + `--shadow-card` + 28rpx 圆角。同页「联系我们」由平铺的四项联系方式收成一张入口卡(配方见 §2.3 例外)——那四项与 `mine/contact` 逐项重合,平铺属"同一意图两个入口",且该页每行还少一个「拨打/复制」动作词。
已完成(2026-10-06):`escort/attendantlist` 4 文件迁至 `attendant/attendantlist`,同目录新增 `attendant/attendantdetail`(4 文件),两页一并并入暖橙体系——`attendantlist.wxss` 的 page 级令牌副本(停在旧值 `#C2410C` / `#9A3412`)整块删除,改用 `app.wxss` 唯一来源,`page{}` 只留 `background-color: var(--paper)`(同 `guide`);`.wxml` 的 `t-icon` 硬编码 `#9A3412`→`#9B4508`,两处竖分隔线 `#E5DACC`→`--sep`。结构:列表卡右侧补 `chevron-right`(`#6F655C`)作点击暗示,整卡可点进详情;详情页按国标 4.2.1.5 分区——主卡(头像 / 脱敏名 / 已核验徽标 / 服务年限 · 累计服务次数,居中)+ 擅长场景(全量,不截断)+ 服务信息(性别 / 服务区域 / 服务语言,空项整行隐藏)+ 个人简介(未填整块隐藏),全页无实心色块、不新增色相,说明行仍是「公示信息,不含联系方式」。入口仍在首页介绍卡信任行(`goToAttendants`),`app.json` 两条路由同步改路径。同日按国标 4.2.1.5 补全公示项:详情页加「资质与培训」(健康证明有效期 + 培训记录)与「过往服务评价」两个分区,两区均无数据时整块隐藏;区块内条目用 `--line` 发丝线分隔,评分用 48rpx `--ink` 大字 + `--muted` 小数(`/ 5`)与条数,无实心色块。
### 5.2 系统级(不在页面里,最易漏)
| 位置 | 现状 | 应改为 |
@@ -200,6 +202,6 @@
| 10 | `images/ai-ink.png` | 整图纯色(AI客服选中态位图) | `#9B4508` | `#8A4B08`(位图需重上色,不能按文本替换) |
| 11 | `images/home-ink.png` | 整图纯色(「我的」默认头像位图,由灰色 `home.png` 重上色) | `#9B4508` | `#8A4B08`(同上) |
**无需回滚**:其余页面从未迁移。仍定义旧值 `#C2410C` / `#9A3412` 的是 `itemdetail`、`attendantlist`、`mine/contact` 三页六文件(各含 `.wxss` 令牌与 `.wxml` 里 `t-icon` 硬编码),本就是回滚后的目标态(`guide` 已于 2026-10-06 迁移,见 §5.1);`agreement`、`recordlist`、`recorddetail`、`mine/*` 等页走更早的金色体系(`#D4A853`),见 §5.1。
**无需回滚**:其余页面从未迁移。仍定义旧值 `#C2410C` / `#9A3412` 的是 `itemdetail`、`mine/contact` 两页四文件(各含 `.wxss` 令牌与 `.wxml` 里 `t-icon` 硬编码),本就是回滚后的目标态(`guide` 已于 2026-10-06 迁移,`attendant/*` 于同日迁移并新增详情页,见 §5.1);`agreement`、`recordlist`、`recorddetail`、`mine/*` 等页走更早的金色体系(`#D4A853`),见 §5.1。
注:`custom-tab-bar` 未选中灰硬编码 `#7A7068` 是独立历史遗留项(应改 `#6F655C`,见 §5.2),与本次主色调整无关。
+2 -1
View File
@@ -38,7 +38,8 @@ doc/
| `pages/ai/aichat` | AI 客服 |
| `pages/escort/itemlist` | 陪诊服务列表 |
| `pages/escort/itemdetail` | 服务详情 / 下单 |
| `pages/escort/attendantlist` | 陪诊师列表 |
| `pages/attendant/attendantlist` | 陪诊师团队(公示列表) |
| `pages/attendant/attendantdetail` | 陪诊师详情(公示) |
| `pages/escort/recordlist` | 订单记录 |
| `pages/escort/recorddetail` | 订单详情 |
| `pages/escort/agreement` | 用户协议 |
+1 -1
View File
@@ -31,7 +31,7 @@
| 页面 | 文件 | 动作 |
|---|---|---|
| `escort/itemdetail` | `.wxss` `.wxml` | 删页内令牌副本(改读 app.wxss),`t-icon` 的 `color` 手改 `#9B4508` |
| `escort/attendantlist` | `.wxss` `.wxml` | 同上 |
| `attendant/attendantlist` | `.wxss` `.wxml` | 已完成(2026-10-06,见 DESIGN.md §5.1);同目录新增 `attendantdetail` |
| `escort/guide` | `.wxss` `.wxml` | 同上 |
| `mine/contact` | `.wxss` `.wxml` | 同上 |
+107
View File
@@ -0,0 +1,107 @@
const API = require('../../utils/api.js')
// 陪诊师详情:数据来自后端公开接口 /health/attendant/:id
// 与列表页是同一份白名单数据(不含手机号 / 身份证号 / 证书编号原文),
// 差别在于详情页按 GB/T 47801—2026 4.2.1.5 把公示项补全:
// 不截断擅长场景,并额外展示个人简介、健康证明有效期、培训记录与过往服务评价
// (培训记录是数组、评价要多一次聚合查询,所以只在详情里带)
Page({
data: {
loading: true,
// null 表示查不到(ID 非法、已离职或已下架),模板据此渲染空态
attendant: null,
specialtyTags: [],
trainings: [],
areaText: '',
langText: ''
},
onLoad(options) {
const id = options.id
if (!id) {
this.setData({ loading: false })
return
}
this.loadAttendant(id)
},
loadAttendant(id) {
API.escort.getAttendantById(id)
.then((res) => {
const item = res.code === 0 && res.data && res.data.attendant
if (!item) {
this.setData({ loading: false })
return
}
const name = item.name || ''
const healthCertificate = item.healthCertificate || {}
const review = item.review || {}
// 健康证明按国标只公示「有效期」,文案分有效 / 已过期两种;
// 运营没登到期日就整行不显示(不给"有效"的默认结论)
let healthCertificateText = ''
if (healthCertificate.expireDate) {
healthCertificateText = healthCertificate.valid
? `有效期内(至 ${healthCertificate.expireDate})`
: `已过期(${healthCertificate.expireDate})`
}
const attendant = {
id: item.id,
name,
avatar: item.avatar || '',
// 头像兜底用的首字:姓名已脱敏为「姓 + 陪诊师」,取第一个字即可
initial: name.slice(0, 1),
// 后端 sex 为空串表示未登记,模板据此隐藏该行
sexText: item.sex === 'male' ? '男' : item.sex === 'female' ? '女' : '',
workYears: item.workYears || 0,
orderCount: item.orderCount || 0,
qualificationVerified: !!item.qualificationVerified,
healthCertificateText,
introduction: item.introduction || '',
reviewCount: review.count || 0,
// 评价条数未达后端阈值时 score 为 null,模板据此显示"暂不显示评分"
reviewScore: typeof review.score === 'number' ? review.score : null
}
this.setData({
loading: false,
attendant,
// 详情页展示全部擅长场景,不再像列表页截断到 3 个
specialtyTags: item.specialties || [],
trainings: item.trainings || [],
// 数组在 WXML 里不能直接拼展示,这里先转成文本
areaText: (item.serviceAreas || []).join(' / '),
langText: (item.languages || []).join(' / ')
})
// 标题用脱敏名,比「陪诊师详情」更有信息量
if (name) {
wx.setNavigationBarTitle({ title: name })
}
})
.catch((err) => {
console.log('获取陪诊师详情失败', err)
this.setData({ loading: false })
})
},
onShareAppMessage() {
const {
attendant
} = this.data
if (!attendant) {
return {
title: '暖橙陪诊 · 陪诊师团队',
path: '/pages/attendant/attendantlist'
}
}
return {
title: `暖橙陪诊 · ${attendant.name}`,
path: `/pages/attendant/attendantdetail?id=${attendant.id}`
}
}
})
+6
View File
@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "陪诊师详情",
"usingComponents": {
"t-icon": "tdesign-miniprogram/icon/icon"
}
}
+146
View File
@@ -0,0 +1,146 @@
<view class="page-bg">
<view class="container">
<view wx:if="{{ loading }}" class="state">
<text class="state-text">加载中…</text>
</view>
<view wx:elif="{{ !attendant }}" class="state">
<text class="state-text">该陪诊师信息不存在或已下架</text>
</view>
<block wx:else>
<!-- 主卡:头像居中,姓名 + 资质徽标,再接一行从业信息。
与列表页卡片同语言(白卡 + 发丝边 + 紧阴影),但居中排布,
让"一个人"与列表里的"一条记录"在版式上区分开 -->
<view class="profile-card">
<!-- 头像兜底:无头像时用浅橙衬底 + 姓氏首字,避免破图 -->
<image
wx:if="{{ attendant.avatar }}"
class="profile-avatar"
src="{{ attendant.avatar }}"
mode="aspectFill"
/>
<view wx:else class="profile-avatar profile-avatar-fallback">
<text class="profile-avatar-text">{{ attendant.initial }}</text>
</view>
<view class="profile-name-row">
<text class="profile-name">{{ attendant.name }}</text>
<view class="profile-badge" wx:if="{{ attendant.qualificationVerified }}">
<t-icon name="check" size="22rpx" color="#9B4508" />
<text class="profile-badge-text">资质已核验</text>
</view>
</view>
<view class="profile-meta">
<text class="profile-meta-text">从业 {{ attendant.workYears }} 年</text>
<view class="meta-sep"></view>
<text class="profile-meta-text">已服务 {{ attendant.orderCount }} 次</text>
</view>
</view>
<!-- 擅长场景:全量展示,不截断 -->
<view class="section" wx:if="{{ specialtyTags.length > 0 }}">
<view class="section-head">
<view class="section-bar"></view>
<text class="section-title">擅长场景</text>
</view>
<view class="tag-card">
<text
class="tag"
wx:for="{{ specialtyTags }}"
wx:for-item="tag"
wx:key="*this"
>{{ tag }}</text>
</view>
</view>
<!-- 服务信息:有哪项展示哪项,整行不留空标签 -->
<view class="section" wx:if="{{ attendant.sexText || areaText || langText }}">
<view class="section-head">
<view class="section-bar"></view>
<text class="section-title">服务信息</text>
</view>
<view class="info-card">
<view class="info-row" wx:if="{{ attendant.sexText }}">
<text class="info-label">性别</text>
<text class="info-value">{{ attendant.sexText }}</text>
</view>
<view class="info-row" wx:if="{{ areaText }}">
<text class="info-label">服务区域</text>
<text class="info-value">{{ areaText }}</text>
</view>
<view class="info-row" wx:if="{{ langText }}">
<text class="info-label">服务语言</text>
<text class="info-value">{{ langText }}</text>
</view>
</view>
</view>
<!-- 资质与培训:健康证明是国标 4.2.1.5 的公示项。
运营没登就整块隐藏,不用"待补充"占位 -->
<view class="section" wx:if="{{ attendant.healthCertificateText || trainings.length > 0 }}">
<view class="section-head">
<view class="section-bar"></view>
<text class="section-title">资质与培训</text>
</view>
<view class="info-card">
<view class="info-row" wx:if="{{ attendant.healthCertificateText }}">
<text class="info-label">健康证明</text>
<text class="info-value">{{ attendant.healthCertificateText }}</text>
</view>
<!-- 培训记录:一条一条列,便于逐条核对 -->
<view class="training-item" wx:for="{{ trainings }}" wx:key="title">
<view class="training-head">
<text class="training-title">{{ item.title }}</text>
<text class="training-date" wx:if="{{ item.date }}">{{ item.date }}</text>
</view>
<text class="training-org" wx:if="{{ item.org }}">{{ item.org }}</text>
</view>
</view>
</view>
<!-- 过往服务评价:只展示聚合结果,不放评价原文——
原文展示要先定好评人的脱敏口径与内容审核,属评价体系下一轮 -->
<view class="section">
<view class="section-head">
<view class="section-bar"></view>
<text class="section-title">过往服务评价</text>
</view>
<view class="info-card">
<view class="review-box" wx:if="{{ attendant.reviewScore !== null }}">
<text class="review-score">{{ attendant.reviewScore }}</text>
<text class="review-unit">/ 5</text>
<text class="review-count">共 {{ attendant.reviewCount }} 条评价</text>
</view>
<!-- 条数未达后端阈值不给分数,避免"1 条 5 分"被读成满分口碑 -->
<text wx:else class="review-empty">
{{ attendant.reviewCount > 0 ? '评价条数不足,暂不显示评分' : '暂无评价' }}
</text>
</view>
</view>
<!-- 个人简介:运营未填就整块隐藏,不留空标题 -->
<view class="section" wx:if="{{ attendant.introduction }}">
<view class="section-head">
<view class="section-bar"></view>
<text class="section-title">个人简介</text>
</view>
<view class="info-card">
<text class="intro-text">{{ attendant.introduction }}</text>
</view>
</view>
<!-- 说明:与列表页同一口径,只交代字段边界,
同时暗示「不展示联系方式」是有意为之,而非信息缺失。
不补充「如何指定陪诊师」之类的话术——那是尚未开放的能力 -->
<view class="notice">
<text class="notice-text">以上为陪同人员信息公示,用于核对身份与从业信息,不含联系方式。</text>
</view>
</block>
<view class="footer-space"></view>
</view>
</view>
+299
View File
@@ -0,0 +1,299 @@
/* pages/attendant/attendantdetail.wxss
陪诊师详情:与陪诊师团队列表、陪诊指南同用一套暖橙 + 暖白令牌,
令牌唯一来源在 app.wxss,本页不复制副本 */
page {
background-color: var(--paper);
}
.page-bg {
min-height: 100vh;
background: var(--paper);
}
.container {
padding: 32rpx 32rpx 0;
}
/* ===== 加载 / 空状态 ===== */
.state {
padding: 120rpx 0;
text-align: center;
}
.state-text {
font-size: 26rpx;
color: var(--muted);
}
/* ===== 主卡:白卡 + 发丝边 + 紧阴影,居中排布 ===== */
.profile-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 48rpx 32rpx 40rpx;
border-radius: 28rpx;
background: var(--white);
border: 2rpx solid var(--line);
box-shadow: var(--shadow-card);
}
.profile-avatar {
width: 144rpx;
height: 144rpx;
border-radius: 36rpx;
flex-shrink: 0;
}
/* 无头像兜底:浅橙衬底 + 姓氏首字。
box-sizing 必须显式声明,否则 2rpx 描边会把 144rpx 撑成 148rpx */
.profile-avatar-fallback {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
background: var(--brand-soft);
border: 2rpx solid var(--brand-line);
}
.profile-avatar-text {
font-size: 52rpx;
font-weight: 700;
color: var(--brand-ink);
}
.profile-name-row {
display: flex;
align-items: center;
margin-top: 24rpx;
}
.profile-name {
font-size: 40rpx;
font-weight: 700;
color: var(--ink);
letter-spacing: 1rpx;
}
/* 资质徽标:浅橙衬底 + 暖橙图标,不引入新的色相 */
.profile-badge {
display: flex;
align-items: center;
flex-shrink: 0;
margin-left: 14rpx;
padding: 4rpx 12rpx;
border-radius: 8rpx;
background: var(--brand-soft);
border: 2rpx solid var(--brand-line);
}
.profile-badge-text {
margin-left: 4rpx;
/* 中文最小 24rpx(12px),低于此不达可读下限 */
font-size: 24rpx;
color: var(--brand-ink);
}
.profile-meta {
display: flex;
align-items: center;
margin-top: 16rpx;
}
.profile-meta-text {
font-size: 26rpx;
color: var(--muted);
}
/* 竖分隔线:与列表页、场景行同一档 --sep */
.meta-sep {
width: 2rpx;
height: 22rpx;
flex-shrink: 0;
margin: 0 16rpx;
background: var(--sep);
}
/* ===== 分区:单竖条 + 区块标题(与全站 section-bar 同构) ===== */
.section {
margin-top: 40rpx;
}
.section-head {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.section-bar {
width: 8rpx;
height: 32rpx;
border-radius: 4rpx;
background: var(--brand-strong);
}
.section-title {
margin-left: 14rpx;
font-size: 32rpx;
font-weight: 700;
color: var(--ink);
letter-spacing: 1rpx;
}
/* ===== 擅长场景 ===== */
.tag-card {
display: flex;
flex-wrap: wrap;
/* 每个 .tag 自带 12rpx 右 / 下外边距,右侧内边距相应减到 16rpx,
否则最后一列标签会比左边多出 12rpx,看起来不居中 */
padding: 28rpx 16rpx 16rpx 28rpx;
border-radius: 24rpx;
background: var(--white);
border: 2rpx solid var(--line);
box-shadow: var(--shadow-card);
}
.tag {
margin: 0 12rpx 12rpx 0;
padding: 8rpx 18rpx;
border-radius: 8rpx;
background: var(--brand-soft);
border: 2rpx solid var(--brand-line);
font-size: 26rpx;
color: var(--brand-ink);
}
/* ===== 服务信息:标签左 --muted、值 --ink,末行去分隔线 ===== */
.info-card {
padding: 4rpx 28rpx;
border-radius: 24rpx;
background: var(--white);
border: 2rpx solid var(--line);
box-shadow: var(--shadow-card);
}
.info-row {
display: flex;
align-items: flex-start;
padding: 24rpx 0;
border-bottom: 2rpx solid var(--line);
}
.info-row:last-child {
border-bottom: none;
}
.info-label {
width: 140rpx;
flex-shrink: 0;
font-size: 26rpx;
color: var(--muted);
}
.info-value {
flex: 1;
font-size: 26rpx;
font-weight: 700;
color: var(--ink);
line-height: 1.6;
}
/* ===== 资质与培训:健康证明行 + 培训记录条目 =====
健康证明复用 .info-row;培训条目用上边线彼此分隔。
两条例外避免出现双线或顶线:
- 紧跟在健康证明行后面时,行尾那条线已由 .info-row 提供
- 作为卡片首个子元素时,不能贴着卡片上沿画线 */
.training-item {
padding: 24rpx 0;
border-top: 2rpx solid var(--line);
}
.info-row + .training-item,
.training-item:first-child {
border-top: none;
}
.training-head {
display: flex;
align-items: flex-start;
}
.training-title {
flex: 1;
font-size: 26rpx;
font-weight: 700;
color: var(--ink);
line-height: 1.6;
}
.training-date {
flex-shrink: 0;
margin-left: 20rpx;
font-size: 24rpx;
color: var(--muted);
}
.training-org {
display: block;
margin-top: 8rpx;
font-size: 24rpx;
color: var(--muted);
}
/* ===== 过往服务评价 ===== */
.review-box {
display: flex;
/* baseline 让「4.8」与「/ 5」在文字基线上对齐,而不是盒中线 */
align-items: baseline;
padding: 28rpx 0;
}
.review-score {
font-size: 48rpx;
font-weight: 700;
color: var(--ink);
line-height: 1;
}
.review-unit {
margin-left: 8rpx;
font-size: 24rpx;
color: var(--muted);
}
/* 条数推到右侧,与左边的分数形成两栏 */
.review-count {
margin-left: auto;
font-size: 24rpx;
color: var(--muted);
}
.review-empty {
display: block;
padding: 28rpx 0;
font-size: 26rpx;
color: var(--muted);
}
/* 简介与 info-row 共用 info-card,但不带标签列 */
.intro-text {
display: block;
padding: 28rpx 0;
font-size: 26rpx;
line-height: 1.8;
color: var(--ink-2);
}
/* ===== 底部说明 ===== */
.notice {
margin-top: 40rpx;
}
.notice-text {
font-size: 24rpx;
line-height: 1.6;
color: var(--muted);
}
.footer-space {
height: 48rpx;
}
@@ -38,7 +38,7 @@ Page({
workYears: item.workYears || 0,
orderCount: item.orderCount || 0,
qualificationVerified: !!item.qualificationVerified,
// 擅长场景最多展示 3 个,避免长尾把卡片撑高
// 擅长场景最多展示 3 个,避免长尾把卡片撑高;完整列表在详情页
specialtyTags: specialties.slice(0, 3),
// 数组在 WXML 里不能直接拼展示,这里先转成文本
areaText: serviceAreas.join(' / '),
@@ -53,10 +53,22 @@ Page({
})
},
// 整卡可点进详情。卡片右侧补 chevron 做点击暗示——
// 项目约束不允许"无暗示的整卡可点"
goToDetail(e) {
const id = e.currentTarget.dataset.id
if (!id) {
return
}
wx.navigateTo({
url: `/pages/attendant/attendantdetail?id=${id}`
})
},
onShareAppMessage() {
return {
title: '暖橙陪诊 · 陪诊师团队',
path: '/pages/escort/attendantlist'
path: '/pages/attendant/attendantlist'
}
}
})
@@ -17,7 +17,13 @@
</view>
<view wx:else class="list">
<view class="staff-card" wx:for="{{ attendants }}" wx:key="id">
<view
class="staff-card"
wx:for="{{ attendants }}"
wx:key="id"
data-id="{{ item.id }}"
bindtap="goToDetail"
>
<view class="staff-head">
<!-- 头像兜底:无头像时用浅橙衬底 + 姓氏首字,避免破图。
@@ -36,7 +42,7 @@
<view class="staff-name-row">
<text class="staff-name">{{ item.name }}</text>
<view class="staff-badge" wx:if="{{ item.qualificationVerified }}">
<t-icon name="check" size="22rpx" color="#9A3412" />
<t-icon name="check" size="22rpx" color="#9B4508" />
<text class="staff-badge-text">资质已核验</text>
</view>
</view>
@@ -45,10 +51,7 @@
<view class="meta-sep"></view>
<text class="staff-meta-text">已服务 {{ item.orderCount }} 次</text>
</view>
</view>
</view>
<!-- 擅长场景:浅橙标签,最多 3 个 -->
<!-- 擅长场景:与姓名、从业信息同列,排在从业信息下方 -->
<view class="staff-tags" wx:if="{{ item.specialtyTags.length > 0 }}">
<text
class="staff-tag"
@@ -57,6 +60,8 @@
wx:key="*this"
>{{ tag }}</text>
</view>
</view>
</view>
<!-- 服务区域 / 语言:单行小字,用细竖线分隔(不用中点字符) -->
<view class="staff-area" wx:if="{{ item.areaText || item.langText }}">
@@ -1,21 +1,8 @@
/* pages/escort/attendantlist.wxss
/* pages/attendant/attendantlist.wxss
陪诊师公示页:与首页、陪诊指南页、联系我们页共用同一套暖橙 + 暖白令牌。
注意 CSS 变量定义在页面级 page{} 里,不是全局——新页面需要自带一份 */
本页原有的 page 级令牌副本(停在旧值 #C2410C / #9A3412)已按
DESIGN.md §5.1 删掉,改用 app.wxss 的唯一来源(#B8520A / #9B4508) */
page {
--brand-strong: #C2410C; /* 实心块/按钮:白字 4.69:1,过 AA 正文 */
--brand-soft: #FFF4E8; /* 图标衬底、标签底 */
--brand-line: #FFE0C2; /* 浅橙衬底描边 */
--brand-ink: #9A3412; /* 浅橙衬底上的文字/图标:6.8:1,过 AA */
--ink: #2B2521;
--ink-2: #4A4038;
--muted: #6F655C; /* 纸面 5.36:1 / 白卡 5.69:1,过 AA */
--line: #ECE3D6; /* 米色发丝边:纸面 1.20:1 / 白卡 1.27:1 */
--paper: #FAF8F5; /* 暖白纸面 */
--white: #FFFFFF;
--shadow-card: 0 2rpx 10rpx rgba(63, 43, 25, 0.07);
background-color: var(--paper);
}
@@ -87,20 +74,23 @@ page {
margin-top: 24rpx;
}
/* stretch 而非 center:让文字块与 160rpx 的头像同高,
由 .staff-main 内部用 space-between 把行铺满,
否则文字块居中后,头像下半部右侧会留出一片空白 */
.staff-head {
display: flex;
align-items: center;
align-items: stretch;
}
.staff-avatar {
width: 96rpx;
height: 96rpx;
border-radius: 24rpx;
width: 160rpx;
height: 160rpx;
border-radius: 40rpx;
flex-shrink: 0;
}
/* 无头像兜底:浅橙衬底 + 姓氏首字。
box-sizing 必须显式声明,否则 2rpx 描边会把 96rpx 撑成 100rpx */
box-sizing 必须显式声明,否则 2rpx 描边会把 160rpx 撑成 164rpx */
.staff-avatar-fallback {
display: flex;
align-items: center;
@@ -111,16 +101,20 @@ page {
}
.staff-avatar-text {
font-size: 36rpx;
font-size: 60rpx;
font-weight: 700;
color: var(--brand-ink);
}
.staff-main {
/* min-width: 0 让长内容可收缩,避免把右侧徽标挤出行外 */
/* min-width: 0 让长内容可收缩,避免把右侧徽标与箭头挤出行外 */
flex: 1;
min-width: 0;
margin-left: 20rpx;
/* 纵向两行铺满头像高度:姓名行贴顶、从业信息贴底 */
display: flex;
flex-direction: column;
justify-content: space-between;
}
.staff-name-row {
@@ -154,10 +148,11 @@ page {
color: var(--brand-ink);
}
/* 竖向位置交给 .staff-main 的 space-between,
这里不再加 margin-top,免得和铺满逻辑叠加 */
.staff-meta {
display: flex;
align-items: center;
margin-top: 10rpx;
}
.staff-meta-text {
@@ -165,21 +160,24 @@ page {
color: var(--muted);
}
/* 竖分隔线:与场景行、页脚同一档 #E5DACC,
/* 竖分隔线:与场景行、页脚同一档 --sep,
比 --line 深一档,保证在浅橙底与白卡上都看得见 */
.meta-sep {
width: 2rpx;
height: 20rpx;
flex-shrink: 0;
margin: 0 14rpx;
background: #E5DACC;
background: var(--sep);
}
/* ===== 擅长场景标签 ===== */
/* ===== 擅长场景标签(已在头像右侧文字列内,排在从业信息下方) ===== */
.staff-tags {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
/* 作为 .staff-main 的第三行:这里只负责与从业信息的最小间距,
竖向富余空间交给 .staff-main 的 space-between 分配。
列宽只有约 414rpx,3 个标签通常会折成两行 */
margin-top: 12rpx;
}
.staff-tag {
@@ -196,6 +194,11 @@ page {
.staff-area {
display: flex;
align-items: center;
/* border-top 画在元素上边缘,padding-top 是线内侧的空隙,
所以线外侧与照片的间距只能用 margin-top 给。
标签行从卡片主体移入头部后,原本垫在线上的那层间距没了,
不补这里就会让照片底线直接贴住这条发丝线 */
margin-top: 24rpx;
padding-top: 16rpx;
border-top: 2rpx solid var(--line);
}
@@ -210,7 +213,7 @@ page {
height: 20rpx;
flex-shrink: 0;
margin: 0 14rpx;
background: #E5DACC;
background: var(--sep);
}
/* ===== 底部说明 ===== */
+5 -2
View File
@@ -19,7 +19,9 @@ Page({
selectedProfileId: '', // 当前选中的就诊人档案 ID,为空表示手动填写
patientName: '',
patientPhone: '',
province: '',
// 默认北京:取值必须与 provinces[0] 完全一致('北京市' 而非 '北京'),
// 否则 picker 的 value=0 与显示文案会对不上
province: '北京市',
provinceIndex: 0,
provinces: ['北京市', '天津市', '河北省', '山西省', '内蒙古自治区', '辽宁省', '吉林省', '黑龙江省', '上海市', '江苏省', '浙江省', '安徽省', '福建省', '江西省', '山东省', '河南省', '湖北省', '湖南省', '广东省', '广西壮族自治区', '海南省', '重庆市', '四川省', '贵州省', '云南省', '西藏自治区', '陕西省', '甘肃省', '青海省', '宁夏回族自治区', '新疆维吾尔自治区', '台湾省', '香港特别行政区', '澳门特别行政区'],
hospital: '',
@@ -367,7 +369,8 @@ Page({
selectedProfileId: '',
patientName: '',
patientPhone: '',
province: '',
// 重置后仍回到默认北京,与 data 初值保持一致
province: '北京市',
provinceIndex: 0,
hospital: '',
department: '',
+15
View File
@@ -26,6 +26,8 @@ Page({
birth: '',
mobile: '',
idnumber: '',
height: '',
weight: '',
remark: ''
}
},
@@ -77,6 +79,9 @@ Page({
birth: profile.birth || '',
mobile: profile.mobile || '',
idnumber: profile.idnumber || '',
// 身高的 schema 默认值是 0,0 视为未填写,回填成空串而不是 "0"
height: health.height ? String(health.height) : '',
weight: health.weight ? String(health.weight) : '',
remark: health.remark || ''
}
})
@@ -150,9 +155,15 @@ Page({
birth,
mobile,
idnumber,
height,
weight,
remark
} = this.data.form
// schema 里身高/体重是 Number,未填按 0(Number('') 即 0,非法输入 NaN 也回落 0)
const heightNum = Number(height) || 0
const weightNum = Number(weight) || 0
// 新增用嵌套对象(schema 的 new Model 需要嵌套结构);
// 更新用点号路径(schema 更新姓名时会额外写 profile.pinyin,整体替换 profile 会冲突)
const payload = this.data.isEdit ? {
@@ -161,6 +172,8 @@ Page({
'profile.birth': birth,
'profile.mobile': mobile.trim(),
'profile.idnumber': idnumber.trim(),
'health.height': heightNum,
'health.weight': weightNum,
'health.remark': remark.trim()
} : {
profile: {
@@ -171,6 +184,8 @@ Page({
idnumber: idnumber.trim()
},
health: {
height: heightNum,
weight: weightNum,
remark: remark.trim()
}
}
+14 -1
View File
@@ -43,8 +43,21 @@
</view>
</view>
<!-- 健康备注:多行输入无法与标签同排,单独一块——标签在上、文本域在下、字数右下 -->
<!-- 健康信息:身高/体重是短输入,沿用行内表单语言(标签左、值右);健康备注是多行输入,
无法与标签同排,故留在本块末尾单独一排——标签在上、文本域在下、字数右下 -->
<view class="form-card">
<view class="form-row">
<text class="form-label">身高</text>
<input class="form-input" value="{{form.height}}" type="digit" placeholder="选填,单位 cm" placeholder-class="form-placeholder"
maxlength="5" data-field="height" bindinput="onFieldInput" />
</view>
<view class="form-row">
<text class="form-label">体重</text>
<input class="form-input" value="{{form.weight}}" type="digit" placeholder="选填,单位 kg" placeholder-class="form-placeholder"
maxlength="5" data-field="weight" bindinput="onFieldInput" />
</view>
<view class="form-remark">
<text class="form-label">健康备注</text>
<textarea class="form-textarea" value="{{form.remark}}" placeholder="选填,如过敏史、慢病、行动不便等情况,便于陪诊师提前准备"
+1 -1
View File
@@ -163,7 +163,7 @@ Page({
// 介绍卡信任行:「实名专业陪诊师」→ 陪诊师公示页
goToAttendants() {
wx.navigateTo({
url: '/pages/escort/attendantlist'
url: '/pages/attendant/attendantlist'
});
},
+2
View File
@@ -18,6 +18,8 @@ const API = {
deleteRecord: (id) => request.delete(`/health/escort-record/${id}`),
// 陪诊师公示列表(公开接口,后端已做脱敏)
getAttendants: (params) => request.get('/health/attendant', params),
// 单个陪诊师详情,同一份白名单数据
getAttendantById: (id) => request.get(`/health/attendant/${id}`),
},
// 就诊人:后端强制以 token 中的用户为准,无需传 userId