<!-- * @Author: EvilStorm
 * @Date: 2020-10-26 10:44:42
 * @LastEditTime: 2020-10-27 11:44:31
 * @LastEditors: EvStorm
 * @Description: 设置 -->
<view style="height:{{CustomBar}}px;">
    <view class="cu-bar ev-fr-start" bindtap="BackPage" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;">
        <text class="cuIcon-back padding-lr-sm"></text>
        <view class="action">设置</view>
    </view>
</view>
<image class="backgroundTexture" mode="aspectFit" src="/images/mineBG.png" />
<view class="ev-mainBody">
    <view class="ev-fc margin-tb-xl">
        <view class="cu-avatar xl round solids" style="background-image:url({{avatar ? avatar:''}})" />
        <!-- <text class="text-sm text-blue padding-top-sm">点击更换头像</text> -->
    </view>
    <view catch:tap="showModal" data-modal="nickname" class="ev-fr setting">
        <view class="settingName">更换昵称</view>
        <view>
            <text class="tips">{{nickname}}</text>
            <text class="cuIcon-right padding-left-xs" style="color:#92979D"></text>
        </view>
    </view>
    <view catch:tap="showModal" data-modal="gender" class="ev-fr setting">
        <view class="settingName">我的性别</view>
        <view>
            <text class="tips">{{["男","女"][gender]}}</text>
            <text class="cuIcon-right padding-left-xs" style="color:#92979D"></text>
        </view>
    </view>
    <view catch:tap="showModal" data-modal="grade" class="ev-fr setting">
        <view class="settingName">当前学期</view>
        <view>
            <text class="tips">{{gradeList[grade].label}}</text>
            <text class="cuIcon-right padding-left-xs" style="color:#92979D"></text>
        </view>
    </view>
    <!-- <button bind:tap="logOut" class="cu-btn bg-white margin-tb-sm lg logOut" style="bottom: {{StatusBar}}px;" type="">
        注销用户
    </button> -->
</view>
<view class="cu-modal bottom-modal {{modal?'show':''}}" style="text-align:left;" bind:tap="cancelModal">
    <view class="cu-dialog" catch:tap style="border-radius: 40rpx 40rpx 0 0;">
        <view wx:if="{{modal === 'nickname'}}" style="height: 940rpx;">
            <view class="title">设置新的昵称</view>
            <view class="padding nicknameBox">
                <input type="text" bindinput="modifyNickname" bindconfirm="modifyNickname" value="{{nicknameEdit}}" placeholder="请输入新的昵称…" />
            </view>
            <view class="padding-bottom padding-xl ev-fr nicknameBtnBox">
                <button class="cu-btn nicknameBtn" bind:tap="cancelModal">取消</button>
                <button class="cu-btn nicknameBtn margin-lr-sm bg-blue" disabled="{{!nicknameEdit}}" bind:tap="nicknameConfirm">
                    保存
                </button>
            </view>
        </view>
        <view wx:if="{{modal === 'gender'}}">
            <view class="padding modalItem" data-id="0" bind:tap="modifyGender">男</view>
            <view class="padding modalItem" data-id="1" bind:tap="modifyGender">女</view>
        </view>
        <view wx:if="{{modal === 'grade'}}" style="height: 940rpx;overflow: auto;">
            <view wx:for="{{gradeList}}" wx:if="{{item.value !== 0}}" data-id="{{item.value}}" bind:tap="modifyGrade" wx:key="index" class="padding modalItem">
                {{item.label}}
            </view>
        </view>
    </view>
</view>