From 06516efb1d4d7a3940aee12d4900d4aeea170874 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Mon, 18 Nov 2024 15:29:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=9C=E4=BA=8B=E6=93=8D=E4=BD=9C=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=97=85=E8=99=AB=E5=AE=B3=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E8=A1=A8=E5=8D=95=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/massif/add_farming.vue | 22 ++-- pages/massif/pestType.vue | 203 ++++------------------------------- 2 files changed, 36 insertions(+), 189 deletions(-) diff --git a/pages/massif/add_farming.vue b/pages/massif/add_farming.vue index bd5d3e2..3a19a7d 100644 --- a/pages/massif/add_farming.vue +++ b/pages/massif/add_farming.vue @@ -431,15 +431,19 @@ export default { }, //选择病虫害名称 pestsFun(){ - uni.navigateTo({ - url:`/pages/massif/pestType?type=${({"病害":"disease","虫害":"pestis"})[this.formData.pestsType]||''}&plantType=${this.massif.plantType}`, - events:{type:e=>{ - this.formData.pests=e.map(v=>v).join(',') - }}, - success:res=>{ - res.eventChannel.emit('ids',this.formData?.pests?.split?.(',')?.filter(v=>v)||[]) - } - }) + if(this.formData.pestsType){ + uni.navigateTo({ + url:`/pages/massif/pestType?type=${this.formData.pestsType}&plantType=${this.massif.plantType}`, + events:{type:e=>{ + this.formData.pests=e.map(v=>v).join(',') + }}, + success:res=>{ + res.eventChannel.emit('ids',this.formData?.pests?.split?.(',')?.filter(v=>v)||[]) + } + }) + }else{ + uni.showToast({title:"请选择病虫害类型!"}) + } }, //添加病虫害记录 toPestRecord(){ diff --git a/pages/massif/pestType.vue b/pages/massif/pestType.vue index 3a568d6..8b6b563 100644 --- a/pages/massif/pestType.vue +++ b/pages/massif/pestType.vue @@ -1,52 +1,6 @@