我如何在许多按钮中显示数据类型“时间”

时间:2019-07-23 22:08:55

标签: typescript ionic3

我有App可以预订酒店房间之类的东西, 所以我需要显示可用的房间吗?

[
   {
        "booking_time": "3:30",
        "booking_date": "2019-07-23",
        "status": 1
    },
    {
        "booking_time": "05:00",
        "booking_date": "2019-07-23",
        "status": 1
    },
    {
        "booking_time": "10:30",
        "booking_date": "2019-07-23",
        "status": 2
    }
]

如果房间正在预订,此api示例

    <div>
      <button ion-button icon-only col-lg-6 (click)="TimeTable('15:30')">
        <ion-icon name="football"></ion-icon>
      </button>
      <p text-center>03:30</p>
    </div>

    <div>
      <button ion-button icon-only col-lg-6 (click)="TimeTable('17:00')">
        <ion-icon name="football"></ion-icon>
      </button>
      <p text-center>05:00</p>
    </div>

    <div>
      <button ion-button icon-only col-lg-6 color="red1" (click)="TimeTable('18:30')">
        <ion-icon name="football"></ion-icon>
      </button>

      <p text-center>06:30</p>
    </div>

    <div>
      <button ion-button icon-only col-lg-6 (click)="TimeTable('20:00')">
        <ion-icon name="football"></ion-icon>
      </button>
      <p text-center>08:00</p>
    </div>

    <div>
      <button ion-button icon-only col-lg-6 (click)="TimeTable('21:30')">
        <ion-icon name="football"></ion-icon>
      </button>
      <p text-center>09:30</p>
    </div>

    <div>
      <button ion-button icon-only col-lg-6 (click)="TimeTable('23:00')">
        <ion-icon name="football"></ion-icon>
      </button>
      <p text-center>11:30</p>
    </div>

html代码

 TimeTable(time: string) {
    this.bookingData.time = time;
  }

任何帮助我的example from Fornt End

所以有什么想法可以帮助我.................................................. ................................................... ...................................................

0 个答案:

没有答案