|
@@ -1,7 +1,7 @@
|
|
|
// import { Component } from '@angular/core';
|
|
|
// import { AlertController } from '@ionic/angular';
|
|
|
|
|
|
-import { Component, OnInit } from '@angular/core';
|
|
|
+import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
|
|
import Swiper from 'swiper';
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
@@ -54,18 +54,23 @@ export class Tab1Page implements OnInit {
|
|
|
console.log('Navigating to Blank page');
|
|
|
}
|
|
|
|
|
|
- ngOnInit() {
|
|
|
- const swiper = new Swiper('.swiper-container', {
|
|
|
- loop: true,
|
|
|
- pagination: {
|
|
|
- el: '.swiper-pagination',
|
|
|
- clickable: true,
|
|
|
- },
|
|
|
- autoplay: {
|
|
|
- delay: 2000, // 设置轮播时间为2秒
|
|
|
- },
|
|
|
- speed: 1000, // 设置过渡速度为1000ms
|
|
|
- });
|
|
|
+ results:Parse.Object[] = []
|
|
|
+ segment = 'tang';
|
|
|
+ slides = [
|
|
|
+ { image: 'assets/images/homepage/home2_1.jpg' },
|
|
|
+ { image: 'assets/images/homepage/home2_2.jpg' },
|
|
|
+ { image: 'assets/images/homepage/home2_3.jpg' }
|
|
|
+ ];
|
|
|
+ currentIndex = 0;
|
|
|
+
|
|
|
+ ngOnInit() {
|
|
|
+ setInterval(() => {
|
|
|
+ this.nextSlide();
|
|
|
+ }, 3000); // 每3秒切换一次图片
|
|
|
+ }
|
|
|
+
|
|
|
+ nextSlide() {
|
|
|
+ this.currentIndex = (this.currentIndex + 1) % this.slides.length;
|
|
|
}
|
|
|
|
|
|
}
|