Files
JayuCloud/JC-Salon-WeChat/api/customers.js
T

74 lines
1.6 KiB
JavaScript
Raw Normal View History

2026-06-04 16:39:06 +08:00
const request = require('../utils/request')
module.exports = {
list(params) {
return request({
url: '/manager/customers',
2026-06-26 11:07:54 +08:00
params
2026-06-04 16:39:06 +08:00
})
},
listForAppointment(params) {
return request({
url: '/manager/customers/appointment-options',
params
})
},
matchIdentityForAppointment(nickname, wechatId, phone) {
return request({ url: '/manager/customers/identity-matches', params: { nickname, wechatId, phone } })
},
2026-06-04 16:39:06 +08:00
detail(id) {
return request({
url: `/manager/customers/${id}`
2026-06-04 16:39:06 +08:00
})
2026-06-26 11:07:54 +08:00
},
2026-10-16 17:33:58 +08:00
matchIdentity(nickname, phone) {
return request({
url: '/manager/customers/matches',
params: { nickname, phone }
})
},
matchExactIdentity(nickname, wechatId, phone) {
return request({
url: '/manager/customers/identity-matches',
params: { nickname, wechatId, phone }
})
},
appointmentOptions(params) {
return request({
url: '/manager/customers/appointment-options',
params
})
},
/**
* 后台按预约/订单上下文单次取号,号码不入库、不缓存;散客可不传 customerId。
*/
dialCustomer(params) {
const source = params || {}
const query = {}
if (source.customerId) query.customerId = source.customerId
if (source.appointmentId) query.appointmentId = source.appointmentId
if (source.orderId) query.orderId = source.orderId
return request({
url: '/manager/customers/dial',
method: 'POST',
data: {},
params: query
})
},
2026-06-26 11:07:54 +08:00
create(data) {
return request({
url: '/manager/customers',
method: 'POST',
data
})
2026-06-04 16:39:06 +08:00
}
}