import { Component } from '@angular/core';

@Component({
  selector: 'app-tab2',
  templateUrl: 'tab2.page.html',
  styleUrls: ['tab2.page.scss']
})
export class Tab2Page {

  contacts = [
    { name: '小江', phone: '13767975832', email: '1969965415' },
    { name: '小明', phone: '123456789', email: 'xiaoming@example.com' },
    { name: '小红', phone: '987654321', email: 'xiaohong@example.com' }
    // 其他联系人数据
  ];
  searchText: string = '';

  constructor() {}

  filterContacts() {
    return this.contacts.filter(contact => contact.name.toLowerCase().includes(this.searchText.toLowerCase()));
  }

  
  openMessages() {
    // 在这里编写打开消息页面的逻辑
    console.log('打开消息页面');
  }
}
