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}` })
|
||||
|
||||
@@ -10,7 +10,16 @@
|
||||
<view class="avatar">{{avatarText}}</view>
|
||||
<view>
|
||||
<text class="customer">{{appointment.customerNameText}}</text>
|
||||
<text class="phone">{{appointment.customerPhoneText}}</text>
|
||||
<view class="phone-row">
|
||||
<text class="phone">{{appointment.customerPhoneText}}</text>
|
||||
<button
|
||||
wx:if="{{appointment.customerPhoneAvailable && appointment.customerId && appointment.orderId}}"
|
||||
class="call-btn"
|
||||
size="mini"
|
||||
loading="{{dialing}}"
|
||||
bindtap="dialCustomer"
|
||||
>呼叫</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="status-tag {{appointment.status === 2 ? 'completed' : appointment.status === 3 ? 'cancelled' : ''}}">{{appointment.historicalBackfill ? '历史补单 · ' : ''}}{{appointment.statusText}}</text>
|
||||
|
||||
@@ -67,6 +67,24 @@
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.phone-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.call-btn {
|
||||
flex-shrink: 0;
|
||||
margin: 0;
|
||||
padding: 0 18rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #edf6ef;
|
||||
color: #247b63;
|
||||
font-size: 22rpx;
|
||||
font-weight: 800;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
flex-shrink: 0;
|
||||
padding: 8rpx 14rpx;
|
||||
|
||||
Reference in New Issue
Block a user