Files
JayuCloud/JY-Salon-WeChat/pages/shop-settings/index.wxml
T
2026-07-01 02:08:51 +08:00

65 lines
4.3 KiB
Plaintext

<view class="page no-tab">
<view wx:if="{{loading}}" class="loading-state">店铺设置加载中</view>
<block wx:else>
<view class="card form-card">
<view class="field"><text class="field-label">店铺名称</text><input value="{{form.shopName}}" data-field="shopName" bindinput="onInput" /></view>
<view class="field">
<view class="label-with-help">
<text class="field-label">默认时长</text>
<text class="help-badge" catchtap="explainDefaultDuration">?</text>
</view>
<input type="number" value="{{form.defaultDuration}}" data-field="defaultDuration" bindinput="onInput" />
<text class="muted">分钟</text>
</view>
<view class="field">
<view class="label-with-help">
<text class="field-label">预约规则</text>
<text class="help-badge" catchtap="explainBookingRule">?</text>
</view>
<input value="{{form.rule}}" data-field="rule" bindinput="onInput" placeholder="例如:必须选择已有作品作为项目来源" />
</view>
</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.scheduleRemark}}" data-field="scheduleRemark" bindinput="onInput" placeholder="可选" /></view>
</view>
</view>
<view 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>
</block>
<view class="fixed-bottom"><button class="primary-btn" loading="{{saving}}" bindtap="save">保存设置</button></view>
</view>