moreplace.page.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { Component, OnInit } from '@angular/core';
  2. import { NavController } from '@ionic/angular';
  3. // import Swiper from 'swiper';
  4. import { Router } from '@angular/router';
  5. import Parse from 'parse';
  6. import { ParseService } from 'src/app/services/parse.service';
  7. @Component({
  8. selector: 'app-moreplace',
  9. templateUrl: './moreplace.page.html',
  10. styleUrls: ['./moreplace.page.scss'],
  11. })
  12. export class MoreplacePage implements OnInit {
  13. constructor(private navCtrl: NavController,private router: Router,private parseService: ParseService) { }
  14. ngOnInit() {
  15. }
  16. search() {
  17. this.router.navigate(['/search']); // 替换成你的 setting 页面路由路径
  18. }
  19. fetchMoreplace(){
  20. }
  21. firstCol: HTMLElement |null = null;
  22. //点击变蓝
  23. filterByCategory(event: any,category: string) {
  24. const selectedCol = event.target;
  25. const allCols = document.querySelectorAll('ion-col');
  26. if (!this.firstCol) {
  27. this.firstCol = document.querySelector('ion-col:first-child');
  28. if (this.firstCol) {
  29. this.firstCol.classList.add('blue');
  30. }
  31. } else if (this.firstCol) {
  32. this.firstCol.classList.remove('blue');
  33. }
  34. allCols.forEach(col => col.classList.remove('blue'));
  35. selectedCol.classList.add('blue');
  36. this.firstCol = selectedCol;
  37. }
  38. }