userinfo_edit.wxml 3.65 KB
<form bindsubmit="formSubmit">
    <view class="container user-container">
        <view class="label-input item" wx:if="{{type=='nickname'}}">
            <text class="label">昵称</text>
            <input autoFocus class="input" name="nickname" placeholder="请输入您的昵称" value="{{user.nickname}}"></input>
        </view>
        <block wx:if="{{type=='mobile'}}">
            <view class="label-input item">
                <text class="label">手机号</text>
                <input autoFocus bindinput="setMobile" class="input" data-name="mobile" name="mobile" placeholder="请输入您的手机号" type="number" value="{{user.mobile}}"></input>
            </view>
            <view class="verify-box item">
                <input class="verify-input" name="mobile_code" placeholder="请输入验证码"></input>
                <button bindtap="getCode" class="verify-btn {{canGetCode?'btn-disable':''}}">获取短信验证码</button>
            </view>
        </block>
        <view class="label-input item" wx:if="{{type=='email'}}">
            <text class="label">邮箱</text>
            <input autoFocus class="input" name="email" placeholder="请输入您的邮箱" value="{{user.email}}"></input>
        </view>
        <block wx:if="{{type=='password'}}">
            <view class="label-input simple" wx:if="{{user.password}}">
                <text class="label">旧密码</text>
                <input autoFocus password class="input" name="old_password" placeholder="旧密码"></input>
            </view>
            <view class="label-input simple">
                <text class="label">新密码</text>
                <input password class="input" name="new_password" placeholder="新密码"></input>
            </view>
            <view class="label-input simple item">
                <text class="label">确认密码</text>
                <input password class="input" name="confirm_password" placeholder="确认密码"></input>
            </view>
        </block>
        <block wx:if="{{type=='paypwd'}}">
            <view class="label-input simple item">
                <text class="label">手机号</text>
                <input autoFocus bindinput="setMobile" class="input" name="paypwd_mobile" placeholder="请输入您的手机号" value="{{user.mobile}}"></input>
            </view>
            <view class="verify-box item">
                <input class="verify-input" name="paypwd_code" placeholder="请输入验证码"></input>
                <button bindtap="getCode" class="verify-btn {{canGetCode?'btn-disable':''}}">获取短信验证码</button>
            </view>
            <view class="label-input simple">
                <text class="label">新密码</text>
                <input password class="input" name="paypwd" placeholder="新密码"></input>
            </view>
            <view class="label-input simple item">
                <text class="label">确认密码</text>
                <input password class="input" name="paypwd_confirm" placeholder="确认密码"></input>
            </view>
        </block>
        <view wx:if="{{type=='sex'}}">
            <view class="gender-box">
                <view bindtap="changeGender" class="gender boy {{user.sex==1&&'boy-click'}}" data-gender="boy" style="background-image:url('{{resourceUrl}}/static/images/bag.png');"></view>
            </view>
            <view class="gender-box">
                <view bindtap="changeGender" class="gender girl {{user.sex==2&&'girl-click'}}" data-gender="girl" style="background-image:url('{{resourceUrl}}/static/images/bag.png');"></view>
            </view>
        </view>
        <button class="submit" formType="submit">确认修改</button>
    </view>
</form>