committed by
trae-solo-agent
co-authored by
Kimi-K3.1-Pro noreply@moonshot.cn
parent
1181d598b4
commit
df96cb3b07
+22
-6
@@ -8,9 +8,9 @@ Page({
|
||||
isTyping: false,
|
||||
scrollToMessage: '',
|
||||
quickQuestions: [
|
||||
'陪诊服务的流程是什么?',
|
||||
'如何预约陪诊服务?',
|
||||
'陪诊服务收费标准?'
|
||||
{ id: '陪诊服务的流程是什么?', text: '陪诊服务的流程是什么?' },
|
||||
{ id: '如何预约陪诊服务?', text: '如何预约陪诊服务?' },
|
||||
{ id: '陪诊服务收费标准?', text: '陪诊服务收费标准?' }
|
||||
]
|
||||
},
|
||||
|
||||
@@ -46,13 +46,27 @@ Page({
|
||||
try {
|
||||
const res = await API.resource.getAiQuickQuestions()
|
||||
if (res.code === 0) {
|
||||
this.setData({ quickQuestions: res.data.aiquick_questions })
|
||||
this.setData({
|
||||
quickQuestions: this.createQuestionItems(res.data.aiquick_questions)
|
||||
})
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取陪诊服务问题失败', err)
|
||||
}
|
||||
},
|
||||
|
||||
// 问题文本即稳定键;重复问题只保留一项,避免服务端清单造成重复 key。
|
||||
createQuestionItems(questions) {
|
||||
const seen = new Set()
|
||||
return (Array.isArray(questions) ? questions : []).reduce((list, item) => {
|
||||
const text = typeof item === 'string' ? item : item?.text
|
||||
if (!text || seen.has(text)) return list
|
||||
seen.add(text)
|
||||
list.push({ id: text, text })
|
||||
return list
|
||||
}, [])
|
||||
},
|
||||
|
||||
initSocketListeners() {
|
||||
const socket = getApp().initChatSocket()
|
||||
|
||||
@@ -190,6 +204,9 @@ Page({
|
||||
.filter(item => item && ['ai', 'user', 'system'].includes(item.type))
|
||||
.map((item) => {
|
||||
const message = { ...item }
|
||||
if (message.contentType === 'questions') {
|
||||
message.content = this.createQuestionItems(message.content)
|
||||
}
|
||||
if (!message.id || usedIds.has(message.id)) {
|
||||
message.id = this.createMessageId()
|
||||
}
|
||||
@@ -248,7 +265,7 @@ Page({
|
||||
id: this.createMessageId(),
|
||||
type: 'ai',
|
||||
contentType: 'questions',
|
||||
content: questions,
|
||||
content: this.createQuestionItems(questions.map(item => item.text)),
|
||||
time: this.formatTime(new Date())
|
||||
}
|
||||
|
||||
@@ -324,7 +341,6 @@ Page({
|
||||
content,
|
||||
id: requestId,
|
||||
token,
|
||||
appId: app.globalData.appId,
|
||||
ts: new Date().toISOString()
|
||||
})
|
||||
return true
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
<view
|
||||
class="quick-item"
|
||||
wx:for="{{quickQuestions}}"
|
||||
wx:key="index"
|
||||
wx:key="id"
|
||||
bindtap="onQuickQuestionTap"
|
||||
data-question="{{item}}"
|
||||
data-question="{{item.text}}"
|
||||
>
|
||||
<text>{{item}}</text>
|
||||
<text>{{item.text}}</text>
|
||||
<t-icon name="chevron-right" size="26rpx" color="#9B4508" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -74,11 +74,11 @@
|
||||
class="quick-item"
|
||||
wx:for="{{item.content}}"
|
||||
wx:for-item="question"
|
||||
wx:key="*this"
|
||||
wx:key="id"
|
||||
bindtap="onQuickQuestionTap"
|
||||
data-question="{{question}}"
|
||||
data-question="{{question.text}}"
|
||||
>
|
||||
<text>{{question}}</text>
|
||||
<text>{{question.text}}</text>
|
||||
<t-icon name="chevron-right" size="26rpx" color="#9B4508" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
const API = require('../../utils/api.js')
|
||||
|
||||
// 由 YYYY-MM-DD 生日换算周岁。
|
||||
// 后端只下发到「日」、不含时分秒——公示场景要的是"多大",不是哪一天生的。
|
||||
// 生日缺失 / 非法 / 算出不合常理(负数或 >120),一律返回 0,模板按 0 隐藏该项
|
||||
function calcAge(birthday) {
|
||||
if (!birthday) {
|
||||
return 0
|
||||
}
|
||||
// 把 '-' 换成 '/' 再解析:小程序 iOS 对 'YYYY-MM-DD HH:mm:ss' 这类格式
|
||||
// 会得到 Invalid Date,'/' 分隔是各端都稳的写法
|
||||
const birth = new Date(String(birthday).replace(/-/g, '/'))
|
||||
if (Number.isNaN(birth.getTime())) {
|
||||
return 0
|
||||
}
|
||||
|
||||
const today = new Date()
|
||||
let age = today.getFullYear() - birth.getFullYear()
|
||||
// 今年生日还没到,减一岁
|
||||
const monthDiff = today.getMonth() - birth.getMonth()
|
||||
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birth.getDate())) {
|
||||
age -= 1
|
||||
}
|
||||
|
||||
// 上限 120 是给运营手抖填错年份兜底,否则页面上会出现"年龄 226 岁"
|
||||
if (!Number.isFinite(age) || age < 0 || age > 120) {
|
||||
return 0
|
||||
}
|
||||
return age
|
||||
}
|
||||
|
||||
// 陪诊师详情:数据来自后端公开接口 /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' ? '女' : '',
|
||||
// 周岁由本页现算,未登记生日时为 0,模板据 0 隐藏该行
|
||||
age: calcAge(item.birthday),
|
||||
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}`
|
||||
}
|
||||
},
|
||||
|
||||
// 朋友圈只能分享当前页,陪诊师 id 只能靠 query 带上;
|
||||
// 详情还没回来(attendant 为 null)时不带 query,好友打开是列表页口径的空态
|
||||
onShareTimeline() {
|
||||
const {
|
||||
attendant
|
||||
} = this.data
|
||||
|
||||
if (!attendant) {
|
||||
return {
|
||||
title: '暖橙陪诊 · 陪诊师团队'
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
title: `暖橙陪诊 · ${attendant.name}`,
|
||||
query: `id=${attendant.id}`
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "陪诊师详情",
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon"
|
||||
}
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
<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 || attendant.age > 0 || 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="{{ attendant.age > 0 }}">
|
||||
<text class="info-label">年龄</text>
|
||||
<text class="info-value">{{ attendant.age }} 岁</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>
|
||||
@@ -1,299 +0,0 @@
|
||||
/* 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 14rpx;
|
||||
border-radius: 10rpx;
|
||||
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: 6rpx 14rpx;
|
||||
border-radius: 10rpx;
|
||||
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;
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
const API = require('../../utils/api.js')
|
||||
|
||||
// 陪诊师公示列表:数据来自后端公开接口 /health/attendant
|
||||
// 该接口已做脱敏(不含手机号 / 身份证号 / 证书编号原文,生日只下发到日),
|
||||
// 前端不做二次裁剪,只把后端字段整形为展示所需结构(周岁由生日现算)
|
||||
|
||||
// 由 YYYY-MM-DD 生日换算周岁。
|
||||
// 后端只下发到「日」、不含时分秒——公示场景要的是"多大",不是哪一天生的。
|
||||
// 生日缺失 / 非法 / 算出不合常理(负数或 >120),一律返回 0,模板按 0 隐藏该项
|
||||
function calcAge(birthday) {
|
||||
if (!birthday) {
|
||||
return 0
|
||||
}
|
||||
// 把 '-' 换成 '/' 再解析:小程序 iOS 对 'YYYY-MM-DD HH:mm:ss' 这类格式
|
||||
// 会得到 Invalid Date,'/' 分隔是各端都稳的写法
|
||||
const birth = new Date(String(birthday).replace(/-/g, '/'))
|
||||
if (Number.isNaN(birth.getTime())) {
|
||||
return 0
|
||||
}
|
||||
|
||||
const today = new Date()
|
||||
let age = today.getFullYear() - birth.getFullYear()
|
||||
// 今年生日还没到,减一岁
|
||||
const monthDiff = today.getMonth() - birth.getMonth()
|
||||
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birth.getDate())) {
|
||||
age -= 1
|
||||
}
|
||||
|
||||
// 上限 120 是给运营手抖填错年份兜底,否则页面上会出现"年龄 226 岁"
|
||||
if (!Number.isFinite(age) || age < 0 || age > 120) {
|
||||
return 0
|
||||
}
|
||||
return age
|
||||
}
|
||||
|
||||
Page({
|
||||
data: {
|
||||
loading: true,
|
||||
attendants: []
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadAttendants()
|
||||
},
|
||||
|
||||
loadAttendants() {
|
||||
API.escort.getAttendants()
|
||||
.then((res) => {
|
||||
if (res.code !== 0) {
|
||||
this.setData({ loading: false })
|
||||
return
|
||||
}
|
||||
|
||||
const list = (res.data && res.data.attendants) || []
|
||||
this.setData({
|
||||
loading: false,
|
||||
attendants: list.map((item) => {
|
||||
const specialties = item.specialties || []
|
||||
const serviceAreas = item.serviceAreas || []
|
||||
const languages = item.languages || []
|
||||
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
avatar: item.avatar,
|
||||
// 头像兜底用的首字:姓名已脱敏为「姓 + 陪诊师」,取第一个字即可
|
||||
initial: (item.name || '').slice(0, 1),
|
||||
workYears: item.workYears || 0,
|
||||
// 周岁由本页现算,未登记生日时为 0,模板据 0 隐藏该段
|
||||
age: calcAge(item.birthday),
|
||||
orderCount: item.orderCount || 0,
|
||||
qualificationVerified: !!item.qualificationVerified,
|
||||
// 擅长场景最多展示 3 个,避免长尾把卡片撑高;完整列表在详情页
|
||||
specialtyTags: specialties.slice(0, 3),
|
||||
// 数组在 WXML 里不能直接拼展示,这里先转成文本
|
||||
areaText: serviceAreas.join(' / '),
|
||||
langText: languages.join(' / ')
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('获取陪诊师列表失败', err)
|
||||
this.setData({ loading: false })
|
||||
})
|
||||
},
|
||||
|
||||
// 整卡可点进详情。卡片右侧补 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/attendant/attendantlist'
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "陪诊师团队",
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon"
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
<view class="page-bg">
|
||||
<view class="container">
|
||||
|
||||
<!-- 头部:小色带 + 深墨标题 + 一句定位(内页规范,与陪诊指南、联系我们同构) -->
|
||||
<view class="page-header">
|
||||
<view class="header-accent"></view>
|
||||
<text class="header-title">陪诊师团队</text>
|
||||
<text class="header-subtitle">每位都实名上岗,从业信息可核对</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{ loading }}" class="state">
|
||||
<text class="state-text">加载中…</text>
|
||||
</view>
|
||||
|
||||
<view wx:elif="{{ attendants.length === 0 }}" class="state">
|
||||
<text class="state-text">暂无陪诊师信息</text>
|
||||
</view>
|
||||
|
||||
<view wx:else class="list">
|
||||
<view
|
||||
class="staff-card"
|
||||
wx:for="{{ attendants }}"
|
||||
wx:key="id"
|
||||
data-id="{{ item.id }}"
|
||||
bindtap="goToDetail"
|
||||
>
|
||||
|
||||
<view class="staff-head">
|
||||
<!-- 头像兜底:无头像时用浅橙衬底 + 姓氏首字,避免破图。
|
||||
整页沿用「浅橙衬底承载标识」的语言,不额外引入色相 -->
|
||||
<image
|
||||
wx:if="{{ item.avatar }}"
|
||||
class="staff-avatar"
|
||||
src="{{ item.avatar }}"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<view wx:else class="staff-avatar staff-avatar-fallback">
|
||||
<text class="staff-avatar-text">{{ item.initial }}</text>
|
||||
</view>
|
||||
|
||||
<view class="staff-main">
|
||||
<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="#9B4508" />
|
||||
<text class="staff-badge-text">资质已核验</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="staff-meta">
|
||||
<text class="staff-meta-text">从业 {{ item.workYears }} 年</text>
|
||||
<!-- 年龄未登记时(后端给 0)整段连同分隔线一起隐藏,不留孤立竖线 -->
|
||||
<block wx:if="{{ item.age > 0 }}">
|
||||
<view class="meta-sep"></view>
|
||||
<text class="staff-meta-text">{{ item.age }} 岁</text>
|
||||
</block>
|
||||
<view class="meta-sep"></view>
|
||||
<text class="staff-meta-text">已服务 {{ item.orderCount }} 次</text>
|
||||
</view>
|
||||
<!-- 擅长场景:与姓名、从业信息同列,排在从业信息下方 -->
|
||||
<view class="staff-tags" wx:if="{{ item.specialtyTags.length > 0 }}">
|
||||
<text
|
||||
class="staff-tag"
|
||||
wx:for="{{ item.specialtyTags }}"
|
||||
wx:for-item="tag"
|
||||
wx:key="*this"
|
||||
>{{ tag }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 服务区域 / 语言:单行小字,用细竖线分隔(不用中点字符) -->
|
||||
<view class="staff-area" wx:if="{{ item.areaText || item.langText }}">
|
||||
<text class="staff-area-text" wx:if="{{ item.areaText }}">服务区域 {{ item.areaText }}</text>
|
||||
<view class="area-sep" wx:if="{{ item.areaText && item.langText }}"></view>
|
||||
<text class="staff-area-text" wx:if="{{ item.langText }}">语言 {{ item.langText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 说明:交代字段口径,同时暗示「不展示联系方式」是有意为之,而非信息缺失 -->
|
||||
<view class="notice" wx:if="{{ !loading }}">
|
||||
<text class="notice-text">以上为陪同人员信息公示,用于核对身份与从业信息,不含联系方式。</text>
|
||||
</view>
|
||||
|
||||
<view class="footer-space"></view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -1,232 +0,0 @@
|
||||
/* pages/attendant/attendantlist.wxss
|
||||
陪诊师公示页:与首页、陪诊指南页、联系我们页共用同一套暖橙 + 暖白令牌。
|
||||
本页原有的 page 级令牌副本(停在旧值 #C2410C / #9A3412)已按
|
||||
DESIGN.md §5.1 删掉,改用 app.wxss 的唯一来源(#B8520A / #9B4508) */
|
||||
page {
|
||||
background-color: var(--paper);
|
||||
}
|
||||
|
||||
.page-bg {
|
||||
min-height: 100vh;
|
||||
background: var(--paper);
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 32rpx 32rpx 0;
|
||||
}
|
||||
|
||||
/* ===== 头部:小色带 + 深墨标题 ===== */
|
||||
.page-header {
|
||||
padding: 24rpx 0 8rpx;
|
||||
}
|
||||
|
||||
.header-accent {
|
||||
width: 64rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 4rpx;
|
||||
background: var(--brand-strong);
|
||||
}
|
||||
|
||||
.header-title {
|
||||
display: block;
|
||||
margin-top: 20rpx;
|
||||
font-size: 46rpx;
|
||||
font-weight: 700;
|
||||
color: var(--ink);
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.header-subtitle {
|
||||
display: block;
|
||||
margin-top: 12rpx;
|
||||
font-size: 26rpx;
|
||||
color: var(--muted);
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
/* ===== 加载 / 空状态 ===== */
|
||||
.state {
|
||||
padding: 120rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.state-text {
|
||||
font-size: 26rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* ===== 陪诊师卡片:发丝边 + 紧阴影,与首页白卡同语言 ===== */
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.staff-card {
|
||||
padding: 28rpx 26rpx;
|
||||
border-radius: 28rpx;
|
||||
background: var(--white);
|
||||
border: 2rpx solid var(--line);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.staff-card + .staff-card {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
/* stretch 而非 center:让文字块与 160rpx 的头像同高,
|
||||
由 .staff-main 内部用 space-between 把行铺满,
|
||||
否则文字块居中后,头像下半部右侧会留出一片空白 */
|
||||
.staff-head {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.staff-avatar {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 40rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 无头像兜底:浅橙衬底 + 姓氏首字。
|
||||
box-sizing 必须显式声明,否则 2rpx 描边会把 160rpx 撑成 164rpx */
|
||||
.staff-avatar-fallback {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
background: var(--brand-soft);
|
||||
border: 2rpx solid var(--brand-line);
|
||||
}
|
||||
|
||||
.staff-avatar-text {
|
||||
font-size: 60rpx;
|
||||
font-weight: 700;
|
||||
color: var(--brand-ink);
|
||||
}
|
||||
|
||||
.staff-main {
|
||||
/* min-width: 0 让长内容可收缩,避免把右侧徽标与箭头挤出行外 */
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-left: 20rpx;
|
||||
/* 纵向两行铺满头像高度:姓名行贴顶、从业信息贴底 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.staff-name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.staff-name {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: var(--ink);
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
/* 资质徽标:浅橙衬底 + 暖橙图标,不引入新的色相 */
|
||||
.staff-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
margin-left: 14rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 10rpx;
|
||||
background: var(--brand-soft);
|
||||
border: 2rpx solid var(--brand-line);
|
||||
}
|
||||
|
||||
.staff-badge-text {
|
||||
margin-left: 4rpx;
|
||||
/* 中文最小 24rpx(12px),低于此不达可读下限 */
|
||||
font-size: 24rpx;
|
||||
color: var(--brand-ink);
|
||||
}
|
||||
|
||||
/* 竖向位置交给 .staff-main 的 space-between,
|
||||
这里不再加 margin-top,免得和铺满逻辑叠加 */
|
||||
.staff-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.staff-meta-text {
|
||||
font-size: 24rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* 竖分隔线:与场景行、页脚同一档 --sep,
|
||||
比 --line 深一档,保证在浅橙底与白卡上都看得见 */
|
||||
.meta-sep {
|
||||
width: 2rpx;
|
||||
height: 20rpx;
|
||||
flex-shrink: 0;
|
||||
margin: 0 14rpx;
|
||||
background: var(--sep);
|
||||
}
|
||||
|
||||
/* ===== 擅长场景标签(已在头像右侧文字列内,排在从业信息下方) ===== */
|
||||
.staff-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
/* 作为 .staff-main 的第三行:这里只负责与从业信息的最小间距,
|
||||
竖向富余空间交给 .staff-main 的 space-between 分配。
|
||||
列宽只有约 414rpx,3 个标签通常会折成两行 */
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.staff-tag {
|
||||
margin: 0 12rpx 12rpx 0;
|
||||
padding: 6rpx 14rpx;
|
||||
border-radius: 10rpx;
|
||||
background: var(--brand-soft);
|
||||
border: 2rpx solid var(--brand-line);
|
||||
font-size: 24rpx;
|
||||
color: var(--brand-ink);
|
||||
}
|
||||
|
||||
/* ===== 服务区域 / 语言 ===== */
|
||||
.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);
|
||||
}
|
||||
|
||||
.staff-area-text {
|
||||
font-size: 24rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.area-sep {
|
||||
width: 2rpx;
|
||||
height: 20rpx;
|
||||
flex-shrink: 0;
|
||||
margin: 0 14rpx;
|
||||
background: var(--sep);
|
||||
}
|
||||
|
||||
/* ===== 底部说明 ===== */
|
||||
.notice {
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.notice-text {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.footer-space {
|
||||
height: 48rpx;
|
||||
}
|
||||
@@ -20,13 +20,36 @@ Page({
|
||||
this.setData({ loading: true, error: false })
|
||||
getApp().loadAgreement().then((agreement) => {
|
||||
this.setData({
|
||||
agreement: agreement || null,
|
||||
agreement: agreement ? this.formatAgreement(agreement) : null,
|
||||
loading: false,
|
||||
error: !agreement
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 服务端协议保留简洁文案结构,页面渲染前补稳定键,不在 WXML 使用索引或值本身作 key。
|
||||
formatAgreement(agreement) {
|
||||
const toItems = list => (list || []).map((text, index) => ({
|
||||
id: `${index}_${text}`,
|
||||
text
|
||||
}))
|
||||
return {
|
||||
...agreement,
|
||||
sections: (agreement.sections || []).map(section => ({
|
||||
...section,
|
||||
items: section.items ? toItems(section.items) : section.items,
|
||||
table: section.table ? {
|
||||
headers: toItems(section.table.headers),
|
||||
rows: (section.table.rows || []).map(row => ({
|
||||
id: row.join('|'),
|
||||
cells: toItems(row)
|
||||
}))
|
||||
} : section.table
|
||||
})),
|
||||
footer: toItems(agreement.footer)
|
||||
}
|
||||
},
|
||||
|
||||
retry() {
|
||||
this.loadAgreement()
|
||||
},
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
<view class="section-content">
|
||||
<!-- list / mixed 类型的 items -->
|
||||
<block wx:if="{{item.type === 'list' || item.type === 'mixed'}}">
|
||||
<view wx:for="{{item.items}}" wx:for-item="subItem" wx:for-index="subIdx" wx:key="subIdx" class="list-item">
|
||||
<view wx:for="{{item.items}}" wx:for-item="subItem" wx:key="id" class="list-item">
|
||||
<view class="list-dot"></view>
|
||||
<text class="list-text">{{subItem}}</text>
|
||||
<text class="list-text">{{subItem.text}}</text>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
<block wx:if="{{item.type === 'mixed' && item.table}}">
|
||||
<view class="refund-table">
|
||||
<view class="table-row header">
|
||||
<text wx:for="{{item.table.headers}}" wx:for-item="h" wx:key="*this" class="table-cell">{{h}}</text>
|
||||
<text wx:for="{{item.table.headers}}" wx:for-item="h" wx:key="id" class="table-cell">{{h.text}}</text>
|
||||
</view>
|
||||
<view wx:for="{{item.table.rows}}" wx:for-item="row" wx:key="*this" class="table-row">
|
||||
<text wx:for="{{row}}" wx:for-item="cell" wx:key="*this" class="table-cell">{{cell}}</text>
|
||||
<view wx:for="{{item.table.rows}}" wx:for-item="row" wx:key="id" class="table-row">
|
||||
<text wx:for="{{row.cells}}" wx:for-item="cell" wx:key="id" class="table-cell">{{cell.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
@@ -52,7 +52,7 @@
|
||||
</view>
|
||||
|
||||
<view class="footer-section">
|
||||
<text wx:for="{{agreement.footer}}" wx:key="*this" class="footer-text">{{item}}</text>
|
||||
<text wx:for="{{agreement.footer}}" wx:key="id" class="footer-text">{{item.text}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
@@ -63,6 +63,14 @@ Page({
|
||||
]
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
const toItems = list => list.map(text => ({ id: text, text }))
|
||||
this.setData({
|
||||
preparations: toItems(this.data.preparations),
|
||||
tips: toItems(this.data.tips)
|
||||
})
|
||||
},
|
||||
|
||||
// 下一步:进入陪诊服务列表
|
||||
goToServiceList() {
|
||||
wx.navigateTo({
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
<text class="card-title">就诊前准备</text>
|
||||
</view>
|
||||
<view class="dot-list">
|
||||
<view class="dot-item" wx:for="{{ preparations }}" wx:key="*this">
|
||||
<view class="dot-item" wx:for="{{ preparations }}" wx:key="id">
|
||||
<view class="dot"></view>
|
||||
<text class="dot-text">{{ item }}</text>
|
||||
<text class="dot-text">{{ item.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -61,9 +61,9 @@
|
||||
<text class="card-title">温馨提示</text>
|
||||
</view>
|
||||
<view class="dot-list">
|
||||
<view class="dot-item" wx:for="{{ tips }}" wx:key="*this">
|
||||
<view class="dot-item" wx:for="{{ tips }}" wx:key="id">
|
||||
<view class="dot"></view>
|
||||
<text class="dot-text">{{ item }}</text>
|
||||
<text class="dot-text">{{ item.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -65,8 +65,12 @@ Page({
|
||||
}
|
||||
|
||||
this.applyBookingConfig(service)
|
||||
const serviceView = {
|
||||
...service,
|
||||
notices: (service.notices || []).map(text => ({ id: text, text }))
|
||||
}
|
||||
this.setData({
|
||||
service,
|
||||
service: serviceView,
|
||||
serviceIcon: this.getServiceIcon(service.title),
|
||||
totalPrice: service.price,
|
||||
pageLoading: false
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<text class="section-title">服务流程</text>
|
||||
</view>
|
||||
<view class="step-list">
|
||||
<view class="step" wx:for="{{ service.flow }}" wx:key="index">
|
||||
<view class="step" wx:for="{{ service.flow }}" wx:key="title">
|
||||
<view class="step-rail">
|
||||
<view class="step-dot">{{ index + 1 }}</view>
|
||||
<view class="step-line" wx:if="{{ index < service.flow.length - 1 }}"></view>
|
||||
@@ -49,9 +49,9 @@
|
||||
<text class="section-title">注意事项</text>
|
||||
</view>
|
||||
<view class="dot-list">
|
||||
<view class="dot-item" wx:for="{{ service.notices }}" wx:key="index">
|
||||
<view class="dot-item" wx:for="{{ service.notices }}" wx:key="id">
|
||||
<view class="dot"></view>
|
||||
<text class="dot-text">{{ item }}</text>
|
||||
<text class="dot-text">{{ item.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -39,11 +39,11 @@ Page({
|
||||
showCancelPopup: false,
|
||||
cancelReason: '',
|
||||
cancelReasons: [
|
||||
'临时有事,无法前往',
|
||||
'病情好转,无需陪诊',
|
||||
'医院停诊/改期',
|
||||
'陪诊师无法到达',
|
||||
'其他原因'
|
||||
{ id: 'schedule', text: '临时有事,无法前往' },
|
||||
{ id: 'recovered', text: '病情好转,无需陪诊' },
|
||||
{ id: 'hospital', text: '医院停诊/改期' },
|
||||
{ id: 'escort', text: '陪诊师无法到达' },
|
||||
{ id: 'other', text: '其他原因' }
|
||||
]
|
||||
},
|
||||
|
||||
@@ -259,10 +259,10 @@ Page({
|
||||
// 不靠一串 && 条件去猜哪条分隔线该出现(避免留下孤立的分隔线)
|
||||
buildPatientMeta(patient) {
|
||||
const list = []
|
||||
if (patient.sexText) list.push(patient.sexText)
|
||||
if (patient.age) list.push(`${patient.age}岁`)
|
||||
if (patient.height) list.push(`身高 ${patient.height}cm`)
|
||||
if (patient.weight) list.push(`体重 ${patient.weight}kg`)
|
||||
if (patient.sexText) list.push({ id: 'sex', text: patient.sexText })
|
||||
if (patient.age) list.push({ id: 'age', text: `${patient.age}岁` })
|
||||
if (patient.height) list.push({ id: 'height', text: `身高 ${patient.height}cm` })
|
||||
if (patient.weight) list.push({ id: 'weight', text: `体重 ${patient.weight}kg` })
|
||||
return list
|
||||
},
|
||||
|
||||
@@ -270,9 +270,11 @@ Page({
|
||||
// 省份不进元信息行,由 hospitalProvince 单独提到卡内右上角
|
||||
buildHospitalMeta(hospital) {
|
||||
const list = []
|
||||
if (hospital.department) list.push(hospital.department)
|
||||
if (hospital.doctor) list.push(hospital.doctor)
|
||||
if (hospital.medicalRecordNo) list.push(`病历号 ${hospital.medicalRecordNo}`)
|
||||
if (hospital.department) list.push({ id: 'department', text: hospital.department })
|
||||
if (hospital.doctor) list.push({ id: 'doctor', text: hospital.doctor })
|
||||
if (hospital.medicalRecordNo) {
|
||||
list.push({ id: 'medicalRecordNo', text: `病历号 ${hospital.medicalRecordNo}` })
|
||||
}
|
||||
return list
|
||||
},
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
|
||||
<!-- 体征行:空值已在 JS 里整项剔除,这里只按序插竖线 -->
|
||||
<view class="meta-list patient-meta-row" wx:if="{{record.patientMeta.length > 0}}">
|
||||
<block wx:for="{{record.patientMeta}}" wx:key="*this">
|
||||
<block wx:for="{{record.patientMeta}}" wx:key="id">
|
||||
<view class="meta-sep" wx:if="{{index > 0}}"></view>
|
||||
<text class="meta-item">{{item}}</text>
|
||||
<text class="meta-item">{{item.text}}</text>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
@@ -85,9 +85,9 @@
|
||||
</view>
|
||||
|
||||
<view class="meta-list hospital-meta" wx:if="{{record.hospitalMeta.length > 0}}">
|
||||
<block wx:for="{{record.hospitalMeta}}" wx:key="*this">
|
||||
<block wx:for="{{record.hospitalMeta}}" wx:key="id">
|
||||
<view class="meta-sep" wx:if="{{index > 0}}"></view>
|
||||
<text class="meta-item">{{item}}</text>
|
||||
<text class="meta-item">{{item.text}}</text>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
@@ -392,16 +392,16 @@
|
||||
<text class="cancel-tip">确定要取消该陪诊订单吗?取消后陪诊师将收到通知。</text>
|
||||
<view class="cancel-reason-list">
|
||||
<view
|
||||
class="cancel-reason-item {{cancelReason === item ? 'active' : ''}}"
|
||||
class="cancel-reason-item {{cancelReason === item.text ? 'active' : ''}}"
|
||||
wx:for="{{cancelReasons}}"
|
||||
wx:key="*this"
|
||||
data-reason="{{item}}"
|
||||
wx:key="id"
|
||||
data-reason="{{item.text}}"
|
||||
bindtap="onSelectCancelReason"
|
||||
>
|
||||
<view class="reason-radio">
|
||||
<view class="reason-radio-inner" wx:if="{{cancelReason === item}}"></view>
|
||||
<view class="reason-radio-inner" wx:if="{{cancelReason === item.text}}"></view>
|
||||
</view>
|
||||
<text class="reason-text">{{item}}</text>
|
||||
<text class="reason-text">{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -59,13 +59,13 @@ Page({
|
||||
// 顺序:出生年月 → 联系电话 → 证件号(脱敏)
|
||||
const metaList = []
|
||||
if (profile.birth) {
|
||||
metaList.push(formatDate(profile.birth, profile.birth))
|
||||
metaList.push({ id: 'birth', text: formatDate(profile.birth, profile.birth) })
|
||||
}
|
||||
if (profile.mobile) {
|
||||
metaList.push(profile.mobile)
|
||||
metaList.push({ id: 'mobile', text: profile.mobile })
|
||||
}
|
||||
if (profile.idnumber) {
|
||||
metaList.push(maskIdNumber(profile.idnumber))
|
||||
metaList.push({ id: 'idnumber', text: maskIdNumber(profile.idnumber) })
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
<text class="sex-tag" wx:if="{{item.sexText}}">{{item.sexText}}</text>
|
||||
</view>
|
||||
<view class="meta-list" wx:if="{{item.metaList.length > 0}}">
|
||||
<block wx:for="{{item.metaList}}" wx:for-item="meta" wx:key="*this">
|
||||
<block wx:for="{{item.metaList}}" wx:for-item="meta" wx:key="id">
|
||||
<view class="meta-sep" wx:if="{{index > 0}}"></view>
|
||||
<text class="meta-item">{{meta}}</text>
|
||||
<text class="meta-item">{{meta.text}}</text>
|
||||
</block>
|
||||
</view>
|
||||
<text class="profile-remark" wx:if="{{item.remark}}">健康备注 {{item.remark}}</text>
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
// pages/home/webview.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
url: ''
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (options.url) {
|
||||
this.setData({
|
||||
url: decodeURIComponent(options.url)
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
<!--pages/home/webview.wxml-->
|
||||
<web-view src="{{url}}"></web-view>
|
||||
@@ -1 +0,0 @@
|
||||
/* pages/home/webview.wxss */
|
||||
+8
-69
@@ -1,80 +1,19 @@
|
||||
// pages/mine/about.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: '暖橙陪诊', // 转发标题
|
||||
path: '/pages/mine/about',
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline: function () {
|
||||
return {
|
||||
title: '暖橙陪诊',
|
||||
path: '/pages/mine/about'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
onShareTimeline() {
|
||||
return {
|
||||
title: '暖橙陪诊'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
// 跳转「联系我们」页:本页不再平铺联系方式,四项内容与那一页重合,
|
||||
// 且那一页每行还带「拨打」「复制」动作词,是更完整的一份
|
||||
// 联系方式只在独立页面维护,避免同一意图出现两个入口。
|
||||
goToContact() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/mine/contact'
|
||||
});
|
||||
wx.navigateTo({ url: '/pages/mine/contact' })
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
@@ -125,13 +125,6 @@ page {
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
/* 摘要:文案与首页同一张卡一致(人工客服),单行短句,不摊开具体号码 */
|
||||
.contact-desc {
|
||||
margin-top: 8rpx;
|
||||
font-size: 26rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* t-icon 的 color 读不到 CSS 变量,只能硬编码,须与令牌同步(DESIGN.md §2.2);
|
||||
此处对应 --muted #6F655C。项目里 chevron 一律 muted,不抢暖橙焦点 */
|
||||
.contact-arrow {
|
||||
|
||||
@@ -1,216 +0,0 @@
|
||||
// pages/mine/addressedit.js
|
||||
const API = require('../../utils/api.js')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
addresses: [],
|
||||
editData: {
|
||||
_index: -1,
|
||||
label: '',
|
||||
province: '',
|
||||
city: '',
|
||||
district: '',
|
||||
address: '',
|
||||
postcode: '',
|
||||
isDefault: false
|
||||
},
|
||||
isEditing: false
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.initAddressData()
|
||||
},
|
||||
|
||||
// 列表初值取自全局用户对象;「我的」页不再持有地址,本页是唯一入口
|
||||
initAddressData() {
|
||||
const app = getApp()
|
||||
const user = app.globalData.user || {}
|
||||
const addresses = user.addresses || []
|
||||
this.setData({
|
||||
// 深拷一份,编辑过程中不污染全局对象,落库成功后才回写
|
||||
addresses: addresses.map(item => ({ ...item })),
|
||||
isEditing: false,
|
||||
editData: this.emptyEditData()
|
||||
})
|
||||
},
|
||||
|
||||
emptyEditData() {
|
||||
return {
|
||||
_index: -1,
|
||||
label: '',
|
||||
province: '',
|
||||
city: '',
|
||||
district: '',
|
||||
address: '',
|
||||
postcode: '',
|
||||
isDefault: false
|
||||
}
|
||||
},
|
||||
|
||||
onAddAddress() {
|
||||
this.setData({
|
||||
isEditing: true,
|
||||
// 第一条地址自动设为默认,免得多一步勾选
|
||||
editData: { ...this.emptyEditData(), isDefault: this.data.addresses.length === 0 }
|
||||
})
|
||||
wx.setNavigationBarTitle({ title: '新增地址' })
|
||||
},
|
||||
|
||||
onEditAddress(e) {
|
||||
const index = e.currentTarget.dataset.index
|
||||
const item = this.data.addresses[index]
|
||||
this.setData({
|
||||
isEditing: true,
|
||||
editData: {
|
||||
_index: index,
|
||||
label: item.label || '',
|
||||
province: item.province || '',
|
||||
city: item.city || '',
|
||||
district: item.district || '',
|
||||
address: item.address || '',
|
||||
// 本页没有邮编输入项,但要原样带过去,避免编辑一次就把它清掉
|
||||
postcode: item.postcode || '',
|
||||
isDefault: item.isDefault || false
|
||||
}
|
||||
})
|
||||
wx.setNavigationBarTitle({ title: '编辑地址' })
|
||||
},
|
||||
|
||||
onBackToList() {
|
||||
this.setData({
|
||||
isEditing: false,
|
||||
editData: this.emptyEditData()
|
||||
})
|
||||
wx.setNavigationBarTitle({ title: '邮寄地址' })
|
||||
},
|
||||
|
||||
onDeleteAddress(e) {
|
||||
const index = e.currentTarget.dataset.index
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '确定删除该地址吗?',
|
||||
success: (res) => {
|
||||
if (!res.confirm) return
|
||||
const addresses = this.data.addresses.slice()
|
||||
addresses.splice(index, 1)
|
||||
// 删掉的是默认地址时顺位补一个,保证列表里始终有默认
|
||||
if (addresses.length > 0 && !addresses.some(a => a.isDefault)) {
|
||||
addresses[0].isDefault = true
|
||||
}
|
||||
this.setData({ addresses })
|
||||
this.persist(addresses)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onSetDefault(e) {
|
||||
const index = e.currentTarget.dataset.index
|
||||
const addresses = this.data.addresses.map((item, i) => ({
|
||||
...item,
|
||||
isDefault: i === index
|
||||
}))
|
||||
this.setData({ addresses })
|
||||
this.persist(addresses)
|
||||
},
|
||||
|
||||
onRegionChange(e) {
|
||||
const region = e.detail.value
|
||||
this.setData({
|
||||
'editData.province': region[0] || '',
|
||||
'editData.city': region[1] || '',
|
||||
'editData.district': region[2] || ''
|
||||
})
|
||||
},
|
||||
|
||||
onFieldInput(e) {
|
||||
const field = e.currentTarget.dataset.field
|
||||
this.setData({
|
||||
[`editData.${field}`]: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
onDefaultChange(e) {
|
||||
this.setData({
|
||||
'editData.isDefault': e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
onSaveEdit() {
|
||||
const editData = this.data.editData
|
||||
if (!editData.label.trim()) {
|
||||
wx.showToast({ title: '请输入地址标签', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (!editData.province || !editData.city || !editData.district) {
|
||||
wx.showToast({ title: '请选择所在地区', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (!editData.address.trim()) {
|
||||
wx.showToast({ title: '请输入详细地址', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
const addresses = this.data.addresses.slice()
|
||||
const newItem = {
|
||||
label: editData.label.trim(),
|
||||
province: editData.province,
|
||||
city: editData.city,
|
||||
district: editData.district,
|
||||
address: editData.address.trim(),
|
||||
postcode: editData.postcode.trim(),
|
||||
isDefault: editData.isDefault
|
||||
}
|
||||
|
||||
if (editData.isDefault) {
|
||||
addresses.forEach(item => { item.isDefault = false })
|
||||
}
|
||||
|
||||
if (editData._index >= 0) {
|
||||
addresses[editData._index] = newItem
|
||||
} else {
|
||||
if (addresses.length === 0) {
|
||||
newItem.isDefault = true
|
||||
}
|
||||
addresses.push(newItem)
|
||||
}
|
||||
|
||||
this.setData({ addresses })
|
||||
this.onBackToList()
|
||||
this.persist(addresses)
|
||||
},
|
||||
|
||||
// 地址是即时生效的(删除 / 设默认 / 表单保存都直接落库),
|
||||
// 成功后回写全局对象:「我的」页与下单页读的都是它
|
||||
persist(addresses) {
|
||||
const app = getApp()
|
||||
const user = app.globalData.user
|
||||
|
||||
if (!user || !user._id) {
|
||||
wx.showToast({ title: '请先登录', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
wx.showLoading({ title: '保存中...' })
|
||||
|
||||
API.user.update({
|
||||
_id: user._id,
|
||||
addresses
|
||||
})
|
||||
.then((data) => {
|
||||
if (data.code === 0) {
|
||||
// 与 profileedit 同一处坑:/user/update 的响应不含 security.token,
|
||||
// 整替会抹掉本机 token,security 必须保留本地那份
|
||||
app.globalData.user = { ...user, ...data.data.user, security: user.security || {} }
|
||||
wx.showToast({ title: '保存成功', icon: 'success' })
|
||||
} else {
|
||||
wx.showToast({ title: data.msg || '保存失败', icon: 'none' })
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
wx.showToast({ title: '网络请求失败', icon: 'none' })
|
||||
})
|
||||
.finally(() => {
|
||||
wx.hideLoading()
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "邮寄地址",
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon"
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
<view class="container">
|
||||
<!-- 原先这里是 mine 页上的 comp_address 浮层(fixed + 遮罩 + 底部 sheet),
|
||||
不占页面栈,系统返回键会直接退出小程序;改为真页面后由微信原生
|
||||
导航栏接管返回。列表 / 表单两个状态仍在同页切换(外层不再有壳),
|
||||
切换时同步改导航栏标题 -->
|
||||
|
||||
<!-- ===== 列表态 ===== -->
|
||||
<block wx:if="{{!isEditing}}">
|
||||
<view class="addr-list" wx:if="{{addresses.length > 0}}">
|
||||
<view
|
||||
class="addr-card {{index === addresses.length - 1 ? 'addr-card-last' : ''}}"
|
||||
wx:for="{{addresses}}"
|
||||
wx:key="index"
|
||||
>
|
||||
<!-- 主体可点进编辑:右侧 chevron 是点击暗示,不做无暗示的整卡可点 -->
|
||||
<view class="addr-main" bindtap="onEditAddress" data-index="{{index}}" hover-class="addr-main-hover">
|
||||
<view class="addr-info">
|
||||
<view class="addr-top">
|
||||
<text class="addr-label">{{item.label}}</text>
|
||||
<text class="addr-default-tag" wx:if="{{item.isDefault}}">默认</text>
|
||||
</view>
|
||||
<text class="addr-region">{{item.province}} {{item.city}} {{item.district}}</text>
|
||||
<text class="addr-detail">{{item.address}}</text>
|
||||
<text class="addr-postcode" wx:if="{{item.postcode}}">邮编:{{item.postcode}}</text>
|
||||
</view>
|
||||
<t-icon name="chevron-right" class="addr-arrow" size="32rpx" />
|
||||
</view>
|
||||
|
||||
<view class="addr-actions">
|
||||
<view class="addr-action" bindtap="onSetDefault" data-index="{{index}}">
|
||||
<!-- 状态同时用图形与文字传达,不只靠颜色(WCAG 1.4.1);
|
||||
t-icon 的 color 读不到变量,故用 CSS 类着色而不是写死 hex -->
|
||||
<t-icon wx:if="{{item.isDefault}}" name="check-circle-filled" class="addr-action-icon addr-action-icon-active" size="32rpx" />
|
||||
<t-icon wx:else name="circle" class="addr-action-icon" size="32rpx" />
|
||||
<text class="addr-action-text {{item.isDefault ? 'addr-action-text-active' : ''}}">{{item.isDefault ? '默认地址' : '设为默认'}}</text>
|
||||
</view>
|
||||
<view class="addr-action" bindtap="onDeleteAddress" data-index="{{index}}">
|
||||
<t-icon name="delete" class="addr-action-icon" size="32rpx" />
|
||||
<text class="addr-action-text">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="addr-empty" wx:else>
|
||||
<t-icon name="location" class="addr-empty-icon" size="80rpx" />
|
||||
<text class="addr-empty-text">还没有邮寄地址,添加后下单即可选用</text>
|
||||
</view>
|
||||
|
||||
<view class="footer-bar">
|
||||
<button class="primary-btn" bindtap="onAddAddress">添加地址</button>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- ===== 表单态 ===== -->
|
||||
<block wx:else>
|
||||
<view class="form-card">
|
||||
<view class="form-row">
|
||||
<text class="form-label">地址标签</text>
|
||||
<input class="form-input" value="{{editData.label}}" placeholder="如:家庭、公司" placeholder-class="form-placeholder"
|
||||
maxlength="20" bindinput="onFieldInput" data-field="label" />
|
||||
</view>
|
||||
|
||||
<view class="form-row">
|
||||
<text class="form-label">所在地区</text>
|
||||
<picker class="form-picker" mode="region" value="{{[editData.province, editData.city, editData.district]}}"
|
||||
bindchange="onRegionChange">
|
||||
<view class="picker-value {{editData.province ? '' : 'picker-placeholder'}}">
|
||||
{{editData.province || '请选择地区'}}{{editData.city ? ' ' + editData.city : ''}}{{editData.district ? ' ' + editData.district : ''}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-row">
|
||||
<text class="form-label">详细地址</text>
|
||||
<input class="form-input" value="{{editData.address}}" placeholder="请输入详细地址" placeholder-class="form-placeholder"
|
||||
maxlength="100" bindinput="onFieldInput" data-field="address" />
|
||||
</view>
|
||||
|
||||
<view class="form-row form-row-last">
|
||||
<text class="form-label">设为默认地址</text>
|
||||
<!-- switch 的 color 属性读不到 CSS 变量,只能硬编码,取值须与令牌同步 -->
|
||||
<switch checked="{{editData.isDefault}}" bindchange="onDefaultChange" color="#B8520A" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 表单态双按钮:取消走空心(--sep 描边 + 透明底),保存是本页唯一实心橙块 -->
|
||||
<view class="footer-bar footer-bar-duo">
|
||||
<button class="ghost-btn" bindtap="onBackToList">取消</button>
|
||||
<button class="primary-btn" bindtap="onSaveEdit">保存</button>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
@@ -1,268 +0,0 @@
|
||||
page {
|
||||
/* 配色令牌来自 app.wxss(全站唯一来源),本页不留副本 */
|
||||
background-color: var(--paper);
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
box-sizing: border-box;
|
||||
/* 底部留出固定操作栏的高度 + 安全区,避免最后一个地址被盖住 */
|
||||
padding: 40rpx 32rpx calc(180rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
/* ===== 通栏白块(列表态 / 表单态共用同一语言)=====
|
||||
白面 + 上下各 2rpx 发丝线 + 中性阴影,圆角 0;
|
||||
负向 margin 抵消容器 32rpx 内距后左右顶到屏幕两侧,
|
||||
行内再用 32rpx 内距回到同一左基线,内部发丝线因此通到底 */
|
||||
.addr-list,
|
||||
.form-card {
|
||||
margin: 0 -32rpx;
|
||||
background: var(--white);
|
||||
border-top: 2rpx solid var(--line);
|
||||
border-bottom: 2rpx solid var(--line);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
/* ===== 地址卡 ===== */
|
||||
.addr-card {
|
||||
padding: 28rpx 32rpx;
|
||||
border-bottom: 2rpx solid var(--line);
|
||||
}
|
||||
|
||||
.addr-card-last {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.addr-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.addr-main-hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.addr-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.addr-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.addr-label {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
/* 默认标签:浅橙衬底档(--brand-soft + 2rpx --brand-line + --brand-ink),
|
||||
字号 24rpx 是中文最小字号下限,不得再小 */
|
||||
.addr-default-tag {
|
||||
margin-left: 16rpx;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 6rpx;
|
||||
background: var(--brand-soft);
|
||||
border: 2rpx solid var(--brand-line);
|
||||
font-size: 24rpx;
|
||||
color: var(--brand-ink);
|
||||
}
|
||||
|
||||
.addr-region {
|
||||
margin-bottom: 6rpx;
|
||||
font-size: 26rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.addr-detail {
|
||||
font-size: 28rpx;
|
||||
color: var(--ink);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.addr-postcode {
|
||||
margin-top: 6rpx;
|
||||
font-size: 24rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.addr-arrow {
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* 卡片操作行:与主体隔一条发丝线,两项分列两端 */
|
||||
.addr-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 24rpx;
|
||||
padding-top: 20rpx;
|
||||
border-top: 2rpx solid var(--line);
|
||||
}
|
||||
|
||||
/* 文字只有 26rpx 高,用 padding 撑热区、等量负外边距抵消,不改变行高 */
|
||||
.addr-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 0;
|
||||
margin: -16rpx 0;
|
||||
}
|
||||
|
||||
.addr-action-icon {
|
||||
margin-right: 10rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.addr-action-icon-active {
|
||||
color: var(--brand-strong);
|
||||
}
|
||||
|
||||
.addr-action-text {
|
||||
font-size: 26rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.addr-action-text-active {
|
||||
color: var(--brand-ink);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* ===== 空态 ===== */
|
||||
.addr-empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 140rpx 32rpx;
|
||||
}
|
||||
|
||||
/* --faint 仅用于非文字装饰,不承载信息 */
|
||||
.addr-empty-icon {
|
||||
color: var(--faint);
|
||||
}
|
||||
|
||||
.addr-empty-text {
|
||||
margin-top: 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* ===== 表单 ===== */
|
||||
/* 行高约 87rpx(28rpx×1.4 + 上下 24rpx),贴近 iOS 44pt 触控目标 */
|
||||
.form-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 24rpx 32rpx;
|
||||
border-bottom: 2rpx solid var(--line);
|
||||
}
|
||||
|
||||
.form-row-last {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/* 标签走 --muted、值走 --ink 700:层级靠明度与字重拉开,不给可点性上色 */
|
||||
.form-label {
|
||||
flex-shrink: 0;
|
||||
margin-right: 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: var(--muted);
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
text-align: right;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.form-placeholder {
|
||||
color: var(--muted);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* picker 需占满剩余宽度,值才能靠右对齐 */
|
||||
.form-picker {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.picker-value {
|
||||
display: block;
|
||||
text-align: right;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.picker-placeholder {
|
||||
color: var(--muted);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* ===== 底部固定操作栏 ===== */
|
||||
/* 纸面与白面填充差只有 1.05:1,靠一道小偏移小模糊的上向暖墨阴影托住边界 */
|
||||
.footer-bar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx 32rpx calc(20rpx + env(safe-area-inset-bottom));
|
||||
background: var(--white);
|
||||
box-shadow: 0 -2rpx 8rpx rgba(63, 43, 25, 0.07);
|
||||
}
|
||||
|
||||
.footer-bar-duo {
|
||||
display: flex;
|
||||
gap: 24rpx;
|
||||
}
|
||||
|
||||
/* 保存是本页唯一的实心暖橙块,独占「全页同类实心块不超过一处」的额度 */
|
||||
.primary-btn {
|
||||
flex: 1;
|
||||
margin: 0;
|
||||
padding: 24rpx 0;
|
||||
border: none;
|
||||
border-radius: 999rpx;
|
||||
background: var(--brand-strong);
|
||||
box-shadow: var(--shadow-cta);
|
||||
color: var(--white);
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
letter-spacing: 2rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.primary-btn::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* 取消:空心胶囊,靠--sep 环 + 透明底表达"次要动作",不占用实心额度 */
|
||||
.ghost-btn {
|
||||
flex: 1;
|
||||
margin: 0;
|
||||
padding: 22rpx 0;
|
||||
border: 2rpx solid var(--sep);
|
||||
border-radius: 999rpx;
|
||||
background: transparent;
|
||||
color: var(--ink-2);
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
letter-spacing: 2rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.ghost-btn::after {
|
||||
border: none;
|
||||
}
|
||||
@@ -58,6 +58,12 @@ Page({
|
||||
onLoad(options) {
|
||||
const section = options && options.section
|
||||
this.sectionId = SECTION_IDS.indexOf(section) > -1 ? section : ''
|
||||
this.setData({
|
||||
sections: this.data.sections.map(item => ({
|
||||
...item,
|
||||
points: item.points.map(text => ({ id: text, text }))
|
||||
}))
|
||||
})
|
||||
},
|
||||
|
||||
onReady() {
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
<!-- 规则条目用陪诊指南页同一套圆点语言 -->
|
||||
<view class="dot-list">
|
||||
<view class="dot-item" wx:for="{{ item.points }}" wx:for-item="point" wx:key="*this">
|
||||
<view class="dot-item" wx:for="{{ item.points }}" wx:for-item="point" wx:key="id">
|
||||
<view class="dot"></view>
|
||||
<text class="dot-text">{{ point }}</text>
|
||||
<text class="dot-text">{{ point.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
+2
-7
@@ -10,7 +10,6 @@ Page({
|
||||
name: '用户',
|
||||
// 身份行副行,loadUserInfo 时由手机号脱敏填入
|
||||
account: '',
|
||||
phone: '',
|
||||
isLoggedIn: false
|
||||
},
|
||||
// 菜单分组:按"用途"而非"是不是陪诊"分,三组才立得住。
|
||||
@@ -77,11 +76,8 @@ Page({
|
||||
this.setData({
|
||||
'userInfo.isLoggedIn': true,
|
||||
'userInfo.name': profile.name || '用户',
|
||||
// 头像补读后端返回值;取不到留空,由模板渲染暖橙默认头像。
|
||||
// 注:profileedit 页里新选的图目前不会落库——utils/api.js 没有文件上传接口,
|
||||
// 微信返回的是本地临时路径,存进库里也会失效,所以这里只修"显示"这一半
|
||||
// 头像只读展示;取不到时由模板渲染暖橙默认头像。
|
||||
'userInfo.avatar': profile.avatar || '',
|
||||
'userInfo.phone': profile.mobile || '',
|
||||
// 身份行副行(微信那行是微信号):本应用没有账号体系,
|
||||
// 等价标识是手机号,脱敏成 138****1234 后再上屏
|
||||
'userInfo.account': this.maskMobile(profile.mobile || '')
|
||||
@@ -94,8 +90,7 @@ Page({
|
||||
'userInfo.isLoggedIn': false,
|
||||
'userInfo.avatar': '',
|
||||
'userInfo.name': '用户',
|
||||
'userInfo.account': '',
|
||||
'userInfo.phone': ''
|
||||
'userInfo.account': ''
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user