优化预约款式录入表单

This commit is contained in:
2026-10-28 17:55:42 +08:00
parent 6fbcf9896e
commit 976ca68687
7 changed files with 303 additions and 223 deletions
@@ -21,21 +21,17 @@
<text wx:if="{{form.manualProductTitle}}" class="field-value">{{form.manualProductTitle}}</text>
<text wx:elif="{{form.manualProductImages.length}}" class="field-value">已添加 {{form.manualProductImages.length}} 张款式图片</text>
<text wx:else class="field-value placeholder">填写款式名称或添加图片</text>
<text wx:if="{{form.amount || form.durationMinutes}}" class="field-meta">{{form.amount || '待填'}} 元 · 预计 {{form.durationMinutes || '60'}} 分钟</text>
<text class="field-label">{{form.manualProductImages.length ? '已添加 ' + form.manualProductImages.length + ' 张图片 · 点击可编辑' : '点击可手动录入,提交预约后自动加入款式库'}}</text>
</view>
<text class="chevron">›</text>
</button>
<view wx:else class="selected-style-card">
<view wx:else class="selected-style-card" bindtap="openManualProduct">
<image wx:if="{{selectedProduct.coverImage}}" class="selected-style-image" src="{{selectedProduct.coverImage}}" mode="aspectFill"></image>
<view wx:else class="field-icon">✦</view>
<view class="selected-style-copy"><text class="selected-style-title">{{selectedProduct.title}}</text><text class="selected-style-meta">参考价 {{selectedProductPriceText || '待定'}} · {{selectedProduct.durationText || '时长待定'}}</text></view>
<button class="switch-manual-action" catchtap="openManualProduct">手动录入</button>
<view class="selected-style-copy"><text class="selected-style-title">{{selectedProduct.title}}</text><text class="selected-style-meta">参考价 {{selectedProductPriceText || '待定'}} · 本次 {{form.amount || '待填'}} 元 · {{form.durationMinutes || '60'}} 分钟</text></view>
<button class="switch-manual-action" catchtap="openManualProduct">调整</button>
</view>
<view class="style-number-row">
<label wx:if="{{form.productId}}" class="number-field"><text class="field-label required">成交金额(元)</text><view class="number-input-wrap"><input type="digit" value="{{form.amount}}" data-field="amount" bindinput="onInput" placeholder="例如 268" /><text class="number-unit">元</text></view></label>
<label class="number-field"><text class="field-label required">预计时长(分钟)</text><view class="number-input-wrap"><input type="number" value="{{form.durationMinutes}}" data-field="durationMinutes" bindinput="onInput" placeholder="60" /><text class="number-unit">分钟</text></view></label>
</view>
<view class="style-remark-field"><text class="field-label">款式备注</text><textarea value="{{form.remark}}" data-field="remark" bindinput="onInput" placeholder="可填写颜色、工艺、特殊要求等(可选)" /></view>
<text class="style-hint">名称和图片至少填写一项;名称为空时会使用客户姓名或“散客款式”。</text>
</view>
@@ -82,15 +78,29 @@
<entity-selector-sheet visible="{{customerSheetVisible}}" title="选择客户" keyword="{{customerKeyword}}" placeholder="搜索客户姓名或手机号" items="{{customerOptions}}" selected-id="{{form.customerUserId}}" loading="{{customerLoading}}" error-text="{{customerError}}" empty-text="暂无匹配客户" show-view-switch="{{true}}" view-mode="{{customerViewMode}}" sort-label="{{customerNewestFirst ? '最新添加' : '最早添加'}}" bind:search="onCustomerSearch" bind:select="selectCustomer" bind:retry="retryCustomerSearch" bind:changeview="changeCustomerView" bind:sort="toggleCustomerSort" bind:close="closeCustomerSheet" />
<entity-selector-sheet visible="{{artistSheetVisible}}" title="选择美甲师" keyword="{{artistKeyword}}" placeholder="搜索美甲师姓名" items="{{artistSelectorItems}}" selected-id="{{form.artistId}}" loading="{{false}}" error-text="{{artistError}}" empty-text="暂无匹配美甲师" action-text="快速新增美甲师" bind:search="onArtistSearch" bind:select="selectArtist" bind:retry="retryArtists" bind:action="addEmployeeFromSelector" bind:close="closeArtistSheet" />
<product-selector-sheet visible="{{productModalVisible}}" mode="list" title="选择已有款式" keyword="{{productKeyword}}" placeholder="搜索款式、标签、美甲师" items="{{filteredProducts}}" selected-id="{{form.productId}}" loading="{{loadingProducts}}" error-text="{{productError}}" empty-text="暂无匹配款式" show-manual-action="{{true}}" bind:search="onProductSearch" bind:select="selectProduct" bind:openmanual="openManualProduct" bind:retry="loadOptions" bind:close="closeProductModal" />
<product-selector-sheet visible="{{productModalVisible}}" mode="list" title="选择已有款式" keyword="{{productKeyword}}" placeholder="搜索款式、标签、美甲师" items="{{filteredProducts}}" selected-id="{{form.productId}}" loading="{{loadingProducts}}" error-text="{{productError}}" empty-text="暂无匹配款式" show-manual-action="{{true}}" bind:search="onProductSearch" bind:select="selectProduct" bind:openmanual="openManualProductFromLibrary" bind:retry="loadOptions" bind:close="closeProductModal" />
<view wx:if="{{manualProductSheetVisible}}" class="modal-mask manual-product-mask" bindtap="closeManualProduct" catchtouchmove="stopTouchMove">
<view class="manual-style-sheet" catchtap="stopTap" catchtouchmove="stopTouchMove">
<view class="modal-head"><view><text class="modal-title">录入本次美甲款式</text><text class="modal-subtitle">名称或图片至少填写一项 · 可添加多张图片</text></view><view class="modal-close" bindtap="closeManualProduct" aria-label="关闭款式录入"></view></view>
<view class="modal-head"><view><text class="modal-title">{{form.productId ? '调整预约款式' : '录入本次美甲款式'}}</text><text class="modal-subtitle">{{form.productId ? '可调整本次价格和预计时长' : '名称或图片至少填写一项 · 可添加多张图片'}}</text></view><view class="modal-close" bindtap="closeManualProduct" aria-label="关闭款式录入"></view></view>
<scroll-view class="manual-style-content" scroll-y enhanced show-scrollbar="{{false}}">
<view class="style-name-row">
<input class="style-name-input" value="{{form.manualProductTitle}}" bindinput="onStyleTitleInput" placeholder="留空时默认使用客户姓名" />
<input class="style-price-input" type="digit" value="{{form.amount}}" data-field="amount" bindinput="onInput" placeholder="金额" />
<view class="manual-style-name-field">
<view class="manual-style-field-heading"><text>名称</text><text class="manual-style-character-count">{{manualProductTitleLength}} / 100</text></view>
<input class="manual-style-title-input" value="{{form.productId ? selectedProduct.title : form.manualProductTitle}}" maxlength="100" disabled="{{form.productId}}" bindinput="onStyleTitleInput" placeholder="留空时默认使用客户姓名" />
</view>
<view class="manual-style-price-duration-row">
<view class="manual-style-compact-field">
<text class="manual-style-field-label">价格</text>
<view class="manual-style-input-wrap"><input type="digit" value="{{form.amount}}" data-field="amount" bindinput="onInput" placeholder="例如 268" /><text>元</text></view>
</view>
<view class="manual-style-compact-field">
<text class="manual-style-field-label">预计时长</text>
<view class="manual-style-input-wrap"><input type="number" value="{{form.durationMinutes}}" data-field="durationMinutes" bindinput="onInput" placeholder="60" /><text>分钟</text></view>
</view>
</view>
<view class="manual-style-description-field">
<text class="manual-style-field-label">款式描述 / 备注</text>
<textarea value="{{unifiedStyleDescription}}" bindinput="onUnifiedStyleDescriptionInput" placeholder="可填写颜色、工艺、特殊要求等(选填)" maxlength="500" />
</view>
<view class="manual-style-images">
<view class="manual-style-image-heading"><text>款式图片</text><text class="manual-style-image-count">{{form.manualProductImages.length}} / 9</text></view>
@@ -105,9 +115,8 @@
<text class="manual-style-image-tip">第一张图片会作为款式封面,后续图片可展示细节或顾客实拍。</text>
</view>
<view class="manual-style-more">
<view class="manual-style-more-toggle" bindtap="toggleManualProductMore"><text>补充更多信息(选填)</text><text class="manual-style-more-arrow">{{manualProductMoreVisible ? '⌃' : '⌄'}}</text></view>
<view class="manual-style-more-toggle" bindtap="toggleManualProductMore"><text>更多款式信息(选填)</text><text class="manual-style-more-arrow">{{manualProductMoreVisible ? '⌃' : '⌄'}}</text></view>
<view wx:if="{{manualProductMoreVisible}}" class="manual-style-more-fields">
<textarea value="{{form.manualProductDescription}}" data-field="manualProductDescription" bindinput="onInput" placeholder="款式描述" />
<input value="{{form.manualProductTags}}" data-field="manualProductTags" bindinput="onInput" placeholder="标签,多个用逗号分隔" />
<input value="{{form.manualProductTargetAudience}}" data-field="manualProductTargetAudience" bindinput="onInput" placeholder="适合人群" />
<input value="{{form.manualProductPrecautions}}" data-field="manualProductPrecautions" bindinput="onInput" placeholder="注意事项" />