diff --git a/_verify.ps1 b/_verify.ps1
new file mode 100644
index 0000000..fa65c5a
--- /dev/null
+++ b/_verify.ps1
@@ -0,0 +1,7 @@
+Add-Type -AssemblyName System.Drawing
+$bmp = [System.Drawing.Bitmap]::FromFile('d:\work\health\code\ws_health\ui\wxapp_escort\images\home-green.png')
+$p = $bmp.GetPixel(64, 64)
+Write-Host "home-green center: $($p.R),$($p.G),$($p.B)"
+$bmp.Dispose()
+Remove-Item 'd:\work\health\code\ws_health\ui\wxapp_escort\_reicon.ps1', 'd:\work\health\code\ws_health\ui\wxapp_escort\_sample.ps1' -ErrorAction SilentlyContinue
+Write-Host 'temp scripts cleaned'
\ No newline at end of file
diff --git a/_verify2.ps1 b/_verify2.ps1
new file mode 100644
index 0000000..848a73c
--- /dev/null
+++ b/_verify2.ps1
@@ -0,0 +1,17 @@
+Add-Type -AssemblyName System.Drawing
+foreach ($n in 'home-green', 'ai-green', 'mine-green') {
+ $bmp = [System.Drawing.Bitmap]::FromFile("d:\work\health\code\ws_health\ui\wxapp_escort\images\$n.png")
+ $counts = @{}
+ for ($x = 0; $x -lt $bmp.Width; $x += 2) {
+ for ($y = 0; $y -lt $bmp.Height; $y += 2) {
+ $p = $bmp.GetPixel($x, $y)
+ if ($p.A -lt 128) { continue }
+ $key = '{0},{1},{2}' -f $p.R, $p.G, $p.B
+ $counts[$key] = [int]$counts[$key] + 1
+ }
+ }
+ $top = $counts.GetEnumerator() | Sort-Object Value -Descending | Select-Object -First 2
+ $line = ($top | ForEach-Object { "$($_.Key)=$($_.Value)" }) -join ' '
+ Write-Host "$n : $line"
+ $bmp.Dispose()
+}
\ No newline at end of file
diff --git a/app.json b/app.json
index 963839f..69bba56 100644
--- a/app.json
+++ b/app.json
@@ -7,21 +7,26 @@
"pages/escort/recordlist",
"pages/escort/agreement",
"pages/escort/recorddetail",
+ "pages/escort/guide",
+ "pages/health/profilelist",
+ "pages/health/profileedit",
"pages/mine/mine",
"pages/mine/about",
+ "pages/mine/contact",
"pages/hospital/contact",
"pages/hospital/ranking",
"pages/home/webview"
],
"window": {
"backgroundTextStyle": "light",
- "navigationBarBackgroundColor": "#FFFFFF",
+ "navigationBarBackgroundColor": "#FAFAF9",
"navigationBarTitleText": "暖橙陪诊",
"navigationBarTextStyle": "black"
},
"tabBar": {
+ "custom": true,
"color": "#999999",
- "selectedColor": "#2D6A4F",
+ "selectedColor": "#C2410C",
"backgroundColor": "#FFFFFF",
"borderStyle": "black",
"list": [
diff --git a/app.wxss b/app.wxss
index 6dd876b..f7113ed 100644
--- a/app.wxss
+++ b/app.wxss
@@ -1,22 +1,29 @@
/**app.wxss**/
page {
- --td-brand-color-1: #fff8f0;
- --td-brand-color-2: #ffe8d4;
- --td-brand-color-3: #ffd4a8;
- --td-brand-color-4: #ffbb72;
- --td-brand-color-5: #ff9b33;
- --td-brand-color-6: #ff8500;
- --td-brand-color-7: #FF9B33;
- --td-brand-color-8: #e68600;
- --td-brand-color-9: #cc6e00;
- --td-brand-color-10: #a35700;
+ /* 品牌翠绿:#22A45D 为基准色(第 7 档),向浅/深各展开数档。
+ 首页主视觉已确定该绿为品牌主色,全站令牌与之对齐,
+ 避免二级页沿用旧橙色造成首页与内页两套配色。 */
+ --td-brand-color-1: #f0faf3;
+ --td-brand-color-2: #dcf3e3;
+ --td-brand-color-3: #bce6cb;
+ --td-brand-color-4: #8ed6a9;
+ --td-brand-color-5: #5cc387;
+ --td-brand-color-6: #3bb471;
+ --td-brand-color-7: #22a45d;
+ --td-brand-color-8: #1b8550;
+ --td-brand-color-9: #166940;
+ --td-brand-color-10: #114f31;
--td-brand-color: var(--td-brand-color-7);
--td-brand-color-active: var(--td-brand-color-8);
--td-brand-color-disabled: var(--td-brand-color-3);
--td-brand-color-light: var(--td-brand-color-1);
--td-brand-color-light-active: var(--td-brand-color-2);
- background-color: #FAF6F1;
+
+ /* 深锚点:用于标题、Logo 文字等需要"分量"的地方,压住整页的重心 */
+ --c-ink: #1c1917;
+
+ background-color: #ffffff;
font-family: -apple-system, PingFang SC, Microsoft YaHei, sans-serif;
}
diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js
new file mode 100644
index 0000000..2eb27f7
--- /dev/null
+++ b/custom-tab-bar/index.js
@@ -0,0 +1,39 @@
+// 自定义 tabBar:原生 tabBar 只能放 PNG 位图,三个图标分别是
+// 实心"手托心" / 气泡里塞"AI"字 / 线框人形,风格互相打架。
+// 改用 TDesign 图标字体后,三个 tab 走同一套线性笔触,只靠颜色区分选中态。
+Component({
+ data: {
+ selected: 0, // 当前选中项,由各 tab 页在 onShow 里同步
+ activeColor: '#C2410C', // 选中:暖橙深一档,白底 4.69:1,过 WCAG AA 正文标准
+ inactiveColor: '#7A7068', // 未选中:暖灰,白底 4.83:1,过 WCAG AA 正文标准
+ list: [{
+ pagePath: '/pages/home/index',
+ text: '首页',
+ icon: 'home'
+ }, {
+ pagePath: '/pages/ai/aichat',
+ text: 'AI客服',
+ icon: 'chat'
+ }, {
+ pagePath: '/pages/mine/mine',
+ text: '我的',
+ icon: 'user'
+ }]
+ },
+
+ methods: {
+ onTap(e) {
+ const {
+ index,
+ path
+ } = e.currentTarget.dataset
+ // 重复点击当前 tab 不做跳转,避免页面被重置
+ if (index === this.data.selected) {
+ return
+ }
+ wx.switchTab({
+ url: path
+ })
+ }
+ }
+})
diff --git a/custom-tab-bar/index.json b/custom-tab-bar/index.json
new file mode 100644
index 0000000..3fb9848
--- /dev/null
+++ b/custom-tab-bar/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "t-icon": "tdesign-miniprogram/icon/icon"
+ }
+}
diff --git a/custom-tab-bar/index.wxml b/custom-tab-bar/index.wxml
new file mode 100644
index 0000000..ba2c2c5
--- /dev/null
+++ b/custom-tab-bar/index.wxml
@@ -0,0 +1,18 @@
+
+
+
+
+ {{ item.text }}
+
+
diff --git a/custom-tab-bar/index.wxss b/custom-tab-bar/index.wxss
new file mode 100644
index 0000000..9a62334
--- /dev/null
+++ b/custom-tab-bar/index.wxss
@@ -0,0 +1,33 @@
+/* 自定义 tabBar 脱离文档流,fixed 在底部;
+ 各 tab 页需自备底部占位(见 home / aichat / mine 的底部留白),否则内容会被盖住 */
+.tab-bar {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 100;
+ display: flex;
+ padding: 12rpx 0 calc(12rpx + env(safe-area-inset-bottom));
+ background: #FFFFFF;
+ border-top: 2rpx solid #F0E9E0;
+}
+
+.tab-item {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.tab-text {
+ margin-top: 6rpx;
+ /* 与全局约束一致:中文正文不小于 24rpx(12px) */
+ font-size: 24rpx;
+ line-height: 1;
+ color: #7A7068;
+}
+
+.tab-item.is-active .tab-text {
+ color: #C2410C;
+ font-weight: 600;
+}
diff --git a/images/ai-green.png b/images/ai-green.png
index 1c9a811..310f335 100644
Binary files a/images/ai-green.png and b/images/ai-green.png differ
diff --git a/images/ai-ink.png b/images/ai-ink.png
new file mode 100644
index 0000000..51b9e15
Binary files /dev/null and b/images/ai-ink.png differ
diff --git a/images/home-green.png b/images/home-green.png
index 246243a..50c67b5 100644
Binary files a/images/home-green.png and b/images/home-green.png differ
diff --git a/images/mine-green.png b/images/mine-green.png
index 57d8297..a0468d0 100644
Binary files a/images/mine-green.png and b/images/mine-green.png differ
diff --git a/pages/ai/aichat.js b/pages/ai/aichat.js
index 89ca034..7e186c6 100644
--- a/pages/ai/aichat.js
+++ b/pages/ai/aichat.js
@@ -28,6 +28,12 @@ Page({
onShow() {
this.getAiQuickQuestions()
this.setData({ inputFocus: true })
+ // 同步自定义 tabBar 选中态(AI客服为第 1 项)
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().setData({
+ selected: 1
+ })
+ }
},
// 获取陪诊服务问题
diff --git a/pages/ai/aichat.wxss b/pages/ai/aichat.wxss
index 3f9dfda..1139f12 100644
--- a/pages/ai/aichat.wxss
+++ b/pages/ai/aichat.wxss
@@ -2,6 +2,9 @@
display: flex;
flex-direction: column;
height: 100vh;
+ box-sizing: border-box;
+ /* 给 fixed 的自定义 tabBar 留位;安全区由这里统一承担,输入区不再重复加 */
+ padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
background-color: #F5F5F5;
position: relative;
}
@@ -289,7 +292,6 @@
.input-area {
background-color: #FFFFFF;
padding: 20rpx 24rpx;
- padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
border-top: 1rpx solid #EEEEEE;
}
@@ -337,7 +339,6 @@
/* AI声明 */
.ai-disclaimer {
padding: 12rpx 24rpx;
- padding-bottom: calc(12rpx + env(safe-area-inset-bottom));
text-align: center;
background-color: #F5F5F5;
}
diff --git a/pages/escort/guide.js b/pages/escort/guide.js
new file mode 100644
index 0000000..8ef3526
--- /dev/null
+++ b/pages/escort/guide.js
@@ -0,0 +1,72 @@
+// pages/escort/guide.js
+
+// 人工客服电话:与首页、关于我们保持一致
+const SERVICE_PHONE = '18618162956'
+
+Page({
+ data: {
+ // 服务流程:与 itemdetail 的「服务流程」同构,这里只描述通用环节
+ steps: [{
+ title: '线上预约',
+ desc: '选择服务项目,填写就诊医院、科室与时间'
+ },
+ {
+ title: '需求确认',
+ desc: '客服电话核对就诊信息与特殊需求'
+ },
+ {
+ title: '陪诊师接单',
+ desc: '按需求匹配陪诊师,出发前与您联系'
+ },
+ {
+ title: '全程陪同',
+ desc: '取号、缴费、检查、取药全程有人陪'
+ },
+ {
+ title: '服务完成',
+ desc: '确认服务结果,客服回访并处理售后'
+ }
+ ],
+ // 就诊前准备:到院前建议提前备齐的材料
+ preparations: [
+ '就诊人身份证、医保卡(或电子医保凭证)',
+ '既往病历、检查报告与影像资料',
+ '需要空腹的项目,就诊当天请勿进食进水',
+ '长期服用的药物清单,方便医生了解用药情况',
+ '提前与陪诊师确认医院、院区与集合地点'
+ ],
+ // 温馨提示:通用提醒,不涉及具体退款或收费规则
+ tips: [
+ '建议比预约时间提前 10-15 分钟到达集合点',
+ '贵重物品与重要证件请自行随身保管',
+ '就诊时间或需求有变化,请尽早联系客服调整'
+ ]
+ },
+
+ // 下一步:进入陪诊服务列表
+ goToServiceList() {
+ wx.navigateTo({
+ url: '/pages/escort/itemlist'
+ })
+ },
+
+ // 兜底出口:仍有疑问可直接拨打客服电话
+ goToContact() {
+ wx.makePhoneCall({
+ phoneNumber: SERVICE_PHONE
+ })
+ },
+
+ onShareAppMessage() {
+ return {
+ title: '暖橙陪诊 · 陪诊指南', // 转发标题
+ path: '/pages/escort/guide'
+ }
+ },
+
+ onShareTimeline() {
+ return {
+ title: '暖橙陪诊 · 陪诊指南'
+ }
+ }
+})
diff --git a/pages/escort/guide.json b/pages/escort/guide.json
new file mode 100644
index 0000000..316990a
--- /dev/null
+++ b/pages/escort/guide.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "陪诊指南",
+ "usingComponents": {
+ "t-icon": "tdesign-miniprogram/icon/icon"
+ }
+}
diff --git a/pages/escort/guide.wxml b/pages/escort/guide.wxml
new file mode 100644
index 0000000..55c7efe
--- /dev/null
+++ b/pages/escort/guide.wxml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 服务流程
+
+
+
+ {{ index + 1 }}
+
+ {{ item.title }}
+ {{ item.desc }}
+
+
+
+
+
+
+
+
+
+
+
+ 就诊前准备
+
+
+
+
+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+ 温馨提示
+
+
+
+
+ {{ item }}
+
+
+
+
+
+
+ 查看陪诊服务
+
+
+
+
+ 还有疑问?联系人工客服
+
+
+
+
+
diff --git a/pages/escort/guide.wxss b/pages/escort/guide.wxss
new file mode 100644
index 0000000..d04059a
--- /dev/null
+++ b/pages/escort/guide.wxss
@@ -0,0 +1,207 @@
+/* pages/escort/guide.wxss
+ 内页规范:小色带 + 白底,不用整块主色面板;
+ 卡片沿用首页「发丝边 + 紧阴影」,与首页保持同一套视觉语言 */
+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: #7A7068; /* 白底 4.8:1,过 AA 正文 */
+ --line: #F0E9E0; /* 米色发丝边 */
+ --paper: #FAF6F0; /* 暖白纸面 */
+ --white: #FFFFFF;
+
+ --shadow-card: 0 2rpx 10rpx rgba(63, 43, 25, 0.04);
+
+ 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;
+}
+
+/* ===== 通用白卡 ===== */
+.card {
+ margin-top: 32rpx;
+ padding: 28rpx 26rpx;
+ border-radius: 28rpx;
+ background: var(--white);
+ border: 2rpx solid var(--line);
+ box-shadow: var(--shadow-card);
+}
+
+.card-head {
+ display: flex;
+ align-items: center;
+ margin-bottom: 20rpx;
+}
+
+.card-mark {
+ width: 44rpx;
+ height: 44rpx;
+ border-radius: 12rpx;
+ background: var(--brand-strong);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+}
+
+.card-title {
+ margin-left: 14rpx;
+ font-size: 32rpx;
+ font-weight: 700;
+ color: var(--ink);
+ letter-spacing: 1rpx;
+}
+
+/* ===== 服务流程:左侧序号 + 递进条目 ===== */
+.step-item {
+ display: flex;
+ padding: 18rpx 0;
+}
+
+.step-index {
+ width: 44rpx;
+ height: 44rpx;
+ border-radius: 50%;
+ background: var(--brand-soft);
+ color: var(--brand-ink);
+ font-size: 26rpx;
+ font-weight: 700;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ margin-right: 20rpx;
+}
+
+.step-body {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+ min-width: 0;
+}
+
+.step-title {
+ font-size: 30rpx;
+ font-weight: 600;
+ color: var(--ink);
+}
+
+.step-desc {
+ margin-top: 8rpx;
+ font-size: 26rpx;
+ color: var(--muted);
+ line-height: 1.6;
+}
+
+/* ===== 要点列表 ===== */
+.dot-item {
+ display: flex;
+ padding: 12rpx 0;
+}
+
+.dot {
+ width: 10rpx;
+ height: 10rpx;
+ border-radius: 50%;
+ background: var(--brand-strong);
+ margin: 16rpx 18rpx 0 4rpx;
+ flex-shrink: 0;
+}
+
+.dot-text {
+ flex: 1;
+ font-size: 28rpx;
+ color: var(--ink-2);
+ line-height: 1.7;
+}
+
+/* ===== 底部出口 ===== */
+.guide-cta {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: 48rpx;
+ padding: 26rpx;
+ border-radius: 999rpx;
+ background: var(--brand-strong);
+ box-shadow: 0 6rpx 16rpx rgba(194, 65, 12, 0.22);
+ transition: transform 0.15s ease;
+}
+
+.guide-cta:active {
+ transform: scale(0.98);
+}
+
+.guide-cta-text {
+ font-size: 30rpx;
+ font-weight: 600;
+ color: var(--white);
+ letter-spacing: 2rpx;
+ margin-right: 6rpx;
+}
+
+.guide-help {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: 24rpx;
+ padding: 22rpx;
+ border-radius: 20rpx;
+ background: var(--brand-soft);
+ border: 2rpx solid var(--brand-line);
+}
+
+.guide-help:active {
+ opacity: 0.75;
+}
+
+.guide-help-text {
+ margin-left: 12rpx;
+ font-size: 26rpx;
+ font-weight: 600;
+ color: var(--brand-ink);
+}
+
+.footer-space {
+ height: 60rpx;
+}
diff --git a/pages/escort/itemdetail.js b/pages/escort/itemdetail.js
index 05e6120..ac9a374 100644
--- a/pages/escort/itemdetail.js
+++ b/pages/escort/itemdetail.js
@@ -15,6 +15,8 @@ Page({
},
totalPrice: '0.00',
showOrderPopup: false,
+ profiles: [], // 健康档案里已保存的就诊人
+ selectedProfileId: '', // 当前选中的就诊人档案 ID,为空表示手动填写
patientName: '',
patientPhone: '',
province: '',
@@ -48,6 +50,13 @@ Page({
this.loadServiceDetail(serviceId)
},
+ onShow() {
+ // 从"新增就诊人"页面返回时,弹窗还开着就刷新一次可选的就诊人
+ if (this.data.showOrderPopup) {
+ this.loadProfiles()
+ }
+ },
+
loadServiceDetail(id) {
const app = getApp()
let service = null
@@ -86,8 +95,57 @@ Page({
this.setData({
patientName: user.profile?.name || '',
patientPhone: user.profile?.mobile || '',
+ selectedProfileId: '',
showOrderPopup: true
})
+
+ this.loadProfiles()
+ },
+
+ // 读取已保存的就诊人,供弹窗内一键选择
+ loadProfiles() {
+ API.healthProfile.getMyProfiles({
+ page: 1,
+ pageSize: 20
+ })
+ .then((res) => {
+ if (res.code !== 0) {
+ return
+ }
+ const list = ((res.data && res.data.list) || []).map((item) => ({
+ _id: item._id,
+ name: item.profile?.name || '',
+ mobile: item.profile?.mobile || ''
+ }))
+ this.setData({
+ profiles: list
+ })
+ })
+ .catch((err) => {
+ console.log('获取就诊人列表失败', err)
+ })
+ },
+
+ // 选择就诊人:自动带入姓名与联系电话
+ onSelectProfile(e) {
+ const id = e.currentTarget.dataset.id
+ const profile = this.data.profiles.find((item) => item._id === id)
+ if (!profile) {
+ return
+ }
+
+ this.setData({
+ selectedProfileId: id,
+ patientName: profile.name,
+ patientPhone: profile.mobile
+ })
+ },
+
+ // 跳转到健康档案新增就诊人
+ goToAddProfile() {
+ wx.navigateTo({
+ url: '/pages/health/profileedit'
+ })
},
closeOrderPopup() {
@@ -96,15 +154,18 @@ Page({
})
},
+ // 手动修改姓名/电话后,不再与所选档案对应,清空选择避免存档信息不一致
onPatientNameChange(e) {
this.setData({
- patientName: e.detail.value
+ patientName: e.detail.value,
+ selectedProfileId: ''
})
},
onPatientPhoneChange(e) {
this.setData({
- patientPhone: e.detail.value
+ patientPhone: e.detail.value,
+ selectedProfileId: ''
})
},
@@ -256,6 +317,11 @@ Page({
}
}
+ // 选择了已保存的就诊人时,一并记录档案 ID
+ if (this.data.selectedProfileId) {
+ orderData.healthProfileId = this.data.selectedProfileId
+ }
+
wx.showLoading({
title: '提交中...'
})
@@ -292,6 +358,7 @@ Page({
resetForm() {
this.setData({
+ selectedProfileId: '',
patientName: '',
patientPhone: '',
province: '',
diff --git a/pages/escort/itemdetail.wxml b/pages/escort/itemdetail.wxml
index 6b00284..a746d47 100644
--- a/pages/escort/itemdetail.wxml
+++ b/pages/escort/itemdetail.wxml
@@ -96,6 +96,26 @@
+
+
+ 选择就诊人
+
+
+
+ {{item.name}}
+ {{item.mobile}}
+
+
+ + 添加就诊人
+
+
+
+
+ 还没有就诊人,去添加后可一键带入 ›
+
+
+
就诊人姓名
diff --git a/pages/escort/itemdetail.wxss b/pages/escort/itemdetail.wxss
index d82ea61..1e459b2 100644
--- a/pages/escort/itemdetail.wxss
+++ b/pages/escort/itemdetail.wxss
@@ -493,3 +493,63 @@ page {
.popup-submit-btn::after {
border: none;
}
+
+/* 就诊人选择 */
+.patient-scroll {
+ width: 100%;
+ white-space: nowrap;
+}
+
+.patient-chips {
+ display: inline-flex;
+ gap: 16rpx;
+}
+
+.patient-chip {
+ display: inline-flex;
+ flex-direction: column;
+ min-width: 160rpx;
+ padding: 14rpx 24rpx;
+ border-radius: 16rpx;
+ background: #F9FAFB;
+ border: 2rpx solid #F3F4F6;
+ box-sizing: border-box;
+}
+
+.patient-chip.active {
+ background: #FDF8EE;
+ border-color: #D4A853;
+}
+
+.patient-chip-name {
+ font-size: 26rpx;
+ color: #374151;
+ font-weight: 600;
+}
+
+.patient-chip.active .patient-chip-name {
+ color: #D4A853;
+}
+
+.patient-chip-phone {
+ font-size: 22rpx;
+ color: #9CA3AF;
+ margin-top: 6rpx;
+}
+
+.patient-chip-add {
+ justify-content: center;
+}
+
+.add-profile-tip {
+ width: 100%;
+ padding: 18rpx 24rpx;
+ border-radius: 16rpx;
+ background: #FDF8EE;
+ box-sizing: border-box;
+}
+
+.add-profile-tip-text {
+ font-size: 24rpx;
+ color: #A1864B;
+}
diff --git a/pages/escort/itemlist.json b/pages/escort/itemlist.json
index 9172073..fb6ae7f 100644
--- a/pages/escort/itemlist.json
+++ b/pages/escort/itemlist.json
@@ -1,4 +1,4 @@
{
"usingComponents": {},
- "navigationBarTitleText": "助诊服务"
+ "navigationBarTitleText": "陪诊服务"
}
\ No newline at end of file
diff --git a/pages/health/profileedit.js b/pages/health/profileedit.js
new file mode 100644
index 0000000..67e1986
--- /dev/null
+++ b/pages/health/profileedit.js
@@ -0,0 +1,221 @@
+const API = require('../../utils/api.js')
+
+// 性别选项,与后端 schema 的 male / female 对应
+const SEX_OPTIONS = [{
+ value: 'male',
+ label: '男'
+ },
+ {
+ value: 'female',
+ label: '女'
+ }
+]
+
+const MOBILE_REGEX = /^1[3-9]\d{9}$/
+
+Page({
+ data: {
+ id: '',
+ isEdit: false,
+ saving: false,
+ today: '',
+ sexOptions: SEX_OPTIONS,
+ form: {
+ name: '',
+ sex: '',
+ birth: '',
+ mobile: '',
+ idnumber: '',
+ remark: ''
+ }
+ },
+
+ onLoad(options) {
+ const id = options.id || ''
+
+ this.setData({
+ id,
+ isEdit: !!id,
+ today: this.formatDate(new Date())
+ })
+
+ wx.setNavigationBarTitle({
+ title: id ? '编辑就诊人' : '新增就诊人'
+ })
+
+ if (id) {
+ this.loadProfile(id)
+ }
+ },
+
+ formatDate(date) {
+ const year = date.getFullYear()
+ const month = String(date.getMonth() + 1).padStart(2, '0')
+ const day = String(date.getDate()).padStart(2, '0')
+ return `${year}-${month}-${day}`
+ },
+
+ // 编辑模式:读取档案详情回填表单
+ loadProfile(id) {
+ API.healthProfile.getMyProfileById(id)
+ .then((res) => {
+ if (res.code !== 0) {
+ wx.showToast({
+ title: res.msg || '加载失败',
+ icon: 'none'
+ })
+ return
+ }
+ const detail = (res.data && res.data.profile) || {}
+ const profile = detail.profile || {}
+ const health = detail.health || {}
+
+ this.setData({
+ form: {
+ name: profile.name || '',
+ sex: profile.sex || '',
+ birth: profile.birth || '',
+ mobile: profile.mobile || '',
+ idnumber: profile.idnumber || '',
+ remark: health.remark || ''
+ }
+ })
+ })
+ .catch((err) => {
+ console.log('获取就诊人信息失败', err)
+ wx.showToast({
+ title: '网络请求失败',
+ icon: 'none'
+ })
+ })
+ },
+
+ onFieldInput(e) {
+ const field = e.currentTarget.dataset.field
+ this.setData({
+ [`form.${field}`]: e.detail.value
+ })
+ },
+
+ onSexSelect(e) {
+ const sex = e.currentTarget.dataset.sex
+ // 再次点击已选中的性别则取消选择
+ this.setData({
+ 'form.sex': this.data.form.sex === sex ? '' : sex
+ })
+ },
+
+ onBirthChange(e) {
+ this.setData({
+ 'form.birth': e.detail.value
+ })
+ },
+
+ // 表单校验,返回错误提示文案;通过校验返回空字符串
+ validate() {
+ const {
+ name,
+ mobile
+ } = this.data.form
+
+ if (!name.trim()) {
+ return '请输入就诊人姓名'
+ }
+ if (!mobile.trim()) {
+ return '请输入联系电话'
+ }
+ if (!MOBILE_REGEX.test(mobile.trim())) {
+ return '请输入正确的手机号'
+ }
+ return ''
+ },
+
+ onSave() {
+ if (this.data.saving) {
+ return
+ }
+
+ const errorMessage = this.validate()
+ if (errorMessage) {
+ wx.showToast({
+ title: errorMessage,
+ icon: 'none'
+ })
+ return
+ }
+
+ const {
+ name,
+ sex,
+ birth,
+ mobile,
+ idnumber,
+ remark
+ } = this.data.form
+
+ // 新增用嵌套对象(schema 的 new Model 需要嵌套结构);
+ // 更新用点号路径(schema 更新姓名时会额外写 profile.pinyin,整体替换 profile 会冲突)
+ const payload = this.data.isEdit ? {
+ 'profile.name': name.trim(),
+ 'profile.sex': sex,
+ 'profile.birth': birth,
+ 'profile.mobile': mobile.trim(),
+ 'profile.idnumber': idnumber.trim(),
+ 'health.remark': remark.trim()
+ } : {
+ profile: {
+ name: name.trim(),
+ sex: sex,
+ birth: birth,
+ mobile: mobile.trim(),
+ idnumber: idnumber.trim()
+ },
+ health: {
+ remark: remark.trim()
+ }
+ }
+
+ this.setData({
+ saving: true
+ })
+ wx.showLoading({
+ title: '保存中...'
+ })
+
+ const request = this.data.isEdit ?
+ API.healthProfile.updateMyProfile(this.data.id, payload) :
+ API.healthProfile.createMyProfile(payload)
+
+ request
+ .then((res) => {
+ wx.hideLoading()
+ if (res.code !== 0) {
+ wx.showToast({
+ title: res.msg || '保存失败',
+ icon: 'none'
+ })
+ return
+ }
+ wx.showToast({
+ title: '保存成功',
+ icon: 'success'
+ })
+ setTimeout(() => {
+ wx.navigateBack()
+ }, 800)
+ })
+ .catch((err) => {
+ wx.hideLoading()
+ console.log('保存就诊人失败', err)
+ wx.showToast({
+ title: '网络请求失败',
+ icon: 'none'
+ })
+ })
+ .finally(() => {
+ this.setData({
+ saving: false
+ })
+ })
+ }
+})
diff --git a/pages/health/profileedit.json b/pages/health/profileedit.json
new file mode 100644
index 0000000..b623dbf
--- /dev/null
+++ b/pages/health/profileedit.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "新增就诊人",
+ "usingComponents": {
+ "t-icon": "tdesign-miniprogram/icon/icon"
+ }
+}
diff --git a/pages/health/profileedit.wxml b/pages/health/profileedit.wxml
new file mode 100644
index 0000000..e114b2f
--- /dev/null
+++ b/pages/health/profileedit.wxml
@@ -0,0 +1,62 @@
+
+
+
+
+ 姓名*
+
+
+
+
+ 性别
+
+
+ {{item.label}}
+
+
+
+
+
+ 出生年月
+
+
+ {{form.birth || '请选择出生年月'}}
+
+
+
+
+
+ 联系电话*
+
+
+
+
+ 证件号
+
+
+
+
+
+
+
+
+
+
+ 信息仅用于陪诊服务,我们会严格保密
+
+
+
+
+
diff --git a/pages/health/profileedit.wxss b/pages/health/profileedit.wxss
new file mode 100644
index 0000000..67bd59f
--- /dev/null
+++ b/pages/health/profileedit.wxss
@@ -0,0 +1,165 @@
+page {
+ background-color: #FAF6F1;
+}
+
+.container {
+ min-height: 100vh;
+ padding: 24rpx 24rpx 200rpx;
+ box-sizing: border-box;
+}
+
+.form-card {
+ background: #FFFFFF;
+ border-radius: 20rpx;
+ padding: 8rpx 28rpx;
+ margin-bottom: 24rpx;
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.04);
+}
+
+.form-item {
+ display: flex;
+ align-items: center;
+ min-height: 108rpx;
+ border-bottom: 1rpx solid #F3F4F6;
+}
+
+.form-item:last-child {
+ border-bottom: none;
+}
+
+.form-item-remark {
+ flex-direction: column;
+ align-items: stretch;
+ padding: 28rpx 0;
+}
+
+.form-label {
+ width: 160rpx;
+ flex-shrink: 0;
+ font-size: 28rpx;
+ color: #374151;
+}
+
+.required {
+ color: #EF4444;
+ margin-left: 4rpx;
+}
+
+.form-input {
+ flex: 1;
+ font-size: 28rpx;
+ color: #1F2937;
+ text-align: right;
+}
+
+.input-placeholder {
+ color: #C4C9D2;
+}
+
+.picker-value {
+ flex: 1;
+ font-size: 28rpx;
+ color: #1F2937;
+ text-align: right;
+}
+
+.picker-placeholder {
+ color: #C4C9D2;
+}
+
+/* 性别选择 */
+.sex-wrap {
+ flex: 1;
+ display: flex;
+ justify-content: flex-end;
+ gap: 20rpx;
+}
+
+.sex-tag {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 120rpx;
+ height: 64rpx;
+ border-radius: 32rpx;
+ background: #F3F4F6;
+ transition: all 0.2s;
+}
+
+.sex-tag-active {
+ background: #FDF8EE;
+ border: 2rpx solid #D4A853;
+}
+
+.sex-text {
+ font-size: 28rpx;
+ color: #6B7280;
+}
+
+.sex-tag-active .sex-text {
+ color: #D4A853;
+ font-weight: 600;
+}
+
+/* 健康备注 */
+.form-textarea {
+ width: 100%;
+ height: 160rpx;
+ margin-top: 16rpx;
+ font-size: 28rpx;
+ color: #1F2937;
+ line-height: 1.6;
+}
+
+.remark-count {
+ align-self: flex-end;
+ font-size: 22rpx;
+ color: #C4C9D2;
+}
+
+/* 隐私提示 */
+.tips {
+ display: flex;
+ align-items: center;
+ padding: 0 12rpx;
+}
+
+.tips-text {
+ margin-left: 10rpx;
+ font-size: 24rpx;
+ color: #B0B7C3;
+}
+
+/* 底部固定保存按钮 */
+.footer-bar {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ padding: 20rpx 24rpx calc(20rpx + env(safe-area-inset-bottom));
+ background: rgba(255, 255, 255, 0.96);
+ box-shadow: 0 -2rpx 16rpx rgba(0, 0, 0, 0.05);
+}
+
+.submit-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 88rpx;
+ border-radius: 44rpx;
+ background: #D4A853;
+}
+
+.submit-btn:active {
+ opacity: 0.85;
+}
+
+.submit-btn-disabled {
+ opacity: 0.6;
+}
+
+.submit-btn-text {
+ font-size: 30rpx;
+ font-weight: 600;
+ color: #FFFFFF;
+}
diff --git a/pages/health/profilelist.js b/pages/health/profilelist.js
new file mode 100644
index 0000000..fe5ae03
--- /dev/null
+++ b/pages/health/profilelist.js
@@ -0,0 +1,134 @@
+const API = require('../../utils/api.js')
+
+Page({
+ data: {
+ profiles: [],
+ loading: false
+ },
+
+ // 用 onShow 而不是 onLoad:从新增/编辑页返回后需要刷新列表
+ onShow() {
+ this.loadProfiles()
+ },
+
+ onPullDownRefresh() {
+ this.loadProfiles().finally(() => {
+ wx.stopPullDownRefresh()
+ })
+ },
+
+ // 拉取当前登录用户的健康档案(就诊人)列表
+ loadProfiles() {
+ this.setData({
+ loading: true
+ })
+
+ return API.healthProfile.getMyProfiles({
+ page: 1,
+ pageSize: 50
+ })
+ .then((res) => {
+ if (res.code !== 0) {
+ wx.showToast({
+ title: res.msg || '加载失败',
+ icon: 'none'
+ })
+ return
+ }
+ const list = (res.data && res.data.list) || []
+ this.setData({
+ profiles: list.map((item) => this.formatProfile(item))
+ })
+ })
+ .catch((err) => {
+ console.log('获取健康档案失败', err)
+ wx.showToast({
+ title: '网络请求失败',
+ icon: 'none'
+ })
+ })
+ .finally(() => {
+ this.setData({
+ loading: false
+ })
+ })
+ },
+
+ // 后端返回的是嵌套结构,这里拍平成卡片展示需要的字段
+ formatProfile(item) {
+ const profile = item.profile || {}
+ const health = item.health || {}
+
+ return {
+ _id: item._id,
+ name: profile.name || '未命名',
+ sexText: profile.sex === 'male' ? '男' : (profile.sex === 'female' ? '女' : ''),
+ birth: profile.birth || '',
+ mobile: profile.mobile || '',
+ idnumberText: this.maskIdNumber(profile.idnumber),
+ remark: health.remark || ''
+ }
+ },
+
+ // 证件号脱敏:仅保留前 4 位与后 4 位
+ maskIdNumber(idnumber) {
+ const value = String(idnumber || '')
+ if (!value) {
+ return '未填写'
+ }
+ if (value.length <= 8) {
+ return value
+ }
+ return `${value.slice(0, 4)}********${value.slice(-4)}`
+ },
+
+ onAdd() {
+ wx.navigateTo({
+ url: '/pages/health/profileedit'
+ })
+ },
+
+ onEdit(e) {
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({
+ url: `/pages/health/profileedit?id=${id}`
+ })
+ },
+
+ onDelete(e) {
+ const id = e.currentTarget.dataset.id
+
+ wx.showModal({
+ title: '删除确认',
+ content: '删除后该就诊人信息将无法恢复,确定删除吗?',
+ confirmColor: '#D4A853',
+ success: (res) => {
+ if (!res.confirm) {
+ return
+ }
+ API.healthProfile.deleteMyProfile(id)
+ .then((result) => {
+ if (result.code !== 0) {
+ wx.showToast({
+ title: result.msg || '删除失败',
+ icon: 'none'
+ })
+ return
+ }
+ wx.showToast({
+ title: '已删除',
+ icon: 'success'
+ })
+ this.loadProfiles()
+ })
+ .catch((err) => {
+ console.log('删除健康档案失败', err)
+ wx.showToast({
+ title: '网络请求失败',
+ icon: 'none'
+ })
+ })
+ }
+ })
+ }
+})
diff --git a/pages/health/profilelist.json b/pages/health/profilelist.json
new file mode 100644
index 0000000..edf3709
--- /dev/null
+++ b/pages/health/profilelist.json
@@ -0,0 +1,8 @@
+{
+ "navigationBarTitleText": "健康档案",
+ "usingComponents": {
+ "t-icon": "tdesign-miniprogram/icon/icon"
+ },
+ "enablePullDownRefresh": true,
+ "backgroundTextStyle": "dark"
+}
diff --git a/pages/health/profilelist.wxml b/pages/health/profilelist.wxml
new file mode 100644
index 0000000..bd63675
--- /dev/null
+++ b/pages/health/profilelist.wxml
@@ -0,0 +1,66 @@
+
+
+
+
+
+ 下单时可直接选择已保存的就诊人,无需重复填写
+
+
+
+
+
+
+
+
+
+ 出生年月
+ {{item.birth || '未填写'}}
+
+
+ 联系电话
+ {{item.mobile || '未填写'}}
+
+
+ 证件号
+ {{item.idnumberText}}
+
+
+ 健康备注
+ {{item.remark}}
+
+
+
+
+
+
+
+
+ 还没有健康档案
+ 添加就诊人后,下单时可一键带入信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/health/profilelist.wxss b/pages/health/profilelist.wxss
new file mode 100644
index 0000000..d0f55c8
--- /dev/null
+++ b/pages/health/profilelist.wxss
@@ -0,0 +1,166 @@
+page {
+ background-color: #FAF6F1;
+}
+
+.container {
+ min-height: 100vh;
+}
+
+/* 顶部说明条 */
+.page-tip {
+ display: flex;
+ align-items: center;
+ margin: 24rpx 24rpx 0;
+ padding: 20rpx 24rpx;
+ border-radius: 16rpx;
+ background: #FDF8EE;
+}
+
+.page-tip-text {
+ margin-left: 12rpx;
+ font-size: 24rpx;
+ color: #A1864B;
+ line-height: 1.5;
+}
+
+/* 就诊人列表 */
+.profile-list {
+ padding: 20rpx 24rpx;
+ display: flex;
+ flex-direction: column;
+ gap: 20rpx;
+}
+
+.profile-card {
+ background: #FFFFFF;
+ border-radius: 20rpx;
+ padding: 28rpx;
+ box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.04);
+}
+
+.profile-card:active {
+ background: #FDFCFA;
+}
+
+.card-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding-bottom: 20rpx;
+ margin-bottom: 20rpx;
+ border-bottom: 1rpx solid #F3F4F6;
+}
+
+.name-wrap {
+ display: flex;
+ align-items: center;
+}
+
+.profile-name {
+ font-size: 32rpx;
+ font-weight: 600;
+ color: #1F2937;
+}
+
+.sex-tag {
+ margin-left: 16rpx;
+ padding: 2rpx 14rpx;
+ border-radius: 8rpx;
+ background: #FDF8EE;
+ color: #D4A853;
+ font-size: 22rpx;
+ font-weight: 600;
+}
+
+.delete-btn {
+ padding: 8rpx 0 8rpx 24rpx;
+}
+
+.card-body {
+ display: flex;
+ flex-direction: column;
+ gap: 16rpx;
+}
+
+.info-row {
+ display: flex;
+ align-items: flex-start;
+}
+
+.info-label {
+ font-size: 26rpx;
+ color: #9CA3AF;
+ width: 140rpx;
+ flex-shrink: 0;
+}
+
+.info-value {
+ font-size: 26rpx;
+ color: #374151;
+ flex: 1;
+ word-break: break-all;
+}
+
+/* 空状态 */
+.empty-state {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding-top: 200rpx;
+}
+
+.empty-text {
+ font-size: 30rpx;
+ color: #9CA3AF;
+ margin-top: 24rpx;
+}
+
+.empty-subtext {
+ font-size: 26rpx;
+ color: #D1D5DB;
+ margin-top: 12rpx;
+}
+
+/* 加载中 */
+.loading-wrap {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 40rpx;
+}
+
+.bottom-space {
+ height: 180rpx;
+}
+
+/* 底部固定新增按钮 */
+.footer-bar {
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ padding: 20rpx 24rpx calc(20rpx + env(safe-area-inset-bottom));
+ background: rgba(255, 255, 255, 0.96);
+ box-shadow: 0 -2rpx 16rpx rgba(0, 0, 0, 0.05);
+}
+
+.add-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 88rpx;
+ border-radius: 44rpx;
+ background: #D4A853;
+}
+
+.add-btn:active {
+ opacity: 0.85;
+}
+
+.add-btn-text {
+ margin-left: 8rpx;
+ font-size: 30rpx;
+ font-weight: 600;
+ color: #FFFFFF;
+}
diff --git a/pages/home/index.js b/pages/home/index.js
index 2ccac0a..6f01c27 100644
--- a/pages/home/index.js
+++ b/pages/home/index.js
@@ -1,92 +1,180 @@
+const API = require('../../utils/api.js')
+
+// 陪诊服务的展示配置:价格等以后端返回为准,这里只覆盖展示名。
+// 图标不走数据,而是按 id 映射到 index.wxss 里内嵌的细线 SVG(.assist-icon-1 ~ .assist-icon-8)
+// key 为后端 services 的 id,顺序即首页宫格的展示顺序
+const SERVICE_UI = {
+ 1: { name: '全天陪诊' },
+ 2: { name: '半天陪诊' },
+ 3: { name: '代问诊' },
+ 4: { name: '检查预约' },
+ 5: { name: '出入院代办' },
+ 6: { name: '跑腿服务' },
+ 7: { name: '陪诊套餐' },
+ 8: { name: '买药套餐' }
+}
+
+// 陪诊服务的展示顺序(两行共 8 项)
+const SERVICE_ORDER = [1, 2, 3, 4, 5, 6, 7, 8]
+
+// 计入"待服务订单"的订单状态:待确认 / 已确认 / 进行中
+const PENDING_ORDER_STATUS = ['pending', 'confirmed', 'in_progress']
+
+// 人工客服电话
+const SERVICE_PHONE = '18618162956'
+
Page({
data: {
- escortServices: [{
- id: 1,
- name: '陪诊',
- icon: 'heart',
- iconColor: '#E11D48',
- bgColor: '#FFF1F2'
- },
- {
- id: 2,
- name: '代问诊',
- icon: 'chat-heart',
- iconColor: '#EA580C',
- bgColor: '#FFF7ED'
- },
- {
- id: 3,
- name: '代办理',
- icon: 'fact-check',
- iconColor: '#059669',
- bgColor: '#ECFDF5'
- },
- {
- id: 8,
- name: '其他助诊',
- icon: 'app',
- iconColor: '#2563EB',
- bgColor: '#EFF6FF'
- }
- ],
- otherServices: [{
- id: 1,
- name: '代探望',
- icon: 'apple',
- url: '',
- type: '',
- iconColor: '#7C3AED',
- bgColor: '#F5F3FF'
- },
- {
- id: 2,
- name: '企业陪诊',
- icon: 'city-8',
- url: '',
- type: '',
- iconColor: '#D97706',
- bgColor: '#FFFBEB'
- },
- {
- id: 3,
- name: '陪诊师入驻',
- icon: 'usergroup',
- url: '',
- type: '',
- iconColor: '#4F46E5',
- bgColor: '#EEF2FF'
- },
- {
- id: 4,
- name: '商务合作',
- icon: 'command',
- url: '',
- type: '',
- iconColor: '#0D9488',
- bgColor: '#F0FDFA'
- },
- ],
- tools: [{
- id: 1,
+ escortServices: [], // 陪诊服务(来自后端,最多 8 项)
+ pendingCount: 0, // 待服务订单数,大于 0 时首页顶部展示状态条
+ quickEntries: [{
+ id: 'records',
name: '预约记录',
- icon: 'assignment',
- url: 'pages/escort/recordlist',
- type: 'page',
- iconColor: '#0891B2',
- bgColor: '#ECFEFF'
+ desc: '查看预约进度与历史',
+ // 日历:与「健康档案」的人形图标形成明显形态差异(原先两个都是"文档+勾",缩小后难分辨)
+ icon: 'calendar-1',
+ url: '/pages/escort/recordlist'
},
{
- id: 2,
+ id: 'health',
name: '健康档案',
- icon: 'attach',
- url: '',
- type: '',
- iconColor: '#DB2777',
- bgColor: '#FDF2F8'
+ desc: '管理家人就诊信息',
+ icon: 'user-checked',
+ url: '/pages/health/profilelist'
}
]
},
+ onLoad() {
+ this.loadServices()
+ },
+
+ onShow() {
+ this.refreshPendingCount()
+ // 同步自定义 tabBar 选中态(首页为第 0 项)
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+ this.getTabBar().setData({
+ selected: 0
+ })
+ }
+ },
+
+ // 读取后端服务列表,拼装成首页宫格所需的展示数据
+ loadServices() {
+ const app = getApp()
+ // servicesReady 由 app.onLaunch 创建,兜底避免极端情况下取不到
+ const ready = app.globalData.servicesReady || Promise.resolve(app.globalData.services || [])
+
+ ready.then((services) => {
+ const serviceMap = {}
+ ;(services || []).forEach((service) => {
+ serviceMap[service.id] = service
+ })
+
+ const escortServices = SERVICE_ORDER
+ .filter((id) => serviceMap[id])
+ .map((id) => {
+ const service = serviceMap[id]
+ const ui = SERVICE_UI[id] || {}
+ return {
+ id,
+ name: ui.name || service.title,
+ // 图标类名:与 index.wxss 中 .assist-icon-{id} 对应
+ iconClass: 'assist-icon-' + id
+ }
+ })
+
+ this.setData({
+ escortServices
+ })
+ })
+ },
+
+ // 统计待服务订单:仅在登录信息就绪后请求,未就绪时稍后重试一次
+ refreshPendingCount(retry) {
+ const app = getApp()
+ const user = app.globalData.user
+
+ if (!user || !user._id) {
+ // 首次进入时 App 的登录请求可能还没返回,延迟重试一次即可
+ if (!retry) {
+ setTimeout(() => this.refreshPendingCount(1), 1500)
+ }
+ return
+ }
+
+ API.escort.getMyRecords({
+ userId: user._id,
+ page: 1,
+ pageSize: 50
+ })
+ .then((res) => {
+ if (res.code !== 0) {
+ return
+ }
+ const records = (res.data && res.data.records) || []
+ const pendingCount = records.filter((record) => PENDING_ORDER_STATUS.indexOf(record.status) > -1).length
+ this.setData({
+ pendingCount
+ })
+ })
+ .catch((err) => {
+ console.log('获取待服务订单失败', err)
+ })
+ },
+
+ goToAiChat() {
+ wx.switchTab({
+ url: '/pages/ai/aichat'
+ });
+ },
+
+ // 页脚 B 端合作入口仍直接转服务电话
+ goToContact() {
+ wx.makePhoneCall({
+ phoneNumber: SERVICE_PHONE
+ });
+ },
+
+ // 「联系我们」卡片:进入独立联系页,页内再提供拨号/复制/工作时间
+ goToContactPage() {
+ wx.navigateTo({
+ url: '/pages/mine/contact'
+ });
+ },
+
+ // Hero 主按钮:先引导新用户了解服务,服务列表入口在指南页底部
+ goToGuide() {
+ wx.navigateTo({
+ url: '/pages/escort/guide'
+ });
+ },
+
+ // 点击陪诊服务,直达服务详情下单
+ goToServiceDetail(e) {
+ const id = e.currentTarget.dataset.id
+ wx.navigateTo({
+ url: `/pages/escort/itemdetail?id=${id}`
+ })
+ },
+
+ // 常用功能:预约记录、健康档案
+ onQuickEntryTap(e) {
+ const entry = e.currentTarget.dataset.item
+ if (!entry || !entry.url) {
+ return
+ }
+ wx.navigateTo({
+ url: entry.url
+ })
+ },
+
+ goToRecords() {
+ wx.navigateTo({
+ url: '/pages/escort/recordlist'
+ })
+ },
+
onShareAppMessage() {
return {
title: '暖橙陪诊', // 转发标题
@@ -98,71 +186,5 @@ Page({
return {
title: '暖橙陪诊',
}
- },
-
- async onLoad() {},
-
- goToAiChat() {
- wx.switchTab({
- url: '/pages/ai/aichat'
- });
- },
-
- goToContact() {
- wx.makePhoneCall({
- phoneNumber: '18618162956'
- });
- },
-
- goToServiceList() {
- wx.navigateTo({
- url: '/pages/escort/itemlist'
- });
- },
-
- goToAssistDetail(e) {
- const id = e.currentTarget.dataset.id;
- wx.navigateTo({
- url: `/pages/escort/itemlist?assistId=${id}`
- });
- },
-
- goToOtherServicesDetail(e) {
- const item = e.currentTarget.dataset.item;
- if (!item || !item.type || !item.url) {
- wx.showToast({
- title: '建设中...',
- icon: 'none'
- });
- return;
- }
- switch (item.type) {
- case 'page':
- wx.navigateTo({
- url: '/' + item.url
- });
- break;
- case 'tab':
- wx.switchTab({
- url: '/' + item.url
- });
- break;
- case 'website':
- wx.navigateTo({
- url: '/pages/home/webview?url=' + encodeURIComponent(item.url)
- });
- break;
- case 'wxapp':
- wx.navigateToMiniProgram({
- shortLink: item.url,
- env: 'release'
- })
- break;
- default:
- wx.showToast({
- title: '建设中...',
- icon: 'none'
- });
- }
}
-});
\ No newline at end of file
+});
diff --git a/pages/home/index.wxml b/pages/home/index.wxml
index 17b5f57..f259261 100644
--- a/pages/home/index.wxml
+++ b/pages/home/index.wxml
@@ -1,110 +1,118 @@
-
-
-
-
- 暖橙陪诊
+
+
+
+
+
+
+ 暖橙陪诊
-
-
-
-
-
-
- 专业陪诊
- 让就医更简单,让客户更安心
-
+
+
+
+
+ 专业陪诊
+ 让就医更省心
+
+ 实名认证陪诊师 · 经验丰富 · 熟悉各大医院流程
+
+
+ 陪诊指南
+
-
-
-
-
- AI
- 客服咨询
- Customer Service
+
+
+
+
+
+
-
-
+
+ 在线咨询
+ AI 客服
-
-
- 24H
- 联系我们
- Contact Us
+
+
+
+
-
-
+
+ 联系我们
+ 人工客服
-
-
-
-