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

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')
}
@@ -6,8 +6,8 @@
<input value="{{form.customerName}}" data-field="customerName" bindinput="onInput" bindfocus="onCustomerFocus" bindblur="hideCustomerDropdown" placeholder="搜索或输入客户姓名" />
</view>
<view class="field">
<text class="field-label required">手机号</text>
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" bindfocus="onCustomerFocus" bindblur="hideCustomerDropdown" placeholder="搜索或输入手机号" />
<text class="field-label">手机号</text>
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" bindfocus="onCustomerFocus" bindblur="hideCustomerDropdown" placeholder="可选,填写后匹配客户" />
</view>
<view wx:if="{{customerDropdownVisible}}" class="customer-dropdown">
<view wx:if="{{customerLoading}}" class="customer-option muted-option">正在搜索客户...</view>
@@ -58,6 +58,26 @@
<text class="time-arrow">›</text>
</view>
</view>
<view class="appointment-flags">
<view class="field toggle-field">
<view class="toggle-copy">
<text class="field-label">是否交定金</text>
</view>
<switch checked="{{form.depositPaid}}" color="#6f8f83" data-field="depositPaid" bindchange="onToggleChange" />
</view>
<view class="field toggle-field">
<view class="toggle-copy">
<text class="field-label">是否需要卸甲</text>
</view>
<switch checked="{{form.needRemoval}}" color="#6f8f83" data-field="needRemoval" bindchange="onToggleChange" />
</view>
<view class="field toggle-field">
<view class="toggle-copy">
<text class="field-label">是否来自美团</text>
</view>
<switch checked="{{form.fromMeituan}}" color="#6f8f83" data-field="fromMeituan" bindchange="onToggleChange" />
</view>
</view>
<view class="field textarea-field">
<text class="field-label">备注</text>
<textarea value="{{form.remark}}" data-field="remark" bindinput="onInput" placeholder="客户偏好、款式说明" />
@@ -130,6 +130,25 @@
align-items: flex-start;
}
.appointment-flags {
display: flex;
flex-direction: column;
gap: 14rpx;
margin-top: 4rpx;
}
.toggle-field {
align-items: center;
}
.toggle-copy {
display: flex;
min-width: 0;
flex: 1;
flex-direction: column;
gap: 4rpx;
}
.capacity-tip {
display: flex;
flex-direction: column;