Files
JayuCloud/JC-Salon-WeChat/pages/schedule-setting/index.wxml
T

73 lines
3.8 KiB
Plaintext

<view class="page no-tab">
<view wx:if="{{onboarding}}" class="onboarding-context card">
<text class="onboarding-context-title">首次排班设置</text>
<text class="onboarding-context-desc">{{appointmentContextText ? '待承接预约:' + appointmentContextText : '保存常规排班后,美甲师即可开始承接预约。'}}</text>
</view>
<view class="section">
<view class="section-title">常规排班</view>
<view class="card rule-card">
<view class="preset-grid">
<view wx:for="{{presetOptions}}" wx:key="value" class="preset-chip {{item.active ? 'active' : ''}}" data-value="{{item.value}}" bindtap="selectPreset">{{item.label}}</view>
</view>
<view class="field-block">
<view class="field-title">工作日</view>
<view class="weekday-grid">
<view wx:for="{{weekdayOptions}}" wx:key="value" class="weekday-chip {{item.active ? 'active' : ''}}" data-value="{{item.value}}" bindtap="toggleWeekday">{{item.label}}</view>
</view>
</view>
<view class="field">
<text class="field-label">开始时间</text>
<picker mode="time" value="{{form.startTime}}" bindchange="onStartChange"><view class="field-value">{{form.startTime}}</view></picker>
</view>
<view class="field">
<text class="field-label">结束时间</text>
<picker mode="time" value="{{form.endTime}}" bindchange="onEndChange"><view class="field-value">{{form.endTime}}</view></picker>
</view>
<view class="field">
<text class="field-label">备注</text>
<input value="{{form.remark}}" data-field="remark" bindinput="onInput" placeholder="可选" />
</view>
</view>
</view>
<view wx:if="{{!onboarding}}" class="section">
<view class="section-title">特殊日期</view>
<view class="card rule-card">
<view class="field">
<text class="field-label">日期</text>
<picker mode="date" value="{{exceptionForm.workDate}}" bindchange="onExceptionDateChange"><view class="field-value">{{exceptionForm.workDate}}</view></picker>
</view>
<view class="field">
<text class="field-label">类型</text>
<picker range="{{exceptionTypes}}" range-key="label" value="{{exceptionTypeIndex}}" bindchange="onExceptionTypeChange"><view class="field-value">{{exceptionTypeLabel}}</view></picker>
</view>
<view wx:if="{{exceptionForm.exceptionType !== 'REST'}}" class="field">
<text class="field-label">开始时间</text>
<picker mode="time" value="{{exceptionForm.startTime}}" bindchange="onExceptionStartChange"><view class="field-value">{{exceptionForm.startTime}}</view></picker>
</view>
<view wx:if="{{exceptionForm.exceptionType !== 'REST'}}" class="field">
<text class="field-label">结束时间</text>
<picker mode="time" value="{{exceptionForm.endTime}}" bindchange="onExceptionEndChange"><view class="field-value">{{exceptionForm.endTime}}</view></picker>
</view>
<view class="field">
<text class="field-label">备注</text>
<input value="{{exceptionForm.remark}}" data-field="remark" bindinput="onExceptionInput" placeholder="可选" />
</view>
<button class="secondary-btn exception-btn" loading="{{saving}}" bindtap="saveException">保存特殊日期</button>
</view>
<view wx:if="{{exceptions.length}}" class="exception-list">
<view wx:for="{{exceptions}}" wx:key="id" class="card exception-card">
<text>{{item.summary}}</text>
<text wx:if="{{item.remark}}" class="exception-remark">{{item.remark}}</text>
</view>
</view>
</view>
<view class="fixed-bottom">
<button class="primary-btn" loading="{{saving}}" bindtap="save">{{onboarding && onboardingSource === 'appointment' ? '保存排班并继续分配' : '保存排班规则'}}</button>
</view>
</view>