import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
import { Router } from '@angular/router';

@Component({
  selector: 'app-search',
  templateUrl: './search.page.html',
  styleUrls: ['./search.page.scss'],
})

export class SearchPage {
  hotSearches: string[] = ['大闹天宫', '秘密森林', '无双', '霸王别姬'];
  searchHistory: string[] = ['无双', '满城尽带黄金甲', '白鹿原'];

  search() {
    // 实现搜索功能的逻辑
  }

  deleteHistoryItem(item: string) {
    const index = this.searchHistory.indexOf(item);
    if (index > -1) {
      this.searchHistory.splice(index, 1);
    }
  }

  deleteAllHistory() {
    this.searchHistory = [];
  }
}
