|
@@ -1,6 +1,6 @@
|
|
|
+import { CommonModule } from '@angular/common';
|
|
|
import { Component } from '@angular/core';
|
|
|
import {
|
|
|
- IonAvatar,
|
|
|
IonButton,
|
|
|
IonCard,
|
|
|
IonCardContent,
|
|
@@ -14,33 +14,80 @@ import {
|
|
|
IonHeader,
|
|
|
IonToolbar,
|
|
|
IonTitle,
|
|
|
- IonContent,
|
|
|
- IonButtons
|
|
|
-} from '@ionic/angular'; // 从Ionic导入组件
|
|
|
+ IonContent,
|
|
|
+ IonButtons,
|
|
|
+ IonTabButton,
|
|
|
+ IonIcon,
|
|
|
+ IonTabBar,
|
|
|
+ IonMenuButton
|
|
|
+} from '@ionic/angular/standalone'; // 从Ionic导入组件
|
|
|
+import { IonAvatar } from '@ionic/angular/standalone';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-tab1',
|
|
|
templateUrl: 'tab1.page.html',
|
|
|
styleUrls: ['tab1.page.scss'],
|
|
|
+ standalone: true,
|
|
|
+ imports:[
|
|
|
+ CommonModule,
|
|
|
+ IonAvatar,
|
|
|
+ IonButton,
|
|
|
+ IonCard,
|
|
|
+ IonCardContent,
|
|
|
+ IonCardHeader,
|
|
|
+ IonCardTitle,
|
|
|
+ IonItem,
|
|
|
+ IonLabel,
|
|
|
+ IonList,
|
|
|
+ IonSearchbar,
|
|
|
+ IonThumbnail,
|
|
|
+ IonHeader,
|
|
|
+ IonToolbar,
|
|
|
+ IonTitle,
|
|
|
+ IonContent,
|
|
|
+ IonButtons,
|
|
|
+ IonTabButton,
|
|
|
+ IonTabBar,
|
|
|
+ IonMenuButton,
|
|
|
+ IonIcon
|
|
|
+ ]
|
|
|
})
|
|
|
export class Tab1Page {
|
|
|
- recommendedRoutes = []; // 推荐路线数据
|
|
|
- personalizedRoutes = []; // 个性化推荐数据
|
|
|
- popularAttractions = []; // 热门景点数据
|
|
|
- userFeedbacks = []; // 用户反馈数据
|
|
|
+ recommendedRoutes = [
|
|
|
+ { title: '滕王阁经典游', description: '探索滕王阁的美丽与历史', thumbnail: 'assets/images/tengwangge.jpg' },
|
|
|
+ { title: '南昌博物馆', description: '了解南昌的文化与历史', thumbnail: 'assets/images/nanchangmuseum.jpg' }
|
|
|
+ ]; // 推荐路线数据示例
|
|
|
+
|
|
|
+ personalizedRoutes = [
|
|
|
+ { title: '情侣浪漫之旅', reason: '适合情侣,包含浪漫晚餐和夜景' },
|
|
|
+ { title: '家庭亲子游', reason: '适合家庭,包含儿童乐园' }
|
|
|
+ ]; // 个性化推荐数据示例
|
|
|
+
|
|
|
+ popularAttractions = [
|
|
|
+ { name: '八一起义纪念馆', description: '纪念南昌起义的历史', image: 'assets/images/yijijiang.jpg' },
|
|
|
+ { name: '南昌青山湖', description: '美丽的湖泊,适合休闲游玩', image: 'assets/images/qingshanhu.jpg' }
|
|
|
+ ]; // 热门景点数据示例
|
|
|
+
|
|
|
+ userFeedbacks = [
|
|
|
+ { userAvatar: 'assets/images/user1.jpg', username: '用户1', content: '这条路线非常棒!', rating: 5 },
|
|
|
+ { userAvatar: 'assets/images/user2.jpg', username: '用户2', content: '我喜欢这个地方!', rating: 4 }
|
|
|
+ ]; // 用户反馈数据示例
|
|
|
|
|
|
constructor() {}
|
|
|
|
|
|
onSearch(event: any) {
|
|
|
const query = event.target.value;
|
|
|
- // 处理搜索逻辑
|
|
|
+ // 处理搜索逻辑,例如过滤推荐路线或热门景点
|
|
|
+ console.log('Searching for:', query);
|
|
|
}
|
|
|
|
|
|
viewRoute(route: any) {
|
|
|
// 导航到路线详情页面
|
|
|
+ console.log('Viewing route:', route);
|
|
|
}
|
|
|
|
|
|
viewAttraction(attraction: any) {
|
|
|
// 导航到景点详情页面
|
|
|
+ console.log('Viewing attraction:', attraction);
|
|
|
}
|
|
|
}
|