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 @@
- 收货地址
+ 收货地址(选填)
收货人与联系电话使用所选就诊人信息
diff --git a/pages/escort/itemorder.js b/pages/escort/itemorder.js
index 4a5f896..8e7ab3b 100644
--- a/pages/escort/itemorder.js
+++ b/pages/escort/itemorder.js
@@ -176,7 +176,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)
@@ -283,7 +295,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 '就诊人手机号有误,请到就诊人档案修改'
}
@@ -446,6 +458,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 = this.createIdempotencyKey()
}
})
\ No newline at end of file
diff --git a/pages/escort/itemorder.wxml b/pages/escort/itemorder.wxml
index 49b1e93..24bdf71 100644
--- a/pages/escort/itemorder.wxml
+++ b/pages/escort/itemorder.wxml
@@ -105,7 +105,7 @@
- 收货地址
+ 收货地址(选填)
收货人与联系电话使用所选就诊人信息