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

71 lines
3.5 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">
<view class="list-heading">
<text>美甲师</text>
<button class="compact-btn" bindtap="addEmployee">新增</button>
</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"></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>
<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 class="required-label">手机号</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 class="required-label">微信号</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>