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

88 lines
4.4 KiB
Plaintext

<view class="page">
<view class="list-heading">
<text>美甲师</text>
<button wx:if="{{isManager}}" class="compact-btn review-toggle {{reviewExpanded ? 'is-open' : ''}}" bindtap="toggleReview">
审核<text wx:if="{{reviewPendingCount > 0}}" class="review-badge">{{reviewPendingCount}}</text>
</button>
<button class="compact-btn" bindtap="addEmployee">新增</button>
</view>
<view wx:if="{{isManager && reviewExpanded}}" class="review-panel card">
<view class="review-panel-head">
<view class="review-head-text">
<text class="review-title">美甲师申请审核</text>
<text class="review-subtitle">仅显示当前门店待处理申请</text>
</view>
<view class="review-head-actions">
<text class="review-count">{{reviewPendingCount}} 项</text>
<view class="review-collapse" bindtap="toggleReview"><text class="review-collapse-icon">︿</text></view>
</view>
</view>
<view wx:if="{{reviewLoading}}" class="review-state">正在加载申请…</view>
<view wx:elif="{{reviewError}}" class="review-state review-error">
<text>{{reviewError}}</text>
<button class="secondary-btn review-retry" bindtap="loadReviewApplications">重试</button>
</view>
<view wx:elif="{{reviewApplications.length === 0}}" class="review-state">暂无待审核美甲师申请</view>
<view wx:else class="review-list">
<view wx:for="{{reviewApplications}}" wx:key="id" class="review-item">
<view class="review-main">
<image class="review-avatar" src="{{item.applicantAvatar || '/assets/images/default-user-avatar.png'}}" mode="aspectFill" data-index="{{index}}" binderror="onReviewAvatarError"></image>
<view class="review-info">
<text class="review-name">{{item.applicantDisplayName}}</text>
<text wx:if="{{item.targetArtistUserId}}" class="review-meta">已预关联美甲师</text>
<text wx:if="{{item.applicantMaskedPhone}}" class="review-meta">{{item.applicantMaskedPhone}}</text>
<text class="review-meta">{{item.shopName || '当前门店'}} · {{item.applicationTimeText}}</text>
<text class="review-number">申请编号 {{item.applicationNo}}</text>
</view>
</view>
<view class="review-actions">
<button class="review-action reject" data-id="{{item.id}}" disabled="{{reviewingId}}" bindtap="rejectApplication">驳回</button>
<button class="review-action approve" data-id="{{item.id}}" loading="{{reviewingId == item.id}}" disabled="{{reviewingId}}" bindtap="approveApplication">通过</button>
</view>
</view>
</view>
</view>
<view class="list">
<view wx:if="{{loadError}}" class="empty card">
<text>{{loadError}}</text>
<button class="secondary-btn retry-btn" bindtap="loadEmployees">重试</button>
</view>
<view wx:elif="{{employees.length === 0}}" class="empty card">暂无美甲师</view>
<view wx:for="{{employees}}" wx:key="id" class="card employee-card" data-id="{{item.id}}" bindtap="openDetail">
<view class="employee-left">
<view wx:if="{{item.avatar}}" class="avatar image-avatar">
<image src="{{item.avatar}}" mode="aspectFill" data-index="{{index}}" binderror="onEmployeeAvatarError"></image>
</view>
<view wx:else class="avatar" style="background: {{item.color}};">{{item.shortName}}</view>
<view>
<text class="employee-name">{{item.name}}</text>
<text class="employee-schedule">{{item.todaySchedule}} · {{item.todayAvailable ? '可预约' : '休息中'}}</text>
<text class="employee-meta">今日 {{item.todayOrders}} 单 · 本月 {{item.monthOrders}} 单</text>
</view>
</view>
<view class="color-pill" style="background: {{item.color}};"></view>
</view>
</view>
<entity-selector-sheet
visible="{{associationSheetVisible}}"
title="选择要关联的美甲师"
keyword="{{associationKeyword}}"
placeholder="搜索美甲师姓名"
items="{{associationItems}}"
selected-id="{{associationSelectedId}}"
loading="{{associationLoading}}"
error-text="{{associationError}}"
empty-text="没有匹配的未关联美甲师"
action-text="确认关联并通过"
bind:search="onApprovalSearch"
bind:select="selectApprovalArtist"
bind:action="confirmApprovalAssociation"
bind:retry="loadApprovalArtists"
bind:close="closeApprovalAssociation"
/>
</view>