From 03386058dc914e5790885bcc2d856477105e43dc Mon Sep 17 00:00:00 2001 From: cxy <1276771477@qq.com> Date: Sun, 24 Nov 2024 18:15:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=B2=A1=E4=BB=80=E4=B9=88=E7=94=A8=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/View/express/ExpressForm.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/View/express/ExpressForm.vue b/frontend/src/View/express/ExpressForm.vue index 800ba54..d775e72 100644 --- a/frontend/src/View/express/ExpressForm.vue +++ b/frontend/src/View/express/ExpressForm.vue @@ -102,9 +102,9 @@ const form = reactive({ }) const confirmOrder = () => { try { - const currentExpressNo = parseInt(form.express_no.slice(2)); // 使用 slice 减少计算 - const n = Math.floor(Math.random() * 10) + 1; // 生成 1 到 10 之间的随机数 - form.express_no = `SF${currentExpressNo + n}`; // 将随机数加到当前快递单号上 + const currentExpressNo = parseInt(form.express_no.slice(2)); + const n = Math.floor(Math.random() * 10) + 1; + form.express_no = `SF${currentExpressNo + n}`; store.add(form); ElMessage({ message: '下单成功!', @@ -115,7 +115,7 @@ const confirmOrder = () => { message: '下单失败,请检查信息!', type: 'error' }); - console.error('下单错误:', error); // 打印错误信息 + console.error('下单错误:', error); } }