Files
bodyWeight/miniprogram/pages/editMember/editMember.wxml
T

191 lines
6.5 KiB
Plaintext

<view class="edit-member">
<!-- 顶部浅蓝提示条 -->
<view class="tips">
<view class="tips-icon">!</view>
<text class="tips-text">最多支持 10 位用户</text>
</view>
<view class="form">
<scroll-view scroll-y class="scrollView">
<view class="scrollViewContent">
<view class="form-card">
<!-- ========== 非家庭用户(员工/本人) ========== -->
<block wx:if="{{ !isFamily }}">
<!-- 姓名 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">姓名</text>
</view>
<view class="form-control">
<view class="form-readonly">
<text class="readonly-text">{{ form.name }}</text>
</view>
</view>
</view>
<!-- 单位 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">单位</text>
</view>
<view class="form-control">
<view class="form-readonly">
<text class="readonly-text">{{ unitDisplay }}</text>
</view>
</view>
</view>
<!-- 性别 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">性别</text>
</view>
<view class="form-control">
<view class="form-readonly">
<text class="readonly-text">{{ form.gender }}</text>
</view>
</view>
</view>
<!-- 年龄 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">年龄</text>
</view>
<view class="form-control">
<view class="form-readonly form-readonly-with-suffix">
<text class="readonly-text">{{ form.age }}</text>
<text class="form-suffix">岁</text>
</view>
</view>
</view>
<!-- 身高 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">身高</text>
<text class="label-star">*</text>
</view>
<view class="form-control">
<view class="form-input-wrap">
<input class="form-input form-input-with-suffix" type="digit" maxlength="5" placeholder="请填写身高" placeholder-class="form-placeholder" value="{{ form.height }}" bind:input="onHeightInput" />
<text class="form-suffix form-suffix-inside">cm</text>
</view>
</view>
</view>
<!-- 体重 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">体重</text>
</view>
<view class="form-control">
<view class="form-input-wrap">
<input class="form-input form-input-with-suffix" type="digit" maxlength="6" placeholder="请填写体重" placeholder-class="form-placeholder" value="{{ form.weight }}" bind:input="onWeightInput" />
<text class="form-suffix form-suffix-inside">kg</text>
</view>
</view>
</view>
</block>
<!-- ========== 家庭用户 ========== -->
<block wx:else>
<!-- 昵称 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">昵称</text>
<text class="label-star">*</text>
</view>
<view class="form-control">
<input class="form-input" type="text" maxlength="20" placeholder="请填写昵称" placeholder-class="form-placeholder" value="{{ form.name }}" disabled="{{ readonly }}" bind:input="onNameInput" />
</view>
</view>
<!-- 身份证号码 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">身份证号码</text>
</view>
<view class="form-control">
<input class="form-input" type="idcard" maxlength="18" placeholder="请填写身份证号" placeholder-class="form-placeholder" value="{{ form.idCard }}" disabled="{{ readonly }}" bind:input="onIdCardInput" />
</view>
</view>
<!-- 性别(左右切换) -->
<view class="form-row">
<view class="form-label">
<text class="label-text">性别</text>
<text class="label-star">*</text>
</view>
<view class="form-control">
<view class="gender-toggle">
<view class="gender-option {{ form.gender === '男' ? 'gender-option-active' : '' }}" data-value="男" bind:tap="onGenderTap">男</view>
<view class="gender-option {{ form.gender === '女' ? 'gender-option-active' : '' }}" data-value="女" bind:tap="onGenderTap">女</view>
</view>
</view>
</view>
<!-- 出生年月 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">出生年月</text>
<text class="label-star">*</text>
</view>
<view class="form-control">
<picker mode="date" value="{{ birthday }}" bindchange="onBirthdayChange">
<view class="form-picker {{ birthday ? '' : 'form-picker-placeholder' }}">
{{ birthday || '请选择出生年月' }}
</view>
</picker>
</view>
</view>
<!-- 身高 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">身高</text>
<text class="label-star">*</text>
</view>
<view class="form-control">
<view class="form-input-wrap">
<input class="form-input form-input-with-suffix" type="digit" maxlength="5" placeholder="请填写身高" placeholder-class="form-placeholder" value="{{ form.height }}" bind:input="onHeightInput" />
<text class="form-suffix form-suffix-inside">cm</text>
</view>
</view>
</view>
<!-- 体重 -->
<view class="form-row">
<view class="form-label">
<text class="label-text">体重</text>
</view>
<view class="form-control">
<view class="form-input-wrap">
<input class="form-input form-input-with-suffix" type="digit" maxlength="6" placeholder="请填写体重" placeholder-class="form-placeholder" value="{{ form.weight }}" bind:input="onWeightInput" />
<text class="form-suffix form-suffix-inside">kg</text>
</view>
</view>
</view>
</block>
</view>
</view>
</scroll-view>
</view>
<!-- 底部双按钮:取消 / 保存 -->
<view class="actions">
<view class="btn-cancel" bind:tap="onCancel">取消</view>
<view class="btn-primary" bind:tap="onSubmit">保存用户信息</view>
</view>
<!-- 确认弹框 -->
<user-info-confirm-modal show="{{ showConfirmModal }}" userInfo="{{ serverResult }}" bind:confirm="onConfirmModalConfirm" bind:cancel="onConfirmModalCancel">
</user-info-confirm-modal>
</view>