<ion-content class="content">
  <div class="header">
    <div class="user-dateil">
      <div
        class="pendant"
        [style.background-image]="
          'url(https://file-cloud.fmode.cn/Qje9D4bqol/20241109/vv1tvb032259054.png)'
        "
      >
        <img [src]="user.get('avatar')" alt="" class="avatar" />
      </div>
      <div class="user-right">
        <div class="user-name">
          {{
            user.get("nickname") ||
              user.get("mobile") ||
              user.get("username")
          }}
        </div>
        <div class="user-block">
          <div class="tags">
            @if (user.get('sex') == '男') {
            <div class="sex">
              <ion-icon name="male-outline"></ion-icon>
            </div>
            }@else if (user.get('sex') == '女') {
            <div class="sex girl">
              <ion-icon name="male-female-outline"></ion-icon>
            </div>
            }
            <div class="age">
              <img
                src="https://file-cloud.fmode.cn/Qje9D4bqol/20241109/pctmvt110807052.png"
                alt=""
              />
              23
            </div>
            <div class="id">ID:{{ user.id }}</div>
          </div>
          <div class="btn" (click)="toUrl('user/profile/'+user.id)">个人主页</div>
        </div>
        <div class="user-footer">
          <div class="row">{{userObj.fans}} 粉丝</div>
          <div class="row">{{userObj.follow}} 关注</div>
          <div class="row">{{userObj.friendly_degree}} 亲密度</div>
        </div>
      </div>
    </div>
  </div>
  <div class="ad">
    <div class="ad-left">
      <div class="text">爱聊 <span>VIP</span></div>
      <p>开通爱聊VIP，解锁海量专属主播聊天。</p>
    </div>
    <div class="btn" (click)="toUrl('goods/vip')">立即开通</div>
  </div>
  <div class="tool">
    @for (item of tools; track $index) {
    <div class="tool-li" (click)="toUrl(item.path)">
      <div class="icon">
        <img [src]="item.icon" alt="" />
      </div>
      <div class="label">
        {{ item.title }}
      </div>
    </div>
    }
  </div>
  <div class="order">
    <div class="ladder">
      <div class="top-block">
        <div class="top2">
          <div class="user-block">
            <div class="user-avatar">
              <img src="/img/2.png" alt="" class="tag" />
              <img [src]="user.get('avatar')" class="avatar" alt="" />
            </div>
            <div class="user-name">
              {{ user.get("name") }}
            </div>
          </div>
          <div class="user-detail">
            <div class="num">7.66</div>
            <div class="pm">TOP2</div>
          </div>
        </div>
        <div class="top1">
          <div class="user-block">
            <div class="user-avatar">
              <img src="/img/2.png" alt="" class="tag" />
              <img [src]="user.get('avatar')" class="avatar" alt="" />
            </div>
            <div class="user-name">
              {{ user.get("name") }}
            </div>
          </div>
          <div class="user-detail">
            <div class="num">7.66</div>
            <div class="pm">TOP1</div>
          </div>
        </div>
        <div class="top3">
          <div class="user-block">
            <div class="user-avatar">
              <img src="/img/2.png" alt="" class="tag" />
              <img [src]="user.get('avatar')" class="avatar" alt="" />
            </div>
            <div class="user-name">
              {{ user.get("name") }}
            </div>
          </div>
          <div class="user-detail">
            <div class="num">7.66</div>
            <div class="pm">TOP2</div>
          </div>
        </div>
      </div>
    </div>
    @for (item of [user,user]; track $index) {
    <div class="row">
      <div class="row-left">
        <span class="row-index">4</span>
        <img [src]="item?.get('avatar')" alt="" class="row-avatar" />
        <div class="row-name">{{ item?.get("name") }}</div>
      </div>
      <div class="row-right">
        <div class="row-tpis">距离第一名</div>
        <div class="row-tpis-num">3.5w <span></span></div>
      </div>
    </div>
    }
  </div>
  <div class="setting">
    <div class="setting-tabs">
      <div class="row">
        <div class="tabs-left">
          <ion-icon name="remove-circle-outline"></ion-icon>
          勿扰开关
        </div>
        <ion-toggle [checked]="profile?.get('isCheck')" (ionChange)="onChange($event)" color="tertiary"></ion-toggle>
      </div>
    </div>
    <div class="list">
      <div class="li" (click)="toUrl('/user/certification')">
        <div class="li-lable">
          <img src="/img/实名 (2).png" alt="" class="icon" />
          实名认证
        </div>
        <ion-icon name="chevron-forward-outline"></ion-icon>
      </div>
      <div class="li" (click)="toUrl('/user/anchor')">
        <div class="li-lable">
          <img src="/img/成为主播.png" alt="" class="icon" />
          成为主播
        </div>
        <ion-icon name="chevron-forward-outline"></ion-icon>
      </div>
      <div class="li" (click)="goRoom()">
        <div class="li-lable">
          <img src="/img/直播.png" alt="" class="icon" />
          直播间管理
        </div>
        <ion-icon name="chevron-forward-outline"></ion-icon>
      </div>
      <div class="li" (click)="showAgreement('registerAgreement')">
        <div class="li-lable">
          <img src="/img/隐私.png" alt="" class="icon" />
          隐私协议
        </div>
        <ion-icon name="chevron-forward-outline"></ion-icon>
      </div>
      <div class="li" (click)="toUrl('user/feedback')">
        <div class="li-lable">
          <img src="/img/意见反馈.png" alt="" class="icon" />
          意见反馈
        </div>
        <ion-icon name="chevron-forward-outline"></ion-icon>
      </div>
      <div class="li">
        <div class="li-lable">
          <img src="/img/在线客服.png" alt="" class="icon" />
          在线客服
        </div>
        <ion-icon name="chevron-forward-outline"></ion-icon>
      </div>
      <div class="li" (click)="showAgreement('liveAgreement')">
        <div class="li-lable">
          <img src="/img/签署协议.png" alt="" class="icon" />
          直播协议
        </div>
        <ion-icon name="chevron-forward-outline"></ion-icon>
      </div>
      <div class="li" (click)="onLogout()">
        <div class="li-lable">
          <img src="/img/退出登录.png" alt="" class="icon" />
          退出登录
        </div>
        <ion-icon name="chevron-forward-outline"></ion-icon>
      </div>
      <!-- @for (item of settings; track $index) {
      <div class="li">
        <div class="li-lable">
          <img [src]="item.icon" alt="" class="icon" />
          {{ item.title }}
        </div>
        <ion-icon name="chevron-forward-outline"></ion-icon>
      </div>
      } -->
    </div>
  </div>
</ion-content>
