fix(escort): 收货地址改为选填并去掉下单必填校验

This commit is contained in:
lik
2026-11-05 20:15:39 +08:00
parent f45f2f4be3
commit 1de3f0cde6
4 changed files with 50 additions and 6 deletions
+24 -2
View File
@@ -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 = ''
},