Files
JayuCloud/JC-Salon-WeChat/pages/planning/index.wxml
T
xiaowang 0dfa3bc5a8
自动发布开发环境 Nacos 配置 / publish (push) Successful in 46s
修复小程序日程页日视图末条内容被滚动容器底边裁切
- 日视图滚动容器末尾新增留白(64rpx + 安全区),避免末条时间刻度与末个预约卡片贴边、滚到底仍缺一截
- 视口高度计算同步预留该留白,短时间轴不再因高度刚好等于内容高度而裁掉末条标签
- 时间刻度列加宽到 104rpx,刻度与泳道内容间距增至 20rpx,改善左侧呼吸感并避免刻度文字被截断
2026-11-08 00:28:17 +08:00

232 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 planning-page">
<view wx:if="{{phoneBannerVisible}}" class="phone-banner">
<view class="phone-banner-track" bindtap="openAccountSettings"><text>绑定手机号,便于账号安全验证与重要通知</text><text>点击前往账号设置</text></view>
<view class="phone-banner-close" catchtap="dismissPhoneBanner">×</view>
</view>
<view class="card control-card">
<view class="date-row">
<view class="date-side">
<button class="icon-btn small" bindtap="prevRange">‹</button>
</view>
<view class="date-center">
<text class="date-main">{{dateTitle}}</text>
<text class="date-sub">{{businessHoursText}}</text>
</view>
<view class="date-side date-tools">
<button class="today-btn" bindtap="goToday">今</button>
<button class="icon-btn small" bindtap="nextRange">›</button>
</view>
</view>
<view class="segmented">
<view wx:for="{{viewModes}}" wx:key="value" class="segment {{viewMode === item.value ? 'active' : ''}}" data-mode="{{item.value}}" bindtap="switchView">{{item.label}}</view>
</view>
<scroll-view class="artist-filter" scroll-x enable-flex>
<view class="artist-chip {{!selectedArtistId ? 'active' : ''}}" data-id="" bindtap="selectArtist">全部美甲师</view>
<view wx:for="{{artists}}" wx:key="id" class="artist-chip {{selectedArtistId == item.id ? 'active' : ''}}" data-id="{{item.id}}" bindtap="selectArtist">
<view class="chip-dot" style="background: {{item.color}};"></view>
<text>{{item.name}}</text>
<text class="chip-count">{{item.rangeCount || 0}}</text>
</view>
</scroll-view>
<view wx:if="{{!selectedArtistId && rangeUnassignedCount > 0}}" class="unassigned-notice" bindtap="openNearestUnassigned">
<view class="chip-dot unassigned-dot"></view>
<text>有 {{rangeUnassignedCount}} 个预约待分配美甲师</text>
<text class="unassigned-link">立即处理 ›</text>
</view>
</view>
<view wx:if="{{!businessHoursConfigured && !calendarError}}" class="business-hours-notice">
<view class="business-hours-notice-copy"><text class="business-hours-notice-title">门店营业时间未设置</text><text class="business-hours-notice-desc">设置后才能安排普通预约,历史订单与补录不受影响。</text></view>
<button wx:if="{{canManageShopSettings}}" class="business-hours-action" bindtap="openShopSettings">去设置</button>
</view>
<view wx:if="{{profilePromptVisible}}" class="profile-prompt-mask">
<view class="profile-prompt">
<text class="profile-prompt-title">完善你的工作名片</text><text class="profile-prompt-desc">头像和昵称会用于门店协作展示,可暂时跳过。</text>
<button class="wechat-avatar" open-type="chooseAvatar" bindchooseavatar="chooseWechatAvatar" disabled="{{profileSaving}}">
<image class="wechat-avatar-image {{profileForm.avatar ? 'is-real' : 'is-default'}}" src="{{profileForm.avatar || '/assets/images/default-user-avatar.png'}}" mode="aspectFill" binderror="onProfileAvatarError"></image>
<view class="wechat-avatar-hint">{{profileSaving ? '上传中' : '点击更换'}}</view>
</button>
<input class="wechat-nickname" type="nickname" value="{{profileForm.nickname}}" bindinput="onNicknameInput" placeholder="填写微信昵称" />
<button class="primary-btn profile-save" loading="{{profileSaving}}" bindtap="saveWechatProfile">保存资料</button><button class="secondary-btn profile-skip" bindtap="skipProfilePrompt">暂时跳过</button>
</view>
</view>
<view wx:if="{{calendarError}}" class="calendar-error-card">
<view class="calendar-error-copy">
<text class="calendar-error-title">日程数据加载失败</text>
<text class="calendar-error-message">{{calendarError}}</text>
</view>
<button class="calendar-error-action" bindtap="loadCalendar">重试</button>
</view>
<block wx:if="{{!calendarError}}">
<view wx:if="{{viewMode === 'day'}}" class="section">
<view wx:if="{{historicalBackfillItems.length}}" class="card historical-backfill-card">
<view class="section-title">历史补单</view>
<view wx:for="{{historicalBackfillItems}}" wx:key="orderItemId" class="historical-backfill-row" data-id="{{item.orderItemId}}" bindtap="openAppointment">
<view><text>{{item.customerName || '散客'}} · {{item.productTitle}}</text><text class="muted">{{item.artistName}} · {{item.startTime || '时间未记录'}}</text></view>
<text>{{item.statusText}} · ¥{{item.amount}}</text>
</view>
</view>
<view class="day-summary">
<view class="summary-item card">
<text class="summary-value">{{dayTotal}}</text>
<text class="summary-label">今日预约</text>
</view>
<view class="summary-item card">
<text class="summary-value">{{freeArtistCount}}</text>
<text class="summary-label">可插单美甲师</text>
</view>
<view class="summary-item card">
<text class="summary-value">{{pendingCount}}</text>
<text class="summary-label">待确认</text>
</view>
<view class="summary-item card unassigned-summary">
<text class="summary-value">{{unassignedCount}}</text>
<text class="summary-label">待分配</text>
</view>
</view>
<view wx:if="{{shopClosed && !hasTimedAppointments}}" class="day-board card business-hours-empty">
<text class="business-hours-empty-title">门店今日休息</text>
<text class="business-hours-empty-desc">休息日不能创建普通预约,可通过历史补录记录已完成的服务。</text>
</view>
<view wx:elif="{{!businessHoursConfigured && !hasTimedAppointments}}" class="day-board card business-hours-empty">
<text class="business-hours-empty-title">预约时间轴暂不可用</text>
<text class="business-hours-empty-desc">请先设置门店营业时间,再安排普通预约。</text>
</view>
<scroll-view wx:else class="day-board card" style="height: {{timelineViewportHeight}}rpx;" scroll-y>
<view class="timeline-wrap" style="height: {{timelineHeight}}rpx;">
<view class="time-axis">
<view wx:for="{{hours}}" wx:key="value" class="time-label" style="top: {{item.top}}rpx;">{{item.label}}</view>
</view>
<scroll-view class="lane-scroll" scroll-x enable-flex>
<view class="lanes" style="height: {{timelineHeight}}rpx; width: {{laneWidth}}rpx;">
<view wx:for="{{dayLanes}}" wx:key="artistId" class="artist-lane" style="height: {{timelineHeight}}rpx; width: {{item.width || laneItemWidth}}rpx;">
<view class="lane-head">
<view class="chip-dot" style="background: {{item.color}};"></view>
<text>{{item.name}}</text>
<text wx:if="{{item.isUnassigned}}" class="lane-unassigned-tag">不占档期</text>
</view>
<view wx:for="{{hours}}" wx:for-item="hour" wx:key="value" class="hour-line" style="top: {{hour.top}}rpx;"></view>
<view wx:for="{{item.blocks}}" wx:for-item="block" wx:key="orderItemId" class="appointment-block {{item.isUnassigned ? 'unassigned-block' : ''}} {{block.status === 0 ? 'pending' : ''}} {{block.compact ? 'compact' : ''}}" style="top: {{block.top}}rpx; left: {{block.left}}rpx; width: {{block.width}}rpx; height: {{block.height}}rpx; background: {{block.tint || '#ffffff'}}; border-left-color: {{item.color}};" data-id="{{block.orderItemId}}" bindtap="openAppointment">
<text class="block-title">{{block.customerName}}</text>
<text class="block-meta">{{block.timeText}} · {{block.productTitle}}</text>
<view class="block-footer">
<text class="block-status">{{block.statusText}}</text>
<view class="block-actions" catchtap="stopTap">
<text wx:if="{{!block.historicalBackfill && block.status === 0 && block.assignmentStatus !== 'UNASSIGNED'}}" data-id="{{block.orderItemId}}" data-status="1" catchtap="quickUpdateStatus">确认</text>
<text wx:if="{{!block.historicalBackfill}}" data-id="{{block.orderItemId}}" catchtap="quickTransfer">{{block.assignmentStatus === 'UNASSIGNED' ? '分配' : '改派'}}</text>
<text wx:if="{{!block.historicalBackfill || block.status === 4}}" data-id="{{block.orderItemId}}" catchtap="quickCancel">取消</text>
<text wx:if="{{block.historicalBackfill && block.status === 4}}" data-id="{{block.orderItemId}}" data-status="2" catchtap="quickUpdateStatus">完成</text>
</view>
</view>
</view>
<view wx:if="{{item.blocks.length === 0}}" class="lane-empty">{{item.emptyText || '全天可约'}}</view>
</view>
</view>
</scroll-view>
</view>
<view class="timeline-bottom-space"></view>
</scroll-view>
</view>
<view wx:if="{{viewMode === 'week'}}" class="section">
<view class="week-card card">
<view class="week-card-head">
<view class="week-card-title">
<text class="week-title">本周安排</text>
<text class="week-range">{{weekRange}}</text>
</view>
<text class="week-summary">共 {{weekTotalCount}} 单 · 待分配 {{weekUnassignedTotal}}</text>
</view>
<view class="week-legend">
<view wx:for="{{weekLegend}}" wx:key="artistId" class="week-legend-item">
<view class="week-legend-dot" style="background: {{item.color}};"></view>
<text class="week-legend-name">{{item.name}}</text>
</view>
<text wx:if="{{!weekLegend.length}}" class="week-legend-empty">暂无美甲师单量</text>
</view>
<view class="week-list">
<view wx:for="{{weekDays}}" wx:key="date" class="week-row {{item.date === todayText ? 'today' : ''}}" data-date="{{item.date}}" bindtap="selectWeekDate" aria-label="查看{{item.date}}日程">
<view class="week-row-date">
<text class="week-row-name">{{item.weekName}}</text>
<text class="week-row-day">{{item.day}}</text>
<text class="week-row-suffix">日</text>
</view>
<text class="week-row-status {{item.statusText === '休' ? 'rest' : ''}}">{{item.statusText}}</text>
<block wx:if="{{item.totalCount === 0}}">
<text wx:if="{{item.statusText !== '休'}}" class="week-row-empty">暂无预约</text>
</block>
<block wx:else>
<view class="week-track">
<view wx:for="{{item.artistCounts}}" wx:for-item="count" wx:for-index="countIndex" wx:key="artistId" class="week-segment" style="width: {{count.width}}rpx; background: {{count.color}};">
<text class="week-segment-text">{{count.artistName || count.shortName}}{{count.count}}</text>
</view>
</view>
<view class="week-row-tail">
<text class="week-row-total">{{item.totalCount}}单</text>
<text wx:if="{{item.unassignedCount > 0}}" class="week-row-pending">待分配 {{item.unassignedCount}}</text>
</view>
</block>
</view>
</view>
</view>
</view>
<view wx:if="{{viewMode === 'month'}}" class="section">
<view class="month-toolbar">
<text class="month-toolbar-title">月历显示</text>
<view class="month-toolbar-controls">
<view class="month-mode-switch">
<view wx:for="{{monthDisplayModes}}" wx:key="value" class="month-mode {{monthDisplayMode === item.value ? 'active' : ''}}" data-mode="{{item.value}}" bindtap="switchMonthDisplay">{{item.label}}</view>
</view>
<view wx:if="{{monthDisplayMode === 'rows'}}" class="row-name-switch {{monthRowLabelVisible ? 'active' : ''}}" bindtap="toggleMonthRowLabel">
<text>姓名</text>
<view class="switch-track"><view class="switch-thumb"></view></view>
</view>
</view>
</view>
<view class="month-card card">
<view class="month-week-head">
<text wx:for="{{weekLabels}}" wx:key="*this">{{item}}</text>
</view>
<view class="month-grid">
<view wx:for="{{monthDays}}" wx:key="date" class="month-cell {{item.isCurrentMonth ? '' : 'out-month'}} {{item.date === currentDateText ? 'selected' : ''}}" data-date="{{item.date}}" bindtap="selectMonthDate" aria-label="查看{{item.date}}日程">
<view class="month-cell-head">
<text class="month-day">{{item.day}}</text>
<view class="month-cell-badges">
<text wx:if="{{item.unassignedCount > 0}}" class="month-unassigned-count">待 {{item.unassignedCount}}</text>
<text wx:if="{{!item.isPast && item.dayStatus === 'full'}}" class="day-mark full">满</text>
<text wx:elif="{{!item.isPast && item.dayStatus === 'rest'}}" class="day-mark rest">休</text>
</view>
</view>
<view wx:if="{{monthDisplayMode === 'count'}}" class="month-bars">
<view wx:for="{{item.artistCounts}}" wx:for-item="count" wx:key="artistId" wx:if="{{count.count > 0}}" class="month-artist-bar" style="background: {{count.color}};">
<text>{{count.shortName}}{{count.count}}</text>
</view>
<view wx:if="{{item.totalCount === 0 && item.dayStatus !== 'rest'}}" class="month-empty">暂无预约</view>
</view>
<view wx:else class="month-blocks">
<block wx:if="{{monthDisplayMode === 'blocks'}}">
<view wx:for="{{item.expandedBlocks}}" wx:for-item="block" wx:key="key" class="month-order-block" style="background: {{block.color}};"></view>
<view wx:if="{{item.totalCount === 0 && item.dayStatus !== 'rest'}}" class="month-empty">暂无预约</view>
</block>
<block wx:else>
<view wx:for="{{item.rowBlocks}}" wx:for-item="block" wx:key="key" class="month-row-block {{monthRowLabelVisible ? 'named' : ''}}" style="background: {{block.color}};">
<text wx:if="{{monthRowLabelVisible}}">{{block.artistName}}</text>
</view>
<view wx:if="{{item.totalCount === 0 && item.dayStatus !== 'rest'}}" class="month-empty">暂无预约</view>
</block>
</view>
</view>
</view>
</view>
</view>
</block>
<button wx:if="{{canCreateAppointment && businessHoursConfigured && !calendarError && (viewMode !== 'day' || currentShopOpen)}}" class="fab" bindtap="createAppointment">+</button>
<action-modal id="actionModal" />
</view>