From 2c0e729875f4a509b96ad36ca4638bbff50c5f25 Mon Sep 17 00:00:00 2001 From: yuan Date: Fri, 12 Jan 2024 19:12:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8D=E5=AD=97=E9=9C=80=E8=A6=81=E5=A1=AB?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/contact-edit/index.vue | 17 +++++++++++++++++ src/pages/contact-new/index.vue | 15 +++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/pages/contact-edit/index.vue b/src/pages/contact-edit/index.vue index c7bdd08..c019b7d 100644 --- a/src/pages/contact-edit/index.vue +++ b/src/pages/contact-edit/index.vue @@ -22,6 +22,14 @@ const goBack = () => { Router.back() } const onSaveClicked = (isSmsSend: boolean) => { + if (contactData.name === ""){ + Taro.showToast({ + title: '名字不能为空', + icon: 'none', + duration: 2000}) + return + } + Taro.showLoading({ title: 'loading', }) @@ -123,6 +131,15 @@ const onDeleteConfirm = (item) => { }) } const onSaveAndSendMessage = () => { + + if (contactData.name === ""){ + Taro.showToast({ + title: '名字不能为空', + icon: 'none', + duration: 2000}) + return + } + if (contactData.phone.length !== 11){ Taro.showToast({ title: '请正确填写手机号', diff --git a/src/pages/contact-new/index.vue b/src/pages/contact-new/index.vue index d2cc898..996b465 100644 --- a/src/pages/contact-new/index.vue +++ b/src/pages/contact-new/index.vue @@ -19,6 +19,14 @@ contactVisitRecord.reset() const onSaveClicked = (isSmsSend: boolean) => { + if (contact.contact.name === ""){ + Taro.showToast({ + title: '名字不能为空', + icon: 'none', + duration: 2000}) + return + } + Taro.showLoading({ title: 'loading', }) @@ -53,6 +61,13 @@ const onSaveClicked = (isSmsSend: boolean) => { } const onSaveAndSendMessage = () => { + if (contact.contact.name === ""){ + Taro.showToast({ + title: '名字不能为空', + icon: 'none', + duration: 2000}) + return + } if (contact.contact.phone.length !== 11){ Taro.showToast({ title: '请正确填写手机号',