修复店务预约与小程序生产问题

This commit is contained in:
2026-07-20 01:22:37 +08:00
parent 92949f9368
commit d180880445
25 changed files with 565 additions and 70 deletions
@@ -269,6 +269,9 @@ Page({
manualProductImageUrl: '',
durationMinutes: '',
artistId: '',
depositPaid: false,
needRemoval: false,
fromMeituan: false,
remark: ''
},
customerOptions: [],
@@ -378,6 +381,13 @@ Page({
}
},
onToggleChange(event) {
const field = event.currentTarget.dataset.field
this.setData({
[`form.${field}`]: !!event.detail.value
})
},
onCustomerFocus(event) {
const field = event.currentTarget.dataset.field
this.setData({ customerDropdownVisible: true })
@@ -715,8 +725,10 @@ Page({
}
const form = this.data.form
const hasManualProduct = String(form.manualProductTitle || '').trim() && String(form.manualProductPrice || '').trim()
const customerName = String(form.customerName || '').trim()
const phone = String(form.phone || '').trim()
const durationMinutes = normalizeDuration(form.durationMinutes)
if (!form.customerName || !form.phone || (!form.productId && !hasManualProduct) || !form.artistId) {
if (!customerName || (!form.productId && !hasManualProduct) || !form.artistId) {
wx.showToast({ title: '请补全预约信息', icon: 'none' })
return
}
@@ -733,8 +745,13 @@ Page({
try {
const payload = {
...form,
customerName,
phone: phone || undefined,
customerUserId: form.customerUserId ? String(form.customerUserId) : undefined,
artistId: String(form.artistId),
depositPaid: !!form.depositPaid,
needRemoval: !!form.needRemoval,
fromMeituan: !!form.fromMeituan,
durationMinutes,
clientRequestId: buildClientRequestId('manager-appointment')
}