新增美甲师手机号改为选填并跳过空值哈希索引
自动发布开发环境 Nacos 配置 / publish (push) Successful in 25s

This commit is contained in:
2026-11-07 00:57:23 +08:00
parent 5fae5163ff
commit ae6317903a
4 changed files with 21 additions and 15 deletions
+10 -7
View File
@@ -325,25 +325,28 @@ Page({
}
return
}
if (!nickname || !phone) {
wx.showToast({ title: '请补全美甲师信息', icon: 'none' })
if (!nickname) {
wx.showToast({ title: '请填写美甲师姓名', icon: 'none' })
return
}
if (!/^1[3-9]\d{9}$/.test(phone)) {
if (phone && !/^1[3-9]\d{9}$/.test(phone)) {
wx.showToast({ title: '请输入正确手机号', icon: 'none' })
return
}
this.setData({ creating: true })
try {
const result = await employeesApi.createUser({
const payload = {
nickname,
phone,
contactPhone: phone,
wechatId,
color: form.color,
avatar: form.avatar || undefined,
type: 3
})
}
if (phone) {
payload.phone = phone
payload.contactPhone = phone
}
const result = await employeesApi.createUser(payload)
const id = result && typeof result === 'object' ? (result.id || result.userId) : result
const employee = { id, name: nickname, title: nickname, avatar: form.avatar || '' }
this.setData({ createdEmployee: employee, applicationApproved: false })