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

69 lines
1.4 KiB
JavaScript

const request = require('../utils/request')
module.exports = {
list(params) {
return request({
url: '/manager/customers',
params
})
},
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 } })
},
detail(id) {
return request({
url: `/manager/customers/${id}`
})
},
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
})
},
/**
* 后台按预约/订单上下文单次取号,号码不入库、不缓存。
*/
dialCustomer(customerId, orderId) {
return request({
url: `/manager/customers/${customerId}/dial`,
method: 'POST',
data: {},
params: { orderId }
})
},
create(data) {
return request({
url: '/manager/customers',
method: 'POST',
data
})
}
}