From c79ada60524a36915488c3c691b9a050e1c983ee Mon Sep 17 00:00:00 2001 From: leiyun Date: Mon, 1 Jun 2026 16:00:37 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E6=94=AF=E6=8C=81=E5=8C=BB=E9=99=A2?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/env.js | 4 +- pages/myinfo/myinfo.vue | 166 +++++++++++++++++++++++++++++- pages/sample-info/sample-info.vue | 1 + 3 files changed, 168 insertions(+), 3 deletions(-) diff --git a/config/env.js b/config/env.js index 43c7ad5..c98ce7b 100644 --- a/config/env.js +++ b/config/env.js @@ -1,8 +1,8 @@ const envConf = { // 开发版-本地环境 develop: { - // BASE_URL: 'http://192.168.10.8:8361', - BASE_URL: 'https://cytx.csybhelp.com', + BASE_URL: 'http://192.168.10.8:8361', + // BASE_URL: 'https://cytx.csybhelp.com', }, // 体验版-测试环境 trial: { diff --git a/pages/myinfo/myinfo.vue b/pages/myinfo/myinfo.vue index bc00ca0..90a7161 100644 --- a/pages/myinfo/myinfo.vue +++ b/pages/myinfo/myinfo.vue @@ -51,7 +51,12 @@ 医院名称 - + + + {{ form.hospital || '请选择医院' }} + + + 癌种 @@ -149,6 +154,43 @@ + + + + 选择医院 + + + + + + {{ item.name }} + + + + 没有找到相关医院 + + + + 找不到医院?手动填写 + + + + + + + + + 手动填写医院 + + + + + + + + + + @@ -197,6 +239,50 @@ const tagOptions = ref([]) const showReturnRegionPicker = ref(false) const returnRegionDefaultIndex = ref([0, 0, 0]) +// 医院选项 +const hospitalOptions = ref([]) +const showHospitalPopup = ref(false) +const hospitalKeywords = ref('') +const showManualHospital = ref(false) +const manualHospitalName = ref('') + +const filteredHospitals = computed(() => { + const kw = hospitalKeywords.value.trim() + if (!kw) return hospitalOptions.value + return hospitalOptions.value.filter(h => h.name.includes(kw)) +}) + +const openHospitalPopup = () => { + hospitalKeywords.value = '' + showHospitalPopup.value = true +} + +const searchHospital = () => { + // 本地过滤,filteredHospitals 自动响应 +} + +const onSelectHospital = (item) => { + form.hospital = item.name + showHospitalPopup.value = false +} + +const manualInputHospital = () => { + // 关闭搜索弹窗,打开手动输入弹窗,带入搜索框内容 + manualHospitalName.value = hospitalKeywords.value.trim() + showHospitalPopup.value = false + showManualHospital.value = true +} + +const confirmManualHospital = () => { + const name = manualHospitalName.value.trim() + if (!name) { + uni.showToast({ title: '请输入医院名称', icon: 'none' }) + return + } + form.hospital = name + showManualHospital.value = false +} + // 签署时的额外信息(用于重签回显) const signExtra = reactive({ income_amount: '', @@ -321,6 +407,7 @@ onLoad(async () => { await loadInfo() loadSubscribeConfig() loadTagOptions() + loadHospitals() }) onBeforeUnmount(() => { @@ -445,6 +532,13 @@ const loadTagOptions = async () => { } catch (e) {} } +const loadHospitals = async () => { + try { + const res = await get('/common/hospitals') + hospitalOptions.value = res.data || [] + } catch (e) {} +} + const chooseDocument = () => { uni.chooseImage({ count: 9 - form.documents.length, @@ -889,4 +983,74 @@ const doSubmit = async () => { display: flex; gap: 24rpx; } + +.hospital-popup { + padding: 32rpx; + display: flex; + flex-direction: column; + height: 70vh; +} + +.popup-title { + font-size: 32rpx; + font-weight: 600; + color: #333; + text-align: center; + margin-bottom: 24rpx; +} + +.search-bar { + margin-bottom: 16rpx; +} + +.hospital-list { + flex: 1; + overflow: hidden; +} + +.hospital-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 28rpx 16rpx; + border-bottom: 1rpx solid #f0f0f0; + font-size: 28rpx; + color: #333; + + &:active { + background: #f5f7fa; + } +} + +.empty-tip { + text-align: center; + padding: 60rpx 0; + font-size: 26rpx; + color: #999; +} + +.add-hospital-link { + display: flex; + align-items: center; + justify-content: center; + gap: 8rpx; + padding: 28rpx 0; + font-size: 28rpx; + color: #0e63e3; + border-top: 1rpx solid #f0f0f0; +} + +.manual-hospital-popup { + padding: 48rpx 40rpx 40rpx; + width: 560rpx; +} + +.manual-input { + margin-bottom: 40rpx; +} + +.manual-btns { + display: flex; + gap: 24rpx; +} diff --git a/pages/sample-info/sample-info.vue b/pages/sample-info/sample-info.vue index 999aff4..385dce3 100644 --- a/pages/sample-info/sample-info.vue +++ b/pages/sample-info/sample-info.vue @@ -340,6 +340,7 @@ const handleSubmit = async () => { } if (form.sample_types && form.sample_types.length > 0) { if (!form.report_email) return uni.showToast({ title: '请输入报告接收邮箱', icon: 'none' }) + if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.report_email)) return uni.showToast({ title: '邮箱格式不正确', icon: 'none' }) if (!form.sample_tracking_no) return uni.showToast({ title: '请输入送检样本物流单号', icon: 'none' }) if (!form.sample_photos || form.sample_photos.length === 0) return uni.showToast({ title: '请上传送检单照片', icon: 'none' }) }