diff --git a/app.json b/app.json index 292e54e..d9d52d0 100644 --- a/app.json +++ b/app.json @@ -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", diff --git a/doc/DESIGN.md b/doc/DESIGN.md index bd4e30c..b050686 100644 --- a/doc/DESIGN.md +++ b/doc/DESIGN.md @@ -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),与本次主色调整无关。 \ No newline at end of file diff --git a/doc/PROJECT_GUIDE.md b/doc/PROJECT_GUIDE.md index 38abd53..897e195 100644 --- a/doc/PROJECT_GUIDE.md +++ b/doc/PROJECT_GUIDE.md @@ -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` | 用户协议 | diff --git a/doc/RERACT_PLAN.md b/doc/RERACT_PLAN.md index 3fb92c2..659e7e7 100644 --- a/doc/RERACT_PLAN.md +++ b/doc/RERACT_PLAN.md @@ -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` | 同上 | diff --git a/pages/attendant/attendantdetail.js b/pages/attendant/attendantdetail.js new file mode 100644 index 0000000..e4d893f --- /dev/null +++ b/pages/attendant/attendantdetail.js @@ -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}` + } + } +}) diff --git a/pages/attendant/attendantdetail.json b/pages/attendant/attendantdetail.json new file mode 100644 index 0000000..0dee0ae --- /dev/null +++ b/pages/attendant/attendantdetail.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "陪诊师详情", + "usingComponents": { + "t-icon": "tdesign-miniprogram/icon/icon" + } +} diff --git a/pages/attendant/attendantdetail.wxml b/pages/attendant/attendantdetail.wxml new file mode 100644 index 0000000..f944522 --- /dev/null +++ b/pages/attendant/attendantdetail.wxml @@ -0,0 +1,146 @@ + + + + + 加载中… + + + + 该陪诊师信息不存在或已下架 + + + + + + + + + + {{ attendant.initial }} + + + + {{ attendant.name }} + + + 资质已核验 + + + + + 从业 {{ attendant.workYears }} 年 + + 已服务 {{ attendant.orderCount }} 次 + + + + + + + + 擅长场景 + + + {{ tag }} + + + + + + + + 服务信息 + + + + 性别 + {{ attendant.sexText }} + + + 服务区域 + {{ areaText }} + + + 服务语言 + {{ langText }} + + + + + + + + + 资质与培训 + + + + 健康证明 + {{ attendant.healthCertificateText }} + + + + + {{ item.title }} + {{ item.date }} + + {{ item.org }} + + + + + + + + + 过往服务评价 + + + + {{ attendant.reviewScore }} + / 5 + 共 {{ attendant.reviewCount }} 条评价 + + + + {{ attendant.reviewCount > 0 ? '评价条数不足,暂不显示评分' : '暂无评价' }} + + + + + + + + + 个人简介 + + + {{ attendant.introduction }} + + + + + + 以上为陪同人员信息公示,用于核对身份与从业信息,不含联系方式。 + + + + + + diff --git a/pages/attendant/attendantdetail.wxss b/pages/attendant/attendantdetail.wxss new file mode 100644 index 0000000..0699da4 --- /dev/null +++ b/pages/attendant/attendantdetail.wxss @@ -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; +} diff --git a/pages/escort/attendantlist.js b/pages/attendant/attendantlist.js similarity index 82% rename from pages/escort/attendantlist.js rename to pages/attendant/attendantlist.js index 3399086..e53265a 100644 --- a/pages/escort/attendantlist.js +++ b/pages/attendant/attendantlist.js @@ -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' } } -}) \ No newline at end of file +}) diff --git a/pages/escort/attendantlist.json b/pages/attendant/attendantlist.json similarity index 98% rename from pages/escort/attendantlist.json rename to pages/attendant/attendantlist.json index 83e920f..1a8afec 100644 --- a/pages/escort/attendantlist.json +++ b/pages/attendant/attendantlist.json @@ -3,4 +3,4 @@ "usingComponents": { "t-icon": "tdesign-miniprogram/icon/icon" } -} \ No newline at end of file +} diff --git a/pages/escort/attendantlist.wxml b/pages/attendant/attendantlist.wxml similarity index 81% rename from pages/escort/attendantlist.wxml rename to pages/attendant/attendantlist.wxml index cde52bb..3d4af0c 100644 --- a/pages/escort/attendantlist.wxml +++ b/pages/attendant/attendantlist.wxml @@ -17,7 +17,13 @@ - + + + {{ tag }} + - - - {{ tag }} - - 服务区域 {{ item.areaText }} @@ -74,4 +79,4 @@ - \ No newline at end of file + diff --git a/pages/escort/attendantlist.wxss b/pages/attendant/attendantlist.wxss similarity index 65% rename from pages/escort/attendantlist.wxss rename to pages/attendant/attendantlist.wxss index 824aa30..cec77f5 100644 --- a/pages/escort/attendantlist.wxss +++ b/pages/attendant/attendantlist.wxss @@ -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); } /* ===== 底部说明 ===== */ @@ -226,4 +229,4 @@ page { .footer-space { height: 48rpx; -} \ No newline at end of file +} diff --git a/pages/escort/itemdetail.js b/pages/escort/itemdetail.js index 629f93d..3a788ee 100644 --- a/pages/escort/itemdetail.js +++ b/pages/escort/itemdetail.js @@ -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: '', diff --git a/pages/health/profileedit.js b/pages/health/profileedit.js index 67e1986..c9c8cf6 100644 --- a/pages/health/profileedit.js +++ b/pages/health/profileedit.js @@ -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() } } diff --git a/pages/health/profileedit.wxml b/pages/health/profileedit.wxml index 2dd03ff..74c66bf 100644 --- a/pages/health/profileedit.wxml +++ b/pages/health/profileedit.wxml @@ -43,8 +43,21 @@ - + + + 身高 + + + + + 体重 + + + 健康备注