|
@@ -5,16 +5,19 @@ import { Router } from '@angular/router';
|
|
|
@Component({
|
|
|
selector: 'app-tab1',
|
|
|
templateUrl: 'tab1.page.html',
|
|
|
- styleUrls: ['tab1.page.scss']
|
|
|
+ styleUrls: ['tab1.page.scss'],
|
|
|
+
|
|
|
})
|
|
|
export class Tab1Page {
|
|
|
// 上方轮播图
|
|
|
+
|
|
|
public attractions = [
|
|
|
{ image: "https://tse3-mm.cn.bing.net/th/id/OIP-C.5HjektOIikSBU1vw0JVKwgHaE8?w=305&h=180&c=7&r=0&o=5&dpr=1.3&pid=1.7", name: '景点1' },
|
|
|
- { image: "https://tse3-mm.cn.bing.net/th/id/OIP-C.5HjektOIikSBU1vw0JVKwgHaE8?w=305&h=180&c=7&r=0&o=5&dpr=1.3&pid=1.7", name: '景点2' },
|
|
|
- { image: "https://tse3-mm.cn.bing.net/th/id/OIP-C.5HjektOIikSBU1vw0JVKwgHaE8?w=305&h=180&c=7&r=0&o=5&dpr=1.3&pid=1.7", name: '景点3' }
|
|
|
+ { image: "https://tse1-mm.cn.bing.net/th/id/OIP-C.4sCrXFdufaW6NLTTeTJFdQHaEq?w=229&h=180&c=7&r=0&o=5&dpr=1.3&pid=1.7", name: '景点2' },
|
|
|
+ { image: "https://ts1.cn.mm.bing.net/th/id/R-C.90139666f8943b728df6af35d9e0f82a?rik=V2B9Csf%2be9hAdA&riu=http%3a%2f%2fi.52desktop.cn%3a81%2fupimg%2fallimg%2f20141231%2f2014123116175167177807.jpg&ehk=AryhWxX8LTLpPs4rb31XISqXKyw0zFPNtxRenGZli8M%3d&risl=&pid=ImgRaw&r=0", name: '景点3' }
|
|
|
];
|
|
|
|
|
|
+
|
|
|
//多图标卡片
|
|
|
cards = [
|
|
|
{ icon: 'map-outline', title: '找攻略' },
|
|
@@ -31,6 +34,7 @@ export class Tab1Page {
|
|
|
|
|
|
chunkedCards: any[] = [];
|
|
|
|
|
|
+
|
|
|
constructor(private router: Router) {
|
|
|
this.chunkSize(this.cards);
|
|
|
}
|
|
@@ -48,6 +52,8 @@ export class Tab1Page {
|
|
|
this.chunkedCards.push(cards.slice(i, i + chunkSize));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
ngOnInit() {
|
|
|
const swiper = new Swiper('.swiper-container', {
|
|
@@ -55,6 +61,13 @@ export class Tab1Page {
|
|
|
nextEl: '.swiper-button-next',
|
|
|
prevEl: '.swiper-button-prev',
|
|
|
},
|
|
|
+
|
|
|
+ autoplay: {
|
|
|
+ delay: 3000, // 自动播放间隔时间为3秒
|
|
|
+ },
|
|
|
+
|
|
|
});
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|