<!-- pages/no-permission/no-permission.wxml — 无权限/申请被拒页 -->
<view class="page" style="padding-top: {{statusBarHeight}}px;">
  <!-- 十字纹背景图案 -->
  <view class="bg-pattern"></view>
  <!-- 顶部渐变装饰（红色主题） -->
  <view class="top-gradient"></view>

  <!-- 主体内容 -->
  <view class="content">
    <!-- 图标区域 -->
    <view class="icon-area">
      <view class="icon-glow"></view>
      <view class="icon-box">
        <image class="icon-main-img" src="/assets/icons/icon-forbidden.svg" mode="aspectFit" />
      </view>
      <view class="icon-dot dot-1"></view>
      <view class="icon-dot dot-2"></view>
    </view>

    <!-- 标题区域：区分 rejected 和 disabled -->
    <view class="title-area">
      <text class="main-title">{{userStatus === 'rejected' ? '申请未通过' : '无访问权限'}}</text>
      <text class="sub-title" wx:if="{{userStatus === 'rejected'}}">很抱歉，您的申请未通过审核，您可以修改信息后重新申请</text>
      <text class="sub-title" wx:else>您的账号已被禁用，如有疑问请联系管理员</text>
    </view>

    <!-- 拒绝原因卡片（仅 rejected 且有拒绝原因时显示） -->
    <view class="reject-reason-card" wx:if="{{userStatus === 'rejected' && latestApplication && latestApplication.reviewNote}}">
      <view class="reject-reason-header">
        <t-icon name="error-circle-filled" size="32rpx" color="#e34d59" />
        <text class="reject-reason-title">拒绝原因</text>
      </view>
      <text class="reject-reason-text">{{latestApplication.reviewNote}}</text>
    </view>

    <!-- 原因说明卡片（仅 disabled 显示） -->
    <view class="reason-card" wx:if="{{userStatus === 'disabled'}}">
      <view class="reason-header">
        <view class="reason-icon-box">
          <t-icon name="error-circle-filled" size="35rpx" color="#e34d59" />
        </view>
        <view class="reason-header-text">
          <text class="reason-title">可能的原因</text>
          <view class="reason-list">
            <text class="reason-item">• 申请多次未通过，账号已被自动禁用</text>
            <text class="reason-item">• 非本店授权员工账号</text>
            <text class="reason-item">• 账号权限已被管理员收回</text>
          </view>
        </view>
      </view>
      <view class="reason-footer">
        <text class="reason-footer-label">请联系管理员</text>
        <text class="reason-footer-value">厉超</text>
      </view>
    </view>

    <!-- 帮助提示 -->
    <view class="contact-hint">
      <t-icon name="help-circle-filled" size="28rpx" color="#a6a6a6" />
      <text class="contact-text">如有疑问，请联系管理员</text>
    </view>
  </view>

  <!-- 底部按钮 -->
  <view class="bottom-area">
    <!-- rejected：双按钮（更换登录账号 + 重新申请） -->
    <view class="btn-row" wx:if="{{userStatus === 'rejected'}}">
      <view class="switch-btn" bindtap="onSwitchAccount">
        <t-icon name="logout" size="28rpx" color="#5e5e5e" />
        <text class="switch-btn-text">更换登录账号</text>
      </view>
      <view class="reapply-btn" bindtap="onReapply">
        <t-icon name="refresh" size="28rpx" color="#fff" />
        <text class="reapply-btn-text">重新申请</text>
      </view>
    </view>
    <!-- disabled：仅更换登录账号 -->
    <view wx:else>
      <view class="switch-btn switch-btn--full" bindtap="onSwitchAccount">
        <t-icon name="logout" size="28rpx" color="#5e5e5e" />
        <text class="switch-btn-text">更换登录账号</text>
      </view>
    </view>
  </view>
</view>

<dev-fab />
