From 48d44bf882236e20b33facc3305fac504329a545 Mon Sep 17 00:00:00 2001 From: leiyun Date: Thu, 4 Jun 2026 00:07:14 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E6=B5=81=E7=A8=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/myinfo/myinfo.vue | 114 ++++++++++++++++++------------ pages/sample-info/sample-info.vue | 39 ++++++---- 2 files changed, 97 insertions(+), 56 deletions(-) diff --git a/pages/myinfo/myinfo.vue b/pages/myinfo/myinfo.vue index 8aeab59..5c2ec45 100644 --- a/pages/myinfo/myinfo.vue +++ b/pages/myinfo/myinfo.vue @@ -1,5 +1,6 @@ @@ -196,8 +185,8 @@ const form = reactive({ income_amount: '' }) const submitting = ref(false) +const pageLoading = ref(true) const showRegionPicker = ref(false) -const showConfirmPopup = ref(false) const subscribeTmplId = ref('') const agreed = ref(false) @@ -208,7 +197,25 @@ const tagOptions = ref([]) const hospitalTree = ref([]) const hospitalPickerRef = ref(null) +const isInfoApproved = computed(() => Number(info.value.status) === 1) +const submitButtonText = computed(() => isInfoApproved.value ? '已通过审核' : '提交审核') + +const showApprovedTip = () => { + uni.showToast({ title: '资料已审核通过,不能修改', icon: 'none' }) +} + +const setGender = (gender) => { + if (isInfoApproved.value) return showApprovedTip() + form.gender = gender +} + +const openRegionPicker = () => { + if (isInfoApproved.value) return showApprovedTip() + showRegionPicker.value = true +} + const openHospitalPicker = () => { + if (isInfoApproved.value) return showApprovedTip() if (!hospitalTree.value.length) { uni.showToast({ title: '医院列表加载中,请稍候', icon: 'none' }) loadHospitalTree() @@ -223,6 +230,7 @@ const openHospitalPicker = () => { } const onHospitalConfirm = (data) => { + if (isInfoApproved.value) return form.hospital = data.hospitalName || '' form.hospital_province_code = data.province_code || '' form.hospital_city_code = data.city_code || '' @@ -349,11 +357,18 @@ const onSignResult = (data) => { onLoad(async () => { uni.$on('signResult', onSignResult) - await loadRegions() - await loadInfo() - loadSubscribeConfig() - loadTagOptions() - loadHospitalTree() + pageLoading.value = true + try { + await loadRegions() + await Promise.all([ + loadInfo(), + loadSubscribeConfig(), + loadTagOptions(), + loadHospitalTree() + ]) + } finally { + pageLoading.value = false + } }) onBeforeUnmount(() => { @@ -361,6 +376,7 @@ onBeforeUnmount(() => { }) const goSign = (type) => { + if (isInfoApproved.value) return showApprovedTip() let url = `/pages/sign/sign?type=${type}` if (type === 'income') { const amt = form.income_amount || signExtra.income_amount || '' @@ -419,6 +435,10 @@ const onRegionChange = (e) => { } const onRegionConfirm = (e) => { + if (isInfoApproved.value) { + showRegionPicker.value = false + return + } const idxs = e.indexs || e.index || [0, 0, 0] const provinces = allRegions.value const prov = provinces[idxs[0]] @@ -489,6 +509,7 @@ const loadHospitalTree = async () => { } const chooseDocument = () => { + if (isInfoApproved.value) return showApprovedTip() uni.chooseImage({ count: 9 - form.documents.length, sizeType: ['compressed'], @@ -515,6 +536,7 @@ const openNotice = () => { } const handleSubmit = async () => { + if (isInfoApproved.value) return showApprovedTip() if (!agreed.value) { return uni.showToast({ title: '请阅读并同意《患者告知书》', icon: 'none' }) } @@ -556,16 +578,11 @@ const handleSubmit = async () => { if (!signedPromise.value) { return uni.showToast({ title: '请签署声明与承诺', icon: 'none' }) } - // 已通过状态需要二次确认 - if (info.value.status === 1) { - showConfirmPopup.value = true - return - } await doSubmit() } const doSubmit = async () => { - showConfirmPopup.value = false + if (isInfoApproved.value) return showApprovedTip() // 先请求订阅消息授权(用户拒绝也继续提交) await requestSubscribe() submitting.value = true @@ -715,6 +732,11 @@ const doSubmit = async () => { color: #0e63e3; background: rgba(14, 99, 227, 0.05); } + + &.disabled { + color: #909399; + background: #f5f7fa; + } } .region-row { @@ -724,6 +746,10 @@ const doSubmit = async () => { padding: 20rpx 24rpx; border: 1rpx solid #ddd; border-radius: 8rpx; + + &.disabled { + background: #f5f7fa; + } } .region-text { diff --git a/pages/sample-info/sample-info.vue b/pages/sample-info/sample-info.vue index 028e80b..cd60ecf 100644 --- a/pages/sample-info/sample-info.vue +++ b/pages/sample-info/sample-info.vue @@ -1,5 +1,6 @@