<!--nova-werun/pages/my/my-profile/index.wxml-->
<nav type="back" title="{{title}}" background-color="{{'#4F9AF7'}}" front-color="{{'#ffffff'}}"></nav>
<view class="all" style="height: {{contentHeight}}rpx;">
    <view class="avatarbox" wx:if="{{title=='完善资料'}}">
        <view class="avatar-box">
            <image class="avatar" wx:if="{{avatar}}" src="{{avatar||'https://file-cloud.fmode.cn/qpFbRRSZrO/20241120/63c55i022235020.png?imageView2/1/w/200/h/200'}}" mode="scaleToFill"></image>
            <image class="photo" wx:if="{{avatar}}" bindtap="deleteavater" src="https://file-cloud.fmode.cn/qpFbRRSZrO/20241223/816ic1022338103.png?imageView2/1/w/200/h/200"></image>

            <upload wx:if="{{!avatar}}" style="width: 50%;" bind:onChangeFile="picture" uploadURL="{{uploadURL}}" domain="{{domain}}" uptokenURL="{{uptokenURL}}" maxCount="1" />
        </view>

    </view>
    <van-field value="{{ nickname }}" required clearable label="昵称" maxlength="8" placeholder="请输入昵称" bind:change="changenickname"  wx:if="{{title=='完善资料'}}" />
    <van-field value="{{ name }}" required clearable label="姓名" maxlength="8" placeholder="请输入姓名" bind:change="changename"  wx:if="{{title=='资料认证'}}" />
    <van-field class="field" required model:value="{{ sex }}" readonly maxlength="1" label="性别" bind:tap="showSelect" wx:if="{{title=='资料认证'}}" />
    <van-field value="{{ phone }}" required clearable label="电话" maxlength="11" placeholder="请输入电话" bind:blur="changephone"  wx:if="{{title=='资料认证'}}" />
    <van-field value="{{ height }}" required clearable label="身高" type="number" placeholder="请输入身高(例如：170)" bind:blur="getHeight" bind:clear='clearHeight' wx:if="{{title=='资料认证'}}" />
    <van-action-sheet show="{{ show2 }}" actions="{{ actions }}" bind:select="onSelect"  />
    <view class="selectbox" bindtap="onClickShow" wx:if="{{title=='资料认证'}}">
        <view class="fuhao">*</view>
        <view class="selecttext">部门</view>
        <view class="selectname">{{selectname||'选择部门'}} ></view>
    </view>

    <van-overlay show="{{ show }}">
        <view class="wrapper" style="height: 100%;width: 100%; display: flex;align-items: flex-end;">
            <!-- <view style="width: 100%;height: 300px;">
                <van-tree-select items="{{ items }}" main-active-index="{{ mainActiveIndex }}" active-id="{{ activeId }}" bind:click-nav="onClickNav" bind:click-item="onClickItem" />
            </view> -->
            <van-picker style="width: 100%;height: 300px;" show-toolbar columns="{{ departs }}" bind:cancel='onClickHide' bind:confirm='onClickItem' />
        </view>
    </van-overlay>





    <view class="submitbox">
        <view class="submit" bindtap="setinfo">提交</view>
    </view>
</view>