From 1de3f0cde62e4a423843632c7f7f2977e6cf89ce Mon Sep 17 00:00:00 2001 From: lik Date: Thu, 5 Nov 2026 20:15:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(escort):=20=E6=94=B6=E8=B4=A7=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=94=B9=E4=B8=BA=E9=80=89=E5=A1=AB=E5=B9=B6=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E4=B8=8B=E5=8D=95=E5=BF=85=E5=A1=AB=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/escort/itemdetail.js | 26 ++++++++++++++++++++++++-- pages/escort/itemdetail.wxml | 2 +- pages/escort/itemorder.js | 26 ++++++++++++++++++++++++-- pages/escort/itemorder.wxml | 2 +- 4 files changed, 50 insertions(+), 6 deletions(-) diff --git a/pages/escort/itemdetail.js b/pages/escort/itemdetail.js index ca17d63..0297534 100644 --- a/pages/escort/itemdetail.js +++ b/pages/escort/itemdetail.js @@ -195,7 +195,19 @@ Page({ sex: item.profile?.sex || '', birth: item.profile?.birth || '' })) - this.setData({ profiles }) + // 默认选中第一个就诊人,信息随档案一键带入 + const first = profiles[0] + if (first && !this.data.selectedProfileId) { + this.setData({ + profiles, + selectedProfileId: first._id, + patientName: first.name, + patientPhone: first.mobile, + selectedPatient: first + }) + } else { + this.setData({ profiles }) + } }) .catch((err) => { console.log('获取就诊人列表失败', err) @@ -299,7 +311,7 @@ Page({ } if (!data.appointmentDate) return '请选择预约日期' if (!data.appointmentTime) return '请选择预约时间' - if (data.requiresAddress && !data.shippingAddress.trim()) return '请填写完整收货地址' + // 收货地址选填:跑腿/买药未填地址时由客服线下确认 if (!/^1[3-9]\d{9}$/.test(data.selectedPatient.mobile.trim())) { return '就诊人手机号有误,请到就诊人档案修改' } @@ -372,6 +384,16 @@ Page({ remark: '', shippingAddress: '' }, () => this.refreshHospitalOptions(provinces[0] || '')) + // 重置后仍默认选中第一个就诊人,方便连续预约 + const first = this.data.profiles[0] + if (first) { + this.setData({ + selectedProfileId: first._id, + patientName: first.name, + patientPhone: first.mobile, + selectedPatient: first + }) + } this.idempotencyKey = '' }, diff --git a/pages/escort/itemdetail.wxml b/pages/escort/itemdetail.wxml index 67a1e4d..a6b8be3 100644 --- a/pages/escort/itemdetail.wxml +++ b/pages/escort/itemdetail.wxml @@ -197,7 +197,7 @@ - 收货地址 + 收货地址(选填)