Salon 侧全场景脱敏与拨号单次取号改造:收掉预约选择客户的完整手机号出口,新增按门店与订单上下文授权的拨号取号端点及隐私号占位渠道,前端改为脱敏展示加呼叫取号,并同步更新协议条款
自动发布开发环境 Nacos 配置 / publish (push) Successful in 24s
自动发布开发环境 Nacos 配置 / publish (push) Successful in 24s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const planningApi = require('../../api/planning')
|
||||
const customersApi = require('../../api/customers')
|
||||
const { markPlanningRefresh } = require('../../utils/planning-refresh')
|
||||
|
||||
function displayValue(value, fallback) {
|
||||
@@ -24,6 +25,7 @@ Page({
|
||||
showComplete: false,
|
||||
showCancel: false,
|
||||
updating: false,
|
||||
dialing: false,
|
||||
loadError: ''
|
||||
},
|
||||
|
||||
@@ -130,6 +132,27 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
async dialCustomer() {
|
||||
const appointment = this.data.appointment || {}
|
||||
if (this.data.dialing) return
|
||||
if (!appointment.customerPhoneAvailable || !appointment.customerId || !appointment.orderId) {
|
||||
wx.showToast({ title: '该客户暂无可拨打的手机号', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ dialing: true })
|
||||
try {
|
||||
const result = await customersApi.dialCustomer(appointment.customerId, appointment.orderId)
|
||||
if (!result || !result.dialNumber) {
|
||||
throw new Error('未获取到可拨打号码')
|
||||
}
|
||||
wx.makePhoneCall({ phoneNumber: result.dialNumber })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '取号失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ dialing: false })
|
||||
}
|
||||
},
|
||||
|
||||
goTransfer() {
|
||||
if (!this.data.showTransfer) return
|
||||
wx.navigateTo({ url: `/pages/artist-transfer/index?id=${this.data.id}` })
|
||||
|
||||
Reference in New Issue
Block a user