Salon 侧全场景脱敏与拨号单次取号改造:收掉预约选择客户的完整手机号出口,新增按门店与订单上下文授权的拨号取号端点及隐私号占位渠道,前端改为脱敏展示加呼叫取号,并同步更新协议条款
自动发布开发环境 Nacos 配置 / publish (push) Successful in 24s

This commit is contained in:
2026-11-04 22:02:51 +08:00
parent bbe1473b70
commit 05493923e4
33 changed files with 697 additions and 28 deletions
+28 -13
View File
@@ -520,6 +520,7 @@ function normalizeCustomer(customer) {
id: customer.id,
name,
phone,
phoneAvailable: customer.phoneAvailable === true || (Boolean(phone) && !String(phone).includes('*')),
displayName: name || phone || '客户',
displayPhone: phone || '未填写手机号',
createdAt: customerCreatedAt(customer)
@@ -952,7 +953,7 @@ Page({
if (requestSeq !== this._customerSuggestionSeq) return
const rows = Array.isArray(result) ? result : (result.list || [])
const remoteSuggestions = rows.map(normalizeCustomer)
.filter(customer => (!name || customer.name.toLowerCase().includes(name)) && (!phone || customer.phone.toLowerCase().includes(phone)))
.filter(customer => !name || customer.name.toLowerCase().includes(name))
.slice(0, 3)
.map(buildCustomerSelectorItem)
this.setData({ customerSuggestions: remoteSuggestions })
@@ -971,7 +972,8 @@ Page({
this.setData({
'form.customerUserId': customer.id,
'form.customerName': customer.name,
'form.phone': customer.phone || '',
// 后端仅返回脱敏号码,不回填到表单,避免把脱敏值当真实号码提交
'form.phone': '',
'form.createCustomerRecord': false,
customerSuggestions: [],
customerSheetVisible: false,
@@ -1000,11 +1002,25 @@ Page({
return
}
const keyword = String(keywordValue === undefined ? this.data.customerKeyword : keywordValue || '').trim()
if (keyword) {
// 号码已全场景脱敏,按手机号检索必须交给后端精确匹配
try {
const result = await customersApi.listForAppointment({ page: 1, size: 100, keyword })
const rows = Array.isArray(result) ? result : (result.list || [])
this.setData({
customerOptions: this.sortCustomerOptions(rows.map(normalizeCustomer)),
customerError: ''
})
} catch (error) {
this.setData({ customerOptions: [], customerError: error.message || '客户加载失败' })
}
return
}
if (this.data.customerDirectory.length === 0) await this.loadCustomerDirectory()
const matches = this.data.customerDirectory.filter(customer =>
!keyword || `${customer.name} ${customer.phone}`.toLowerCase().includes(keyword.toLowerCase())
)
this.setData({ customerOptions: this.sortCustomerOptions(matches), customerError: '' })
this.setData({
customerOptions: this.sortCustomerOptions(this.data.customerDirectory),
customerError: ''
})
},
changeCustomerView(event) {
@@ -1013,11 +1029,10 @@ Page({
toggleCustomerSort() {
const customerNewestFirst = !this.data.customerNewestFirst
const keyword = String(this.data.customerKeyword || '').trim().toLowerCase()
const matches = this.data.customerDirectory.filter(customer =>
!keyword || `${customer.name} ${customer.phone}`.toLowerCase().includes(keyword)
)
this.setData({ customerNewestFirst, customerOptions: this.sortCustomerOptions(matches, customerNewestFirst) })
this.setData({
customerNewestFirst,
customerOptions: this.sortCustomerOptions(this.data.customerOptions, customerNewestFirst)
})
},
retryCustomerSearch() {
@@ -1032,7 +1047,8 @@ Page({
this.setData({
'form.customerUserId': customer.id,
'form.customerName': customer.name,
'form.phone': customer.phone || '',
// 选择已有客户时不回填脱敏号码,手机号仅在用户主动修改时提交
'form.phone': '',
'form.createCustomerRecord': false,
customerSheetVisible: false,
customerKeyword: '',
@@ -1925,7 +1941,6 @@ Page({
this.setData({
'form.customerUserId': customer.id,
'form.customerName': customer.name,
'form.phone': customer.phone,
'form.createCustomerRecord': false
})
} else {