<!-- pages/login/login.wxml -->
<view class="login-container">
  <!-- 顶部 Logo / 标题 -->
  <view class="head">
    <image src="/images/Blvlogo.png" mode="aspectFit" class="logo"/>
    <text class="title">宝来威工作助手</text>
  </view>

  <!-- 微信登录按钮 -->
  <view wx:if="{{!needReg}}" class="wx-login-box">
    <button class="wx-btn" open-type="getUserProfile" bindtap="handleLogin">      
      微信一键登录
    </button>
  </view>

  <!-- 信息补全表单 -->
  <view wx:else class="reg-form">
    <text class="tip">请补全信息</text>
    <!-- 头像 -->
  <!--index.wxml-->
<view class="avatar-box " >
  <button open-type="chooseAvatar" bindchooseavatar="onAvatar" style="margin: 0; padding: 0;height: 32px;width:90%; ">
  <image src="{{avatarUrl}}" style="height: 30px;width: 30px;" />
</button>
<text class="tip">点击更换头像</text>
</view>

 

    <!-- 昵称 -->
<input type="nickname" class="input" placeholder="请输入昵称" bindblur="onNick" />


    <input
      class="input"
      placeholder="用户名称"
      value="{{form.name}}"
      bindinput="inputName"
      maxlength="20"
    />
    <input
      class="input"
      placeholder="联系电话"
      type="number"
      value="{{form.phone}}"
      bindinput="inputPhone"
      maxlength="11"
    />

    <button class="submit-btn" style="display: flex;  flex-direction:column;  justify-content: center; " bindtap="submitReg">进入聊天</button>
  </view>

  <!-- 底部协议 -->

<view class="footer">
  <checkbox-group bindchange="onAgreeChange" class="agree-line">
    <checkbox value="1" checked="{{isAgree}}" />
    <text class="txt">登录须要勾选</text>
    <text class="link" bindtap="openContract">《用户协议》</text>
  </checkbox-group>
</view>

</view>
<!-- 在文件底部添加 -->
<!-- <view class="auth-modal" hidden="{{!showAuthModal}}">
  <view class="auth-content">
    <view class="auth-header">获取用户信息</view>
    <view class="auth-body">
      我们需要获取您的头像和昵称以提供更好的服务
    </view>
    <view class="auth-footer">
      <button class="auth-btn" bindtap="onAuthCancel">取消</button>
      <button class="auth-btn primary" open-type="getUserInfo" bindgetuserinfo="onGetUserInfo">授权</button>
    </view>
  </view>
</view> -->