Delancey hai 6 meses
pai
achega
a7789c9481

+ 123 - 48
travel-app/src/app/tab1/tab1.page.html

@@ -1,55 +1,130 @@
+<ion-app>
+  <ion-header>
+    <ion-toolbar color="primary">
+      <ion-title>南昌旅游App</ion-title>
+    </ion-toolbar>
+  </ion-header>
 
+  <ion-content>
 
-<ion-header>
-  <ion-toolbar>
-    <ion-searchbar placeholder="搜索山脉或路线"></ion-searchbar>
-    <ion-icon name="notifications" slot="end"></ion-icon>
-  </ion-toolbar>
-</ion-header>
+    <!-- 热门推荐 -->
+    <ion-grid>
+      <ion-row>
+        <ion-col *ngFor="let item of hotRecommendations" size="6">
+          <ion-card>
+            <img [src]="item.image" />
+            <ion-card-header>
+              <ion-card-title>{{ item.title }}</ion-card-title>
+            </ion-card-header>
+            <ion-card-content>
+              {{ item.description }}
+            </ion-card-content>
+          </ion-card>
+        </ion-col>
+      </ion-row>
+    </ion-grid>
 
-<ion-content>
-  <ion-grid>
-    <ion-row>
-      <ion-col>
-        <ion-card *ngFor="let route of recommendedRoutes">
-          <img [src]="route.image" />
-          <ion-card-header>
-            <ion-card-title>{{ route.name }}</ion-card-title>
-          </ion-card-header>
-          <ion-card-content>
-            <p>{{ route.difficulty }} - {{ route.time }}</p>
-          </ion-card-content>
-        </ion-card>
-      </ion-col>
-    </ion-row>
+    <!-- 导航栏 -->
+    <ion-tabs>
+      <ion-tab-bar slot="bottom">
+        <ion-tab-button tab="home">
+          <ion-icon name="home"></ion-icon>
+          <ion-label>首页</ion-label>
+        </ion-tab-button>
+        <ion-tab-button tab="attractions">
+          <ion-icon name="pin"></ion-icon>
+          <ion-label>景点</ion-label>
+        </ion-tab-button>
+        <ion-tab-button tab="food">
+          <ion-icon name="restaurant"></ion-icon>
+          <ion-label>美食</ion-label>
+        </ion-tab-button>
+        <ion-tab-button tab="lodging">
+          <ion-icon name="bed"></ion-icon>
+          <ion-label>住宿</ion-label>
+        </ion-tab-button>
+        <ion-tab-button tab="guide">
+          <ion-icon name="book"></ion-icon>
+          <ion-label>攻略</ion-label>
+        </ion-tab-button>
+        <ion-tab-button tab="events">
+          <ion-icon name="calendar"></ion-icon>
+          <ion-label>活动</ion-label>
+        </ion-tab-button>
+        <ion-tab-button tab="profile">
+          <ion-icon name="person"></ion-icon>
+          <ion-label>个人中心</ion-label>
+        </ion-tab-button>
+      </ion-tab-bar>
+    </ion-tabs>
 
-    <ion-row>
-      <ion-col>
-        <ion-card *ngFor="let plan of trainingPlans">
-          <img [src]="plan.image" />
-          <ion-card-header>
-            <ion-card-title>{{ plan.name }}</ion-card-title>
-          </ion-card-header>
-          <ion-card-content>
-            <p>{{ plan.description }}</p>
-          </ion-card-content>
-        </ion-card>
-      </ion-col>
-    </ion-row>
+    <!-- 特色活动/优惠信息 -->
+    <ion-list>
+      <ion-item *ngFor="let event of events">
+        <ion-thumbnail slot="start">
+          <img [src]="event.image" />
+        </ion-thumbnail>
+        <ion-label>
+          <h2>{{ event.title }}</h2>
+          <p>{{ event.description }}</p>
+        </ion-label>
+      </ion-item>
+    </ion-list>
+
+    <!-- 个性化推荐 -->
+    <ion-list>
+      <ion-item *ngFor="let recommendation of personalizedRecommendations">
+        <ion-label>
+          <h2>{{ recommendation.title }}</h2>
+          <p>{{ recommendation.description }}</p>
+        </ion-label>
+      </ion-item>
+    </ion-list>
+
+    <!-- 旅游攻略 -->
+    <ion-list>
+      <ion-item *ngFor="let guide of travelGuides">
+        <ion-label>
+          <h2>{{ guide.title }}</h2>
+          <p>{{ guide.description }}</p>
+        </ion-label>
+      </ion-item>
+    </ion-list>
 
