Files
JayuCloud/JY-Salon-WeChat/pages/shop-settings/index.wxml
T

303 lines
14 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<view class="page no-tab shop-settings-page">
<view wx:if="{{loading}}" class="loading-state">店铺设置加载中</view>
<block wx:else>
<view class="nav-spacer"></view>
<view class="shop-hero" data-field="cover" bindtap="openProfileSheet">
<view class="hero-bg"></view>
<view class="hero-content">
<view wx:if="{{coverImagePreviewUrl}}" class="hero-avatar">
<image src="{{coverImagePreviewUrl}}" mode="aspectFill"></image>
</view>
<view wx:else class="hero-avatar hero-avatar-empty">店</view>
<view class="hero-main">
<view class="hero-title-row">
<text class="hero-title">{{shopName || '店铺名称'}}</text>
<text class="edit-mark">✎</text>
</view>
<view class="hero-badges">
<text class="status-badge {{businessStatusClass}}">{{businessStatusText}}</text>
<text class="soft-badge">{{scheduleSummary}}</text>
</view>
<view class="hero-meta-row">
<text class="meta-dot">⌖</text>
<text class="hero-address">{{shopAddress}}</text>
</view>
</view>
<text class="hero-arrow">›</text>
</view>
<view class="hero-stats">
<view class="stat-item">
<text>特殊日期</text>
<view>{{exceptionCountText}}</view>
</view>
<view class="stat-item">
<text>店铺图片</text>
<view>{{imageCountText}}</view>
</view>
<view class="stat-item">
<text>标签</text>
<view>{{tagCountText}}</view>
</view>
</view>
</view>
<view class="section">
<view class="section-head">
<view class="section-title-wrap">
<text class="leaf-icon">◒</text>
<text class="section-title">店铺资料</text>
</view>
<text class="section-link" data-field="shopName" bindtap="openProfileSheet">编辑</text>
</view>
<view class="settings-card">
<view class="settings-row" data-field="shopName" bindtap="openProfileSheet">
<text class="row-label">店铺名称</text>
<text class="row-value">{{shopName || '未设置'}}</text>
<text class="row-arrow">›</text>
</view>
<view class="settings-row" data-field="rule" bindtap="openProfileSheet">
<text class="row-label">店铺简介</text>
<text class="row-value">{{shopDescription || '暂未填写门店介绍'}}</text>
<text class="row-arrow">›</text>
</view>
<view class="settings-row" data-field="address" bindtap="openProfileSheet">
<text class="row-label">店铺地址</text>
<text class="row-value">{{shopAddress}}</text>
<text class="row-arrow">›</text>
</view>
<view class="settings-row row-last" data-field="cover" bindtap="openProfileSheet">
<text class="row-label">店铺主图</text>
<view wx:if="{{coverImagePreviewUrl}}" class="row-thumb">
<image src="{{coverImagePreviewUrl}}" mode="aspectFill"></image>
</view>
<text wx:else class="row-value">未设置</text>
<text class="row-arrow">›</text>
</view>
</view>
</view>
<view class="section">
<view class="section-head">
<view class="section-title-wrap">
<text class="leaf-icon">◒</text>
<text class="section-title">店铺展示</text>
</view>
<text class="section-link" bindtap="editTags">管理</text>
</view>
<view class="settings-card">
<view class="settings-row tall-row" bindtap="editTags">
<text class="row-label">店铺标签</text>
<view wx:if="{{tagList.length}}" class="row-tags">
<text
wx:for="{{tagList}}"
wx:key="id"
class="tag-preview"
style="background: {{item.bgColor}}; color: {{item.textColor}}; border-color: {{item.borderColor}};"
>{{item.name}}</text>
</view>
<text wx:else class="row-value">暂无标签</text>
<text class="row-arrow">›</text>
</view>
<view class="settings-row" data-field="gallery" bindtap="openProfileSheet">
<text class="row-label">环境照片</text>
<text class="row-value">{{imageCountText}}</text>
<text class="row-arrow">›</text>
</view>
<view class="settings-row row-last">
<text class="row-label">主页预览</text>
<text class="row-value muted-value">跟随用户端展示</text>
<text class="row-eye">◉</text>
</view>
</view>
</view>
<view class="section">
<view class="section-head">
<view class="section-title-wrap">
<text class="leaf-icon">◒</text>
<text class="section-title">营业管理</text>
</view>
<text class="section-link" data-tab="RULE" bindtap="openScheduleSheet">设置</text>
</view>
<view class="settings-card">
<view class="settings-row" data-tab="RULE" bindtap="openScheduleSheet">
<text class="row-label">营业时间</text>
<text class="row-value">{{scheduleSummary}}</text>
<text class="row-arrow">›</text>
</view>
<view class="settings-row" data-tab="RULE" bindtap="openScheduleSheet">
<text class="row-label">预约规则</text>
<text class="row-value">{{scheduleRemarkText}}</text>
<text class="row-arrow">›</text>
</view>
<view class="settings-row row-last" data-tab="EXCEPTION" bindtap="openScheduleSheet">
<text class="row-label">特殊日期</text>
<text class="row-value accent-value">{{exceptionSummary}}</text>
<text class="row-arrow">›</text>
</view>
</view>
</view>
</block>
<view wx:if="{{profileSheetVisible}}" class="sheet-mask" catchtap="closeProfileSheet">
<view id="profile-sheet" class="schedule-sheet profile-sheet" catchtap="stopPropagation">
<view class="sheet-handle"></view>
<view class="sheet-head">
<text class="sheet-title">{{profileSheetTitle}}</text>
<text class="sheet-close" bindtap="closeProfileSheet">×</text>
</view>
<block wx:if="{{activeProfileField === 'shopName'}}">
<view class="profile-field-column">
<text class="sheet-field-title">店铺名称</text>
<input class="profile-input" value="{{profileForm.shopName}}" data-field="shopName" bindinput="onProfileInput" placeholder="请输入店铺名称" />
</view>
</block>
<block wx:elif="{{activeProfileField === 'rule'}}">
<view class="profile-field-column">
<text class="sheet-field-title">门店介绍</text>
<view class="intro-editor">
<textarea
value="{{profileForm.rule}}"
data-field="rule"
bindinput="onProfileInput"
maxlength="120"
auto-height="{{false}}"
placeholder="写下门店风格、擅长方向、服务氛围"
placeholder-class="intro-placeholder"
></textarea>
<text class="intro-count">{{introLength}}/120</text>
</view>
</view>
</block>
<block wx:elif="{{activeProfileField === 'address'}}">
<view class="profile-field-column">
<text class="sheet-field-title">店铺地址</text>
<input class="profile-input" value="{{profileForm.address}}" data-field="address" bindinput="onProfileInput" placeholder="请输入店铺地址" />
</view>
</block>
<block wx:elif="{{activeProfileField === 'cover'}}">
<view class="cover-card compact-cover-card">
<view wx:if="{{coverImagePreviewUrl}}" class="cover-preview">
<image src="{{coverImagePreviewUrl}}" mode="aspectFill"></image>
</view>
<view wx:else class="cover-preview cover-empty">
<text class="cover-empty-title">店铺封面</text>
<text class="cover-empty-desc">上传一张能代表风格的作品图</text>
</view>
<view class="cover-actions">
<button class="cover-btn" loading="{{coverUploading}}" disabled="{{coverUploading || saving}}" bindtap="chooseCoverImage">{{coverUploading ? '上传中' : '更换主图'}}</button>
<button wx:if="{{coverImagePreviewUrl}}" class="cover-remove" disabled="{{coverUploading || saving}}" bindtap="removeCoverImage">移除</button>
</view>
</view>
</block>
<block wx:else>
<view class="gallery-head">
<view>
<text class="sheet-field-title">环境照片</text>
<text class="gallery-subtitle">用于店铺展示区,最多 9 张</text>
</view>
<text class="gallery-count">{{galleryItems.length}}/9</text>
</view>
<view class="gallery-grid">
<view wx:for="{{galleryItems}}" wx:key="fileId" class="gallery-item">
<image wx:if="{{item.url}}" src="{{item.url}}" mode="aspectFill"></image>
<view wx:else class="gallery-placeholder">图片</view>
<text class="gallery-remove" data-index="{{index}}" bindtap="removeGalleryImage">×</text>
</view>
<view wx:if="{{galleryItems.length < 9}}" class="gallery-add" bindtap="chooseGalleryImages">
<text class="gallery-add-icon">+</text>
<text>{{galleryUploading ? '上传中' : '添加'}}</text>
</view>
</view>
</block>
<button class="primary-btn sheet-save" loading="{{saving}}" disabled="{{saving || coverUploading || galleryUploading}}" bindtap="saveProfileField">{{profileSheetSaveText}}</button>
</view>
</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>