|
@@ -1,60 +1,88 @@
|
|
|
-import { Component } from '@angular/core';
|
|
|
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonIcon, IonButtons, IonButton, IonFooter, IonLabel, IonAvatar, IonList, IonItem, IonItemOptions, IonItemOption, IonThumbnail, IonItemSliding, IonCardContent, IonCardHeader, IonCardTitle, IonCard, IonRow, IonCol, IonGrid } from '@ionic/angular/standalone';
|
|
|
-import { ExploreContainerComponent } from '../explore-container/explore-container.component';
|
|
|
-import { addIcons } from 'ionicons';
|
|
|
-import { logoTwitter, logoWechat } from 'ionicons/icons';
|
|
|
+import { Component, OnInit, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
|
+import {
|
|
|
+ IonHeader, IonToolbar, IonTitle, IonContent, IonSearchbar, IonButtons, IonButton, IonIcon, IonMenuButton, IonAvatar,
|
|
|
+ IonGrid, IonRow, IonCol, IonCard, IonCardHeader, IonCardContent, IonList, IonItem, IonLabel
|
|
|
+} from '@ionic/angular/standalone';
|
|
|
+
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
-import { RouterModule } from '@angular/router';
|
|
|
+import { Router } from '@angular/router';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-tab2',
|
|
|
templateUrl: 'tab2.page.html',
|
|
|
styleUrls: ['tab2.page.scss'],
|
|
|
standalone: true,
|
|
|
- imports:
|
|
|
- [
|
|
|
- CommonModule,RouterModule,
|
|
|
- IonItemSliding,IonCardContent,IonCardHeader,IonCardTitle,IonCard,
|
|
|
- IonRow,IonCol,IonGrid,
|
|
|
- IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,
|
|
|
- IonIcon,IonButtons,IonButton,IonFooter,IonLabel,IonAvatar,IonList,IonItem,IonItemOptions,IonItemOption,
|
|
|
- IonThumbnail,
|
|
|
+ imports: [
|
|
|
+ IonHeader, IonToolbar, IonContent,
|
|
|
+ IonSearchbar, IonButtons, IonButton, IonIcon, IonMenuButton, IonAvatar, IonGrid, IonRow,
|
|
|
+ IonCol, IonCard, IonCardHeader, IonCardContent, IonList, IonItem, IonLabel, IonLabel, CommonModule
|
|
|
],
|
|
|
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
|
})
|
|
|
-export class Tab2Page {
|
|
|
- constructor() {
|
|
|
- addIcons({logoWechat,logoTwitter})
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- features = [
|
|
|
- {
|
|
|
- icon: 'create',
|
|
|
- title: '剧本创作',
|
|
|
- description: '快速生成符合景区特色的剧本。',
|
|
|
- link: '/script-creation',
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'color-palette',
|
|
|
- title: 'IP打造',
|
|
|
- description: '设计独特角色形象,发掘景区特色IP。',
|
|
|
- link: '/ip-creation',
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'game-controller',
|
|
|
- title: '游戏体验',
|
|
|
- description: '参与沉浸式剧本杀,享受互动乐趣。',
|
|
|
- link: '/game-experience',
|
|
|
- },
|
|
|
+export class Tab2Page implements OnInit {
|
|
|
+ // 属性
|
|
|
+ searchQuery: string = ''; // 搜索查询字符串
|
|
|
+ recommendedItems: any[] = []; // 推荐位数据
|
|
|
+
|
|
|
+ userAvatar: string | null = null; // 用户头像
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ constructor(private router: Router) { }
|
|
|
+ ngOnInit(): void {
|
|
|
+ throw new Error('Method not implemented.');
|
|
|
+ }
|
|
|
+ // 导航到首页
|
|
|
+ goToTab2() {
|
|
|
+ // 实现导航逻辑,例如使用Angular Router
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理搜索输入
|
|
|
+ onSearchInput(event: any) {
|
|
|
+ // 处理搜索输入的逻辑,例如过滤显示结果
|
|
|
+ console.log(this.searchQuery);
|
|
|
+ }
|
|
|
+
|
|
|
+ latestPosts = [
|
|
|
+ { title: '新小说发布', content: '用户XX发布了一部新小说《XX传》', avatarUrl: 'assets/images/avatar1.jpg' },
|
|
|
+ { title: '热门讨论', content: '关于小说创作的技巧讨论火热进行中', avatarUrl: 'assets/images/avatar2.jpg' },
|
|
|
+ ];
|
|
|
+
|
|
|
+ popularTopics = [
|
|
|
+ { name: '小说创作大赛', description: '参与大赛,赢取丰厚奖品!' },
|
|
|
+ { name: '智能体互动体验', description: '分享你与智能体的互动故事。' },
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
- startExperience(script: any) {
|
|
|
- // 跳转到剧本体验页面
|
|
|
- console.log('开始体验:', script.title);
|
|
|
+ openUserProfile() {
|
|
|
+ // 跳转到用户个人中心页面
|
|
|
+ this.router.navigate(['/profile']);
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
+ openSettings() {
|
|
|
+ // 跳转到设置页面
|
|
|
+ this.router.navigate(['/settings']);
|
|
|
+ }
|
|
|
|
|
|
+ navigateToJubenGeneration() {
|
|
|
+ // 跳转到剧本生成页面
|
|
|
+ this.router.navigate(['/tabs/juben']);
|
|
|
+ }
|
|
|
+
|
|
|
+ navigateToCharacterCreation() {
|
|
|
+ // 跳转到智能体创建页面
|
|
|
+ this.router.navigate(['/character-creation']);
|
|
|
+ }
|
|
|
+ goToItem(item: any): void {
|
|
|
+ // 假设item有一个属性可以用来导航,比如item.id
|
|
|
+ // 这里你需要根据你的应用逻辑来调整
|
|
|
+ this.router.navigate(['/some-route', item.id]);
|
|
|
+ }
|
|
|
+ openUserMenu($event: Event): void {
|
|
|
+ // 在这里添加打开用户菜单的逻辑
|
|
|
+ // 例如,你可以切换一个布尔值来控制菜单的显示状态
|
|
|
+ console.log('User menu button clicked', $event);
|
|
|
+ }
|
|
|
|
|
|
+}
|