Files
JayuCloud/JY-Salon-WeChat/pages/employees/index.wxml
T
2026-07-25 20:27:25 +08:00

97 lines
4.7 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 employee-page">
<scroll-view class="employee-filter-scroll" scroll-x enable-flex>
<view class="employee-filters">
<view wx:for="{{statusFilters}}" wx:key="value" class="employee-filter {{activeStatus === item.value ? 'active' : ''}}" data-status="{{item.value}}" bindtap="switchStatus">
<text>{{item.label}}({{item.count}})</text>
</view>
</view>
</scroll-view>
<view class="employee-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 {{item.isManager ? 'manager' : ''}}" data-id="{{item.id}}" bindtap="openDetail">
<view class="employee-avatar-wrap">
<view wx:if="{{item.avatar}}" class="employee-avatar image-avatar">
<image src="{{item.avatar}}" mode="aspectFill"></image>
</view>
<view wx:else class="employee-avatar" style="background: {{item.color}};">{{item.shortName}}</view>
<view class="employee-dot {{item.statusClass}}"></view>
</view>
<view class="employee-card-body">
<view class="employee-title-row">
<text class="employee-name">{{item.name}}</text>
<text class="role-tag {{item.isManager ? 'manager' : ''}}">{{item.roleText}}</text>
</view>
<view class="employee-status-row">
<text class="employee-state {{item.statusClass}}">{{item.statusText}}</text>
<text class="employee-schedule">{{item.scheduleSummary}}</text>
</view>
<view class="employee-metrics">
<view class="employee-metric">
<text class="metric-label">今日预约</text>
<text class="metric-value">{{item.todayOrders}}</text>
</view>
<view class="employee-metric">
<text class="metric-label">本月订单</text>
<text class="metric-value">{{item.monthOrders}}</text>
</view>
<view class="employee-metric strong">
<text class="metric-label">本月收入</text>
<text class="metric-value">¥{{item.monthAmount}}</text>
</view>
</view>
</view>
<text class="arrow">›</text>
</view>
</view>
<button class="fab employee-fab" bindtap="addEmployee" aria-label="新增员工">+</button>
<view wx:if="{{createModalVisible}}" class="modal-mask" bindtap="closeCreateModal">
<view class="employee-modal" catchtap="stopTap">
<view class="modal-head">
<view>
<text class="modal-title">新增美甲师</text>
</view>
<view class="modal-close" bindtap="closeCreateModal"></view>
</view>
<view class="avatar-upload">
<view wx:if="{{createForm.avatarUrl}}" class="avatar-preview image-avatar">
<image src="{{createForm.avatarUrl}}" mode="aspectFill"></image>
</view>
<view wx:else class="avatar-preview">头像</view>
<button class="secondary-btn avatar-btn" loading="{{avatarUploading}}" bindtap="chooseEmployeeAvatar">上传头像</button>
<button wx:if="{{createForm.avatarUrl}}" class="text-btn avatar-remove" bindtap="removeEmployeeAvatar">移除</button>
</view>
<view class="form-grid">
<view class="modal-field">
<text class="required-label">姓名</text>
<input value="{{createForm.nickname}}" data-field="nickname" bindinput="onCreateInput" placeholder="请输入姓名" />
</view>
<view class="modal-field">
<text>手机号</text>
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" placeholder="选填,填写后用于手机号登录" />
</view>
<view class="modal-field">
<text class="required-label">登录账号</text>
<input value="{{createForm.account}}" data-field="account" bindinput="onCreateInput" placeholder="请输入账号" />
</view>
<view class="modal-field">
<text class="required-label">初始密码</text>
<input value="{{createForm.password}}" data-field="password" bindinput="onCreateInput" password placeholder="请输入密码" />
</view>
<view class="modal-field">
<text>微信号</text>
<input value="{{createForm.wechatId}}" data-field="wechatId" bindinput="onCreateInput" placeholder="请输入微信号" />
</view>
</view>
<button class="primary-btn modal-submit" loading="{{creating}}" bindtap="submitEmployee">保存美甲师</button>
</view>
</view>
</view>