time.component.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!-- <ion-header>
  2. <ion-toolbar>
  3. <ion-buttons slot="start">
  4. <ion-button (click)="preMonth()">上个月</ion-button>
  5. </ion-buttons>
  6. <ion-title (click)="openPicker()">{{ curYear }}年 {{ curMonth }}月 ></ion-title>
  7. <ion-buttons slot="end">
  8. <ion-button (click)="nextMonth()">下个月</ion-button>
  9. </ion-buttons>
  10. </ion-toolbar>
  11. </ion-header> -->
  12. <div >
  13. <div style="display: flex;margin: auto;justify-content: space-between;">
  14. <ion-buttons slot="start">
  15. <ion-button (click)="preMonth()">上个月</ion-button>
  16. </ion-buttons>
  17. <div (click)="openPicker()" style="display: flex;align-items: center;justify-content: center;font-weight: bolder;">{{ curYear }}年 {{ curMonth }}月 ></div>
  18. <ion-buttons slot="end">
  19. <ion-button (click)="nextMonth()">下个月</ion-button>
  20. </ion-buttons>
  21. </div>
  22. <div>
  23. <div class="week-days">
  24. <div *ngFor="let day of week" class="week-day">{{ day }}</div>
  25. </div>
  26. <div class="days">
  27. <!-- 上个月 -->
  28. <div *ngFor="let item of firstDays" (click)="topre(item)" class="lastday">
  29. {{ item }}
  30. </div>
  31. <!-- 当前月 -->
  32. <div *ngFor="let day of curDays" class="curday"
  33. [ngClass]="{'selected': selectedDate === day }"
  34. (click)="selectDate(day)" style="display: flex; flex-direction: column; justify-content: end;">
  35. <div class="img" style="height: 60%;">
  36. <!-- 根据日期查找天气类型 -->
  37. <!-- {{ getWeatherType(curYear, curMonth, day) }} -->
  38. <img *ngIf="checkedDates.includes(formatDate(curYear, curMonth, day))" style="height: 100%;" src="" alt="">
  39. <img *ngIf="!checkedDates.includes(formatDate(curYear, curMonth, day))" style="height: 100%;" [src]="getWeatherType(curYear, curMonth, day)" alt="">
  40. </div>
  41. <div style="height: 40%;">{{ day }}</div>
  42. </div>
  43. <!-- 下个月 -->
  44. <div *ngFor="let item of nextDaysArray" (click)="tolast(item)" class="lastday">{{ item }}</div>
  45. </div>
  46. <!-- <ion-button (click)="daka()">打卡</ion-button> -->
  47. </div>
  48. </div>