166 lines
4.6 KiB
Plaintext
166 lines
4.6 KiB
Plaintext
<!--屏幕背景变暗的背景 -->
|
|
<view class="modalBg" wx:if="{{modalStatus}}" bindtap="hideModal"></view>
|
|
|
|
<!--弹出框 -->
|
|
<view animation="{{animationData}}" class="modal" wx:if="{{modalStatus}}">
|
|
<view class="header">
|
|
<view></view>
|
|
<view>添加用户</view>
|
|
</view>
|
|
<view class="seaction">
|
|
<!-- 用户类型切换 -->
|
|
<view class="select">
|
|
<view
|
|
class="{{userType === 'employee' ? 'selectActive' : ''}}"
|
|
bindtap="switchUserType"
|
|
data-type="employee"
|
|
>员工</view>
|
|
<view
|
|
class="{{userType === 'family' ? 'selectActive' : ''}}"
|
|
bindtap="switchUserType"
|
|
data-type="family"
|
|
>家庭用户</view>
|
|
</view>
|
|
|
|
<!-- 员工模式 -->
|
|
<block wx:if="{{userType === 'employee'}}">
|
|
<!-- 工号输入 -->
|
|
<view class="input">
|
|
<view>工号:</view>
|
|
<view>
|
|
<input type="text" maxlength="8" placeholder="输入工号自动显示员工信息" value="{{workNo}}" bindinput="onWorkNoInput" bindconfirm="searchUser" />
|
|
</view>
|
|
</view>
|
|
<!-- 姓名(只读) -->
|
|
<view class="only">
|
|
<view>姓名:</view>
|
|
<view>
|
|
<view>
|
|
<block wx:if="{{userInfo}}">
|
|
{{userInfo.realname || ''}}
|
|
</block>
|
|
<block wx:else>
|
|
<text style="color: #808080;">请先输入工号</text>
|
|
</block>
|
|
</view>
|
|
<view></view>
|
|
</view>
|
|
</view>
|
|
<!-- 性别(只读) -->
|
|
<view class="only">
|
|
<view>性别:</view>
|
|
<view>
|
|
<view>
|
|
<block wx:if="{{userInfo}}">
|
|
{{userInfo.sex === 1 ? '男' : userInfo.sex === 2 ? '女' : ''}}
|
|
</block>
|
|
<block wx:else>
|
|
<text style="color: #808080;">请先输入工号</text>
|
|
</block>
|
|
</view>
|
|
<view></view>
|
|
</view>
|
|
</view>
|
|
<!-- 生日(只读) -->
|
|
<view class="only">
|
|
<view>生日:</view>
|
|
<view>
|
|
<view>
|
|
<block wx:if="{{userInfo}}">
|
|
{{userInfo.birthday || ''}}
|
|
</block>
|
|
<block wx:else>
|
|
<text style="color: #808080;">请先输入工号</text>
|
|
</block>
|
|
</view>
|
|
<view></view>
|
|
</view>
|
|
</view>
|
|
<!-- 身高(可输入) -->
|
|
<view class="inputUnit">
|
|
<view>身高:</view>
|
|
<view>
|
|
<view>
|
|
<input type="digit" value="{{userInfo.height || ''}}" bindinput="onHeightInput" placeholder="请输入身高" />
|
|
</view>
|
|
<view>cm</view>
|
|
</view>
|
|
</view>
|
|
<!-- 体重(可输入) -->
|
|
<view class="inputUnit">
|
|
<view>体重:</view>
|
|
<view>
|
|
<view>
|
|
<input type="digit" value="{{userInfo.weight || ''}}" bindinput="onWeightInput" placeholder="请输入体重" />
|
|
</view>
|
|
<view>kg</view>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
|
|
<!-- 家庭用户模式 -->
|
|
<block wx:elif="{{userType === 'family'}}">
|
|
<!-- 姓名(手动输入) -->
|
|
<view class="input">
|
|
<view>姓名:</view>
|
|
<view>
|
|
<input type="text" placeholder="请输入姓名" value="{{familyInfo.name}}" bindinput="onFamilyNameInput" />
|
|
</view>
|
|
</view>
|
|
<!-- 性别(picker 选择) -->
|
|
<view class="only">
|
|
<view>性别:</view>
|
|
<view>
|
|
<view>
|
|
<picker range="{{genderOptions}}" value="{{genderIndex}}" bindchange="onFamilyGenderChange">
|
|
<view style="color: #252535; font-size: 32rpx; font-weight: 500; height: 100rpx; line-height: 100rpx;">
|
|
{{genderOptions[genderIndex]}}
|
|
</view>
|
|
</picker>
|
|
</view>
|
|
<view></view>
|
|
</view>
|
|
</view>
|
|
<!-- 生日(picker date 选择) -->
|
|
<view class="only">
|
|
<view>生日:</view>
|
|
<view>
|
|
<view>
|
|
<picker mode="date" value="{{familyInfo.birthday}}" start="1900-01-01" bindchange="onFamilyBirthdayChange">
|
|
<view style="color: {{familyInfo.birthday ? '#252535' : '#808080'}}; font-size: 32rpx; font-weight: 500; height: 100rpx; line-height: 100rpx;">
|
|
{{familyInfo.birthday || '请选择生日'}}
|
|
</view>
|
|
</picker>
|
|
</view>
|
|
<view></view>
|
|
</view>
|
|
</view>
|
|
<!-- 身高(手动输入) -->
|
|
<view class="inputUnit">
|
|
<view>身高:</view>
|
|
<view>
|
|
<view>
|
|
<input type="digit" value="{{familyInfo.height}}" bindinput="onFamilyHeightInput" placeholder="请输入身高" />
|
|
</view>
|
|
<view>cm</view>
|
|
</view>
|
|
</view>
|
|
<!-- 体重(手动输入) -->
|
|
<view class="inputUnit">
|
|
<view>体重:</view>
|
|
<view>
|
|
<view>
|
|
<input type="digit" value="{{familyInfo.weight}}" bindinput="onFamilyWeightInput" placeholder="请输入体重" />
|
|
</view>
|
|
<view>kg</view>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
|
|
</view>
|
|
<view class="footer">
|
|
<view bind:tap="closeModal">取消</view>
|
|
<view bind:tap="submit">确定</view>
|
|
</view>
|
|
</view>
|