重构店铺设置展示与编辑流程

This commit is contained in:
2026-07-23 20:22:01 +08:00
parent b965057499
commit 0996f73af6
14 changed files with 1530 additions and 567 deletions
+140 -92
View File
@@ -3,7 +3,7 @@
<block wx:else>
<view class="page-heading">
<text class="page-title">店铺设置</text>
<text class="page-subtitle">把门店气质写进第一眼</text>
<text class="page-subtitle">先看见门店状态,再按需调整细节。</text>
</view>
<view class="cover-card">
@@ -14,119 +14,167 @@
<text class="cover-empty-title">店铺封面</text>
<text class="cover-empty-desc">上传一张能代表风格的作品图</text>
</view>
<view class="cover-badge">门店封面</view>
<view class="cover-badge">门店档案</view>
<view class="cover-shade">
<view class="cover-copy">
<text class="cover-title">{{form.shopName || '店铺主图'}}</text>
<text class="cover-desc">{{form.rule || '色彩、手作与细节管理的预约空间'}}</text>
</view>
<view class="cover-actions">
<button class="cover-btn" loading="{{coverUploading}}" bindtap="chooseCoverImage">更换主图</button>
<button wx:if="{{coverImagePreviewUrl}}" class="cover-remove" bindtap="removeCoverImage">移除</button>
<text class="cover-title">{{shopName || '店铺主图'}}</text>
<text class="cover-desc">{{shopDescription || '色彩、手作与细节管理的预约空间'}}</text>
</view>
<button class="cover-btn" bindtap="editProfile">修改档案</button>
</view>
</view>
<view class="card form-card">
<view class="form-header">
<view id="shop-profile-card" class="section">
<view class="section-head">
<view>
<text class="form-kicker">门店档案</text>
<text class="form-title">展示给客户看的第一段介绍</text>
<text class="section-title">店铺档案</text>
<text class="section-subtitle">展示给客户看的第一段介绍</text>
</view>
<text class="section-link" bindtap="editProfile">修改</text>
</view>
<view class="field"><text class="field-label">店铺名称</text><input value="{{form.shopName}}" data-field="shopName" bindinput="onInput" placeholder="请输入店铺名称" /></view>
<view class="field">
<view class="label-with-help">
<text class="field-label">默认时长</text>
<text class="help-badge" catchtap="explainDefaultDuration">?</text>
<view class="card profile-summary-card" bindtap="editProfile">
<view class="summary-row">
<text class="summary-label">店铺名称</text>
<text class="summary-value">{{shopName || '未设置'}}</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="explainShopIntro">?</text>
</view>
<view class="intro-editor">
<textarea
value="{{form.rule}}"
data-field="rule"
bindinput="onInput"
maxlength="120"
auto-height="{{false}}"
placeholder="写下门店风格、擅长方向、服务氛围"
placeholder-class="intro-placeholder"
></textarea>
<text class="intro-count">{{introLength}}/120</text>
<view class="summary-row summary-row-last">
<text class="summary-label">门店介绍</text>
<text class="summary-value summary-description">{{shopDescription || '暂未填写门店介绍'}}</text>
</view>
</view>
</view>
<view class="section">
<view class="section-title">标签设置</view>
<view class="card tag-setting-card">
<view class="tag-form-row">
<input class="tag-input" value="{{tagForm.name}}" bindinput="onTagInput" placeholder="输入标签名称" />
<button class="secondary-btn tag-save-btn" loading="{{tagSaving}}" disabled="{{tagSaving || tagsLoading}}" bindtap="saveTag">{{tagForm.id ? '更新' : '新增'}}</button>
<view id="shop-tag-card" class="section">
<view class="section-head">
<view>
<text class="section-title">店铺标签</text>
<text class="section-subtitle">{{tagCountText}}</text>
</view>
<view wx:if="{{tagForm.id}}" class="tag-edit-tip">
<text>正在编辑“{{tagForm.name}}”</text>
<text class="tag-clear" bindtap="clearTagForm">取消</text>
<text class="section-link" bindtap="editTags">管理</text>
</view>
<view class="card tag-summary-card" bindtap="editTags">
<view wx:if="{{tagList.length}}" class="tag-cloud">
<text
wx:for="{{tagList}}"
wx:key="id"
class="tag-preview"
style="background: {{item.bgColor}}; color: {{item.textColor}}; border-color: {{item.borderColor}};"
>{{item.name}}</text>
<text class="tag-add">+</text>
</view>
<view wx:if="{{tagsLoading}}" class="tag-empty">标签加载中</view>
<view wx:elif="{{tagList.length}}" class="tag-list">
<view wx:for="{{tagList}}" wx:key="id" class="tag-item">
<view class="tag-preview" style="background: {{item.bgColor}}; color: {{item.textColor}}; border-color: {{item.borderColor}};">{{item.name}}</view>
<view class="tag-actions">
<text data-id="{{item.id}}" bindtap="editTag">编辑</text>
<text class="danger" data-id="{{item.id}}" bindtap="deleteTag">删除</text>
</view>
<view wx:else class="empty-inline">还没有标签,点击添加门店特色</view>
<view class="summary-action-row">
<text>用于预约时快速选择和展示</text>
<text class="summary-arrow">›</text>
</view>
</view>
</view>
<view id="shop-schedule-card" class="section">
<view class="section-head">
<view>
<text class="section-title">营业安排</text>
<text class="section-subtitle">排班与特殊日期合并管理</text>
</view>
<text class="section-link" data-tab="RULE" bindtap="openScheduleSheet">修改</text>
</view>
<view class="card schedule-summary-card" data-tab="RULE" bindtap="openScheduleSheet">
<view class="schedule-summary-row">
<view class="summary-icon schedule-icon">◷</view>
<view class="summary-main">
<text class="summary-value">{{scheduleSummary}}</text>
<text class="summary-meta">{{scheduleRemarkText}}</text>
</view>
<text class="summary-arrow">›</text>
</view>
<view wx:else class="tag-empty">暂无标签,可用于新建预约时快速选择</view>
</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 id="shop-exception-card" class="schedule-summary-row special-summary-row" data-tab="EXCEPTION" bindtap="openScheduleSheet">
<view class="summary-icon exception-icon">●</view>
<view class="summary-main">
<text class="summary-value">{{exceptionCountText}}</text>
<text class="summary-meta">{{exceptionSummary}}</text>
</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>
<text class="summary-arrow">›</text>
</view>
</view>
</view>
</block>
<view class="fixed-bottom"><button class="primary-btn" loading="{{saving}}" bindtap="save">保存设置</button></view>
<view wx:if="{{scheduleSheetVisible}}" class="sheet-mask" catchtap="closeScheduleSheet">
<view id="schedule-sheet" class="schedule-sheet" catchtap="stopPropagation">
<view class="sheet-handle"></view>
<view class="sheet-head">
<text class="sheet-title">营业安排</text>
<text class="sheet-close" bindtap="closeScheduleSheet">×</text>
</view>
<view class="sheet-tabs">
<view class="sheet-tab {{activeScheduleTab === 'RULE' ? 'active' : ''}}" data-tab="RULE" bindtap="switchScheduleTab">常规排班</view>
<view class="sheet-tab {{activeScheduleTab === 'EXCEPTION' ? 'active' : ''}}" data-tab="EXCEPTION" bindtap="switchScheduleTab">特殊日期</view>
</view>
<block wx:if="{{activeScheduleTab === 'RULE'}}">
<view class="sheet-field-block">
<text class="sheet-field-title">营业模式</text>
<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>
<view class="sheet-field-block">
<text class="sheet-field-title">营业日</text>
<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="sheet-field">
<text class="sheet-field-label">营业开始</text>
<picker mode="time" value="{{form.startTime}}" bindchange="onStartChange"><view class="sheet-field-value">{{form.startTime}}</view></picker>
</view>
<view class="sheet-field">
<text class="sheet-field-label">营业结束</text>
<picker mode="time" value="{{form.endTime}}" bindchange="onEndChange"><view class="sheet-field-value">{{form.endTime}}</view></picker>
</view>
<view class="sheet-field">
<text class="sheet-field-label">排班备注</text>
<input value="{{form.scheduleRemark}}" data-field="scheduleRemark" bindinput="onInput" placeholder="可选" />
</view>
<button class="primary-btn sheet-save" loading="{{saving}}" disabled="{{saving}}" bindtap="saveSchedule">保存排班</button>
</block>
<block wx:else>
<view class="sheet-field">
<text class="sheet-field-label">日期</text>
<picker mode="date" value="{{exceptionForm.workDate}}" bindchange="onExceptionDateChange"><view class="sheet-field-value">{{exceptionForm.workDate}}</view></picker>
</view>
<view class="sheet-field">
<text class="sheet-field-label">类型</text>
<picker range="{{exceptionTypes}}" range-key="label" value="{{exceptionTypeIndex}}" bindchange="onExceptionTypeChange"><view class="sheet-field-value">{{exceptionTypeLabel}}</view></picker>
</view>
<view wx:if="{{exceptionForm.exceptionType !== 'REST'}}" class="sheet-field">
<text class="sheet-field-label">开始时间</text>
<picker mode="time" value="{{exceptionForm.startTime}}" bindchange="onExceptionStartChange"><view class="sheet-field-value">{{exceptionForm.startTime}}</view></picker>
</view>
<view wx:if="{{exceptionForm.exceptionType !== 'REST'}}" class="sheet-field">
<text class="sheet-field-label">结束时间</text>
<picker mode="time" value="{{exceptionForm.endTime}}" bindchange="onExceptionEndChange"><view class="sheet-field-value">{{exceptionForm.endTime}}</view></picker>
</view>
<view class="sheet-field">
<text class="sheet-field-label">备注</text>
<input value="{{exceptionForm.remark}}" data-field="remark" bindinput="onExceptionInput" placeholder="可选" />
</view>
<button class="primary-btn sheet-save" loading="{{saving}}" disabled="{{saving}}" bindtap="saveException">保存特殊日期</button>
<view class="exception-history">
<view class="exception-history-head">
<text>已配置日期</text>
<text>{{exceptions.length}} 条</text>
</view>
<view wx:if="{{exceptions.length}}" class="exception-history-list">
<view wx:for="{{exceptions}}" wx:key="id" class="exception-history-item">
<text>{{item.summary}}</text>
<text wx:if="{{item.remark}}" class="exception-history-remark">{{item.remark}}</text>
</view>
</view>
<view wx:else class="empty-inline">暂无特殊日期</view>
</view>
</block>
</view>
</view>
</view>