<!--componets/authorized-login-dialog/authorizedLoginDialog.wxml-->
<van-popup show="{{ showDialog }}" close-on-click-overlay="{{false}}" position="bottom" z-index="10087" overlay
    bind:close="onCloseDialog" custom-style="background-color: transparent;">
    <view class="dialog-bg">
        <view class="close-btn" bindtap="onCloseDialog">
            <van-icon name="cross" />
        </view>
        <view class="title-box">
            <image class="logo" src="../../static/images/logo.png" mode="widthFix"></image>
            <text class="title">舒眠大健康</text>
        </view>
        <text class="desc">请您授权头像、昵称、手机号信息，您授权的信息将受到严格保护，请放心使用。</text>
        <button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
            <image class="avatar" src="{{avatarUrl}}" mode="widthFix"></image>
        </button>
        <input type="nickname" class="nickname-input" placeholder="请输入昵称" bind:change="onInputNameChange" maxlength="8"
            placeholder-style="color: #888888;" value="{{nickName}}" />

        <button wx:if="{{!phoneNumber.length}}" open-type="getPhoneNumber" class="custom-input-button"
            bindgetphonenumber="onGetPhoneNumber">获取手机号码</button>
        <input wx:else type="number" class="nickname-input" placeholder="请输入手机号码" bindinput="onInputPhoneChange"
            placeholder-style="color: #888888;" value="{{phoneNumber}}" maxlength="11" disabled="{{true}}" />
        <button open-type="getUserInfo" bindgetuserinfo="handleUserInfo" class="auth-button"
            disabled="{{disableCommitBtn}}">
            确认授权
        </button>
        <view wx:if="{{showLoading}}" class="mask-content">
            <van-loading type="spinner" custom-class="custom-loading" color="#0ABCA4" size="80rpx" />
        </view>
    </view>
</van-popup>