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

91 lines
7.3 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 employee-create-page">
<view class="create-intro">
<text class="create-title">新增美甲师档案</text>
<text class="create-subtitle">{{applicationId ? '保存后将自动关联当前申请并通过审核' : (pickerMode ? '保存后自动选择该美甲师' : '保存后即可用于预约指定和美甲师管理')}}</text>
</view>
<view class="card avatar-card" bindtap="chooseAvatar">
<image wx:if="{{form.avatarUrl}}" class="avatar-preview" src="{{form.avatarUrl}}" mode="aspectFill" binderror="onAvatarError"></image>
<image wx:else class="avatar-preview" src="/assets/images/default-user-avatar.png" mode="aspectFit"></image>
<view class="avatar-copy">
<text class="avatar-title">美甲师头像</text>
<text class="avatar-tip">点击选择图片,可稍后补充</text>
</view>
<text class="avatar-action">{{avatarUploading ? '上传中' : '更换'}}</text>
</view>
<button wx:if="{{form.avatarUrl}}" class="remove-avatar" catchtap="removeAvatar">移除当前头像</button>
<view class="card form-card create-form">
<view class="field">
<text class="field-label required">姓名</text>
<input value="{{form.nickname}}" data-field="nickname" bindinput="onInput" placeholder="请输入美甲师姓名" />
</view>
<view class="field">
<text class="field-label required">手机号</text>
<input value="{{form.phone}}" data-field="phone" bindinput="onInput" type="number" maxlength="11" placeholder="请输入手机号" />
</view>
<view class="login-unlinked" bindtap="openUserPicker">
<text class="login-unlinked-label">微信账号</text>
<text class="login-unlinked-status">{{selectedWechatUser ? '已绑定' : '未绑定'}}</text>
<text class="login-unlinked-note">{{selectedWechatUser ? selectedWechatUser.title : '点击可选择当前店铺中未绑定身份的微信身份进行绑定'}}</text>
</view>
<view class="field">
<text class="field-label">微信号</text>
<input value="{{form.wechatId}}" data-field="wechatId" bindinput="onInput" placeholder="选填" />
</view>
<view class="field color-field">
<text class="field-label required">日程中排班展示颜色</text>
<view class="color-current">
<view class="color-current-chip" style="background: {{form.color}};"></view>
<text class="color-current-value">{{form.color}}</text>
<view class="color-select-btn" bindtap="openColorSheet">选择颜色<text class="color-select-arrow">›</text></view>
</view>
</view>
</view>
<view class="fixed-bottom">
<button class="primary-btn" loading="{{creating || associatingApplication}}" disabled="{{avatarUploading || creating || associatingApplication || (applicationId && applicationApproved)}}" bindtap="submit">{{applicationId && !createdEmployee ? '创建并通过审核' : (applicationId && createdEmployee && !applicationApproved ? '重试关联并通过' : '保存美甲师')}}</button>
</view>
<view wx:if="{{onboardingVisible}}" class="onboarding-mask" catchtouchmove="stopTouchMove">
<view class="onboarding-card">
<view class="onboarding-icon {{applicationId && !applicationApproved ? 'association-failed' : ''}}">{{applicationId && !applicationApproved ? '!' : '✓'}}</view>
<text class="onboarding-title">{{applicationId && !applicationApproved ? '美甲师档案已创建' : (applicationId ? '申请已关联并通过' : '美甲师已创建')}}</text>
<text class="onboarding-desc">{{applicationId && !applicationApproved ? '员工档案已保留,申请仍待处理。关联失败不会重复创建员工,可直接重试。' : (pickerMode ? '设置常规排班后,可继续把当前预约分配给该美甲师。' : '为新美甲师设置首个常规排班,之后即可正常承接预约。')}}</text>
<view wx:if="{{applicationId && !applicationApproved}}" class="association-retry-box">
<text>申请编号 {{applicationNo || applicationId}}</text>
<button class="primary-btn onboarding-primary" loading="{{associatingApplication}}" disabled="{{associatingApplication}}" bindtap="associateCreatedEmployee">重试关联并通过审核</button>
<button class="onboarding-skip" disabled="{{associatingApplication}}" bindtap="leaveAssociationForLater">稍后处理</button>
</view>
<block wx:else>
<text class="onboarding-default-note">不立即设置时,将默认全年无休、全天排班(00:00-23:59);实际预约仍受门店营业时间限制,之后可在排班设置中调整。</text>
<button class="primary-btn onboarding-primary" loading="{{savingDefaultSchedule}}" disabled="{{savingDefaultSchedule}}" bindtap="setupFirstSchedule">{{pickerMode ? '设置排班并分配' : '立即设置排班'}}</button>
<button class="onboarding-skip" loading="{{savingDefaultSchedule}}" disabled="{{savingDefaultSchedule}}" bindtap="skipFirstSchedule">{{pickerMode ? '暂不设置(使用全天排班)' : '不设置,保留全天排班'}}</button>
</block>
</view>
</view>
<view wx:if="{{colorSheetVisible}}" class="color-sheet-mask" catchtouchmove="stopTouchMove" catchtap="closeColorSheet">
<view class="color-sheet" catchtap="stopColorSheetTap">
<view class="color-sheet-handle"></view>
<text class="color-sheet-title">选择颜色</text>
<view class="color-preview" style="background: {{colorDraft}};"></view>
<text class="color-section-title">推荐色</text>
<view class="color-grid">
<view wx:for="{{employeeColors}}" wx:key="*this" class="color-grid-item {{colorDraft === item ? 'selected' : ''}}" style="background: {{item}};" data-color="{{item}}" bindtap="pickDraftColor"></view>
</view>
<text class="color-section-title">色轮</text>
<view class="color-wheel" bindtap="onWheelTap" catchtouchmove="onWheelTouch">
<view class="color-wheel-dot" style="left: {{wheelDotX}}rpx; top: {{wheelDotY}}rpx; background: {{colorDraft}};"></view>
</view>
<text class="color-section-title">自定义色值</text>
<view class="color-hex-row">
<input class="color-hex-input" value="{{colorHexInput}}" bindinput="onColorHexInput" maxlength="7" placeholder="#8FB89A" />
<button class="color-apply-btn" bindtap="applyColorHex">应用</button>
</view>
<button class="primary-btn color-save-btn" bindtap="saveColorSheet">保存颜色</button>
</view>
</view>
<entity-selector-sheet visible="{{userPickerVisible}}" title="选择微信用户" keyword="{{userKeyword}}" placeholder="搜索昵称或手机号" items="{{userItems}}" selected-id="{{selectedWechatUserId}}" loading="{{userLoading}}" empty-text="暂无未关联的微信用户" action-text="暂不关联" bind:search="onUserSearch" bind:select="selectWechatUser" bind:action="closeUserPicker" bind:close="closeUserPicker" />
<entity-selector-sheet visible="{{associationSheetVisible}}" title="关联待审核申请" keyword="{{associationKeyword}}" placeholder="搜索申请昵称、手机号或编号" items="{{associationItems}}" selected-id="{{associationSelectedId}}" loading="{{associationLoading}}" empty-text="暂无可关联申请" action-text="暂不关联,继续" bind:search="onAssociationSearch" bind:select="selectAssociation" bind:action="skipAssociation" bind:close="skipAssociation" />
</view>