101 lines
12 KiB
Plaintext
101 lines
12 KiB
Plaintext
<view class="page no-tab appointment-page backfill-page">
|
||
<view class="appointment-hero">
|
||
<view class="appointment-hero-copy">
|
||
<text class="appointment-eyebrow">HISTORICAL ORDER</text>
|
||
<text class="appointment-title">补录一笔历史订单</text>
|
||
</view>
|
||
<view class="appointment-date-pill"><text class="date-pill-icon">◷</text><text>{{form.serviceDate}}</text></view>
|
||
</view>
|
||
|
||
<view class="card form-card style-section">
|
||
<view class="section-heading">
|
||
<view class="section-title-row"><text class="section-title-main">美甲款式</text><text class="required-mark">*</text></view>
|
||
<button class="link-action" bindtap="openProductLibrary">款式库</button>
|
||
</view>
|
||
<button wx:if="{{!form.productId}}" class="field-card appointment-field-card full" bindtap="openManualProduct">
|
||
<image wx:if="{{form.manualProductImages.length}}" class="field-icon style-entry-image" src="{{form.manualProductImages[0].previewUrl || form.manualProductImages[0].fileUrl}}" mode="aspectFill" data-index="0" binderror="onManualProductImageError"></image>
|
||
<view wx:else class="field-icon">✦</view>
|
||
<view class="field-text">
|
||
<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 ? '已添加图片 · 点击可编辑' : '点击手动录入,提交后自动保存到本店款式库'}}</text>
|
||
</view>
|
||
<text class="chevron">›</text>
|
||
</button>
|
||
<view wx:else class="selected-style-card" bindtap="openManualProduct">
|
||
<image wx:if="{{selectedProduct.coverImage}}" class="selected-style-image" src="{{selectedProduct.coverImage}}" mode="aspectFill" binderror="onSelectedProductImageError"></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 || '待定'}} · 本次 {{form.amount || '待填'}} 元 · {{form.durationMinutes || '60'}} 分钟</text></view>
|
||
<button class="switch-manual-action" catchtap="openManualProduct">调整</button>
|
||
</view>
|
||
<text class="style-hint">名称和图片至少填写一项;名称未填时会使用客户姓名,未选择客户则使用“散客款式”。</text>
|
||
<text class="style-hint">手动录入款式在补录提交成功后自动保存到本店款式库,仅门店可见,不会公开展示。</text>
|
||
</view>
|
||
|
||
<view class="card form-card appointment-info-section">
|
||
<view class="section-heading"><view><text class="section-title-main">服务信息</text><text class="section-caption">服务时间可留空,美甲师必须选择</text></view></view>
|
||
<picker mode="date" value="{{form.serviceDate}}" bindchange="onDateChange">
|
||
<view class="field-card appointment-field-card"><view class="field-icon">▣</view><view class="field-text"><text class="field-label">服务日期</text><text class="field-value">{{form.serviceDate}}</text></view><text class="chevron">›</text></view>
|
||
</picker>
|
||
<picker mode="time" value="{{form.serviceTime}}" bindchange="onTimeChange">
|
||
<view class="field-card appointment-field-card"><view class="field-icon">◷</view><view class="field-text"><text class="field-label">服务时间</text><text class="field-value {{form.serviceTime ? '' : 'placeholder'}}">{{form.serviceTime || '时间未记录'}}</text><text class="field-meta">可留空,仅按服务日期统计</text></view><text class="chevron">›</text></view>
|
||
</picker>
|
||
<view class="field-card appointment-field-card" bindtap="openArtistSelector"><view class="field-icon">♙</view><view class="field-text"><text class="field-label">服务美甲师</text><text class="field-value {{selectedArtistName ? '' : 'placeholder'}}">{{selectedArtistName || '请选择美甲师'}}</text></view><text class="chevron">›</text></view>
|
||
</view>
|
||
|
||
<view class="card form-card customer-section">
|
||
<view class="section-heading"><view><text class="section-title-main">客户</text><text class="section-caption">可留空,留空时按散客记录</text></view></view>
|
||
<view class="customer-entry">
|
||
<view class="customer-fields">
|
||
<input class="customer-name-input" value="{{form.customerName}}" data-field="customerName" bindinput="onCustomerInput" placeholder="客户姓名(可选)" />
|
||
<input class="customer-wechat-input" value="{{form.wechatId}}" data-field="wechatId" bindinput="onCustomerInput" placeholder="微信号(可选)" />
|
||
<input class="customer-phone-input" value="{{form.phone}}" data-field="phone" bindinput="onCustomerInput" type="number" maxlength="11" placeholder="手机号(可选)" />
|
||
</view>
|
||
<button class="customer-library-btn" aria-label="选择已有客户" catchtap="openCustomerSelector"><text class="customer-library-icon">⌕</text></button>
|
||
</view>
|
||
<view wx:if="{{form.customerUserId}}" class="customer-selected-tip">已选择系统客户</view>
|
||
</view>
|
||
|
||
<view class="card form-card service-status-section">
|
||
<view class="section-heading"><view><text class="section-title-main">服务状态</text><text class="section-caption">补录订单直接进入选择的状态</text></view></view>
|
||
<view class="status-segment">
|
||
<view class="status-option {{form.status == 4 ? 'active' : ''}}" data-status="4" bindtap="selectStatus"><text class="status-indicator in-service"></text><text>服务中</text></view>
|
||
<view class="status-option {{form.status == 2 ? 'active' : ''}}" data-status="2" bindtap="selectStatus"><text class="status-indicator completed"></text><text>已完成</text></view>
|
||
</view>
|
||
<text class="style-hint">历史补单不校验美甲师排班,也不会占用预约时段。</text>
|
||
</view>
|
||
|
||
<view class="draft-tip card"><text>恢复默认值会清空本次填写,并保留入口日期和美甲师。</text><button class="text-btn draft-clear" bindtap="resetForm">恢复默认值</button></view>
|
||
|
||
<view class="fixed-bottom"><button class="primary-btn submit-btn" loading="{{submitting}}" disabled="{{submitting}}" bindtap="submit">保存历史补单</button></view>
|
||
|
||
<product-selector-sheet visible="{{productSelectorVisible}}" mode="list" title="选择已有款式" keyword="{{productKeyword}}" placeholder="搜索款式、标签、美甲师" items="{{productOptions}}" selected-id="{{form.productId}}" loading="{{loadingProducts}}" error-text="{{productError}}" empty-text="暂无匹配款式" show-manual-action="{{true}}" bind:search="searchProducts" bind:select="selectProduct" bind:openmanual="openManualProduct" bind:close="closeProductSelector" bind:retry="loadProducts" />
|
||
<entity-selector-sheet visible="{{artistSelectorVisible}}" title="选择美甲师" keyword="{{artistKeyword}}" placeholder="搜索美甲师姓名" items="{{artistOptions}}" selected-id="{{form.artistId}}" loading="{{loadingArtists}}" error-text="{{artistError}}" empty-text="暂无可选美甲师" bind:search="searchArtists" bind:select="selectArtist" bind:retry="loadArtists" bind:close="closeArtistSelector" />
|
||
<entity-selector-sheet visible="{{customerSelectorVisible}}" title="选择客户" keyword="{{customerKeyword}}" placeholder="搜索客户姓名或手机号" items="{{customerOptions}}" selected-id="{{form.customerUserId}}" loading="{{loadingCustomers}}" error-text="{{customerError}}" empty-text="暂无客户,可留空记为散客" action-text="按散客记录" bind:search="searchCustomers" bind:select="selectCustomer" bind:retry="loadCustomers" bind:action="useWalkIn" bind:close="closeCustomerSelector" />
|
||
|
||
<view wx:if="{{manualProductSheetVisible}}" class="modal-mask manual-product-mask" bindtap="closeManualProduct" catchtouchmove="stopTouchMove">
|
||
<view class="manual-style-sheet backfill-manual-style-sheet" catchtap="stopTap" catchtouchmove="stopTouchMove">
|
||
<view class="modal-head"><view><text class="modal-title">{{form.productId ? '调整补录款式' : '录入本次美甲款式'}}</text><text class="modal-subtitle">名称或图片至少填写一项 · 可添加多张图片</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="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="{{manualProductDraft.title}}" maxlength="100" data-field="title" bindinput="onManualProductInput" 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 || manualProductDraft.price}}" 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="{{manualProductDraft.durationMinutes}}" data-field="durationMinutes" bindinput="onManualProductInput" placeholder="60" /><text>分钟</text></view></view>
|
||
</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>
|
||
<scroll-view class="manual-style-image-scroll" scroll-x="true" enhanced="true" show-scrollbar="false"><view class="manual-style-image-grid">
|
||
<view wx:for="{{form.manualProductImages}}" wx:key="fileId" class="manual-style-image-tile"><image src="{{item.previewUrl || item.fileUrl}}" mode="aspectFill" data-index="{{index}}" binderror="onManualProductImageError"></image><text wx:if="{{index === 0}}" class="manual-style-image-cover">封面</text><button class="manual-style-image-remove" data-index="{{index}}" disabled="{{manualImageUploading}}" catchtap="removeManualProductImage" aria-label="移除图片">×</button></view>
|
||
<button wx:if="{{form.manualProductImages.length < 9}}" class="manual-style-add-image" bindtap="chooseManualProductImage" loading="{{manualImageUploading}}" disabled="{{manualImageUploading}}"><text class="manual-style-add-icon">+</text><text>点击添加图片</text></button>
|
||
</view></scroll-view><text class="manual-style-image-tip">第一张图片会作为款式封面</text>
|
||
</view>
|
||
<view class="manual-style-description-field"><text class="manual-style-field-label">款式描述 / 补单备注(选填)</text><textarea value="{{manualProductDraft.description}}" data-field="description" bindinput="onManualProductInput" placeholder="可填写颜色、工艺、服务说明等" maxlength="500" /></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 wx:if="{{manualProductMoreVisible}}" class="manual-style-more-fields"><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="注意事项" /></view></view>
|
||
</scroll-view>
|
||
<view class="manual-style-footer"><button class="manual-style-confirm" bindtap="useManualProduct">用于本次补录</button><button class="manual-style-library-link" bindtap="openProductLibrary">从款式库中选择</button></view>
|
||
</view>
|
||
</view>
|
||
</view>
|