tab1.page.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <ion-header [translucent]="true">
  2. <ion-toolbar>
  3. <ion-title style="text-align: center;">
  4. 主页
  5. </ion-title>
  6. </ion-toolbar>
  7. </ion-header>
  8. <head><link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.min.css"></head>
  9. <ion-content [fullscreen]="true">
  10. <ion-header collapse="condense">
  11. <ion-toolbar>
  12. <ion-title size="large">主页</ion-title>
  13. </ion-toolbar>
  14. </ion-header>
  15. <ion-segment [ngModelOptions]="{standalone:true}" [(ngModel)]="changeTab" (ionChange)="shishang($event)">
  16. <ion-segment-button value="default">
  17. <ion-label>换装</ion-label>
  18. </ion-segment-button>
  19. <ion-segment-button value="segment">
  20. <ion-label>上传</ion-label>
  21. </ion-segment-button>
  22. <ion-segment-button value="buttons">
  23. <ion-label>结果</ion-label>
  24. </ion-segment-button>
  25. </ion-segment>
  26. <div *ngIf="changeTab === 'default'" style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; text-align: center; padding: 20px;">
  27. <img src="../../assets/images/1.jpg" alt="" style="max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);">
  28. <h2 style="margin-top: 20px;">欢迎来到虚拟试衣</h2>
  29. <ion-button color="primary" shape="round" style="margin-top: 20px;" (click)="startDressing()">开始换装</ion-button>
  30. </div>
  31. <div *ngIf="changeTab === 'segment'" style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; padding: 20px;">
  32. <div class="image-container" [@imageAnimation]="currentImageIndex" style="margin-bottom: 20px;">
  33. <img [src]="images[currentImageIndex]" alt="Image" style="max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);">
  34. </div>
  35. <div style="display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 20px;">
  36. <ion-button color="primary" shape="round" (click)="changeImage(-1)" style="margin-right: 10px;">
  37. <ion-icon name="arrow-back-outline"></ion-icon> 上一个
  38. </ion-button>
  39. <ion-button color="primary" shape="round" (click)="changeImage(1)">
  40. 下一个 <ion-icon name="arrow-forward-outline"></ion-icon>
  41. </ion-button>
  42. </div>
  43. <h2 style="font-family: '宋体'; font-size: 1.2em;">上传图片并选择服装</h2>
  44. <input type="file" (change)="onFileSelected($event)" style="margin-bottom: 20px;">
  45. <div style="width: 100%;">
  46. <ion-button expand="block" color="primary" style="margin-bottom: 10px;" (click)="selectClothing()">
  47. <ion-icon name="shirt-outline"></ion-icon>
  48. 选择服装
  49. </ion-button>
  50. <ion-button expand="block" color="success" style="margin-bottom: 10px;" (click)="save()">
  51. <ion-icon name="save-outline"></ion-icon>
  52. 保存
  53. </ion-button>
  54. <ion-button expand="block" color="primary" style="margin-bottom: 10px;" (click)="submit()">
  55. <ion-icon name="checkmark-outline"></ion-icon>
  56. 提交
  57. </ion-button>
  58. <ion-button expand="block" color="danger" (click)="returnToHome()">
  59. <ion-icon name="home-outline"></ion-icon>
  60. 返回首页
  61. </ion-button>
  62. </div>
  63. </div>
  64. <div *ngIf="changeTab === 'buttons'" class="center-content">
  65. <h2>查看结果</h2>
  66. <!-- 这里放置结果的样式 -->
  67. <div class="center-buttons">
  68. <ion-button (click)="share()">分享</ion-button>
  69. <ion-button (click)="returnToHome()">返回首页</ion-button>
  70. </div>
  71. </div>
  72. <!-- <app-explore-container name="Tab 1 page"></app-explore-container> -->
  73. </ion-content>