From 17b0c42d31992877074b1e26bf11804964324807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89?= <814457906@qq.com> Date: Thu, 22 Feb 2024 17:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=93=E5=BE=81=E6=A3=80=E6=B5=8B=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagesC/addequipment/addequipment.vue | 38 +++++++++++++++++++--------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/pagesC/addequipment/addequipment.vue b/pagesC/addequipment/addequipment.vue index 925bdf0..969ea8e 100644 --- a/pagesC/addequipment/addequipment.vue +++ b/pagesC/addequipment/addequipment.vue @@ -89,24 +89,38 @@ return z.y + '-' + z.M + '-' + z.d + ' ' + z.h + ':' + z.m + ':' + z.s }, submit() { - binding(this.data).then(res => { - if (res.code == 200) { - this.$refs.uToast.show({ - title: '绑定成功', - type: 'success', + if (this.data.sn) { + if (this.data.deviceType) { + binding(this.data).then(res => { + if (res.code == 200) { + this.$refs.uToast.show({ + title: '绑定成功', + type: 'success', + }) + setTimeout(function() { + uni.navigateBack({ + delta: 1 + }) + }, 2000); + } else { + this.$refs.uToast.show({ + title: res.msg, + type: 'error', + }) + } }) - setTimeout(function() { - uni.navigateBack({ - delta: 1 - }) - }, 2000); } else { this.$refs.uToast.show({ - title: res.msg, + title: '请选择设备类型', type: 'error', }) } - }) + } else { + this.$refs.uToast.show({ + title: '请输入设备序列号', + type: 'error', + }) + } } } }