+    <!-- 用户互动区域 -->
+    <ion-list>
+      <ion-item *ngFor="let post of travelPosts">
+        <ion-avatar slot="start">
+          <img [src]="post.avatar" />
+        </ion-avatar>
+        <ion-label>
+          <h2>{{ post.username }}</h2>
+          <p>{{ post.content }}</p>
+        </ion-label>
+      </ion-item>
+    </ion-list>
+
+    <!-- 搜索功能 -->
+    <ion-searchbar placeholder="搜索景点、美食、住宿..."></ion-searchbar>
+
+    <!-- 客服与帮助 -->
+    <ion-fab vertical="bottom" horizontal="end" slot="fixed">
+      <ion-fab-button>
+        <ion-icon name="help-circle"></ion-icon>
+      </ion-fab-button>
+    </ion-fab>
+
+    <!-- 天气和出行信息 -->
+    <ion-card>
+      <ion-card-header>
+        <ion-card-title>南昌天气</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <!-- 天气信息展示 -->
+      </ion-card-content>
+    </ion-card>
+
+    <!-- 下载/分享按钮 -->
     <ion-row>
       <ion-col>
-        <ion-card *ngFor="let content of educationalContent">
-          <img [src]="content.image" />
-          <ion-card-header>
-            <ion-card-title>{{ content.title }}</ion-card-title>
-          </ion-card-header>
-          <ion-card-content>
-            <p>{{ content.summary }}</p>
-          </ion-card-content>
-        </ion-card>
-      </ion-col>
-    </ion-row>
-  </ion-grid>
-</ion-content>
-
+        <ion-button expand="block">按钮文本</ion-button>

+ 35 - 10
travel-app/src/app/tab1/tab1.page.scss

@@ -1,14 +1,39 @@
 
