115 lines
6.1 KiB
Plaintext
115 lines
6.1 KiB
Plaintext
<view class="page no-tab">
|
||
<view class="card form-card">
|
||
<view class="customer-select">
|
||
<view class="field">
|
||
<text class="field-label required">客户姓名</text>
|
||
<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="搜索或输入手机号" />
|
||
</view>
|
||
<view wx:if="{{customerDropdownVisible}}" class="customer-dropdown">
|
||
<view wx:if="{{customerLoading}}" class="customer-option muted-option">正在搜索客户...</view>
|
||
<view wx:elif="{{customerError}}" class="customer-option muted-option">{{customerError}},可继续手动输入</view>
|
||
<view wx:else>
|
||
<view wx:for="{{customerOptions}}" wx:key="id" class="customer-option" data-id="{{item.id}}" bindtap="selectCustomer">
|
||
<view class="customer-copy">
|
||
<text class="customer-name">{{item.displayName}}</text>
|
||
<text class="customer-phone">{{item.displayPhone}}</text>
|
||
</view>
|
||
<text class="customer-select-tag">选择</text>
|
||
</view>
|
||
<view wx:if="{{customerOptions.length === 0}}" class="customer-option muted-option">暂无匹配客户,可继续手动输入</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="field">
|
||
<text class="field-label required">预约日期</text>
|
||
<picker mode="date" value="{{form.appointmentDate}}" bindchange="onDateChange">
|
||
<view class="field-value">{{form.appointmentDate}}</view>
|
||
</picker>
|
||
</view>
|
||
<view class="field">
|
||
<text class="field-label required">预约时间</text>
|
||
<picker mode="time" value="{{form.appointmentTime}}" start="10:00" end="22:00" bindchange="onTimeChange">
|
||
<view class="field-value">{{form.appointmentTime}}</view>
|
||
</picker>
|
||
</view>
|
||
<view class="field">
|
||
<text class="field-label required">预约作品</text>
|
||
<view class="field-value product-value" bindtap="openProductModal">
|
||
<text>{{selectedProduct.title || form.manualProductTitle || '请选择预约作品'}}</text>
|
||
<text wx:if="{{form.manualProductTitle && !form.productId}}" class="manual-badge">手动</text>
|
||
</view>
|
||
</view>
|
||
<view class="field">
|
||
<text class="field-label">预计时长</text>
|
||
<input value="{{form.durationMinutes}}" data-field="durationMinutes" bindinput="onInput" type="number" placeholder="默认读取作品时长" />
|
||
<text class="unit">分钟</text>
|
||
</view>
|
||
<view class="field">
|
||
<text class="field-label required">指定员工</text>
|
||
<picker range="{{artists}}" range-key="name" bindchange="onArtistChange">
|
||
<view class="field-value">{{selectedArtist.name || '请选择美甲师'}}</view>
|
||
</picker>
|
||
</view>
|
||
<view class="field textarea-field">
|
||
<text class="field-label">备注</text>
|
||
<textarea value="{{form.remark}}" data-field="remark" bindinput="onInput" placeholder="客户偏好、款式说明" />
|
||
</view>
|
||
</view>
|
||
|
||
<view class="capacity-tip card">
|
||
<text class="tip-title">容量校验</text>
|
||
<text class="tip-text">保存时会校验营业时间、美甲师休息和同时间段容量,冲突会直接拦截。</text>
|
||
</view>
|
||
|
||
<view wx:if="{{conflictTip}}" class="availability-tip card {{conflictLevel}}">
|
||
<text class="tip-title">时段检查</text>
|
||
<text class="tip-text">{{conflictTip}}</text>
|
||
</view>
|
||
|
||
<view wx:if="{{productModalVisible}}" class="modal-mask" bindtap="closeProductModal">
|
||
<view class="product-modal" catchtap="stopTap">
|
||
<view class="modal-head">
|
||
<view>
|
||
<text class="modal-title">选择预约作品</text>
|
||
</view>
|
||
<view class="modal-close" bindtap="closeProductModal">×</view>
|
||
</view>
|
||
<input class="product-search" value="{{productKeyword}}" bindinput="onProductSearch" placeholder="搜索作品、标签、美甲师" />
|
||
<scroll-view class="product-list" scroll-y>
|
||
<view wx:if="{{productError}}" class="product-empty">{{productError}}</view>
|
||
<view wx:for="{{filteredProducts}}" wx:key="id" class="product-option {{form.productId == item.id ? 'active' : ''}}" data-id="{{item.id}}" bindtap="selectProduct">
|
||
<image wx:if="{{item.coverImage}}" class="product-cover" src="{{item.coverImage}}" mode="aspectFill"></image>
|
||
<view wx:else class="product-cover placeholder">图</view>
|
||
<view class="product-info">
|
||
<view class="product-title-row">
|
||
<text class="product-title">{{item.title}}</text>
|
||
<text class="product-price">{{item.priceText}}</text>
|
||
</view>
|
||
<text class="product-meta">{{item.artistText}} · {{item.durationText || '时长待定'}}</text>
|
||
<view class="tag-row">
|
||
<text wx:for="{{item.tagList}}" wx:for-item="tag" wx:key="*this" class="tag-pill">{{tag}}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view wx:if="{{!productError && filteredProducts.length === 0}}" class="product-empty">暂无匹配作品</view>
|
||
</scroll-view>
|
||
<view class="manual-panel">
|
||
<text class="manual-title required-label">手动新增预约作品</text>
|
||
<view class="manual-grid">
|
||
<input value="{{form.manualProductTitle}}" data-field="manualProductTitle" bindinput="onInput" placeholder="作品名称" />
|
||
<input value="{{form.manualProductPrice}}" data-field="manualProductPrice" bindinput="onInput" type="digit" placeholder="价格" />
|
||
</view>
|
||
<button class="secondary-btn manual-btn" bindtap="useManualProduct">使用手动预约作品</button>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="fixed-bottom">
|
||
<button wx:if="{{canCreateAppointment}}" class="primary-btn" loading="{{loading}}" bindtap="submit">保存预约</button>
|
||
</view>
|
||
</view>
|