tab1.page.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // import { Component } from '@angular/core';
  2. // import { AlertController } from '@ionic/angular';
  3. import { Component, OnInit } from '@angular/core';
  4. import Swiper from 'swiper';
  5. import { Router } from '@angular/router';
  6. @Component({
  7. selector: 'app-tab1',
  8. templateUrl: 'tab1.page.html',
  9. styleUrls: ['tab1.page.scss']
  10. })
  11. export class Tab1Page implements OnInit {
  12. constructor(private router: Router) {}
  13. navigateToBannerPage(banner: string) {
  14. // 导航到对应的Banner页面
  15. console.log('Navigating to Banner page: ' + banner);
  16. }
  17. navigateToRecentPage(recent: string) {
  18. // 导舓到对应的最近更新页面
  19. console.log('Navigating to Recent page: ' + recent);
  20. }
  21. navigateToMoviePage(hotMovie: string) {
  22. // 导航到对应的电影页面
  23. console.log('Navigating to Movie page: ' + hotMovie);
  24. }
  25. navigateToLocationPage(location: string) {
  26. // 导航到对应的热门地点页面
  27. console.log('Navigating to Location page: ' + location);
  28. }
  29. navigateToRoutePage(route: string) {
  30. // 导航到对应的热门路线页面
  31. console.log('Navigating to Route page: ' + route);
  32. }
  33. navigateToCityPage(city: string) {
  34. // 导航到对应的热门城市页面
  35. console.log('Navigating to City page: ' + city);
  36. }
  37. //点击更多时,默认跳
  38. navigateToBlankPage() {
  39. // 导航到空白页面
  40. console.log('Navigating to Blank page');
  41. }
  42. ngOnInit() {
  43. const swiper = new Swiper('.swiper-container', {
  44. loop: true,
  45. pagination: {
  46. el: '.swiper-pagination',
  47. clickable: true,
  48. },
  49. autoplay: {
  50. delay: 2000, // 设置轮播时间为2秒
  51. },
  52. speed: 1000, // 设置过渡速度为1000ms
  53. });
  54. }
  55. }