-
 ion-slides {
-    height: 200px;
+  height: 200px;
+
+  img {
+    width: 100%;
+    height: 100%;
   }
-  
-  ion-card {
-    margin-bottom: 10px;
+}
+
+ion-card {
+  margin: 10px 0;
+
+  img {
+    max-width: 100%;
+    height: auto;
   }
-  
-  ion-card img {
-    max-height:500px;
-    width: 100%;
-  }
+}
+
+ion-tab-bar {
+  ion-tab-button {
+    --background: #f4f4f4;
+    --color: #333;
+
+    &.tab-selected {
+      --background: #3880ff;
+      --color: #fff;
+    }
+  }
+}
+
+ion-searchbar {
+  --border-radius: 20px;
+  --background: #f4f4f4;
+}
+
+ion-fab-button {
+  --background: #3880ff;
+}

+ 40 - 18
travel-app/src/app/tab1/tab1.page.ts

@@ -1,35 +1,57 @@
-import { Component,CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonSearchbar, IonicSlides, IonGrid, IonRow, IonCol, IonCard, IonCardHeader, IonCardTitle, IonCardContent, IonFooter, IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel, IonInput } from '@ionic/angular/standalone';
+import { Component, ViewChild } from '@angular/core';
+import { IonicModule } from '@ionic/angular';
 import { ExploreContainerComponent } from '../explore-container/explore-container.component';
-import { CommonModule } from '@angular/common';
+import { IonAvatar, IonCard, IonCardContent, IonCardHeader, IonCol, IonContent, IonFab, IonFabButton, IonGrid, IonIcon, IonItem, IonLabel, IonList, IonRow, IonSearchbar, IonTab, IonTabBar, IonTabButton, IonTabs, IonThumbnail, IonToolbar } from '@ionic/angular/standalone';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule 以使用 *ngFor
 
 @Component({
   selector: 'app-tab1',
   templateUrl: 'tab1.page.html',
   styleUrls: ['tab1.page.scss'],
   standalone: true,
-  imports: [IonHeader, IonToolbar, IonTitle, IonSearchbar,IonGrid,
-    IonRow,IonCol,IonCard,IonCardHeader,IonCardTitle,IonCardContent,
-    IonFooter,IonTabs,IonTabBar,IonTabButton,IonIcon,IonLabel,
-    IonContent, ExploreContainerComponent,CommonModule,IonInput],
-    schemas:[CUSTOM_ELEMENTS_SCHEMA],
+  imports: [
+    IonicModule,
+    IonContent, IonToolbar, IonGrid, IonRow, IonCard, IonCardContent, IonCardHeader,
+    IonCol, IonTab, IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel, IonList, IonItem,
+    IonThumbnail, IonAvatar, IonSearchbar, IonFab, IonFabButton,
+    ExploreContainerComponent,
+    CommonModule
+  ]
 })
 export class Tab1Page {
   constructor() {}
 
-  // 示例数据
-  recommendedRoutes = [
-    { id: 1, name: '庐山经典路线', difficulty: '中等', time: '5小时', image: 'assets/img/庐山.png' },
-    { id: 2, name: '三清山挑战路线', difficulty: '困难', time: '8小时', image: 'assets/img/三清山.png' }
+  @ViewChild('slides') ionSlides: any; // 使用 ViewChild 获取 ion-slides 实例
+
+  slides: any[] = [
+    { image: 'src/assets/img/1.png' },
+    { image: 'src/assets/img/1.png' },
+    { image: 'src/assets/img/1.png' },
+  ];
+
+  hotRecommendations: any[] = [
+    { title: '滕王阁', description: '江南三大名楼之一', image: 'src/assets/img/1.png' },
+    { title: '八一广场', description: '南昌市中心广场', image: 'src/assets/img/1.png' },
+    // 更多推荐...
+  ];
+
+  events: any[] = [
+    { title: '南昌国际马拉松', description: '一年一度的国际体育赛事', image: 'src/assets/img/1.png' },
+    // 更多活动...
+  ];
+
+  personalizedRecommendations: any[] = [
+    { title: '红色旅游线路', description: '南昌起义纪念馆一日游', image: 'src/assets/img/1.png' },
+    // 更多个性化推荐...
   ];
 
-  trainingPlans = [
-    { id: 1, name: '初级体能训练', description: '适合初级登山者', image: 'assets/img/1.png' },
-    { id: 2, name: '高级耐力提升', description: '为长期登山者设计', image: 'assets/img/1.png' }
+  travelGuides: any[] = [
+    { title: '一日游推荐', description: '南昌市区经典一日游路线', image: 'src/assets/img/1.png' },
+    // 更多攻略...
   ];
 
-  educationalContent = [
-    { id: 1, title: '江西山川文化', summary: '探索江西名山的历史与文化', image: 'assets/img/1.png' },
-    { id: 2, title: '山地生态保护', summary: '了解山地生态的重要性', image: 'assets/img/1.png' }
+  travelPosts: any[] = [
+    { username: '张三', content: '今天去了滕王阁,真的很壮观!', avatar: 'src/assets/img/1.png' },
+    // 更多用户互动...
   ];
 }

+ 0 - 15
travel-app/src/app/tab3/tab3.page.html

@@ -13,20 +13,5 @@
     </ion-toolbar>
   </ion-header>
 
-  <div class="chat-container">
-    <ion-list>
-      <ion-item *ngFor="let message of messages" class="chat-message">
-        <ion-label>{{ message.sender }}: {{ message.text }}</ion-label>
-      </ion-item>
-    </ion-list>
-  </div>
-
-  <ion-footer>
-    <ion-toolbar>
-      <ion-input [(ngModel)]="userMessage" placeholder="Type a message..."></ion-input>
-      <ion-button (click)="sendMessage()" fill="clear" color="primary">Send</ion-button>
-    </ion-toolbar>
-  </ion-footer>
-  
   <app-explore-container name="Tab 3 page"></app-explore-container>
 </ion-content>

+ 0 - 31
travel-app/src/app/tab3/tab3.page.scss

@@ -1,31 +0,0 @@
-.chat-container {
-    background-color: #e8f5e9; // Light green background
-    height: 100%;
-    padding: 16px;
-    ion-list {
-      background-color: #fff;
-      border-radius: 8px;
-      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
-      margin-bottom: 16px;
-    }
-    .chat-message {
-      --background: #fff;
-      ion-label {
-        color: #212121; // Dark text color
-      }
-    }
-  }
-  
-  ion-footer {
-    ion-toolbar {
-      ion-input {
-        --background: #fff;
-        border-radius: 4px;
-        margin-right: 8px;
-      }
-      ion-button {
-        height: 100%;
-      }
-    }
-  }
-  

+ 2 - 22
travel-app/src/app/tab3/tab3.page.ts

@@ -1,5 +1,5 @@
 import { Component } from '@angular/core';
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonItem, IonFooter, IonButton } from '@ionic/angular/standalone';
+import { IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/angular/standalone';
 import { ExploreContainerComponent } from '../explore-container/explore-container.component';
 
 @Component({
@@ -7,30 +7,10 @@ import { ExploreContainerComponent } from '../explore-container/explore-containe
   templateUrl: 'tab3.page.html',
   styleUrls: ['tab3.page.scss'],
   standalone: true,
-  imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,
-    IonList, IonItem, IonFooter,IonButton
-  ],
+  imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent]
 })
 export class Tab3Page {
-  
-  userMessage: string = '';
-  messages: any[] = [];
 
   constructor() {}
 
-  sendMessage() {
-    if (this.userMessage.trim() !== '') {
-      this.messages.push({ sender: 'You', text: this.userMessage });
-      // Here you would typically send the message to the server and get a response
-      // For this example, we'll just simulate a response
-      this.simulateAIResponse(this.userMessage);
-      this.userMessage = '';
-    }
-  }
-
-  simulateAIResponse(message: string) {
-    setTimeout(() => {
-      this.messages.push({ sender: 'AI', text: `Received your message: ${message}` });
-    }, 1000);
-  }
 }