tab3.page.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <ion-header [translucent]="true">
  2. <ion-toolbar>
  3. <ion-title>
  4. 我的
  5. </ion-title>
  6. </ion-toolbar>
  7. </ion-header>
  8. <ion-content [fullscreen]="true">
  9. <!-- 用户登录状态 -->
  10. <ion-card>
  11. <!-- 未登录 -->
  12. @if(!currentUser?.id){
  13. <ion-card-header>
  14. <ion-card-title>未登录,请先登录</ion-card-title>
  15. </ion-card-header>
  16. }
  17. <!-- 已登录 -->
  18. @if(currentUser?.id){
  19. <ion-card-header>
  20. <div style="display: flex; align-items: center;">
  21. <img src="{{currentUser?.get('avatar')}}" alt="头像" style="width: 50px; height: 50px; border-radius: 50%; margin-right: 10px;">
  22. <div>
  23. <ion-card-title>{{currentUser?.get("username")}} </ion-card-title>
  24. <ion-card-subtitle style="font-size: 16px;">性别: {{currentUser?.get("gender") || "-"}} 年龄: {{currentUser?.get("age") || "-"}}</ion-card-subtitle>
  25. </div>
  26. </div>
  27. </ion-card-header>
  28. }
  29. <ion-card-content>
  30. @if(!currentUser?.id){
  31. <div style="display: flex; justify-content: space-between;">
  32. <ion-button expand="block" color="danger" (click)="signup()" style="flex: 1; margin-right: 5px;">注册</ion-button>
  33. <ion-button expand="block" color="danger" (click)="login()" style="flex: 1; margin-left: 5px;">登录</ion-button>
  34. </div>
  35. }
  36. @if(currentUser?.id){
  37. <div style="display: flex; justify-content: space-between;">
  38. <ion-button expand="block" color="danger" (click)="editUser()" style="flex: 1; margin-right: 5px;">编辑资料</ion-button>
  39. <ion-button expand="block" color="danger" (click)="logout()" style="flex: 1; margin-right: 5px;">登出</ion-button>
  40. </div>
  41. }
  42. </ion-card-content>
  43. </ion-card>
  44. <!-- 功能列表 -->
  45. <ion-card>
  46. <ion-list>
  47. <!-- 个人信息设置 -->
  48. <ion-item>
  49. <ion-icon name="person-outline" slot="start"></ion-icon>
  50. <ion-label>个人信息</ion-label>
  51. <ion-icon name="chevron-forward-outline" slot="end" (click)="presentInfoModal()"></ion-icon>
  52. </ion-item>
  53. <!-- 我的收藏 -->
  54. <ion-item>
  55. <ion-icon name="heart-outline" slot="start"></ion-icon>
  56. <ion-label>我的收藏</ion-label>
  57. <ion-icon name="chevron-forward-outline" slot="end"></ion-icon>
  58. </ion-item>
  59. <!-- 消息通知 -->
  60. <ion-item>
  61. <ion-icon name="notifications-outline" slot="start"></ion-icon>
  62. <ion-label>消息通知</ion-label>
  63. <ion-icon name="chevron-forward-outline" slot="end"></ion-icon>
  64. </ion-item>
  65. <!-- 系统设置 -->
  66. <ion-item>
  67. <ion-icon name="settings-outline" slot="start"></ion-icon>
  68. <ion-label>系统设置</ion-label>
  69. <ion-icon name="chevron-forward-outline" slot="end"></ion-icon>
  70. </ion-item>
  71. <!-- 关于我们 -->
  72. <ion-item>
  73. <ion-icon name="information-circle-outline" slot="start"></ion-icon>
  74. <ion-label>关于我们</ion-label>
  75. <ion-icon name="chevron-forward-outline" slot="end"></ion-icon>
  76. </ion-item>
  77. </ion-list>
  78. </ion-card>
  79. </ion-content>