From c865223e4a19c0eb3a62594bdfcc4eee815b02b8 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Sat, 25 Jul 2026 18:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=88=B7=E7=A9=BA?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E6=8F=90=E4=BA=A4=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JY-Salon-WeChat/pages/customers/index.js | 3 ++- docs/项目变更记录.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/JY-Salon-WeChat/pages/customers/index.js b/JY-Salon-WeChat/pages/customers/index.js index f3a21f99..b62ac90f 100644 --- a/JY-Salon-WeChat/pages/customers/index.js +++ b/JY-Salon-WeChat/pages/customers/index.js @@ -156,7 +156,8 @@ Page({ } this.setData({ creating: true }) try { - await customersApi.create({ nickname, phone }) + const payload = phone ? { nickname, phone } : { nickname } + await customersApi.create(payload) wx.showToast({ title: '客户已新增', icon: 'success' }) this.resetCreateForm() this.setData({ createModalVisible: false }) diff --git a/docs/项目变更记录.md b/docs/项目变更记录.md index 8ce84ee5..26e5cb0c 100644 --- a/docs/项目变更记录.md +++ b/docs/项目变更记录.md @@ -633,5 +633,6 @@ - 变更原因:新增客户时手机号不应作为必填项,避免只知道客户姓名时无法先建档。 - 处理方式:客户新增弹层仅保留客户姓名必填;手机号字段去掉必填标识,提交时允许为空并继续调用现有客户创建接口。 +- 追加修正:空手机号提交时不再把 `phone: ""` 传给接口,避免后端把空字符串按手机号格式校验并返回“手机号格式不正确”。 - 数据库说明:本次不新增 SQL,不修改初始化 SQL,不需要执行数据库迁移。 - 验证结果:客户页 JS 语法、BOM、`git diff --check` 和 GitNexus staged 变更检测通过。