<!--pages/profile/change-password.wxml-->
<view class="change-password-container">
  <!-- 页面标题 -->
  <view class="page-header">
    <view class="header-title">修改密码</view>
  </view>

  <!-- 表单内容 -->
  <view class="form-container">
    <view class="form-item">
      <text class="form-label">用户名</text>
      <view class="form-value">{{userInfo.username || '刘超'}}</view>
    </view>

    <view class="form-item">
      <text class="form-label">旧密码</text>
      <input 
        class="form-input" 
        type="password" 
        placeholder="请输入旧密码" 
        value="{{formData.oldPassword}}"
        data-field="oldPassword"
        bindinput="onInputChange"
      />
    </view>

    <view class="form-item">
      <text class="form-label">新密码</text>
      <input 
        class="form-input" 
        type="password" 
        placeholder="请输入新密码" 
        value="{{formData.newPassword}}"
        data-field="newPassword"
        bindinput="onInputChange"
      />
    </view>

    <view class="form-item">
      <text class="form-label">确认新密码</text>
      <input 
        class="form-input" 
        type="password" 
        placeholder="请输入确认密码" 
        value="{{formData.confirmPassword}}"
        data-field="confirmPassword"
        bindinput="onInputChange"
      />
    </view>
  </view>

  <!-- 操作按钮 -->
  <view class="button-container">
    <button class="btn confirm-btn" bindtap="handleConfirm" disabled="{{loading}}">
      {{loading ? '修改中...' : '确认'}}
    </button>
    <button class="btn reset-btn" bindtap="handleReset" disabled="{{loading}}">
      重置
    </button>
  </view>
</view>

<!-- 加载提示 -->
<view class="loading-overlay" wx:if="{{loading}}">
  <view class="loading-content">
    <text class="loading-text">修改中...</text>
  </view>
</view>